Skip to content

Commit dea60c9

Browse files
committed
Add skeleton template for technical recall page
Basic template, url and view class. Currently relies on dummy uuids and the view doesn't implement form handling at this stage.
1 parent 58848dd commit dea60c9

5 files changed

Lines changed: 115 additions & 3 deletions

File tree

manage_breast_screening/reading/apps.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22

33

44
class ReadingConfig(AppConfig):
5+
default_auto_field = "django.db.models.BigAutoField"
56
name = "manage_breast_screening.reading"

manage_breast_screening/reading/jinja2/read_image.jinja

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,12 @@
9191
</div>
9292

9393
<div class="nhsuk-u-margin-bottom-4">
94-
<button class="nhsuk-button nhsuk-button--secondary nhsuk-u-width-full nhsuk-u-margin-bottom-3">
94+
<a href="{{ url('reading:add_technical_recall', kwargs={'session_pk': view.kwargs.session_pk, 'read_pk': view.kwargs.pk}) }}"
95+
role="button"
96+
draggable="false"
97+
class="nhsuk-button nhsuk-button--secondary nhsuk-u-width-full nhsuk-u-margin-bottom-3">
9598
Technical recall <span class="app-shortcut-hint">(T)</span>
96-
</button>
99+
</a>
97100
</div>
98101

99102
<div class="nhsuk-u-margin-bottom-4">
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{% extends "layout-app.jinja" %}
2+
{% from "nhsuk/components/button/macro.jinja" import button %}
3+
{% from "nhsuk/components/checkboxes/macro.jinja" import checkboxes %}
4+
5+
{% macro recall_fields(prefix) %}
6+
<div class="nhsuk-form-group">
7+
<label class="nhsuk-label" for="{{ prefix }}_reason">Reason for recall</label>
8+
<select class="nhsuk-select" id="{{ prefix }}_reason" name="{{ prefix }}_reason">
9+
<option value="" selected disabled>Select a reason</option>
10+
<option value="breast_positioning">Breast positioning</option>
11+
<option value="incorrect_exposure">Incorrect exposure</option>
12+
<option value="image_obscured">Image obscured</option>
13+
<option value="image_blurred">Image blurred</option>
14+
<option value="image_missing">Image missing</option>
15+
<option value="other_reason">Other reason</option>
16+
</select>
17+
</div>
18+
<div class="nhsuk-form-group">
19+
<label class="nhsuk-label nhsuk-label--s" for="{{ prefix }}_details">Additional details (optional)</label>
20+
<input class="nhsuk-input" id="{{ prefix }}_details" name="{{ prefix }}_details" type="text">
21+
</div>
22+
{% endmacro %}
23+
24+
{% block page_content %}
25+
<div class="nhsuk-grid-row">
26+
<div class="nhsuk-grid-column-full">
27+
<span class="nhsuk-caption-l">Erin Sauer</span>
28+
<h1 class="nhsuk-heading-l">Technical recall</h1>
29+
30+
<form action="{{ request.path }}" method="post" novalidate>
31+
{{ csrf_input }}
32+
33+
<h2 class="nhsuk-heading-m">Which views need to be retaken?</h2>
34+
35+
<div class="nhsuk-grid-row">
36+
<div class="nhsuk-grid-column-one-half">
37+
<h3 class="nhsuk-heading-s">Right breast</h3>
38+
39+
{% set rcc_conditional = recall_fields("rcc") %}
40+
{{ checkboxes({
41+
"idPrefix": "rcc",
42+
"name": "rcc",
43+
"items": [
44+
{"value": "rcc", "text": "RCC", "conditional": {"html": rcc_conditional}}
45+
]
46+
}) }}
47+
48+
{% set rmlo_conditional = recall_fields("rmlo") %}
49+
{{ checkboxes({
50+
"idPrefix": "rmlo",
51+
"name": "rmlo",
52+
"items": [
53+
{"value": "rmlo", "text": "RMLO", "conditional": {"html": rmlo_conditional}}
54+
]
55+
}) }}
56+
</div>
57+
58+
<div class="nhsuk-grid-column-one-half">
59+
<h3 class="nhsuk-heading-s">Left breast</h3>
60+
61+
{% set lcc_conditional = recall_fields("lcc") %}
62+
{{ checkboxes({
63+
"idPrefix": "lcc",
64+
"name": "lcc",
65+
"items": [
66+
{"value": "lcc", "text": "LCC", "conditional": {"html": lcc_conditional}}
67+
]
68+
}) }}
69+
70+
{% set lmlo_conditional = recall_fields("lmlo") %}
71+
{{ checkboxes({
72+
"idPrefix": "lmlo",
73+
"name": "lmlo",
74+
"items": [
75+
{"value": "lmlo", "text": "LMLO", "conditional": {"html": lmlo_conditional}}
76+
]
77+
}) }}
78+
</div>
79+
</div>
80+
81+
{{ button({"text": "Continue"}) }}
82+
</form>
83+
</div>
84+
</div>
85+
{% endblock %}

manage_breast_screening/reading/urls.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,9 @@
1111
views.ReadImageView.as_view(),
1212
name="image_read",
1313
),
14+
path(
15+
"sessions/<uuid:session_pk>/reads/<uuid:read_pk>/technical-recall/",
16+
views.AddTechnicalRecallView.as_view(),
17+
name="add_technical_recall",
18+
),
1419
]

manage_breast_screening/reading/views.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
from logging import getLogger
2+
13
from django.contrib.auth.decorators import permission_required
24
from django.forms import Form
35
from django.shortcuts import render
46
from django.views.decorators.http import require_http_methods
5-
from django.views.generic import FormView
7+
from django.views.generic import FormView, TemplateView
68
from rules.contrib.views import PermissionRequiredMixin
79

810
from manage_breast_screening.auth.models import Permission
@@ -11,6 +13,8 @@
1113
)
1214
from manage_breast_screening.mammograms.views.mixins import AppointmentMixin
1315

16+
logger = getLogger(__name__)
17+
1418

1519
@require_http_methods(["GET"])
1620
@permission_required(Permission.READ_IMAGES, raise_exception=True)
@@ -61,3 +65,17 @@ def _get_images(self, study):
6165
)
6266

6367
return images
68+
69+
70+
class AddTechnicalRecallView(TemplateView):
71+
template_name = "reading/technical_recall.jinja"
72+
73+
def get_context_data(self, **kwargs):
74+
context = super().get_context_data(**kwargs)
75+
context.update(
76+
{
77+
"page_title": "Technical recall",
78+
"back_link_params": {"href": "#"},
79+
}
80+
)
81+
return context

0 commit comments

Comments
 (0)