Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c45c18e
Rename function for clarity on mammogram records
dannychadburn Jun 23, 2026
6b6d5b5
Shorten warning callout heading in symptoms card
dannychadburn Jun 23, 2026
ffaa30a
Update text for symptom acknowledgment message
dannychadburn Jun 23, 2026
74d3af5
Rename function hasReportedMammograms to hasRecordedMammograms
dannychadburn Jun 23, 2026
b4d870e
Update titleText in notification banner to 'Priors recorded'
dannychadburn Jun 23, 2026
f90a1d4
Update mammogram history subheading and summary text
dannychadburn Jun 23, 2026
1652276
Update symptom references in reading-generator.js
dannychadburn Jun 23, 2026
4910cf8
Change 'reported' to 'recorded' in opinion.html
dannychadburn Jun 23, 2026
9d733fa
Change heading from 'Reported' to 'Recorded' mammograms
dannychadburn Jun 23, 2026
946ae83
Update comment for previous mammograms generation
dannychadburn Jun 23, 2026
7a4c8f2
Change 'reported' to 'recorded' in priors.html
dannychadburn Jun 23, 2026
262dd16
Change 'reported' to 'recorded' for mammograms
dannychadburn Jun 23, 2026
6381a1c
Update comment for clarity on mammogram reporting
dannychadburn Jun 23, 2026
c248d1c
Update wording from 'reported' to 'disclosed'
dannychadburn Jun 23, 2026
1f533b6
Update comment for previous mammogram rate
dannychadburn Jun 23, 2026
ad41a3e
Update condition to check for recorded mammograms
dannychadburn Jun 23, 2026
31717b3
Update condition for mammogram reporting check
dannychadburn Jun 23, 2026
2e12b4b
Rename 'Recorded mammograms' to 'Disclosed mammograms'
dannychadburn Jun 26, 2026
9e75d72
Update messages from 'recorded' to 'added'
dannychadburn Jun 26, 2026
a334d7a
Update text for recent mammograms section
dannychadburn Jun 26, 2026
db30e88
Update message for unrecorded symptoms
dannychadburn Jun 26, 2026
0c1d1aa
Update text for breast features count display
dannychadburn Jun 26, 2026
3926ddc
Change wording from 'recorded' to 'added' for symptoms
dannychadburn Jun 26, 2026
a65d10e
Update text for clarity in symptoms details
dannychadburn Jun 26, 2026
5a214a7
Update success message for breast implants recording
dannychadburn Jun 26, 2026
1620f79
Change 'recorded' to 'added' in medical info summary
dannychadburn Jun 26, 2026
db2f170
Update consent message for implant description
dannychadburn Jun 26, 2026
54e4aa8
Change default message for left breast procedures
dannychadburn Jun 26, 2026
9faa166
Rephrase confirmation message for appointment
dannychadburn Jun 26, 2026
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
2 changes: 1 addition & 1 deletion app/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ module.exports = {
generation: {
numberOfParticipants: 1000,
bookingProbability: 0.8, // 80% of slots are booked
previousMammogramRate: 0.05 // Rate of completed events with reported previous mammograms
previousMammogramRate: 0.05 // Rate of completed events with recorded previous mammograms
}
}
2 changes: 1 addition & 1 deletion app/lib/generators/event-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ const generateEvent = ({
}
}

// Generate previous mammograms (reported mammograms from other facilities)
// Generate previous mammograms (recorded mammograms from other facilities)
const previousMammograms = generatePreviousMammograms({
eventDate: event.timing.actualEndTime || event.timing.actualStartTime,
addedByUserId: event.sessionDetails.startedBy,
Expand Down
2 changes: 1 addition & 1 deletion app/lib/generators/previous-mammogram-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ const generatePreviousMammograms = ({ eventDate, addedByUserId, rate }) => {
? rate
: (config.generation?.previousMammogramRate ?? 0.2)

// Decide whether this event has reported mammograms
// Decide whether this event has recorded mammograms
if (Math.random() > effectiveRate) {
return null
}
Expand Down
6 changes: 3 additions & 3 deletions app/lib/generators/reading-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ const DEFAULT_READ_WEIGHTS = {

// Normal opinion freetext reasons when participant has symptoms
const NORMAL_DETAILS_WITH_SYMPTOMS = [
'Images reviewed carefully in the context of reported symptoms. No mammographic abnormality identified. Clinical follow-up recommended for symptoms.',
'Images reviewed carefully in the context of disclosed symptoms. No mammographic abnormality identified. Clinical follow-up recommended for symptoms.',
'Thorough review of all views performed. No significant mammographic findings. Symptoms noted but no corresponding imaging abnormality detected.',
'Normal mammographic appearance bilaterally. Symptoms have been considered in this assessment. No imaging correlate found.',
'Careful assessment undertaken given reported symptoms. Mammographic appearances are within normal limits. Clinical assessment advised.',
'No mammographic abnormality detected on careful review. Reported symptoms do not have a mammographic correlate. Recommend clinical follow-up.'
'Careful assessment undertaken given disclosed symptoms. Mammographic appearances are within normal limits. Clinical assessment advised.',
'No mammographic abnormality detected on careful review. Disclosed symptoms do not have a mammographic correlate. Recommend clinical follow-up.'
]

// Normal opinion freetext reasons without symptoms (used for a small proportion)
Expand Down
22 changes: 11 additions & 11 deletions app/lib/utils/prior-mammograms.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// app/lib/utils/prior-mammograms.js
//
// Utility functions for working with prior mammograms (previously reported
// Utility functions for working with prior mammograms (previously recorded
// mammograms from other facilities). These derive event-level state from
// per-mammogram request tracking on event.previousMammograms[].

const { formatDate, formatRelativeDate } = require('./dates')

/** Returns true if the event has any previously reported mammograms */
const hasReportedMammograms = (event) => {
/** Returns true if the event has any previously recorded mammograms */
const hasRecordedMammograms = (event) => {
if (!event) return false
return (
Array.isArray(event.previousMammograms) &&
Expand All @@ -17,15 +17,15 @@ const hasReportedMammograms = (event) => {

/** Returns true if any prior mammogram has requestStatus 'pending' or 'requested' (holds case from reading) */
const awaitingPriors = (event) => {
if (!hasReportedMammograms(event)) return false
if (!hasRecordedMammograms(event)) return false
return event.previousMammograms.some(
(m) => m.requestStatus === 'pending' || m.requestStatus === 'requested'
)
}

/** Returns true if any prior mammogram has requestStatus 'not_requested' */
const hasUnrequestedPriors = (event) => {
if (!hasReportedMammograms(event)) return false
if (!hasRecordedMammograms(event)) return false
return event.previousMammograms.some(
(m) => m.requestStatus === 'not_requested'
)
Expand All @@ -38,7 +38,7 @@ const hasUnrequestedPriors = (event) => {
* @returns {{total: number, counts: object, hasAwaiting: boolean, hasUnrequested: boolean, allResolved: boolean}}
*/
const getPriorsSummary = (event) => {
if (!hasReportedMammograms(event)) {
if (!hasRecordedMammograms(event)) {
return {
total: 0,
counts: {},
Expand Down Expand Up @@ -82,15 +82,15 @@ const getPriorsSummary = (event) => {

/** Get priors with requestStatus 'not_requested' (for the request priors UI) */
const getUnrequestedPriors = (event) => {
if (!hasReportedMammograms(event)) return []
if (!hasRecordedMammograms(event)) return []
return event.previousMammograms.filter(
(m) => m.requestStatus === 'not_requested'
)
}

/** Get priors with requestStatus 'pending' or 'requested' (awaiting arrival) */
const getAwaitingPriors = (event) => {
if (!hasReportedMammograms(event)) return []
if (!hasRecordedMammograms(event)) return []
return event.previousMammograms.filter(
(m) => m.requestStatus === 'pending' || m.requestStatus === 'requested'
)
Expand All @@ -101,7 +101,7 @@ const getAwaitingPriors = (event) => {
* Only 'pending' is checked — once admin moves to 'requested', the reader can no longer undo.
*/
const userRequestedPriors = (event, userId) => {
if (!hasReportedMammograms(event)) return false
if (!hasRecordedMammograms(event)) return false
return event.previousMammograms.some(
(m) => m.requestStatus === 'pending' && m.requestedBy === userId
)
Expand Down Expand Up @@ -179,14 +179,14 @@ const summarisePriorMammogram = (mammogram, options = {}) => {
* @returns {Array<string>} Array of summary strings
*/
const summarisePriorMammograms = (event, options = {}) => {
if (!hasReportedMammograms(event)) return []
if (!hasRecordedMammograms(event)) return []
return event.previousMammograms
.map((m) => summarisePriorMammogram(m, options))
.filter(Boolean)
}

module.exports = {
hasReportedMammograms,
hasRecordedMammograms,
awaitingPriors,
hasUnrequestedPriors,
getPriorsSummary,
Expand Down
2 changes: 1 addition & 1 deletion app/routes/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -1957,7 +1957,7 @@ module.exports = (router) => {
}

// Show combined success message
req.flash('success', 'Breast implants recorded and consent recorded')
req.flash('success', 'Breast implants added and consent recorded')

// Continue to next step in the flow
const returnUrl = getReturnUrl(
Expand Down
4 changes: 2 additions & 2 deletions app/views/_includes/cards/medical-information/symptoms.njk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

{% if not hasSymptoms %}
{% set insetHtml %}
<p>No symptoms have been recorded for this participant.</p>
<p>No symptoms have been added for this participant.</p>
{% endset %}
{{ insetText({
html: insetHtml
Expand All @@ -32,4 +32,4 @@
headingLevel: "2",
feature: false,
descriptionHtml: symptomsCardHtml
}) }}
}) }}
4 changes: 2 additions & 2 deletions app/views/_includes/medical-information/breast-features.njk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{% if hasBreastFeatures %}

<p>
{{ breastFeaturesCount }} breast {{ "feature" | pluralise(breastFeaturesCount) }} recorded
{{ breastFeaturesCount }} breast {{ "feature" | pluralise(breastFeaturesCount) }} added
</p>

<script>
Expand Down Expand Up @@ -38,7 +38,7 @@
{% else %}
{% set insetHtml %}
<p>
No breast features have been recorded for this participant.
No breast features have been added for this participant.
</p>
{% endset %}
{{ insetText({
Expand Down
14 changes: 7 additions & 7 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 = "Previous mammograms from screening records and any reported by the participant" %}
{% set subHeading = "Previous mammograms from screening records and any disclosed by the participant" %}
{% set sectionId = sectionHeading | kebabCase %}
{% set scrollTo = sectionId %}

Expand All @@ -32,9 +32,9 @@
{% endset %}

{% if hasAdditionalMammograms %}
{% set mammogramHistoryContentsSummary = (event.previousMammograms | length) ~ " reported " + ("mammogram" | pluralise(event.previousMammograms | length)) + " added" %}
{% set mammogramHistoryContentsSummary = (event.previousMammograms | length) ~ " " ~ ("mammogram" | pluralise(event.previousMammograms | length)) ~ " added" %}
{% else %}
{% set mammogramHistoryContentsSummary = "No reported mammograms added" %}
{% set mammogramHistoryContentsSummary = "No mammograms added" %}
{% endif %}


Expand Down Expand Up @@ -136,7 +136,7 @@
{% set scrollTo = sectionId %}

{% set symptomsCount = event.medicalInformation.symptoms and event.medicalInformation.symptoms | length %}
{% set symptomsContentsSummaryText %}{{ symptomsCount or "No" }} {{ "symptom" | pluralise(symptomsCount) }} recorded{% endset %}
{% set symptomsContentsSummaryText %}{{ symptomsCount or "No" }} {{ "symptom" | pluralise(symptomsCount) }} added{% endset %}

{% set symptomsCardContent %}
{% include "_includes/medical-information/symptoms-card-content.njk" %}
Expand Down Expand Up @@ -183,7 +183,7 @@
{% set hasBreastFeatures = breastFeaturesCount > 0 %}

{% set breastFeaturesContentsSummaryText %}
{{ breastFeaturesCount or "No" }} breast {{ "feature" | pluralise(breastFeaturesCount) }} recorded
{{ breastFeaturesCount or "No" }} breast {{ "feature" | pluralise(breastFeaturesCount) }} added
{% endset %}

{% set breastFeaturesHtml %}
Expand Down Expand Up @@ -244,9 +244,9 @@
{% endif %}

{% if otherRelevantInformationCount > 0 %}
{% set otherRelevantInformationSummary = otherRelevantInformationCount ~ " other relevant information recorded" %}
{% set otherRelevantInformationSummary = otherRelevantInformationCount ~ " other relevant information added" %}
{% else %}
{% set otherRelevantInformationSummary = "No other relevant information recorded" %}
{% set otherRelevantInformationSummary = "No other relevant information added" %}
{% endif %}

{% switch displayFormat %}
Expand Down
6 changes: 3 additions & 3 deletions app/views/_includes/medical-information/mammogram-history.njk
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

{# User-added unverified mammograms #}
{% if hasAdditionalMammograms %}
<h3 class="nhsuk-heading-s">Reported mammograms</h3>
<h3 class="nhsuk-heading-s">Disclosed mammograms</h3>
{% set userMammogramRows = [] %}

{% for previousMammogram in event.previousMammograms %}
Expand Down Expand Up @@ -91,7 +91,7 @@
{% set mammogramValueHtml = mammogramValueLines | join('<br>') %}

{% set keyHtml %}
Recorded {{ previousMammogram.dateAdded | formatDate }}
Added {{ previousMammogram.dateAdded | formatDate }}
{% if previousMammogram.addedBy %}
<span class="nhsuk-u-secondary-text-colour app-nowrap nhsuk-body-s nhsuk-u-font-weight-normal nhsuk-u-margin-bottom-0 ">by {{ previousMammogram.addedBy
| getUsername({
Expand All @@ -113,7 +113,7 @@
{
href: contextUrl + "/previous-mammograms/edit/" + previousMammogram.id | urlWithReferrer(referrerChain | appendReferrer(currentUrl), scrollTo),
text: "Change",
visuallyHiddenText: "Participant reported mammogram"
visuallyHiddenText: "Participant disclosed mammogram"
}
]
} if allowEdits
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
{{ breastItemsList(historyItem.proceduresRightBreast, "No procedure") }}
{% endset %}
{% set leftBreastContent %}
{{ breastItemsList(historyItem.proceduresLeftBreast, "No procedures recorded") }}
{{ breastItemsList(historyItem.proceduresLeftBreast, "No procedures added") }}
{% endset %}
{{ leftRightBreastDisplay(rightBreastContent, leftBreastContent) }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
{% set hasSymptoms = symptomsCount > 0 %}

{% set symptomsContentsSummaryText %}
{{ symptomsCount or "No" }} {{ 'symptom' | pluralise(symptomsCount) }} recorded
{{ symptomsCount or "No" }} {{ 'symptom' | pluralise(symptomsCount) }} added
{% endset %}


{% include "summary-lists/medical-information/symptoms/summary.njk" %}

{% if not hasSymptoms %}
{% set insetHtml %}
<p>No symptoms have been recorded for this participant.</p>
<p>No symptoms have been added for this participant.</p>
{% endset %}
{{ insetText({
html: insetHtml
Expand Down
12 changes: 6 additions & 6 deletions app/views/_includes/summary-lists/medical-info-summary.njk
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
{# Build symptoms HTML #}
{% set symptomsHtml %}
{% if symptomsCount == 0 %}
<p>No symptoms recorded</p>
<p>No symptoms added</p>
{% elif symptomsCount == 1 %}
<p>{{ symptomSummaries[0] }}</p>
{% else %}
Expand All @@ -72,7 +72,7 @@
{# Build breast features HTML #}
{% set breastFeaturesHtml %}
{% if breastFeaturesCount == 0 %}
<p>No breast features recorded</p>
<p>No breast features added</p>
{% elseif breastFeaturesCount == 1 %}
<p>{{ breastFeatureSummaries[0] }}</p>
{% else %}
Expand Down Expand Up @@ -153,13 +153,13 @@
{% set mammogramsAction = {
href: "./previous-mammograms/add" | urlWithReferrer(mammogramsAddReferrerChain),
text: "Add a mammogram",
visuallyHiddenText: "reported mammograms"
visuallyHiddenText: "mammograms added"
} | openInModal %}
{% else %}
{% set mammogramsAction = {
href: "./confirm-information/previous-mammograms" | urlWithReferrer(currentUrl),
text: "View or change",
visuallyHiddenText: "reported mammograms"
visuallyHiddenText: "mammograms added"
} %}
{% endif %}

Expand Down Expand Up @@ -203,7 +203,7 @@
{% if not showOnlyPopulated or additionalMammogramsCount > 0 %}
{% set rows = rows | push({
key: {
text: "Reported mammograms"
text: "Mammograms added"
},
value: {
html: previousMammogramsHtml
Expand Down Expand Up @@ -285,7 +285,7 @@
{% endif %}

{% if rows | length == 0 %}
<p class="nhsuk-body">No medical information recorded.</p>
<p class="nhsuk-body">No medical information added.</p>
{% else %}
{{ summaryList({
rows: rows | removeLastRowBorder
Expand Down
8 changes: 4 additions & 4 deletions app/views/_includes/summary-lists/questionnaire.njk
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,14 @@
<li>Details: {{questionnaire.skinChangeDetails}}</li>
</ul>
{% else %}
{{ questionnaire.skinChanges | formatAnswer({ noText: "No changes reported" }) }}
{{ questionnaire.skinChanges | formatAnswer({ noText: "No changes disclosed" }) }}
{% endif %}
{% endset %}

{% set nippleSymptomsValue %}
{% if questionnaire.nippleSymptoms %}
{% if questionnaire.nippleSymptoms.includes("none") %}
No symptoms reported
No symptoms disclosed
{% else %}
<ul class="nhsuk-list nhsuk-list--bullet">
{% for symptom in questionnaire.nippleSymptoms %}
Expand Down Expand Up @@ -282,7 +282,7 @@
value: {
text: questionnaire.lumpsNoticed | formatAnswer({
yesValue: questionnaire.lumpDetails,
noText: "No lumps reported"
noText: "No lumps disclosed"
})
},
actions: {
Expand All @@ -302,7 +302,7 @@
value: {
text: questionnaire.shapeChanges | formatAnswer({
yesValue: questionnaire.shapeChangeDetails,
noText: "No changes reported"
noText: "No changes disclosed"
})
},
actions: {
Expand Down
2 changes: 1 addition & 1 deletion app/views/_includes/symptomsWarningCard.njk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% endset %}

{{ warningCallout({
heading: 'Significant symptoms reported',
heading: 'Significant symptoms',
html: warningCalloutHtml,
classes: "nhsuk-u-margin-top-3 nhsuk-u-margin-bottom-4"
}) }}
Expand Down
4 changes: 2 additions & 2 deletions app/views/events/check-information.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
<h1>{{ pageHeading }}</h1>

<p class="nhsuk-u-reading-width">
Before concluding this appointment, confirm that the information recorded is correct.
To conclude this appointment, confirm this information is correct.
</p>
{# {{ button({
text: "Complete screening and return to clinic"
Expand Down Expand Up @@ -256,4 +256,4 @@ <h1>{{ pageHeading }}</h1>

{# <p><a href="./attended-not-screened-reason">Screening cannot proceed</a></p> #}

{% endblock %}
{% endblock %}
Loading