Skip to content

Commit 9546d02

Browse files
authored
Merge pull request #804 from NHSDigital/DTOSS-11583-small-buttons
Small buttons for the medical information page
2 parents 91dabcd + 7596c55 commit 9546d02

16 files changed

+155
-180
lines changed

manage_breast_screening/mammograms/jinja2/mammograms/medical_information/medical_history/forms/mastectomy_or_lumpectomy_history.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{% block form %}
77
<p>
88
This is designed to capture information on prophylactic or elective surgery.
9-
<a href="{{ presenter.add_breast_cancer_history_link.href }}" class="nhsuk-link">
9+
<a href="{{ presenter.add_breast_cancer_history_button.href }}" class="nhsuk-link">
1010
Add breast cancer details
1111
</a>
1212
if that was the reason for this surgery.

manage_breast_screening/mammograms/jinja2/mammograms/record_medical_information.jinja

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{% extends "wizard_step.jinja" %}
2+
{% from "nhsuk/components/button/macro.jinja" import button %}
23
{% from "nhsuk/components/card/macro.jinja" import card %}
34
{% from "nhsuk/components/inset-text/macro.jinja" import insetText %}
45
{% from "nhsuk/components/summary-list/macro.jinja" import summaryList %}
@@ -23,13 +24,18 @@
2324
}) }}
2425
{% endif %}
2526

26-
<p class="nhsuk-u-margin-top-4 nhsuk-u-margin-bottom-0">
27-
<a href="{{ presenter.add_lump_link.href }}" class="nhsuk-link nhsuk-link--no-visited-state">{{ presenter.add_lump_link.text }}</a><br>
28-
<a href="{{ presenter.add_swelling_or_shape_change_link.href }}" class="nhsuk-link nhsuk-link--no-visited-state">{{ presenter.add_swelling_or_shape_change_link.text }}</a><br>
29-
<a href="{{ presenter.add_skin_change_link.href }}" class="nhsuk-link nhsuk-link--no-visited-state">{{ presenter.add_skin_change_link.text }}</a><br>
30-
<a href="{{ presenter.add_nipple_change_link.href }}" class="nhsuk-link nhsuk-link--no-visited-state">{{ presenter.add_nipple_change_link.text }}</a><br>
31-
<a href="{{ presenter.add_other_symptom_link.href }}" class="nhsuk-link nhsuk-link--no-visited-state">{{ presenter.add_other_symptom_link.text }}</a>
32-
</p>
27+
<hr>
28+
<h3>Add symptoms</h3>
29+
30+
<div class="nhsuk-button-group app-button-group--small">
31+
{% for button_info in presenter.symptom_buttons %}
32+
{{ button({
33+
"text": button_info.text,
34+
"href": button_info.href,
35+
"classes": "nhsuk-button--secondary nhsuk-button--small"
36+
}) }}
37+
{% endfor %}
38+
</div>
3339
{% endcall %}
3440

3541
{% set medical_history_card_html %}
@@ -40,7 +46,6 @@
4046
</a><br>
4147
{{ summaryList(presented_item.summary_list_params) }}
4248
{% endfor %}
43-
<a href="{{ presenter.add_breast_cancer_history_link.href }}" class="nhsuk-link nhsuk-link--no-visited-state">{{ presenter.add_breast_cancer_history_link.text }}</a><br>
4449
{% endset %}
4550

4651
{% set mastectomy_or_lumpectomy_history_html %}
@@ -50,7 +55,6 @@
5055
</a><br>
5156
{{ summaryList(presented_item.summary_list_params) }}
5257
{% endfor %}
53-
<a href="{{ presenter.add_mastectomy_or_lumpectomy_history_link.href }}" class="nhsuk-link nhsuk-link--no-visited-state">{{ presenter.add_mastectomy_or_lumpectomy_history_link.text }}</a><br>
5458
{% endset %}
5559

5660
{% set implanted_medical_device_history_html %}
@@ -60,7 +64,6 @@
6064
</a><br>
6165
{{ summaryList(presented_item.summary_list_params) }}
6266
{% endfor %}
63-
<a href="{{ presenter.add_implanted_medical_device_history_link.href }}" class="nhsuk-link nhsuk-link--no-visited-state">{{ presenter.add_implanted_medical_device_history_link.text }}</a><br>
6467
{% endset %}
6568

6669
{% set breast_augmentation_history_html %}
@@ -70,7 +73,6 @@
7073
</a><br>
7174
{{ summaryList(presented_item.summary_list_params) }}
7275
{% endfor %}
73-
<a href="{{ presenter.add_breast_augmentation_history_link.href }}" class="nhsuk-link nhsuk-link--no-visited-state">{{ presenter.add_breast_augmentation_history_link.text }}</a><br>
7476
{% endset %}
7577

7678
{% set other_procedure_history_html %}
@@ -80,7 +82,6 @@
8082
</a><br>
8183
{{ summaryList(presented_item.summary_list_params) }}
8284
{% endfor %}
83-
<a href="{{ presenter.add_other_procedure_history_link.href }}" class="nhsuk-link nhsuk-link--no-visited-state">{{ presenter.add_other_procedure_history_link.text }}</a><br>
8485
{% endset %}
8586

8687
{% set cyst_history_html %}
@@ -90,22 +91,15 @@
9091
</a><br>
9192
{{ summaryList(presented_item.summary_list_params) }}
9293
{% endfor %}
93-
<a href="{{ presenter.add_cyst_history_link.href }}" class="nhsuk-link nhsuk-link--no-visited-state">{{ presenter.add_cyst_history_link.text }}</a><br>
9494
{% endset %}
9595

96-
{% set non_cancerous_lump_diagnosis_link %}
97-
<a class="nhsuk-link" href="#">Enter non-cancerous lump diagnosis</a>
98-
{% endset %}
9996
{% set benign_lump_history_html %}
10097
{% for presented_item in presenter.benign_lump_history %}
10198
{{ summaryList(presented_item.summary_list_params) }}
10299
<p><a href="{{ presented_item.change_link.href }}" class="nhsuk-link nhsuk-link--no-visited-state">{{ presented_item.change_link.text }}</a></p>
103100
{% endfor %}
104-
<a href="{{ presenter.add_benign_lump_history_link.href }}" class="nhsuk-link nhsuk-link--no-visited-state">{{ presenter.add_benign_lump_history_link.text }}</a><br>
105-
{% endset %}
106-
{% set chest_procedures_link %}
107-
<a class="nhsuk-link" href="#">Enter other breast or chest procedures</a>
108101
{% endset %}
102+
109103
{{ summaryList({
110104
"rows": [
111105
{
@@ -206,6 +200,20 @@
206200
}
207201
]
208202
}) }}
203+
204+
<hr>
205+
<h3>Add medical history</h3>
206+
207+
<div class="nhsuk-button-group app-button-group--small">
208+
{% for button_info in presenter.medical_history_buttons %}
209+
{{ button({
210+
"text": button_info.text,
211+
"href": button_info.href,
212+
"classes": "nhsuk-button--secondary nhsuk-button--small"
213+
}) }}
214+
{% endfor %}
215+
</div>
216+
209217
{% endset %}
210218
{{ card({
211219
"heading": "Medical history",

manage_breast_screening/mammograms/presenters/medical_information_presenter.py

Lines changed: 46 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
from manage_breast_screening.mammograms.presenters.symptom_presenter import (
2525
SymptomPresenter,
2626
)
27-
from manage_breast_screening.participants.models.symptom import SymptomType
2827

2928
from .appointment_presenters import AppointmentPresenter
3029

@@ -79,165 +78,151 @@ def symptom_rows(self):
7978
return [symptom.summary_list_row for symptom in self.symptoms]
8079

8180
@property
82-
def add_lump_link(self):
81+
def symptom_buttons(self):
82+
return [
83+
self.add_lump_button,
84+
self.add_swelling_or_shape_change_button,
85+
self.add_skin_change_button,
86+
self.add_nipple_change_button,
87+
self.add_other_symptom_button,
88+
]
89+
90+
@property
91+
def medical_history_buttons(self):
92+
return [
93+
self.add_breast_cancer_history_button,
94+
self.add_implanted_medical_device_history_button,
95+
self.add_breast_augmentation_history_button,
96+
self.add_mastectomy_or_lumpectomy_history_button,
97+
self.add_cyst_history_button,
98+
self.add_benign_lump_history_button,
99+
self.add_other_procedure_history_button,
100+
]
101+
102+
@property
103+
def add_lump_button(self):
83104
url = reverse("mammograms:add_symptom_lump", kwargs={"pk": self.appointment.pk})
84105

85-
return {
86-
"href": url,
87-
"text": (
88-
"Add another lump"
89-
if SymptomType.LUMP in self.existing_symptom_type_ids
90-
else "Add a lump"
91-
),
92-
}
106+
return {"href": url, "text": "Lump"}
93107

94108
@property
95-
def add_swelling_or_shape_change_link(self):
109+
def add_swelling_or_shape_change_button(self):
96110
url = reverse(
97111
"mammograms:add_symptom_swelling_or_shape_change",
98112
kwargs={"pk": self.appointment.pk},
99113
)
100114

101-
return {
102-
"href": url,
103-
"text": (
104-
"Add another swelling or shape change"
105-
if SymptomType.SWELLING_OR_SHAPE_CHANGE
106-
in self.existing_symptom_type_ids
107-
else "Add a swelling or shape change"
108-
),
109-
}
115+
return {"href": url, "text": "Swelling or shape change"}
110116

111117
@property
112-
def add_skin_change_link(self):
118+
def add_skin_change_button(self):
113119
url = reverse(
114120
"mammograms:add_symptom_skin_change",
115121
kwargs={"pk": self.appointment.pk},
116122
)
117123

118-
return {
119-
"href": url,
120-
"text": (
121-
"Add another skin change"
122-
if SymptomType.SKIN_CHANGE in self.existing_symptom_type_ids
123-
else "Add a skin change"
124-
),
125-
}
124+
return {"href": url, "text": "Skin change"}
126125

127126
@property
128-
def add_nipple_change_link(self):
127+
def add_nipple_change_button(self):
129128
url = reverse(
130129
"mammograms:add_symptom_nipple_change",
131130
kwargs={"pk": self.appointment.pk},
132131
)
133132

134-
return {
135-
"href": url,
136-
"text": (
137-
"Add another nipple change"
138-
if SymptomType.NIPPLE_CHANGE in self.existing_symptom_type_ids
139-
else "Add a nipple change"
140-
),
141-
}
133+
return {"href": url, "text": "Nipple change"}
142134

143135
@property
144-
def add_other_symptom_link(self):
136+
def add_other_symptom_button(self):
145137
url = reverse(
146138
"mammograms:add_symptom_other",
147139
kwargs={"pk": self.appointment.pk},
148140
)
149141

150-
return {
151-
"href": url,
152-
"text": (
153-
"Add another symptom (other symptom)"
154-
if SymptomType.NIPPLE_CHANGE in self.existing_symptom_type_ids
155-
else "Add a symptom (other symptom)"
156-
),
157-
}
142+
return {"href": url, "text": "Other"}
158143

159144
@property
160-
def add_breast_cancer_history_link(self):
145+
def add_breast_cancer_history_button(self):
161146
url = reverse(
162147
"mammograms:add_breast_cancer_history_item",
163148
kwargs={"pk": self.appointment.pk},
164149
)
165150

166151
return {
167152
"href": url,
168-
"text": ("Add breast cancer history"),
153+
"text": "Breast cancer",
169154
}
170155

171156
@property
172-
def add_implanted_medical_device_history_link(self):
157+
def add_implanted_medical_device_history_button(self):
173158
url = reverse(
174159
"mammograms:add_implanted_medical_device_history_item",
175160
kwargs={"pk": self.appointment.pk},
176161
)
177162

178163
return {
179164
"href": url,
180-
"text": ("Add implanted medical device history"),
165+
"text": "Implanted medical device",
181166
}
182167

183168
@property
184-
def add_cyst_history_link(self):
169+
def add_cyst_history_button(self):
185170
url = reverse(
186171
"mammograms:add_cyst_history_item",
187172
kwargs={"pk": self.appointment.pk},
188173
)
189174

190175
return {
191176
"href": url,
192-
"text": ("Add cyst history"),
177+
"text": ("Cysts"),
193178
}
194179

195180
@property
196-
def add_breast_augmentation_history_link(self):
181+
def add_breast_augmentation_history_button(self):
197182
url = reverse(
198183
"mammograms:add_breast_augmentation_history_item",
199184
kwargs={"pk": self.appointment.pk},
200185
)
201186

202187
return {
203188
"href": url,
204-
"text": ("Add breast augmentation history"),
189+
"text": "Breast implants or augmentation",
205190
}
206191

207192
@property
208-
def add_benign_lump_history_link(self):
193+
def add_benign_lump_history_button(self):
209194
url = reverse(
210195
"mammograms:add_benign_lump_history_item",
211196
kwargs={"pk": self.appointment.pk},
212197
)
213198

214199
return {
215200
"href": url,
216-
"text": "Add benign lump history",
201+
"text": "Benign lumps",
217202
}
218203

219204
@property
220-
def add_mastectomy_or_lumpectomy_history_link(self):
205+
def add_mastectomy_or_lumpectomy_history_button(self):
221206
url = reverse(
222207
"mammograms:add_mastectomy_or_lumpectomy_history_item",
223208
kwargs={"pk": self.appointment.pk},
224209
)
225210

226211
return {
227212
"href": url,
228-
"text": "Add mastectomy or lumpectomy history",
213+
"text": "Mastectomy or lumpectomy",
229214
}
230215

231216
@property
232-
def add_other_procedure_history_link(self):
217+
def add_other_procedure_history_button(self):
233218
url = reverse(
234219
"mammograms:add_other_procedure_history_item",
235220
kwargs={"pk": self.appointment.pk},
236221
)
237222

238223
return {
239224
"href": url,
240-
"text": "Add other procedure history",
225+
"text": "Other procedures",
241226
}
242227

243228
def _present_items(self, items, presenter_class):

0 commit comments

Comments
 (0)