From 1d67a91749e6259f5698c281c8d1e0c908eebb05 Mon Sep 17 00:00:00 2001 From: rivalee Date: Mon, 10 Aug 2026 13:47:29 +0100 Subject: [PATCH 1/5] Update button content to authorise --- app/assets/javascript/expandable-sections.js | 6 +++--- app/views/appointments/review-medical-information.html | 4 ++-- tests/e2e/appointment.spec.js | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/assets/javascript/expandable-sections.js b/app/assets/javascript/expandable-sections.js index ea2ba2d7..31ffa0b0 100644 --- a/app/assets/javascript/expandable-sections.js +++ b/app/assets/javascript/expandable-sections.js @@ -123,7 +123,7 @@ document.addEventListener('DOMContentLoaded', function () { // Initialize progress updateProgress(sections, completedSections) - // Handle "Complete all and continue" button + // Handle "Authorise" button const completeAllButtons = document.querySelectorAll( '.js-complete-all-sections' ) @@ -322,7 +322,7 @@ function openNextIncompleteSection(currentIndex, sections, completedSections) { // Function to highlight the completion button when all sections are done function highlightCompletionButton() { const completeButton = document.querySelector( - 'button:contains("Complete all and continue")' + 'button:contains("Authorise")' ) if (!completeButton) { @@ -330,7 +330,7 @@ function highlightCompletionButton() { const buttons = document.querySelectorAll('button') buttons.forEach((btn) => { - if (btn.textContent.includes('Complete all and continue')) { + if (btn.textContent.includes('Authorise')) { btn.classList.add('nhsuk-button--green') // Highlight in green btn.style.animation = 'pulse 2s infinite' // Add a subtle animation } diff --git a/app/views/appointments/review-medical-information.html b/app/views/appointments/review-medical-information.html index b61b10a5..95668f08 100644 --- a/app/views/appointments/review-medical-information.html +++ b/app/views/appointments/review-medical-information.html @@ -32,7 +32,7 @@

{{ button({ - text: "Complete all and continue" if appointment.workflowStatus['review-medical-information'] != 'completed' else "Next section", + text: "Authorise and continue" if appointment.workflowStatus['review-medical-information'] != 'completed' else "Next section", classes: "nhsuk-u-margin-bottom-0 nhsuk-button js-complete-all-sections" }) }}
@@ -44,7 +44,7 @@

{{ button({ - text: "Complete all and continue", + text: "Authorise and continue", classes: "js-complete-all-sections" }) }} diff --git a/tests/e2e/appointment.spec.js b/tests/e2e/appointment.spec.js index 68e2d5f1..56452935 100644 --- a/tests/e2e/appointment.spec.js +++ b/tests/e2e/appointment.spec.js @@ -132,7 +132,7 @@ test.describe('Screening appointment', () => { await expect(page.getByText('Lump').first()).toBeVisible() await page - .getByRole('button', { name: 'Complete all and continue' }) + .getByRole('button', { name: 'Authorise' }) .first() .click() @@ -162,7 +162,7 @@ test.describe('Screening appointment', () => { page.getByRole('heading', { name: 'Review medical information' }) ).toBeVisible() await page - .getByRole('button', { name: 'Complete all and continue' }) + .getByRole('button', { name: 'Authorise' }) .first() .click() From ac1c972812e1dcaad1736bd40629c449a4c5f1a3 Mon Sep 17 00:00:00 2001 From: rivalee Date: Mon, 10 Aug 2026 14:55:37 +0100 Subject: [PATCH 2/5] add line of text with mammographer name --- app/views/appointments/review-medical-information.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/appointments/review-medical-information.html b/app/views/appointments/review-medical-information.html index 95668f08..95d7c068 100644 --- a/app/views/appointments/review-medical-information.html +++ b/app/views/appointments/review-medical-information.html @@ -35,6 +35,7 @@

text: "Authorise and continue" if appointment.workflowStatus['review-medical-information'] != 'completed' else "Next section", classes: "nhsuk-u-margin-bottom-0 nhsuk-button js-complete-all-sections" }) }} +

This will authorise imaging by {{ data.currentUser.firstName }} {{ data.currentUser.lastName }}

@@ -45,8 +46,9 @@

{{ button({ text: "Authorise and continue", - classes: "js-complete-all-sections" + classes: "js-complete-all-sections nhsuk-u-margin-bottom-0" }) }} +

This will authorise imaging by {{ data.currentUser.firstName }} {{ data.currentUser.lastName }}

{% include "screening-cannot-proceed-link.njk" %}
From 4d181826bb2e9c444fd38038881176acd0e1e780 Mon Sep 17 00:00:00 2001 From: rivalee Date: Wed, 12 Aug 2026 10:55:17 +0100 Subject: [PATCH 3/5] fix bug --- app/routes/clinics.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/routes/clinics.js b/app/routes/clinics.js index faad4200..491a80e7 100644 --- a/app/routes/clinics.js +++ b/app/routes/clinics.js @@ -182,6 +182,9 @@ module.exports = (router) => { } const clinicData = getClinicData(req.session.data, req.params.id) + if (!clinicData) { + return res.redirect('/clinics') + } let remainingCount = filterAppointmentsByStatus( clinicData.appointments, 'remaining' From f959888c2bd4613ac086f19096882ef152e43f81 Mon Sep 17 00:00:00 2001 From: rivalee Date: Tue, 18 Aug 2026 14:55:28 +0100 Subject: [PATCH 4/5] Update content when breast implants added --- .../review-medical-information.html | 138 ++++++++++++++++-- 1 file changed, 126 insertions(+), 12 deletions(-) diff --git a/app/views/appointments/review-medical-information.html b/app/views/appointments/review-medical-information.html index 95d7c068..dc819036 100644 --- a/app/views/appointments/review-medical-information.html +++ b/app/views/appointments/review-medical-information.html @@ -13,6 +13,19 @@ {# Display format for medical information sections #} {% set displayFormat = "expander" %} +{# Check if participant has active (non-removed) breast implants #} +{% set hasActiveImplants = false %} +{% set implantRecords = appointment.medicalInformation.medicalHistory.breastImplantsAugmentation %} +{% if implantRecords | length %} + {% for implant in implantRecords %} + {% if not implant.hasBeenRemoved %} + {% set hasActiveImplants = true %} + {% endif %} + {% endfor %} +{% endif %} + +{% set defaultAuthoriser = "J. Wyatt" %} + {% block pageContent %}

@@ -29,28 +42,129 @@

value: appointment.workflowStatus['review-breast-features-after-imaging'] }) }} -
-
+ {% if hasActiveImplants and appointment.workflowStatus['review-medical-information'] != 'completed' %} + {{ insetText({ + html: "

You do not have permission to authorise some views.

" + }) }} +
{{ button({ - text: "Authorise and continue" if appointment.workflowStatus['review-medical-information'] != 'completed' else "Next section", - classes: "nhsuk-u-margin-bottom-0 nhsuk-button js-complete-all-sections" + text: "Authorise with " + defaultAuthoriser + " and continue", + classes: "nhsuk-u-margin-bottom-0 js-complete-all-sections js-irmer-authorise-button" }) }} -

This will authorise imaging by {{ data.currentUser.firstName }} {{ data.currentUser.lastName }}

+ Choose alternative authoriser
-
+ {% else %} +
+
+ {{ button({ + text: "Authorise and continue" if appointment.workflowStatus['review-medical-information'] != 'completed' else "Next section", + classes: "nhsuk-u-margin-bottom-0 nhsuk-button js-complete-all-sections" + }) }} +

This will authorise imaging by {{ data.currentUser.firstName }} {{ data.currentUser.lastName }}

+
+
+ {% endif %}
{% include "_includes/medical-information/index.njk" %}
- {{ button({ - text: "Authorise and continue", - classes: "js-complete-all-sections nhsuk-u-margin-bottom-0" - }) }} -

This will authorise imaging by {{ data.currentUser.firstName }} {{ data.currentUser.lastName }}

+ {% if hasActiveImplants and appointment.workflowStatus['review-medical-information'] != 'completed' %} + {{ insetText({ + html: "

You do not have permission to authorise some views.

" + }) }} +
+ {{ button({ + text: "Authorise with " + defaultAuthoriser + " and continue", + classes: "nhsuk-u-margin-bottom-0 js-complete-all-sections js-irmer-authorise-button" + }) }} + Choose alternative authoriser +
+ {% else %} + {{ button({ + text: "Authorise and continue", + classes: "js-complete-all-sections nhsuk-u-margin-bottom-0" + }) }} +

This will authorise imaging by {{ data.currentUser.firstName }} {{ data.currentUser.lastName }}

+ {% endif %} - {% include "screening-cannot-proceed-link.njk" %} +
+ {% include "screening-cannot-proceed-link.njk" %} +
+ {# Alternative authoriser modal #} + {% if hasActiveImplants %} + {% set authoriserModalContent %} + {{ radios({ + name: "irmerAuthoriser", + fieldset: { + legend: { + text: "Select an alternative authoriser" + } + }, + items: [ + { value: "S. Patel", text: "S. Patel" }, + { value: "R. Thompson", text: "R. Thompson" }, + { value: "L. Okonkwo", text: "L. Okonkwo" }, + { value: "H. Chambers", text: "H. Chambers" }, + { value: "F. Kaur", text: "F. Kaur" } + ] + }) }} + {% endset %} + + {{ appModal({ + id: "choose-authoriser-modal", + title: "Choose alternative authoriser", + showCloseButton: true, + content: authoriserModalContent, + actions: [ + { + text: "Save", + action: "close", + classes: "js-select-authoriser" + }, + { + text: "Cancel", + element: "link", + action: "close" + } + ] + }) }} + {% endif %} + +{% endblock %} + +{% if hasActiveImplants %} +{% block pageScripts %} + {% endblock %} +{% endif %} From dd44623cd4778c4d3847c818a50ee8cdbb97a538 Mon Sep 17 00:00:00 2001 From: rivalee Date: Thu, 20 Aug 2026 15:25:05 +0100 Subject: [PATCH 5/5] Update IRMER auth button to choose authoriser --- .../review-medical-information.html | 37 +++++++++++++------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/app/views/appointments/review-medical-information.html b/app/views/appointments/review-medical-information.html index dc819036..a2b44e12 100644 --- a/app/views/appointments/review-medical-information.html +++ b/app/views/appointments/review-medical-information.html @@ -24,8 +24,6 @@ {% endfor %} {% endif %} -{% set defaultAuthoriser = "J. Wyatt" %} - {% block pageContent %}

@@ -48,10 +46,11 @@

}) }}
{{ button({ - text: "Authorise with " + defaultAuthoriser + " and continue", - classes: "nhsuk-u-margin-bottom-0 js-complete-all-sections js-irmer-authorise-button" + text: "Choose an authoriser", + classes: "nhsuk-u-margin-bottom-0 js-irmer-authorise-button js-choose-authoriser-link", + attributes: { type: "button" } }) }} - Choose alternative authoriser +
{% else %}
@@ -76,10 +75,11 @@

}) }}
{{ button({ - text: "Authorise with " + defaultAuthoriser + " and continue", - classes: "nhsuk-u-margin-bottom-0 js-complete-all-sections js-irmer-authorise-button" + text: "Choose an authoriser", + classes: "nhsuk-u-margin-bottom-0 js-irmer-authorise-button js-choose-authoriser-link", + attributes: { type: "button" } }) }} - Choose alternative authoriser +
{% else %} {{ button({ @@ -101,7 +101,7 @@

name: "irmerAuthoriser", fieldset: { legend: { - text: "Select an alternative authoriser" + text: "Select an authoriser" } }, items: [ @@ -116,7 +116,7 @@

{{ appModal({ id: "choose-authoriser-modal", - title: "Choose alternative authoriser", + title: "Choose an authoriser", showCloseButton: true, content: authoriserModalContent, actions: [ @@ -129,6 +129,12 @@

text: "Cancel", element: "link", action: "close" + }, + { + text: "Appointment cannot proceed", + element: "link", + href: "/clinics/" + clinicId + "/appointments/" + appointmentId + "/attended-not-screened-reason", + action: "close" } ] }) }} @@ -144,7 +150,7 @@

const modal = document.getElementById("choose-authoriser-modal") if (!modal) return - // Open modal when "Choose alternative authoriser" is clicked + // Open modal when authoriser button is clicked document.querySelectorAll(".js-choose-authoriser-link").forEach((link) => { link.addEventListener("click", (event) => { event.preventDefault() @@ -152,7 +158,7 @@

}) }) - // Update all authorise buttons when an authoriser is selected + // Update buttons and enable form submission when an authoriser is selected const selectButton = modal.querySelector(".js-select-authoriser") if (selectButton) { selectButton.addEventListener("click", () => { @@ -160,6 +166,13 @@

if (selected) { document.querySelectorAll(".js-irmer-authorise-button").forEach((btn) => { btn.textContent = "Authorise with " + selected.value + " and continue" + btn.removeAttribute("type") + btn.classList.add("js-complete-all-sections") + btn.classList.remove("js-choose-authoriser-link") + }) + // Show the alternative authoriser links + document.querySelectorAll(".js-alternative-authoriser-link").forEach((link) => { + link.style.display = "" }) } })