ED and referral flow: ten features from Josh's list

Merged
BI
4d ago
+5974-1072

Ten ED and referral flow features from Josh's list of 50, built on synthetic data. Merge slot 7, after the page-tops redesign. Josh approved one PR on 9 Nov 2026. His rulings are recorded as D-110.

Review page with before-and-after screenshots: https://claude.ai/artifact/Mw767wFxkToNNDP86tDk6H

What it adds

  1. Referral response timer. Each ward still to answer shows the time it has left, then how long it is overdue. An overdue ward gets an Escalate button, which records a bed meeting action and can be undone. A wait-listed ward now reads "wait list", not as a struck-out decline.
  2. Medical clearance tracker (clinical; Josh signed off). A clinician still records clearance. The app shows time since arrival or time to clearance, and shows amber after 6 h with nothing recorded (edClearanceNotRecorded). ED Statistics gets a median time to clearance card.
  3. Psychiatry review tracker. Adds Movement.psychReview, with REQUEST_PSYCH_REVIEW and RECORD_PSYCH_REVIEW_SEEN. Each ED review row shows one next-step button. The list is never re-sorted.
  4. Smart bed match, as a fit line only. Every shortlist card shows "Fits sex and security · Not met: age · Check special care". Cards are not ranked and nothing is marked as the best match.
  5. Where the hours went. A breakdown of the stay's hours on the patient page.
  6. Ward wait list, and the ward ready for its next patient. Adds MARK_WARD_READY_FOR_NEXT, which a pull clears. Home shows a line for each ward that is ready.
  7. Step-down requests between wards. Sent from the ward board. The request opens the existing referral sheet as a ward-to-ward referral.
  8. ED-to-ward handover pack. A two-column A4 page that can be printed or copied. It is never emailed, and the record number is left out of the copy.
  9. Alternatives to admission (clinical; Josh signed off). An unranked, optional list on a ward-bed referral. It never blocks Send. Service names are placeholders.
  10. Referral pre-fill. Values carried from the current stay or the last referral, each marked "Check it". Free text, risk flags and urgency still start empty, as D-99 requires.

Checks

  • Full unit suite on Node 24 before the main merge: 2,203 files and 21,726 tests passed, 32 skipped.
  • After merging the latest main, these passed:
    • the whole-project type check
    • the journey documentation check, after refreshing its review digests
    • the focused tests: 1,835 passed
  • Not run locally: the phone size limits (script-budget.json). CI checks them, and I'll check them again before arming in slot 7.

Not built

  • A handover pack button inside the referral drawer.
  • Review steps on the phone ED list.
  • A Statistics view for "where the hours went".

Generated by Claude Code