diff --git a/app/assets/javascript/main.js b/app/assets/javascript/main.js index bfe28e13..e59dd167 100644 --- a/app/assets/javascript/main.js +++ b/app/assets/javascript/main.js @@ -95,6 +95,9 @@ document.addEventListener('DOMContentLoaded', () => { // Handle reset data in background setupResetSessionLink() + // Auto-save breast density factors when changed + setupBreastDensityFactorsAutosave() + // Reading workflow: auto-dismiss the opinion banner after a delay const opinionBanner = document.querySelector('[data-reading-opinion-banner]') if (opinionBanner) { @@ -185,6 +188,105 @@ document.addEventListener('DOMContentLoaded', () => { } }) +function setupBreastDensityFactorsAutosave() { + const saveTarget = document.querySelector('[data-breast-density-factors-save-url]') + if (!saveTarget) { + return + } + + const saveUrl = saveTarget.dataset.breastDensityFactorsSaveUrl + if (!saveUrl) { + return + } + + const checkboxSelector = + 'input[name="appointment[medicalInformation][breastDensityFactors]"]' + const hrtRadioSelector = + 'input[name="appointment[medicalInformation][breastDensityFactorsHrt]"]' + const checkboxes = document.querySelectorAll(checkboxSelector) + const hrtRadios = document.querySelectorAll(hrtRadioSelector) + + if (checkboxes.length === 0 && hrtRadios.length === 0) { + return + } + + const updateBreastDensityFactorsSummary = () => { + // Find the breast-density-factors section and update its contents summary + const section = document.getElementById('breast-density-factors') + if (!section) { + return + } + + // Count selected factors + const selectedCheckboxes = document.querySelectorAll(`${checkboxSelector}:checked`) + const selectedHrtRadio = document.querySelector(`${hrtRadioSelector}:checked`) + let count = selectedCheckboxes.length + if (selectedHrtRadio && selectedHrtRadio.value === 'yes') { + count += 1 + } + + // Find and update the contents summary span + const summarySpan = section.querySelector('.app-details__contents-summary') + if (summarySpan) { + if (count === 0) { + summarySpan.textContent = 'No breast density factors added' + } else if (count === 1) { + summarySpan.textContent = '1 breast density factor added' + } else { + summarySpan.textContent = count + ' breast density factors added' + } + } + } + + const saveFactors = async () => { + const formData = new URLSearchParams() + const selectedCheckboxes = document.querySelectorAll(`${checkboxSelector}:checked`) + const selectedHrtRadio = document.querySelector(`${hrtRadioSelector}:checked`) + + selectedCheckboxes.forEach((checkbox) => { + formData.append( + 'appointment[medicalInformation][breastDensityFactors]', + checkbox.value + ) + }) + + if (selectedHrtRadio) { + formData.append( + 'appointment[medicalInformation][breastDensityFactorsHrt]', + selectedHrtRadio.value + ) + } + + try { + const response = await fetch(saveUrl, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + 'X-Requested-With': 'XMLHttpRequest' + }, + body: formData.toString() + }) + + if (!response.ok) { + throw new Error('Breast density factors auto-save failed') + } + + // Update the summary text in the section after successful save + updateBreastDensityFactorsSummary() + } catch (error) { + console.error(error) + } + } + + checkboxes.forEach((checkbox) => { + checkbox.addEventListener('change', saveFactors) + }) + + hrtRadios.forEach((radio) => { + radio.addEventListener('change', saveFactors) + }) +} + // Quick settings modal — press backtick (`) to open settings in a modal overlay. // On close, the page reloads to pick up any changes. document.addEventListener('keydown', (e) => { diff --git a/app/lib/utils/medical-information.js b/app/lib/utils/medical-information.js index 1834ab14..df79a46f 100644 --- a/app/lib/utils/medical-information.js +++ b/app/lib/utils/medical-information.js @@ -429,59 +429,28 @@ const summariseOtherRelevantInformation = (medicalInformation) => { const summaries = [] - // HRT summary - const hrt = medicalInformation.hrt - if (hrt) { - if (hrt.hrtQuestion === 'yes') { - summaries.push( - `Taking HRT (started ${hrt.hrtDateStarted || 'date not specified'})` - ) - } else if (hrt.hrtQuestion === 'no-recently-stopped') { - if (hrt.hrtDateStopped) { - summaries.push(`Recently stopped HRT (stopped ${hrt.hrtDateStopped})`) - } else { - summaries.push('Recently stopped HRT') - } - } - // Don't add anything for 'no' - that's the default/negative state + const breastDensityFactorsRaw = medicalInformation.breastDensityFactors + const breastDensityFactors = Array.isArray(breastDensityFactorsRaw) + ? breastDensityFactorsRaw + : breastDensityFactorsRaw + ? [breastDensityFactorsRaw] + : [] + const breastDensityFactorsHrt = + medicalInformation.breastDensityFactorsHrt || + (breastDensityFactors.includes('hrt') ? 'yes' : undefined) + + if (breastDensityFactors.includes('pregnant')) { + summaries.push('Pregnant') } - // Pregnancy and breastfeeding summary - const pregBf = medicalInformation.pregnancyAndBreastfeeding - if (pregBf) { - // Pregnancy - if (pregBf.pregnancyStatus === 'yes') { - if (pregBf.pregnancyDueDate) { - summaries.push(`Pregnant (due ${pregBf.pregnancyDueDate})`) - } else { - summaries.push('Pregnant') - } - } else if (pregBf.pregnancyStatus === 'noButRecently') { - if (pregBf.pregnancyEndDate) { - summaries.push(`Recently pregnant (ended ${pregBf.pregnancyEndDate})`) - } else { - summaries.push('Recently pregnant') - } - } + if (breastDensityFactors.includes('breastfeeding')) { + summaries.push('Breastfeeding') + } - // Breastfeeding - if (pregBf.breastfeedingStatus === 'yes') { - if (pregBf.breastfeedingStartDate) { - summaries.push( - `Breastfeeding (started ${pregBf.breastfeedingStartDate})` - ) - } else { - summaries.push('Breastfeeding') - } - } else if (pregBf.breastfeedingStatus === 'recentlyStopped') { - if (pregBf.breastfeedingStopDate) { - summaries.push( - `Recently breastfeeding (stopped ${pregBf.breastfeedingStopDate})` - ) - } else { - summaries.push('Recently breastfeeding') - } - } + if (breastDensityFactorsHrt === 'yes') { + summaries.push('Taking HRT') + } else if (breastDensityFactorsHrt === 'no') { + summaries.push('Not taking HRT') } // Other medical information (free text) diff --git a/app/routes/appointments/medical-information.js b/app/routes/appointments/medical-information.js index aee90aad..ab0d6ddd 100644 --- a/app/routes/appointments/medical-information.js +++ b/app/routes/appointments/medical-information.js @@ -7,8 +7,143 @@ const { getReturnUrl, modalBreakout } = require('../../lib/utils/referrers') +const { getAppointmentData } = require('../../lib/utils/appointment-data') module.exports = (router) => { + // Auto-save breast density factors when checkboxes are changed + router.post( + '/clinics/:clinicId/appointments/:appointmentId/medical-information/breast-density-factors-save', + (req, res) => { + const data = req.session.data + const postedFactors = req.body?.appointment?.medicalInformation?.breastDensityFactors + const postedHrt = req.body?.appointment?.medicalInformation?.breastDensityFactorsHrt + + // No posted factors means all options are currently unchecked + const factors = Array.isArray(postedFactors) + ? postedFactors + : postedFactors + ? [postedFactors] + : [] + const nonHrtFactors = factors.filter((factor) => factor && factor !== 'hrt') + + if (!data.appointment) { + data.appointment = {} + } + + if (!data.appointment.medicalInformation) { + data.appointment.medicalInformation = {} + } + + data.appointment.medicalInformation.breastDensityFactors = nonHrtFactors + + if (postedHrt === 'yes' || postedHrt === 'no') { + data.appointment.medicalInformation.breastDensityFactorsHrt = postedHrt + } + + // Keep a draft cache outside auto-stored form keys so later form posts + // cannot accidentally clear the latest autosaved checkbox state. + if (!data._medicalInformationDraft) { + data._medicalInformationDraft = {} + } + data._medicalInformationDraft.breastDensityFactors = nonHrtFactors + + if (postedHrt === 'yes' || postedHrt === 'no') { + data._medicalInformationDraft.breastDensityFactorsHrt = postedHrt + } + + res.status(204).send() + } + ) + + // Save other medical information while preserving breast density factors + router.post( + '/clinics/:clinicId/appointments/:appointmentId/medical-information/other-medical-information-save', + (req, res) => { + const { clinicId, appointmentId } = req.params + const data = req.session.data + const referrerChain = req.query.referrerChain + const scrollTo = req.query.scrollTo + + const appointmentMedicalInformation = data?.appointment?.medicalInformation + const postedBreastDensityFactors = + appointmentMedicalInformation?.breastDensityFactors + const postedBreastDensityFactorsHrt = + appointmentMedicalInformation?.breastDensityFactorsHrt + const cachedBreastDensityFactors = + data?._medicalInformationDraft?.breastDensityFactors + const cachedBreastDensityFactorsHrt = + data?._medicalInformationDraft?.breastDensityFactorsHrt + + const normalisedPostedBreastDensityFactors = + Array.isArray(postedBreastDensityFactors) + ? postedBreastDensityFactors + : postedBreastDensityFactors + ? [postedBreastDensityFactors] + : undefined + + if (normalisedPostedBreastDensityFactors) { + if (!data._medicalInformationDraft) { + data._medicalInformationDraft = {} + } + data._medicalInformationDraft.breastDensityFactors = + normalisedPostedBreastDensityFactors.filter((factor) => factor && factor !== 'hrt') + } + + if (postedBreastDensityFactorsHrt === 'yes' || postedBreastDensityFactorsHrt === 'no') { + if (!data._medicalInformationDraft) { + data._medicalInformationDraft = {} + } + data._medicalInformationDraft.breastDensityFactorsHrt = + postedBreastDensityFactorsHrt + } + + // If this submission did not include factors, keep the last saved values + if (!normalisedPostedBreastDensityFactors) + { + const savedAppointmentData = getAppointmentData(data, clinicId, appointmentId) + const savedBreastDensityFactors = + savedAppointmentData?.appointment?.medicalInformation?.breastDensityFactors + + if (cachedBreastDensityFactors) + { + data.appointment.medicalInformation.breastDensityFactors = + cachedBreastDensityFactors + } + else if (savedBreastDensityFactors) + { + data.appointment.medicalInformation.breastDensityFactors = + savedBreastDensityFactors + } + } + + if (!postedBreastDensityFactorsHrt) + { + const savedAppointmentData = getAppointmentData(data, clinicId, appointmentId) + const savedBreastDensityFactorsHrt = + savedAppointmentData?.appointment?.medicalInformation?.breastDensityFactorsHrt + + if (cachedBreastDensityFactorsHrt) + { + data.appointment.medicalInformation.breastDensityFactorsHrt = + cachedBreastDensityFactorsHrt + } + else if (savedBreastDensityFactorsHrt) + { + data.appointment.medicalInformation.breastDensityFactorsHrt = + savedBreastDensityFactorsHrt + } + } + + const returnUrl = getReturnUrl( + `/clinics/${clinicId}/appointments/${appointmentId}/review-medical-information`, + referrerChain, + scrollTo + ) + + res.redirect(modalBreakout(returnUrl)) + } + ) + // Save breast features (includes converting JSON string to structured data) router.post( '/clinics/:clinicId/appointments/:appointmentId/medical-information/record-breast-features/save', diff --git a/app/views/_includes/medical-information/index.njk b/app/views/_includes/medical-information/index.njk index 78da700f..0091efeb 100644 --- a/app/views/_includes/medical-information/index.njk +++ b/app/views/_includes/medical-information/index.njk @@ -219,60 +219,80 @@ {% endswitch %} {# -------------------------------------------------------------- #} -{# Other relevant information #} -{% set sectionHeading = "Other relevant information" %} -{% set subHeading = "Including HRT, pregnancy, breastfeeding and mammographer notes" %} -{% set sectionId = sectionHeading | kebabCase %} -{% set scrollTo = sectionId %} +{# Breast density factors #} +{% set breastDensitySectionId = "breast-density-factors" %} +{% set scrollTo = breastDensitySectionId %} -{% set otherRelevantInformationHtml %} - {% include "_includes/summary-lists/medical-information/other-relevant-information.njk" %} +{% set breastDensityFactorsHtml %} + {% include "_includes/summary-lists/medical-information/breast-density-factors.njk" %} {% endset %} -{% set otherRelevantInformationCount = 0 %} +{# Count selected breast density factors for expander summary #} +{% set _bdf = appointment.medicalInformation.breastDensityFactors %} +{% if _bdf and not (_bdf | isArray) %}{% set _bdf = [_bdf] %}{% endif %} +{% set _bdfHrt = appointment.medicalInformation.breastDensityFactorsHrt %} +{% if not _bdfHrt and _bdf and _bdf | includes("hrt") %}{% set _bdfHrt = "yes" %}{% endif %} +{% set breastDensityCount = 0 %} +{% if _bdfHrt == "yes" %}{% set breastDensityCount = breastDensityCount + 1 %}{% endif %} +{% if _bdf and _bdf | includes("pregnant") %}{% set breastDensityCount = breastDensityCount + 1 %}{% endif %} +{% if _bdf and _bdf | includes("breastfeeding") %}{% set breastDensityCount = breastDensityCount + 1 %}{% endif %} +{% set breastDensityContentsSummary = breastDensityCount ~ (" breast density factor added" if breastDensityCount == 1 else " breast density factors added") if breastDensityCount > 0 else "No breast density factors added" %} -{% if appointment.medicalInformation.hrt.hrtQuestion == 'yes' %} - {% set otherRelevantInformationCount = otherRelevantInformationCount + 1 %} -{% endif %} +{% switch displayFormat %} + {% case 'flat' %} +
- {{ subHeading }} -
- {{ otherRelevantInformationHtml | safe }} + {{ otherMedicalInformationHtml | safe }} {% endcall %} {% default %} {{ appDetails({ - id: sectionId, + id: otherMedicalInfoSectionId, classes: "nhsuk-expander js-expandable-section js-track-expanded", - summaryText: sectionHeading, - subtitle: subHeading, - contentsSummary: otherRelevantInformationSummary, - html: otherRelevantInformationHtml, + summaryText: "Other medical information", + contentsSummary: otherMedicalInfoContentsSummary, + html: otherMedicalInformationHtml, status: "To review" }) }} {% endswitch %} diff --git a/app/views/_includes/summary-lists/medical-info-summary.njk b/app/views/_includes/summary-lists/medical-info-summary.njk index 4fb122de..d4bbab01 100644 --- a/app/views/_includes/summary-lists/medical-info-summary.njk +++ b/app/views/_includes/summary-lists/medical-info-summary.njk @@ -127,23 +127,37 @@ {# Build referrer chain for add journey: confirmation -> review #} {% set mammogramsAddReferrerChain = currentUrl | appendReferrer(contextUrl + "/confirm-information/previous-mammograms") %} -{# Other relevant information summary #} -{# Get other relevant information summaries #} -{% set otherRelevantInfoSummaries = appointment.medicalInformation | summariseOtherRelevantInformation %} -{% set otherRelevantInfoCount = otherRelevantInfoSummaries | length %} +{# Breast density factors summary #} +{% set _bdf = appointment.medicalInformation.breastDensityFactors %} +{% if _bdf and not (_bdf | isArray) %}{% set _bdf = [_bdf] %}{% endif %} +{% set _bdfHrt = appointment.medicalInformation.breastDensityFactorsHrt %} +{% if not _bdfHrt and _bdf and _bdf | includes("hrt") %}{% set _bdfHrt = "yes" %}{% endif %} -{# Build other relevant information HTML #} -{% set otherRelevantInfoHtml %} - {% if otherRelevantInfoCount == 0 %} -No other information added
- {% elif otherRelevantInfoCount == 1 %} -{{ otherRelevantInfoSummaries[0] }}
- {% else %} +{% set breastDensityFactorsHtml %} + {% if _bdfHrt == "yes" or _bdfHrt == "no" or (_bdf and _bdf | length > 0) %}No breast density factors added
+ {% endif %} +{% endset %} + +{% set breastDensityCount = 0 %} +{% if _bdfHrt == "yes" %}{% set breastDensityCount = breastDensityCount + 1 %}{% endif %} +{% if _bdf and _bdf | includes("pregnant") %}{% set breastDensityCount = breastDensityCount + 1 %}{% endif %} +{% if _bdf and _bdf | includes("breastfeeding") %}{% set breastDensityCount = breastDensityCount + 1 %}{% endif %} + +{# Other medical information summary #} +{% set otherMedicalInfo = appointment.medicalInformation.otherMedicalInformation %} +{% set otherMedicalInfoHtml %} + {% if otherMedicalInfo %} +{{ otherMedicalInfo }}
+ {% else %} +No other medical information added
{% endif %} {% endset %} @@ -266,20 +280,40 @@ }) %} {% endif %} -{% if not showOnlyPopulated or otherRelevantInfoCount > 0 %} +{% if not showOnlyPopulated or breastDensityCount > 0 %} + {% set rows = rows | push({ + key: { + text: "Breast density factors" + }, + value: { + html: breastDensityFactorsHtml + }, + actions: { + items: [ + { + href: ("./confirm-information/breast-density-factors") | urlWithReferrer(currentUrl), + text: "View or change", + visuallyHiddenText: "breast density factors" + } + ] + } if allowEdits + }) %} +{% endif %} + +{% if not showOnlyPopulated or otherMedicalInfo %} {% set rows = rows | push({ key: { - text: "Other relevant information" + text: "Other medical information" }, value: { - html: otherRelevantInfoHtml + html: otherMedicalInfoHtml }, actions: { items: [ { href: ("./confirm-information/other-relevant-information") | urlWithReferrer(currentUrl), text: "View or change", - visuallyHiddenText: "other relevant information" + visuallyHiddenText: "other medical information" } ] } if allowEdits diff --git a/app/views/_includes/summary-lists/medical-information/breast-density-factors.njk b/app/views/_includes/summary-lists/medical-information/breast-density-factors.njk new file mode 100644 index 00000000..eb5c2a2d --- /dev/null +++ b/app/views/_includes/summary-lists/medical-information/breast-density-factors.njk @@ -0,0 +1,112 @@ +{# app/views/_includes/summary-lists/medical-information/breast-density-factors.njk #} + +{% set selectedBreastDensityFactors = appointment.medicalInformation.breastDensityFactors %} +{% set breastDensityFactorsHrt = appointment.medicalInformation.breastDensityFactorsHrt %} + +{% if selectedBreastDensityFactors and not (selectedBreastDensityFactors | isArray) %} + {% set selectedBreastDensityFactors = [selectedBreastDensityFactors] %} +{% endif %} + +{% if not breastDensityFactorsHrt and selectedBreastDensityFactors and selectedBreastDensityFactors | includes("hrt") %} + {% set breastDensityFactorsHrt = "yes" %} +{% endif %} + +{% set participantName = participant | getFullName %} + +{% set breastDensityFactorsHrtQuestion = "Has " + participantName + " begun course of HRT since their last screening appointment?" %} +{% set pregnantOrBreastfeedingQuestion = "Is " + participantName + " pregnant or breastfeeding?" %} + +{% set breastDensityFactorsHrtSummaryHtml %} + {{ "Yes" if breastDensityFactorsHrt == "yes" or (selectedBreastDensityFactors and selectedBreastDensityFactors | includes("hrt")) else "No" }} +{% endset %} + +{% set pregnantOrBreastfeedingSummaryHtml %} + {% if selectedBreastDensityFactors and (selectedBreastDensityFactors | includes("pregnant") or selectedBreastDensityFactors | includes("breastfeeding")) %} +No
+ {% endif %} +{% endset %} + + + +Select any current or recent considerations
+ +{% set breastDensityFactorsHrtInputHtml %} + {{ radios({ + name: "appointment[medicalInformation][breastDensityFactorsHrt]", + value: breastDensityFactorsHrt, + classes: "nhsuk-radios--inline nhsuk-radios--small", + fieldset: { + legend: { + text: breastDensityFactorsHrtQuestion, + classes: "nhsuk-fieldset__legend--s" + } + }, + items: [ + { + value: "yes", + text: "Yes" + }, + { + value: "no", + text: "No" + } + ] + }) }} +{% endset %} + +{% set pregnantOrBreastfeedingInputHtml %} + {{ checkboxes({ + name: "appointment[medicalInformation][breastDensityFactors]", + values: selectedBreastDensityFactors, + classes: "nhsuk-checkboxes--small", + fieldset: { + legend: { + text: pregnantOrBreastfeedingQuestion, + classes: "nhsuk-fieldset__legend--s" + } + }, + items: [ + { + value: "pregnant", + text: "Pregnant" + }, + { + value: "breastfeeding", + text: "Breastfeeding" + } + ] + }) }} +{% endset %} + +{{ summaryList({ + rows: [ + { + key: { + text: "HRT (Hormone replacement therapy)" + }, + value: { + html: breastDensityFactorsHrtInputHtml if allowEdits else breastDensityFactorsHrtSummaryHtml + } + }, + { + key: { + text: "Pregnant or breastfeeding" + }, + value: { + html: pregnantOrBreastfeedingInputHtml if allowEdits else pregnantOrBreastfeedingSummaryHtml + } + } + ] +} | openInModal | handleSummaryListMissingInformation | removeLastRowBorder ) }} diff --git a/app/views/_includes/summary-lists/medical-information/other-relevant-information.njk b/app/views/_includes/summary-lists/medical-information/other-relevant-information.njk index 9e969635..6a3aa8ef 100644 --- a/app/views/_includes/summary-lists/medical-information/other-relevant-information.njk +++ b/app/views/_includes/summary-lists/medical-information/other-relevant-information.njk @@ -1,122 +1,9 @@ {# app/views/_includes/summary-lists/medical-information/other-relevant-information #} - -{% set hrtHtml %} - {% set hrtData = appointment.medicalInformation.hrt %} - - {% if hrtData %} - {% if hrtData.hrtQuestion == 'yes' %} -- Currently taking HRT -
-- {# Example: "Started: September 2022" #} - Started: {{ hrtData.hrtDateStarted }} -
- {% elseif hrtData.hrtQuestion == 'no-recently-stopped' %} -- Recently stopped taking HRT -
-
- Duration taken: {{ hrtData.hrtDurationBeforeStopping }}
- Date stopped: {{ hrtData.hrtDateStopped }}
-
- Currently pregnant -
-- {# Example: "Due date: June 2026" #} - Due date: {{ pregnancyAndBreastfeedingData.pregnancyDueDate }} -
- {% elseif pregnancyAndBreastfeedingData.pregnancyStatus == 'noButRecently' %} -- Recently pregnant -
-- Pregnancy ended: {{ pregnancyAndBreastfeedingData.pregnancyEndDate }} -
- {% elseif pregnancyAndBreastfeedingData.pregnancyStatus == 'noNotPregnant' %} -Not pregnant
- {% else %} -No information provided
- {% endif %} - - {% if pregnancyAndBreastfeedingData.breastfeedingStatus == 'yes' %} -- Currently breastfeeding -
-- {# Example: "Started: January 2026" #} - Started: {{ pregnancyAndBreastfeedingData.breastfeedingStartDate }} -
- {% elseif pregnancyAndBreastfeedingData.breastfeedingStatus == 'recentlyStopped' %} -- Recently breastfeeding -
-- Date stopped: {{ pregnancyAndBreastfeedingData.breastfeedingStopDate }} -
- {% elseif pregnancyAndBreastfeedingData.breastfeedingStatus == 'no' %} -Not breastfeeding
- {% else %} -No information provided
- {% endif %} - {% else %} - {{ valueHtml }} - {% endif %} - -{% endset %} +{# Shows only the other medical information (free-text) row. + Breast density factors have their own include: breast-density-factors.njk #} {{ summaryList({ rows: [ - { - key: { - text: "Hormone replacement therapy (HRT)" - }, - value: { - html: hrtHtml - }, - actions: { - items: [ - { - href: contextUrl + "/medical-information/hormone-replacement-therapy" | urlWithReferrer(referrerChain | appendReferrer(currentUrl), scrollTo), - text: "Change", - visuallyHiddenText: "hormone replacement therapy (HRT)" - } - ] - } if allowEdits - }, - { - key: { - text: "Pregnancy and breastfeeding" - }, - value: { - html: pregnancyAndBreastfeedingHtml - }, - actions: { - items: [ - { - href: contextUrl + "/medical-information/pregnancy-and-breastfeeding" | urlWithReferrer(referrerChain | appendReferrer(currentUrl), scrollTo), - text: "Change", - visuallyHiddenText: "pregnancy and breastfeeding" - } - ] - } if allowEdits - }, { key: { text: "Other medical information" diff --git a/app/views/appointments/check-information.html b/app/views/appointments/check-information.html index ea32df8d..8a061f52 100644 --- a/app/views/appointments/check-information.html +++ b/app/views/appointments/check-information.html @@ -144,16 +144,28 @@ } }) }} - {# Other relevant information card #} - {% set otherRelevantInformationHtml %} + {# Breast density factors card #} + {% set breastDensityFactorsHtml %} + {% include "_includes/summary-lists/medical-information/breast-density-factors.njk" %} + {% endset %} + + {{ card({ + heading: "Breast density factors", + headingLevel: "2", + feature: true, + descriptionHtml: breastDensityFactorsHtml + }) }} + + {# Other medical information card #} + {% set otherMedicalInformationHtml %} {% include "_includes/summary-lists/medical-information/other-relevant-information.njk" %} {% endset %} {{ card({ - heading: "Other relevant medical information", + heading: "Other medical information", headingLevel: "2", feature: true, - descriptionHtml: otherRelevantInformationHtml + descriptionHtml: otherMedicalInformationHtml }) }} {% endset %} diff --git a/app/views/appointments/confirm-information/breast-density-factors.html b/app/views/appointments/confirm-information/breast-density-factors.html new file mode 100644 index 00000000..18cae417 --- /dev/null +++ b/app/views/appointments/confirm-information/breast-density-factors.html @@ -0,0 +1,45 @@ +{# app/views/appointments/confirm-information/breast-density-factors.html #} + +{% extends 'layout-appointment.html' %} + +{% set pageHeading = "Review breast density factors" %} +{% set showNavigation = false %} +{% set activeWorkflowStep = 'check-information' %} +{% set hideBackLink = true %} + +{% set allowEdits = true %} + +{% set gridColumn = "nhsuk-grid-column-full" %} + +{% set scrollTo = "breast-density-factors" %} + +{% block pageContent %} + + {# TODO: Ideally this would be before the main element #} + {{ backLink({ + href: "../check-information" | getReturnUrl(referrerChain), + text: "Back", + classes: "nhsuk-u-margin-top-0 nhsuk-u-margin-bottom-4" + }) }} + +