Skip to content

Simplify HRT, pregnancy, breastfeeding questions into "Breast density factors" - #378

Open
rivalee wants to merge 7 commits into
mainfrom
hrt-redesign
Open

Simplify HRT, pregnancy, breastfeeding questions into "Breast density factors"#378
rivalee wants to merge 7 commits into
mainfrom
hrt-redesign

Conversation

@rivalee

@rivalee rivalee commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

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

Screenshot 2026-07-27 at 10 03 37 Screenshot 2026-07-30 at 14 21 48

Check information page

Screenshot 2026-07-27 at 10 03 26

@edwardhorsford
edwardhorsford temporarily deployed to manage-breas-hrt-redesi-c9f0yc July 22, 2026 14:24 Inactive
@rivalee
rivalee marked this pull request as ready for review July 22, 2026 14:24
@edwardhorsford
edwardhorsford temporarily deployed to manage-breas-hrt-redesi-c9f0yc July 27, 2026 09:02 Inactive
@edwardhorsford
edwardhorsford temporarily deployed to manage-breas-hrt-redesi-c9f0yc July 27, 2026 09:51 Inactive
@edwardhorsford
edwardhorsford temporarily deployed to manage-breas-hrt-redesi-c9f0yc July 27, 2026 13:22 Inactive
@edwardhorsford
edwardhorsford temporarily deployed to manage-breas-hrt-redesi-c9f0yc July 30, 2026 10:35 Inactive
@edwardhorsford
edwardhorsford temporarily deployed to manage-breas-hrt-redesi-c9f0yc July 30, 2026 12:09 Inactive
@rivalee
rivalee requested a review from edwardhorsford July 30, 2026 12:20
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants