Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions app/lib/utils/prior-mammograms.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,21 +129,19 @@ const summarisePriorMammogram = (mammogram, options = {}) => {
let location = ''
switch (mammogram.location) {
case 'bsu':
location = mammogram.bsu || 'NHS breast screening unit'
location = 'At another BSU'
Comment thread
edwardhorsford marked this conversation as resolved.
break
case 'otherUk':
location = mammogram.otherUk || 'Other UK location'
location = 'Elsewhere in the UK'
Comment thread
edwardhorsford marked this conversation as resolved.
break
case 'otherNonUk':
location = mammogram.otherNonUk
? `Outside UK: ${mammogram.otherNonUk}`
: 'Outside UK'
location = 'Outside the UK'
Comment thread
edwardhorsford marked this conversation as resolved.
break
case 'currentBsu':
location = unitName || 'Current BSU'
location = `At ${unitName || 'this BSU'}`
break
case 'preferNotToSay':
location = 'Location not given'
location = 'Location not provided'
break
default:
location = ''
Expand All @@ -152,14 +150,14 @@ const summarisePriorMammogram = (mammogram, options = {}) => {
// Date detail — combine formatted date and relative time into parenthesised suffix
const dateParts = []
if (mammogram.dateType === 'dateKnown' && mammogram.dateTaken) {
dateParts.push(formatDate(mammogram.dateTaken, 'MMMM YYYY'))
dateParts.push(formatDate(mammogram.dateTaken, 'MMM YYYY'))
if (mammogram._rawDate) {
dateParts.push(formatRelativeDate(mammogram._rawDate))
}
} else if (mammogram.dateType === 'moreThanSixMonths') {
dateParts.push(mammogram.approximateDate || 'over 6 months ago')
dateParts.push('over 6 months ago')
} else if (mammogram.dateType === 'lessThanSixMonths') {
dateParts.push(mammogram.approximateDate || 'less than 6 months ago')
dateParts.push('less than 6 months ago')
}

const dateDetail = dateParts.length > 0 ? `(${dateParts.join(', ')})` : ''
Expand Down
4 changes: 2 additions & 2 deletions app/views/_includes/medical-information/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

{# Mammogram history #}
{% set sectionHeading = "Mammogram history" %}
{% set subHeading = "The last confirmed mammogram and any added manually since then" %}
{% set subHeading = "Previous mammograms from screening records and any reported by the participant" %}
{% set sectionId = sectionHeading | kebabCase %}
{% set scrollTo = sectionId %}

Expand Down Expand Up @@ -275,4 +275,4 @@
html: otherRelevantInformationHtml,
status: "To review"
}) }}
{% endswitch %}
{% endswitch %}
9 changes: 3 additions & 6 deletions app/views/_includes/medical-information/mammogram-history.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
{% set hasAdditionalMammograms = event.previousMammograms | length > 0 %}

{# System record - last known mammogram from BSU records #}
{% if hasAdditionalMammograms %}
<h3 class="nhsuk-heading-s">From screening records</h3>
{% endif %}

{% set systemRecordHtml %}
{% set mostRecentClinic = data | getParticipantMostRecentClinic(participant.id) %}
Expand All @@ -15,15 +12,15 @@
{{ mostRecentClinic.location.name }}</br>
{{ mostRecentClinic.event.type | sentenceCase }}
{% else %}
{{ "Not known" | asHint }}
{{ "No information" | asHint }}
{% endif %}
{% endset %}

{{ summaryList({
rows: [
{
key: {
text: "Last known mammogram"
text: "Most recent mammogram on record"
},
value: {
html: systemRecordHtml
Expand Down Expand Up @@ -126,4 +123,4 @@
{{ summaryList({
rows: userMammogramRows
} | openInModal | removeLastRowBorder) }}
{% endif %}
{% endif %}
2 changes: 1 addition & 1 deletion app/views/events/previous-mammograms/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ <h1 class="nhsuk-heading-l">
},
value: event.previousMammogramTemp.otherDetails,
hint: {
text: "For example, the reason for the mammograms and the outcome of the assessment"
text: "For example, the reason for the mammogram, the participant's previous address, and the outcome of the assessment"
}
}) }}

Expand Down