Skip to content

Commit 214fb41

Browse files
committed
Show significant symptoms reported
1 parent 194faa5 commit 214fb41

5 files changed

Lines changed: 29 additions & 5 deletions

File tree

manage_breast_screening/mammograms/jinja2/mammograms/medical_information/section_cards.jinja

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@
9393
{% endif %}
9494
{% endmacro %}
9595

96-
{% macro symptoms_content(presented_medical_info, read_only=false) %}
97-
{% set symptom_rows = presented_medical_info.read_only_symptom_rows if read_only else presented_medical_info.symptom_rows %}
98-
<p {%- if not read_only and not symptom_rows %} class="nhsuk-u-margin-bottom-3"{% endif %}>Any problems or symptoms, including lumps, swelling, rashes or nipple changes</p>
96+
{% macro symptoms_content(presented_medical_info, read_only=false, significant_only=false) %}
97+
{% set symptom_rows = presented_medical_info.significant_symptom_rows if significant_only else presented_medical_info.read_only_symptom_rows if read_only else presented_medical_info.symptom_rows %}
98+
{%- if not significant_only %}<p {%- if not read_only and not symptom_rows %} class="nhsuk-u-margin-bottom-3"{% endif %}>Any problems or symptoms, including lumps, swelling, rashes or nipple changes</p>{% endif %}
9999
{% if symptom_rows %}
100100
{{ summaryList({
101101
"rows": symptom_rows

manage_breast_screening/mammograms/presenters/medical_information_presenter.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,14 @@ def read_only_symptom_rows(self):
175175
for symptom in self.symptoms
176176
]
177177

178+
@property
179+
def significant_symptom_rows(self):
180+
return [
181+
symptom.build_summary_list_row(include_actions=False)
182+
for symptom in self.symptoms
183+
if symptom.highlight_to_readers
184+
]
185+
178186
@property
179187
def symptom_buttons(self):
180188
return [

manage_breast_screening/mammograms/presenters/symptom_presenter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
class SymptomPresenter:
2020
def __init__(self, symptom):
2121
self._symptom = symptom
22+
self.highlight_to_readers = symptom.highlight_to_readers
2223

2324
@property
2425
def area_line(self):

manage_breast_screening/reading/jinja2/read_image.jinja

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
{% from "nhsuk/components/inset-text/macro.jinja" import insetText %}
44
{% from "nhsuk/components/summary-list/macro.jinja" import summaryList %}
55
{% from "nhsuk/components/tag/macro.jinja" import tag %}
6+
{% from "nhsuk/components/warning-callout/macro.jinja" import warningCallout %}
67
{% from "mammograms/check_information/medical_information_card.jinja" import medical_summary_card %}
8+
{% from "mammograms/medical_information/section_cards.jinja" import symptoms_content %}
79

810
{# djlint:off H006 #}
911

@@ -56,6 +58,13 @@
5658
</div>
5759
</div>
5860

61+
{% if medical_information_presenter.significant_symptom_rows %}
62+
{{ warningCallout({
63+
"heading": "Significant symptoms reported",
64+
"html": symptoms_content(medical_information_presenter, significant_only=True, read_only=True),
65+
}) }}
66+
{% endif %}
67+
5968
<div class="nhsuk-grid-row">
6069
<div class="nhsuk-grid-column-one-third nhsuk-u-margin-bottom-4">
6170
<h2 class="nhsuk-heading-s">Image thumbnails ({{ images | length }})</h2>
@@ -112,7 +121,7 @@
112121
}) }}
113122
{% endif %}
114123

115-
{{ medical_summary_card(presented_medical_information) }}
124+
{{ medical_summary_card(check_medical_information_presenter) }}
116125
</div>
117126
</div>
118127
{% endblock %}

manage_breast_screening/reading/views.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
from manage_breast_screening.mammograms.presenters.medical_history.check_medical_information_presenter import (
1111
CheckMedicalInformationPresenter,
1212
)
13+
from manage_breast_screening.mammograms.presenters.medical_information_presenter import (
14+
MedicalInformationPresenter,
15+
)
1316
from manage_breast_screening.participants.models import Appointment
1417

1518
logger = getLogger(__name__)
@@ -39,7 +42,10 @@ def get_context_data(self, **kwargs):
3942
"heading": participant.full_name,
4043
"caption": "Review images",
4144
"images": images,
42-
"presented_medical_information": CheckMedicalInformationPresenter(
45+
"check_medical_information_presenter": CheckMedicalInformationPresenter(
46+
appointment
47+
),
48+
"medical_information_presenter": MedicalInformationPresenter(
4349
appointment
4450
),
4551
"notes_for_reader": appointment.study.additional_details,

0 commit comments

Comments
 (0)