Skip to content

Commit 5cb60e1

Browse files
committed
Rename ReadImageView -> ShowImageReadView
We also remove AppointmentMixin so that we no longer rely on an appointment pk passed in the URL. The view now picks an arbitrary appointment with a study attached as dummy data, with a TODO marking it for replacement once retrieval of the appropriate Reading object is implemented.
1 parent dea60c9 commit 5cb60e1

3 files changed

Lines changed: 14 additions & 6 deletions

File tree

manage_breast_screening/participants/models/appointment.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ def filter_counts_for_clinic(cls, clinic):
111111
counts[filter] = clinic.appointments.for_filter(filter).count()
112112
return counts
113113

114+
@classmethod
115+
def with_study(cls):
116+
return cls.objects.filter(study__isnull=False)
117+
114118
@property
115119
def provider(self):
116120
return self.clinic_slot.provider

manage_breast_screening/reading/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
path("", views.show_reading_dashboard_view, name="show_reading_dashboard"),
99
path(
1010
"sessions/<uuid:session_pk>/reads/<uuid:pk>/",
11-
views.ReadImageView.as_view(),
11+
views.ShowImageReadView.as_view(),
1212
name="image_read",
1313
),
1414
path(

manage_breast_screening/reading/views.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from manage_breast_screening.mammograms.presenters.medical_history.check_medical_information_presenter import (
1212
CheckMedicalInformationPresenter,
1313
)
14-
from manage_breast_screening.mammograms.views.mixins import AppointmentMixin
14+
from manage_breast_screening.participants.models import Appointment
1515

1616
logger = getLogger(__name__)
1717

@@ -22,25 +22,29 @@ def show_reading_dashboard_view(request):
2222
return render(request, "show_readings.jinja")
2323

2424

25-
class ReadImageView(PermissionRequiredMixin, AppointmentMixin, FormView):
25+
class ShowImageReadView(PermissionRequiredMixin, FormView):
2626
form_class = Form
2727
template_name = "read_image.jinja"
2828
permission_required = Permission.READ_IMAGES
2929

3030
def get_context_data(self, **kwargs):
3131
context = super().get_context_data(**kwargs)
3232

33+
# TODO: dummy data — replace once retrieval of the appropriate Reading object is implemented.
34+
appointment = Appointment.with_study().first()
35+
participant = appointment.participant
36+
3337
images = []
3438

3539
context.update(
3640
{
37-
"heading": self.participant.full_name,
41+
"heading": participant.full_name,
3842
"caption": "Review images",
3943
"images": images,
4044
"presented_medical_information": CheckMedicalInformationPresenter(
41-
self.appointment
45+
appointment
4246
),
43-
"notes_for_reader": self.appointment.study.additional_details,
47+
"notes_for_reader": appointment.study.additional_details,
4448
"is_urgent": True,
4549
"is_second_read": True,
4650
"is_previously_skipped": True,

0 commit comments

Comments
 (0)