|
23 | 23 | {% endset %} |
24 | 24 |
|
25 | 25 | {% set mammogramHistoryContentsSummary %} |
26 | | - Last mammogrogram {{ "2022-03-23" | formatDate | formatRelativeDate | asHint }} |
| 26 | + {# Last mammogrogram {{ "2022-03-23" | formatDate | formatRelativeDate | asHint }} #} |
27 | 27 | {% endset %} |
28 | 28 |
|
29 | 29 | {% set hasAdditionalMammograms = event.previousMammograms | length > 0 %} |
30 | 30 |
|
31 | 31 | {% if hasAdditionalMammograms %} |
32 | | - {% set mammogramHistoryContentsSummary = ((event.previousMammograms | length) + 1) ~ " mammograms added" %} |
| 32 | + {% set mammogramHistoryContentsSummary = ((event.previousMammograms | length)) ~ " new " + ("mammogram" | pluralise(event.previousMammograms | length)) + " added" %} |
33 | 33 | {% endif %} |
34 | 34 |
|
| 35 | + |
35 | 36 | {% switch displayFormat %} |
36 | 37 | {% case 'flat' %} |
37 | 38 | <h2 id="{{ sectionId }}">{{ sectionHeading }}</h2> |
|
53 | 54 | id: sectionId, |
54 | 55 | classes: "nhsuk-expander js-expandable-section", |
55 | 56 | summaryText: "Mammogram history", |
56 | | - _contentsSummary: mammogramHistoryContentsSummary, |
| 57 | + contentsSummary: mammogramHistoryContentsSummary, |
57 | 58 | subtitle: "The last confirmed mammogram and any added manually since then", |
58 | 59 | html: mammogramHistoryHtml, |
59 | 60 | status: "To review", |
|
156 | 157 | {% include "medical-information/medical-history/index.njk" %} |
157 | 158 | {% endset %} |
158 | 159 |
|
| 160 | +{% set medicalInfoCount = 0 %} |
| 161 | +{% if event.medicalInformation.medicalHistory %} |
| 162 | + {% for type, historyGroup in event.medicalInformation.medicalHistory %} |
| 163 | + {% for item in historyGroup %} |
| 164 | + {% set medicalInfoCount = medicalInfoCount + 1 %} |
| 165 | + {% endfor %} |
| 166 | + {% endfor %} |
| 167 | +{% endif %} |
| 168 | + |
| 169 | +{{ medicalInfoCount | log("Medical info count") }} |
| 170 | + |
| 171 | +{% set contentsSummary %} |
| 172 | + {% if medicalInfoCount > 0 %} |
| 173 | + {{ medicalInfoCount }} {{ "item" | pluralise(medicalInfoCount) }} added |
| 174 | + {% else %} |
| 175 | + No information added |
| 176 | + {% endif %} |
| 177 | +{% endset %} |
| 178 | + |
159 | 179 | {% switch displayFormat %} |
160 | 180 | {% case 'flat' %} |
161 | 181 | <h2>{{ sectionHeading }}</h2> |
|
174 | 194 | id: "medical-history", |
175 | 195 | classes: "nhsuk-expander js-expandable-section", |
176 | 196 | summaryText: sectionHeading, |
177 | | - contentsSummary: "No information added", |
| 197 | + contentsSummary: contentsSummary, |
178 | 198 | subtitle: subHeading, |
179 | 199 | html: medicalHistoryHtml, |
180 | 200 | status: "To review" |
|
0 commit comments