Skip to content

Commit d3b80c5

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 fa7947a commit d3b80c5

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

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
@@ -10,7 +10,7 @@
1010
from manage_breast_screening.mammograms.presenters.medical_history.check_medical_information_presenter import (
1111
CheckMedicalInformationPresenter,
1212
)
13-
from manage_breast_screening.mammograms.views.mixins import AppointmentMixin
13+
from manage_breast_screening.participants.models import Appointment
1414

1515
logger = getLogger(__name__)
1616

@@ -20,25 +20,29 @@ def show_reading_dashboard_view(request):
2020
return render(request, "show_readings.jinja")
2121

2222

23-
class ReadImageView(PermissionRequiredMixin, AppointmentMixin, FormView):
23+
class ShowImageReadView(PermissionRequiredMixin, FormView):
2424
form_class = Form
2525
template_name = "read_image.jinja"
2626
permission_required = Permission.VIEW_MAMMOGRAM_APPOINTMENT
2727

2828
def get_context_data(self, **kwargs):
2929
context = super().get_context_data(**kwargs)
3030

31+
# TODO: dummy data — replace once retrieval of the appropriate Reading object is implemented.
32+
appointment = Appointment.objects.filter(study__isnull=False).first()
33+
participant = appointment.participant
34+
3135
images = []
3236

3337
context.update(
3438
{
35-
"heading": self.participant.full_name,
39+
"heading": participant.full_name,
3640
"caption": "Review images",
3741
"images": images,
3842
"presented_medical_information": CheckMedicalInformationPresenter(
39-
self.appointment
43+
appointment
4044
),
41-
"notes_for_reader": self.appointment.study.additional_details,
45+
"notes_for_reader": appointment.study.additional_details,
4246
"is_urgent": True,
4347
"is_second_read": True,
4448
"is_previously_skipped": True,

0 commit comments

Comments
 (0)