Care plans, safety flags, tribunal dates, carer told and escalation history

Merged
BI
3d ago
+3957-851

Requested by Josh · project thread

Josh approved the clinical wording on 9 Nov 2026, and the hold label has been removed. Merge slot 9 (merge-order-9-nov), after #1563. Defaults approved by Josh on 9 Nov 2026: D-104 (recorded in #1555). Review page: https://claude.ai/artifact/B1ichQUZqwjUkwBpcjZ6iX

What changes (items from the list of 50)

  • 16 Risk flags on cards: the referral's flags show as one short line with the referral date on ED board rows, the ED person sheet and a ward's bed request. Read only through patient-referral-safety.ts (H10); nothing stored on the patient (R-2026-09-04-A kept). New flag "Needs security escort".
  • 33 Interpreter and cultural support: " interpreter" on the same cards; new Patient.culturalSupportRequested, set only when asked for, never derived from Aboriginal status.
  • 27 Care plans: new "Care and safety" card on the patient's Now tab, with Add care plan. A new plan supersedes the old one and nothing is deleted. An attachment keeps only its file type and size (H-0049). Frequent presenter tag at 4+ ED presentations in 12 months (CLINICAL_VALUES.frequentPresenterEdPresentations, Josh's default, check before clinical use).
  • 30 Tribunal hearing: date and time as typed, then an outcome. After the date passes with no outcome: "Hearing date passed, outcome not recorded". No countdown (D-93).
  • 34 Carer told: admission, transfer and discharge read the existing support notification checklist. Discharge goes through carerToldAtDischarge(), ready to point at the discharge thread's checklist item.
  • 28 Escalation history: Movement.escalations keeps every escalation, and older saves still load. What happened next is derived from the record. Shown in the movement workspace and on the delays board.
  • 38 Duplicate warning: the referral drawer's new-patient form now runs duplicateCandidates, as Add a patient already did.

New events: RECORD_CARE_PLAN, RECORD_TRIBUNAL_HEARING, RECORD_TRIBUNAL_OUTCOME, SET_CULTURAL_SUPPORT_REQUEST. Each has roles, persistence classification, typed-text ledger and scrub entries, a history entry and journey dispositions.

Checks

  • Merged with main at a446dca; conflicts resolved (fuzz builders, history count, journey files, storage verdict fixture re-recorded).
  • Full Vitest suite on the merged branch: 2,207 files, 21,791 passed, 3 skipped, 0 failed.
  • tsc (typecheck config): clean. Journey verify.mjs --check: passed.
  • Browser check of the local app at 1280 px (light and dark) and 400 px. Escalation history and the referral duplicate check were not screenshotted.
  • Not run locally: production build and phone size limits (script-budget.json). CI covers these.

Open question for later (needs an owner ruling, not in this PR)

Wards see no flags on bed requests backed by a full referral record, because ward screens can't read referral records (FD-23).


Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01J352njSsrUEXnx3x6XKBAG