Simplify HRT, pregnancy, breastfeeding questions into "Breast density factors" - #378
Open
rivalee wants to merge 7 commits into
Open
Simplify HRT, pregnancy, breastfeeding questions into "Breast density factors"#378rivalee wants to merge 7 commits into
rivalee wants to merge 7 commits into
Conversation
rivalee
marked this pull request as ready for review
July 22, 2026 14:24
Follow-up to the breast density factors work, tidying up the method. - Remove the _medicalInformationDraft cache and the other-medical-information save route. auto-store-data merges nested objects, so a note being added could never have cleared the factors - the cache guarded against something that couldn't happen. - Fix the clobbering that could actually happen: the kit's unchecked-checkbox script adds an "_unchecked" value for every checkbox in the form being submitted, and auto-store-data replaces arrays rather than merging them, so submitting any other form on the page wiped the saved answers. The inputs are now named outside the appointment namespace, so only the autosave route writes them. - Add getBreastDensityFactors, summariseBreastDensityFactors and summariseOtherMedicalInformation, replacing the array coercion that was repeated across four templates. Count the factors separately from the answers, so a recorded "not taking HRT" still shows on the summary rather than hiding the row. - Retire the HRT and pregnancy/breastfeeding pages, generators and the dead summariseOtherRelevantInformation. Generate the new fields instead, so seeded appointments have data, and keep "no medical information" possible. - Move the include out of summary-lists into forms - it embeds inputs rather than being a summary list - and drop the openInModal and handleSummaryListMissingInformation filters, which were no-ops with no actions on the rows. - Fix copy: sentence case on the HRT key, a missing article in the HRT question, and drop the hint that only described the checkboxes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cards: https://nhsd-jira.digital.nhs.uk/browse/DTOSS-12763 and https://nhsd-jira.digital.nhs.uk/browse/DTOSS-12767
Instead of sub-pages for HRT and pregnancy and breastfeeding, we have a simplified version that asks about breast density factors, with checkboxes shown on the top level.
The checkboxes save as they're selected, so that they're not overwritten by eg a medical info note being added. This is something we'd need to discuss with a frontend developer.
Screenshots
Medical information page
Check information page