From 08e0d62676ffc29804921228caad4468d5f8b325 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 11 Nov 2026 15:51:42 +0000 Subject: [PATCH 1/3] Give the community desk's ED heads-up a narrow scoped list (D-154) A community team desk's movements hold only its own referrals' journeys, so the Your patients in ED card was empty there. scopeWorkspace now adds communityEdArrivals for a community team desk: its open-episode patients in an ED now, as UMRN, ED name and time only, read from the whole workspace. The ED journey and the person's record stay out of the view. The card reads the list through a new shell context. The mock episode team and status now live in one small list that the record mock-ups spread, so the access code does not load the record mock-ups. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01GxPPxjdesrEjVU1zKyiFhd --- docs/ward-flow/OWNER-RULINGS.md | 602 +++++++++--------- docs/ward-flow/decisions.md | 10 + .../home-team-heads-up-card.tsx | 18 +- .../patients/community-episode-teams.ts | 21 + .../patients/patient-record-extras.ts | 13 +- .../ward-management/shell/ward-access.tsx | 18 +- .../ward-management/ward-access-scope.ts | 23 + .../ward-community-ed-arrivals-scope.test.ts | 66 ++ 8 files changed, 451 insertions(+), 320 deletions(-) create mode 100644 src/components/ward-management/patients/community-episode-teams.ts create mode 100644 tests/ward-community-ed-arrivals-scope.test.ts diff --git a/docs/ward-flow/OWNER-RULINGS.md b/docs/ward-flow/OWNER-RULINGS.md index 10212a843f..48eb3ec0c6 100644 --- a/docs/ward-flow/OWNER-RULINGS.md +++ b/docs/ward-flow/OWNER-RULINGS.md @@ -9,7 +9,7 @@ Scanned `docs/ward-flow/decisions.md`, `docs/ward-flow/owner-*.md` and `docs/his One file matches `*owner*` but not `owner-*` and is deliberately excluded: `how-to-write-to-the-owner.md` — it is instructions for writing TO the owner, not a record of what he ruled. -**710 rulings/items extracted, across 43 of 44 files.** +**711 rulings/items extracted, across 43 of 44 files.** **0 file(s) UNPARSED** — no recognised ruling structure found; listed, not dropped. See below. **1 file(s) recorded as holding no ruling of their own**, each with its reason. See below. @@ -32,7 +32,7 @@ line, in the order discovered — confirm which instance you mean before citing --- -## ID index — 460 distinct IDs +## ID index — 461 distinct IDs So an ID like `D-9` or `O-17.1` can be looked up directly, without knowing which file it lives in. Bare numbered rulings (files that number "1., 2., 3. …" with no owner-issued letter code) are @@ -72,253 +72,254 @@ safe global key across 30 files. | `D-1` ⚠️ **3 occurrences in 3 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-12-four-answers.md`:16 | D-1 · Legal forms: split the list in two | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:85 | D-1 — 🔴 The screen is called **Patient**, not "Patient Now" | -| ↳ | `decisions.md`:177 | D-1. Ward Flow is local only, with no linked repository (Replaced by D-27) | +| ↳ | `decisions.md`:178 | D-1. Ward Flow is local only, with no linked repository (Replaced by D-27) | | `D-2` ⚠️ **3 occurrences in 3 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-12-four-answers.md`:57 | D-2 · Raise the three unbindable table thresholds | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:108 | D-2 — 🔴 Communication: BUILD IT. The system must be able to tell someone something. | -| ↳ | `decisions.md`:187 | D-2. Railway is disconnected | +| ↳ | `decisions.md`:188 | D-2. Railway is disconnected | | `D-3` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:215 | D-3 — 🔴 The 12px floor is ADOPTED. Screen by screen, not as a sweep. | -| ↳ | `decisions.md`:198 | D-3. The PsychSift and Database code is being retired from Ward Flow | +| ↳ | `decisions.md`:199 | D-3. The PsychSift and Database code is being retired from Ward Flow | | `D-3b` | `../history/archive/dated-notes/owner-decisions-2026-09-12-four-answers.md`:77 | D-3b · The data-conditional absence sweep is DEFERRED | | `D-4` ⚠️ **4 occurrences in 3 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-12-four-answers.md`:97 | D-4 · The deliberate sub-12px exception stands if its reasoning is sound | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:263 | D-4 · WARD LEAD RULING, not the owner's — the Access record's false assurance | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:390 | D-4 ADDENDUM, 2026-09-11 — 🔴 the OTHER half of that sentence, found by Lane C after the fix | -| ↳ | `decisions.md`:206 | D-4. Synthetic patients only | +| ↳ | `decisions.md`:207 | D-4. Synthetic patients only | | `D-5` ⚠️ **4 occurrences in 3 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-12-routing-and-nine-flags.md`:15 | D-5 · 🔴 A NEW STANDING RULE: PROTECTED-WORK DELETIONS COME TO WARD VERIFIER FIRST | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:340 | D-5 · WARD LEAD RULING, not the owner's — gender reaches BOTH bed gates or neither | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:431 | D-5 MEASUREMENT, 2026-09-11 — the wiring task handed back, and the arithmetic is starker than I expected | -| ↳ | `decisions.md`:214 | D-5. Parallel threads in separate worktrees, folded one at a time | +| ↳ | `decisions.md`:215 | D-5. Parallel threads in separate worktrees, folded one at a time | | `D-6` ⚠️ **3 occurrences in 3 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-12-routing-and-nine-flags.md`:52 | D-6 · 🟢 THE `--t-0` COLLISION — amend the brief in the same change | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:472 | D-6 · WARD LEAD RULING — "Not recorded" and "Not yet recorded" are BOTH used, deliberately | -| ↳ | `decisions.md`:225 | D-6. Aboriginal cultural safety review deferred | +| ↳ | `decisions.md`:226 | D-6. Aboriginal cultural safety review deferred | | `D-7` ⚠️ **3 occurrences in 3 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-12-routing-and-nine-flags.md`:72 | D-7 · 🟢 THE REMAINING SEVEN ARE FLAGGED TO WARD LEAD | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:499 | D-7 · WARD LEAD RULING — the Patient screen SHOWS gender, and the addition is logged as an addition | -| ↳ | `decisions.md`:233 | D-7. The first four milestones, in this order | +| ↳ | `decisions.md`:234 | D-7. The first four milestones, in this order | | `D-8` ⚠️ **3 occurrences in 3 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-12-fold-and-authorisation.md`:9 | D-8 · 🔴 "FOLD INTO MAIN" ALWAYS MEANS THE LOCAL WARD FLOW LINE | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:545 | D-8 · WARD LEAD RULING — the announced marker says "invented NAMES", never "invented people" | -| ↳ | `decisions.md`:245 | D-8. Josh's standing rulings, numbered R1 to R16, for every session and tool | +| ↳ | `decisions.md`:246 | D-8. Josh's standing rulings, numbered R1 to R16, for every session and tool | | `D-9` ⚠️ **3 occurrences in 3 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-12-fold-and-authorisation.md`:51 | D-9 · 🟢 THE MENTAL HEALTH ACT AUTHORISATION GATE IS OVERRIDABLE — with the owner's clinical reason | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:589 | D-9 · WARD LEAD RULING — the referral board's table MAY scroll sideways; the missing thing is the affordance | -| ↳ | `decisions.md`:277 | D-9. Josh's rulings of 25 September, 11:43 to 12:00 (R17 to R21) | +| ↳ | `decisions.md`:278 | D-9. Josh's rulings of 25 September, 11:43 to 12:00 (R17 to R21) | | `D-10` ⚠️ **3 occurrences in 3 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-12-fold-and-authorisation.md`:91 | D-10 · ⏸️ THE SMALL-TEXT RAISE IS DEFERRED — with the triggers written down, because a deferral without one is a drop | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:618 | D-10 · WARD LEAD RULING — the overflow affordance is a SENTENCE first and a measured border second, not the standard's shade | -| ↳ | `decisions.md`:291 | D-10. Gate build type check (R22) | +| ↳ | `decisions.md`:292 | D-10. Gate build type check (R22) | | `D-11` ⚠️ **3 occurrences in 3 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-12-fold-and-authorisation.md`:129 | D-11 · 🔴 TWO LEDGERS IS CORRECT AND INTENDED — WARD FLOW TASKS GO ON THE WARD FLOW LEDGER, AND THE MAIN PROJECT'S IS DISREGARDED FOR THIS PROJECT | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:685 | D-11 · A-1 — the half-written referral history WARNS, and is never stored | -| ↳ | `decisions.md`:300 | D-11. Rulings of 25 September, 12:41 (R23 to R25) | +| ↳ | `decisions.md`:301 | D-11. Rulings of 25 September, 12:41 (R23 to R25) | | `D-12` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:704 | D-12 · A-2 — the referrer is the RECORDED SOURCE, and a person only if the record carries one | -| ↳ | `decisions.md`:316 | D-12. Rulings of 25 September, 12:43 (R26 to R31) | +| ↳ | `decisions.md`:317 | D-12. Rulings of 25 September, 12:43 (R26 to R31) | | `D-13` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:720 | D-13 · A-3 and A-4 — both resolve FOR THE CODE; the drawings change | -| ↳ | `decisions.md`:335 | D-13. Tooling tests in batch gates (R32) | +| ↳ | `decisions.md`:336 | D-13. Tooling tests in batch gates (R32) | | `D-14` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:739 | D-14 · A-6 and A-8 — ADD THE LINK, AND MAKE THE GUARD ENFORCE IN THE SAME CHANGE. Never one without the other. | -| ↳ | `decisions.md`:345 | D-14. Standing defaults: decide small things without asking | +| ↳ | `decisions.md`:346 | D-14. Standing defaults: decide small things without asking | | `D-15` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:778 | D-15 · A-7 — the figure NAMES ITS OWN CLOCK, or it does not ship | -| ↳ | `decisions.md`:357 | D-15. Rulings of 25 September, 13:26 (R33 to R35) | +| ↳ | `decisions.md`:358 | D-15. Rulings of 25 September, 13:26 (R33 to R35) | | `D-16` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:799 | D-16 · WARD LEAD RULING — the unwired primary actions use §8.6's EXISTING sentence; nothing new is invented | -| ↳ | `decisions.md`:370 | D-16. Legal overrides and form receipts, 25 September 13:51 UTC | +| ↳ | `decisions.md`:371 | D-16. Legal overrides and form receipts, 25 September 13:51 UTC | | `D-17` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:843 | D-17 · WARD LEAD RULING — A-8: FD-23 wins. The Patient screen never shows where else a patient has been. | -| ↳ | `decisions.md`:383 | D-17. Morning roll-up time is Josh's own default (25 September) | +| ↳ | `decisions.md`:384 | D-17. Morning roll-up time is Josh's own default (25 September) | | `D-18` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:878 | D-18 · WARD LEAD RULING — the referral query contract carries MODEL values; and `gp` is a question for the owner, not a mapping for me | -| ↳ | `decisions.md`:394 | D-18. The privacy lock stops saving only for typed text (25 September) | +| ↳ | `decisions.md`:395 | D-18. The privacy lock stops saving only for typed text (25 September) | | `D-19` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:922 | D-19 · WARD LEAD RULING — "something is already open for this person" is PERMITTED; "where" never is | -| ↳ | `decisions.md`:405 | D-19. Rulings of 25 September, evening (walkthrough, leave beds, PsychSift, gender display) | +| ↳ | `decisions.md`:406 | D-19. Rulings of 25 September, evening (walkthrough, leave beds, PsychSift, gender display) | | `D-20` ⚠️ **3 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:967 | D-20 · WARD LEAD RULING — the drawing wins; the vocabulary anchor was never the heading | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:1010 | D-20-REVISED · the drawing renames BOTH, so neither side is taken whole | -| ↳ | `decisions.md`:435 | D-20. One high-contrast colour check retired (26 September) | +| ↳ | `decisions.md`:436 | D-20. One high-contrast colour check retired (26 September) | | `D-21` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:1058 | D-21 · WARD LEAD RULING — tasks 10 and 12 are CLOSED, not deferred, and not built as callerless modules | -| ↳ | `decisions.md`:448 | D-21. Coordinator bed board: all nine recommended answers (26 September) | +| ↳ | `decisions.md`:449 | D-21. Coordinator bed board: all nine recommended answers (26 September) | | `D-22` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:1084 | D-22 · SHAPE 2 — the landmark label and the heading stop being two strings | -| ↳ | `decisions.md`:460 | D-22. No legal limits in hour rules; the rest are labelled defaults (26 September) | +| ↳ | `decisions.md`:461 | D-22. No legal limits in hour rules; the rest are labelled defaults (26 September) | | `D-23` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:1121 | D-23 · The bed board passes an empty leave-bed list into three capacity figures, and says nothing | -| ↳ | `decisions.md`:476 | D-23. Leave-bed fields kept; patient search stops matching by ward (26 September) | +| ↳ | `decisions.md`:477 | D-23. Leave-bed fields kept; patient search stops matching by ward (26 September) | | `D-24` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:1142 | D-24 · The raw `1.2` line-height — token it, and accept that community no longer matches | -| ↳ | `decisions.md`:490 | D-24. Hour-rules morning list: all A (26 September) | +| ↳ | `decisions.md`:491 | D-24. Hour-rules morning list: all A (26 September) | | `D-25` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:1161 | D-25 · Command's `deadlineLine` sentence is not built — and this DEFERS the R-5 question rather than answering it | -| ↳ | `decisions.md`:514 | D-25. The lone-patient check counts free beds on both matching paths (26 September) | +| ↳ | `decisions.md`:515 | D-25. The lone-patient check counts free beds on both matching paths (26 September) | | `D-26` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:1184 | D-26 · `edPressure` becomes a projection of `edHomeSummaries` — the two screens stop being able to disagree | -| ↳ | `decisions.md`:522 | D-26. Select fold checks by changed risk (27 September) | +| ↳ | `decisions.md`:523 | D-26. Select fold checks by changed risk (27 September) | | `D-27` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:1213 | D-27 · The word for a free bed is READY — and the ruling is about the WORD, not the identifier | -| ↳ | `decisions.md`:540 | D-27. Ward Flow uses its dedicated repository (28 September) | -| `D-28` | `decisions.md`:553 | D-28. Design Modernization & Anti-Box Architecture (30 September 2026) | -| `D-29` | `decisions.md`:567 | D-29. Act time limits shown as a labelled synthetic demo (4 October 2026) | +| ↳ | `decisions.md`:541 | D-27. Ward Flow uses its dedicated repository (28 September) | +| `D-28` | `decisions.md`:554 | D-28. Design Modernization & Anti-Box Architecture (30 September 2026) | +| `D-29` | `decisions.md`:568 | D-29. Act time limits shown as a labelled synthetic demo (4 October 2026) | | `D-30` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:1238 | D-30 · `Unit.forensic` is a WARD flag, and every rendered string says so | -| ↳ | `decisions.md`:582 | D-30. Central Coordinator Approval for Inter-Ward Bed Transfers (6 October 2026) | +| ↳ | `decisions.md`:583 | D-30. Central Coordinator Approval for Inter-Ward Bed Transfers (6 October 2026) | | `D-31` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:1367 | D-31 · The plan's disposition — delete one half, re-derive the other | -| ↳ | `decisions.md`:589 | D-31. Gender-Diverse Bed Placement Policy & Clinical Override Safety (6 October 2026) | +| ↳ | `decisions.md`:590 | D-31. Gender-Diverse Bed Placement Policy & Clinical Override Safety (6 October 2026) | | `D-32` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:1289 | D-32 · D-6 is restated: ONE WORDING PER STATE, and the states are named | -| ↳ | `decisions.md`:596 | D-32. FIFO Waiting Time with Clinical Triage Badging vs Algorithmic Urgency Sorting (6 October 2026) | +| ↳ | `decisions.md`:597 | D-32. FIFO Waiting Time with Clinical Triage Badging vs Algorithmic Urgency Sorting (6 October 2026) | | `D-33` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:1322 | D-33 · "Nothing outstanding" does three jobs, and only one of them may keep the words | -| ↳ | `decisions.md`:603 | D-33. Separation of Local Ward Shift Notes from Statewide Coordinator Telemetry (6 October 2026) | +| ↳ | `decisions.md`:604 | D-33. Separation of Local Ward Shift Notes from Statewide Coordinator Telemetry (6 October 2026) | | `D-34` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:1347 | D-34 · A hypothetical destination row may not use obligation vocabulary at all | -| ↳ | `decisions.md`:610 | D-34. Acute Medical Deterioration Bed Release and Escalation Protocol (6 October 2026) | +| ↳ | `decisions.md`:611 | D-34. Acute Medical Deterioration Bed Release and Escalation Protocol (6 October 2026) | | `D-35` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:1388 | D-35 · The ED pressure strip does not narrow to the selected service, and #6 is CLOSED | -| ↳ | `decisions.md`:617 | D-35. Deferral of Regional Multi-Leg Transport & RFDS Repatriation (6 October 2026) | +| ↳ | `decisions.md`:618 | D-35. Deferral of Regional Multi-Leg Transport & RFDS Repatriation (6 October 2026) | | `D-36` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:1405 | D-36 · _Referrals into this ward_ / _into the team_ — PRESENTATION, with a condition | -| ↳ | `decisions.md`:624 | D-36. Affirmation of External Governance & Clinical Safety Hard Gates (6 October 2026) (Replaced by D-87) | +| ↳ | `decisions.md`:625 | D-36. Affirmation of External Governance & Clinical Safety Hard Gates (6 October 2026) (Replaced by D-87) | | `D-37` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:1411 | D-37 · _Clinically ready, not yet gone_ — PRESENTATION, and the heading must name its subject | -| ↳ | `decisions.md`:639 | D-37. External Governance Hard Gate Operational Postures & Resolution Roadmap (6 October 2026) (Replaced by D-87) | +| ↳ | `decisions.md`:640 | D-37. External Governance Hard Gate Operational Postures & Resolution Roadmap (6 October 2026) (Replaced by D-87) | | `D-38` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:1417 | D-38 · _People currently in a hospital bed_ on community team statistics — an aggregate that identifies at small N | -| ↳ | `decisions.md`:666 | D-38. Leave, absent without leave and CTO on the Patient page (9 October 2026) | +| ↳ | `decisions.md`:667 | D-38. Leave, absent without leave and CTO on the Patient page (9 October 2026) | | `D-39` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:1437 | D-39 · _Contacts_ and _Time to first contact_ — HELD, build neither | -| ↳ | `decisions.md`:684 | D-39. Patients are identified by UMRN, never by a WF number (9 October 2026) | +| ↳ | `decisions.md`:685 | D-39. Patients are identified by UMRN, never by a WF number (9 October 2026) | | `D-40` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:1445 | D-40 · An empty check array never claims reconciliation — on either shell surface | -| ↳ | `decisions.md`:728 | D-40. A second community treatment order keeps the first (9 October 2026) | +| ↳ | `decisions.md`:729 | D-40. A second community treatment order keeps the first (9 October 2026) | | `D-41` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:1478 | D-41 · `corridorCounts` is extended, and its POPULATION changes | -| ↳ | `decisions.md`:739 | D-41. Delays board filters narrow the table and state the hidden count (9 October 2026) | +| ↳ | `decisions.md`:740 | D-41. Delays board filters narrow the table and state the hidden count (9 October 2026) | | `D-42` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:1490 | D-42 · _Referrals into this ward_ renders bare counts. No share. | -| ↳ | `decisions.md`:752 | D-42. 12px typography floor with no uppercase exception reaffirmed in Design System v9 (9–10 October 2026) | +| ↳ | `decisions.md`:753 | D-42. 12px typography floor with no uppercase exception reaffirmed in Design System v9 (9–10 October 2026) | | `D-43` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:1724 | D-43 · Ward Lead ruling — the bed board's ordinal contradiction is a LANE TASK | -| ↳ | `decisions.md`:758 | D-43. Colour lives in glyphs and the hero; red means act now with a thin 1px edge, never a fill (9 October 2026) | +| ↳ | `decisions.md`:759 | D-43. Colour lives in glyphs and the hero; red means act now with a thin 1px edge, never a fill (9 October 2026) | | `D-44` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:1791 | D-44 · The community scope note is reworded and the comparison panel stays | -| ↳ | `decisions.md`:765 | D-44. Compact sizing, white cards and smaller text retained over expression-test card tints (9 October 2026) | +| ↳ | `decisions.md`:766 | D-44. Compact sizing, white cards and smaller text retained over expression-test card tints (9 October 2026) | | `D-45` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:1803 | D-45 · 🔴 THE SEED DECISION — the fixture gains BOTH, as ONE change, after the statistics screens | -| ↳ | `decisions.md`:771 | D-45. Phone is its own 390×844 design, never a desktop reflow (9 October 2026) | +| ↳ | `decisions.md`:772 | D-45. Phone is its own 390×844 design, never a desktop reflow (9 October 2026) | | `D-46` ⚠️ **2 occurrences in 2 files — not unique** | | | | ↳ | `../history/archive/dated-notes/owner-decisions-2026-09-1x.md`:1984 | D-46 · A guard that fails whenever the machine is busy | -| ↳ | `decisions.md`:778 | D-46. Every page has a focal part, a part of its own, a page-specific hero and command-bar action rules (9 October 2026) | -| `D-47` | `decisions.md`:784 | D-47. Glass stays about 80% opaque with the top sheen kept (10 October 2026) | -| `D-48` | `decisions.md`:790 | D-48. Figures stay in Geist Mono with tabular digits while chart axes use Geist Sans (10 October 2026) | -| `D-49` | `decisions.md`:796 | D-49. Ward Flow 44px default row target (dense 36px, touch 52px) vs retired 48px PsychSift tap knob (10 October 2026) | -| `D-50` | `decisions.md`:802 | D-50. Neutral T1 urgency pill vs Form 1A amber statutory warning badge (10 October 2026) | -| `D-51` | `decisions.md`:808 | D-51. Delays filters hide rows with a stated hidden count while other queues highlight by default (10 October 2026) | -| `D-52` | `decisions.md`:815 | D-52. 10 October page review rulings: time-axis overdue zone, 15px/20px strip figures, 8px people pips and incremental shared parts (10 October 2026) | -| `D-53` | `decisions.md`:821 | D-53. Elevate design language and Glare mode adopted for Design System v9 (10 October 2026) | -| `D-54` | `decisions.md`:828 | D-54. Tier time thresholds remain synthetic demo values requiring clinical sign-off (10 October 2026) | -| `D-55` | `decisions.md`:836 | D-55. Supabase is Ward Flow's database and sign-in provider, and Azure is retired (15 October 2026) | -| `D-56` | `decisions.md`:842 | D-56. Josh signs the clinical values that have a recorded source, for the prototype (15 October 2026) | -| `D-57` | `decisions.md`:848 | D-57. Twenty Top 25 items move from the showcase into the real screens, each behind its own flag (15 October 2026) | -| `D-58` | `decisions.md`:875 | D-58. Josh signs three more clinical values that have a national source, for the prototype (15 October 2026) | -| `D-59` | `decisions.md`:881 | D-59. Each role sees only what it needs, from one access table (15 October 2026) | -| `D-60` | `decisions.md`:887 | D-60. Criteria led discharge, for voluntary patients only (15 October 2026) | -| `D-61` | `decisions.md`:896 | D-61. Tasks and Alerts are one queue called Alerts (16 October 2026) | -| `D-62` | `decisions.md`:902 | D-62. The one Alerts queue is signed off and its flag removed (16 October 2026) | -| `D-63` | `decisions.md`:908 | D-63. Josh signs the remaining clinical values and the criteria list, for the prototype (16 October 2026) | -| `D-64` | `decisions.md`:916 | D-64. Criteria led discharge shows on the boards and warns at departure (16 October 2026) | -| `D-65` | `decisions.md`:923 | D-65. Criteria led discharge on in production, typed patient specific criteria, and the AWOL bed hold review paused (17 October 2026) | -| `D-66` | `decisions.md`:939 | D-66. Granted roles work without a second approval (17 October 2026) | -| `D-67` | `decisions.md`:947 | D-67. Recover synthetic form drafts within the browser session (17 October 2026) | -| `D-68` | `decisions.md`:954 | D-68. Bed meeting TV content and access (19 October 2026) | -| `D-69` | `decisions.md`:962 | D-69. A referral with no legal status: "Needs an involuntary-capable bed until status is set." (20 October 2026) | -| `D-70` | `decisions.md`:969 | D-70. No computed Mental Health Act periods: show only the recorded due time (20 October 2026) | -| `D-71` | `decisions.md`:975 | D-71. Audit 1 clinical safety fixes: no suggested wards, wait-order queues, recorded facts only (20 October 2026) | -| `D-72` | `decisions.md`:988 | D-72. Seven product decisions for the 21 October fix plan (21 October 2026) | -| `D-73` | `decisions.md`:1004 | D-73. Batch merge safeguards (21 October 2026) | -| `D-74` | `decisions.md`:1020 | D-74. Owner answers to the 21 October open questions (21 October 2026) | -| `D-75` | `decisions.md`:1041 | D-75. UX audit follow-up, page caching, community gaps and the extra-travel bed hold (21 October 2026) | -| `D-76` | `decisions.md`:1054 | D-76. Community referral gaps: the full move journey and asking more wards (21 October 2026) | -| `D-77` | `decisions.md`:1063 | D-77. The ten bigger UX changes approved for build (22 October 2026) | -| `D-78` | `decisions.md`:1083 | D-78. One decline list for wards and coordinators (22 October 2026) | -| `D-79` | `decisions.md`:1094 | D-79. Wards see the full referral, with name and UMRN, before they answer (23 October 2026) | -| `D-80` | `decisions.md`:1105 | D-80. Role access plan version 2: all 17 recommendations (23 October 2026) | -| `D-81` | `decisions.md`:1120 | D-81. Pulled, with a pull time limit, for a bed kept for an incoming patient (24 October 2026) | -| `D-82` | `decisions.md`:1127 | D-82. A PR may raise a phone size limit by up to 5 KB per screen without asking (26 October 2026) | -| `D-83` | `decisions.md`:1135 | D-83. Patient names stay in full on every screen, copy and TV; privacy work must not make the app less useful (26 October 2026) | -| `D-84` | `decisions.md`:1146 | D-84. The live app stays on Railway Singapore for now, and there is no server-side TV account yet (26 October 2026) | -| `D-85` | `decisions.md`:1154 | D-85. "Held" only for a bed kept for its own patient; "pulled" for an incoming bed; "held up" for a delay (26 October 2026) | -| `D-86` | `decisions.md`:1161 | D-86. No second approver for role grants, at pilot or otherwise (27 October 2026) | -| `D-87` | `decisions.md`:1168 | D-87. D-36 and D-37 are replaced by the real-data gate (27 October 2026) | -| `D-88` | `decisions.md`:1180 | D-88. The public demo opens with a demo code once the front door is on (27 October 2026) | -| `D-89` | `decisions.md`:1187 | D-89. Redesign mock-up copies of large screens may pass the 1,500-line cap (30 October 2026) | -| `D-90` | `decisions.md`:1195 | D-90. Help gets How do I…, Show me runs everywhere, and Help is built without a separate mock-up step (30 October 2026) | -| `D-91` | `decisions.md`:1206 | D-91. One design home for the redesign, and Josh's answers on Help, Settings, search and notifications (31 October 2026) | -| `D-92` | `decisions.md`:1241 | D-92. Help goes live before its mock-up review, one search box on Capacity, and referral rows on Home open the panel (31 October 2026) | -| `D-93` | `decisions.md`:1251 | D-93. Legal form times show only as typed, never as a countdown (31 October 2026) | -| `D-94` | `decisions.md`:1259 | D-94. Design rulings of 31 October 2026 | -| `D-95` | `decisions.md`:1272 | D-95. One page scroll, and a click outside closes a drawer (3 November 2026) | -| `D-96` | `decisions.md`:1282 | D-96. A named bed is pulled, and its patient is not also waiting (8 November 2026) | -| `D-97` | `decisions.md`:1292 | D-97. Owner answers on seven open items: N21, N25, N26, N29, N40, N41 and WF-B008 (8 November 2026) | -| `D-98` | `decisions.md`:1305 | D-98. Friction pass: Quick bar, Patient peek and Ward peek (8 November 2026) | -| `D-99` | `decisions.md`:1314 | D-99. "Real details" in the referral drawer's sample patients (25 September 2026) | -| `D-100` | `decisions.md`:1320 | D-100. "Under a form" means one rule everywhere (9 November 2026) | -| `D-101` | `decisions.md`:1327 | D-101. Clinically ready for discharge, with one delay reason (9 November 2026) | -| `D-102` | `decisions.md`:1336 | D-102. Report-a-problem screenshots are blurred, and patient-table exports carry no names (9 November 2026) | -| `D-103` | `decisions.md`:1345 | D-103. Any coordinator on shift may mark a bed override reviewed (9 November 2026) | -| `D-104` | `decisions.md`:1352 | D-104. Care plans and safety flags: five defaults (9 November 2026) | -| `D-105` | `decisions.md`:1364 | D-105. Optional clerk details on the patient record (8 November 2026) | -| `D-106` | `decisions.md`:1371 | D-106. Clinical values from the 9 November 2026 documentation audit (9 November 2026) | -| `D-107` | `decisions.md`:1383 | D-107. Working rules and documentation from the 9 November 2026 audit (9 November 2026) | -| `D-108` | `decisions.md`:1397 | D-108. Six bed-flow features: keep D-93 and D-72, ED long-wait next steps (9 November 2026) | -| `D-109` | `decisions.md`:1406 | D-109. Home's bed alert line tests the whole number shown (9 November 2026) | -| `D-110` | `decisions.md`:1413 | D-110. ED and referral flow: neutral fit line, clearance timing and alternatives to admission (9 November 2026) | -| `D-111` | `decisions.md`:1423 | D-111. Review and audit plan: first guards and four open answers (9 November 2026) | -| `D-112` | `decisions.md`:1437 | D-112. Phone bottom bar: the floating bar (9 November 2026) | -| `D-113` | `decisions.md`:1446 | D-113. Second patient identifier on accept and Mark done; no initials search (9 November 2026) | -| `D-114` | `decisions.md`:1456 | D-114. Allow pull_request_target for three workflows only (9 November 2026) | -| `D-115` | `decisions.md`:1464 | D-115. One count on every screen, and a missing patient shown everywhere (9 November 2026) | -| `D-116` | `decisions.md`:1478 | D-116. Page tops: the PR #1581 recommendations stand (9 November 2026) | -| `D-117` | `decisions.md`:1495 | D-117. Care plans follow-up: frequent presenter count, tribunal date and ward flags (10 November 2026) | -| `D-118` | `decisions.md`:1504 | D-118. Page tops: Referrals and Ward phone limits up to 8 KB above main (10 November 2026) | -| `D-119` | `decisions.md`:1510 | D-119. Page tops: phone limits raised to measured sizes, trim after merge (10 November 2026) | -| `D-120` | `decisions.md`:1517 | D-120. Discharge and capacity values: pull limit, transport delay and discharge date slip (9 November 2026) | -| `D-121` | `decisions.md`:1526 | D-121. Working rules, guards and your PC from the 10 November 2026 audit (10 November 2026) | -| `D-122` | `decisions.md`:1540 | D-122. Clinical and privacy answers from the 10 November 2026 audit (10 November 2026) | -| `D-123` | `decisions.md`:1553 | D-123. Master audit list answers: two clinical fixes and five working rules (10 November 2026) | -| `D-124` | `decisions.md`:1567 | D-124. Offline saves whose record changed are refused and shown (10 November 2026) | -| `D-125` | `decisions.md`:1574 | D-125. Top 10 audit follow-ups approved (10 November 2026) | -| `D-126` | `decisions.md`:1586 | D-126. Ranked lists: neutral orders approved (10 November 2026) | -| `D-127` | `decisions.md`:1605 | D-127. Neutral wording for a community treatment order at arrival (10 November 2026) | -| `D-128` | `decisions.md`:1612 | D-128. Final master audit: nine answers (10 November 2026) | -| `D-129` | `decisions.md`:1627 | D-129. Master audit findings: every recommendation approved (10 November 2026) | -| `D-130` | `decisions.md`:1677 | D-130. Audit follow-ups: every remaining recommendation approved (10 November 2026) | -| `D-131` | `decisions.md`:1693 | D-131. Hard-case demo data allowed, and the movement diagram follows the engine (10 November 2026) | -| `D-132` | `decisions.md`:1702 | D-132. Audit fixes group 1: docs and CI guards (10 November 2026) | -| `D-133` | `decisions.md`:1712 | D-133. Batch 1 (ED and referral flow): three answers (10 November 2026) | -| `D-134` | `decisions.md`:1722 | D-134. Ward arrival and beds batch: how to hold, advocate line, night list and the feature freeze (10 November 2026) | -| `D-135` | `decisions.md`:1745 | D-135. Batch 4, outages and pilot control: pack age and plan answers (10 November 2026) | -| `D-136` | `decisions.md`:1754 | D-136. Feature batch 3 (shift change and follow-up): two signed values (10 November 2026) | -| `D-137` | `decisions.md`:1766 | D-137. Feature build batch 5: count leak first, TV change mark and QR library (10 November 2026) | -| `D-138` | `decisions.md`:1782 | D-138. Phone alert urgency by kind (10 November 2026) | -| `D-139` | `decisions.md`:1788 | D-139. Phone Statistics ward list A to Z, and leave return times as typed (10 November 2026) | -| `D-140` | `decisions.md`:1798 | D-140. Feature list adopted, and Wave 1 begins (10 November 2026) | -| `D-141` | `decisions.md`:1811 | D-141. Batch 1 (ED and referral flow) design approved, with eleven answers (11 November 2026) | -| `D-142` | `decisions.md`:1829 | D-142. Batch 4: design review and all twelve answers approved, D-80 amended for site features (11 November 2026) | -| `D-143` | `decisions.md`:1841 | D-143. MHERT is MHERL in the glossary; SMHMR deferred (11 November 2026) | -| `D-144` | `decisions.md`:1849 | D-144. Chip rows move only sideways on a phone (11 November 2026) | -| `D-146` | `decisions.md`:1855 | D-146. Performance audit fixes and the phone speed target (11 November 2026) | -| `D-147` | `decisions.md`:1861 | D-147. Demo-code tries keep per-address keying until a trusted proxy is set (11 November 2026) | -| `D-152` | `decisions.md`:1867 | D-152. Returned to ED prompt sees every return in shared mode (11 November 2026) | -| `D-153` | `decisions.md`:1875 | D-153. Keep the drawn-time settle check, and defer a separate agent GitHub identity (11 November 2026) | +| ↳ | `decisions.md`:779 | D-46. Every page has a focal part, a part of its own, a page-specific hero and command-bar action rules (9 October 2026) | +| `D-47` | `decisions.md`:785 | D-47. Glass stays about 80% opaque with the top sheen kept (10 October 2026) | +| `D-48` | `decisions.md`:791 | D-48. Figures stay in Geist Mono with tabular digits while chart axes use Geist Sans (10 October 2026) | +| `D-49` | `decisions.md`:797 | D-49. Ward Flow 44px default row target (dense 36px, touch 52px) vs retired 48px PsychSift tap knob (10 October 2026) | +| `D-50` | `decisions.md`:803 | D-50. Neutral T1 urgency pill vs Form 1A amber statutory warning badge (10 October 2026) | +| `D-51` | `decisions.md`:809 | D-51. Delays filters hide rows with a stated hidden count while other queues highlight by default (10 October 2026) | +| `D-52` | `decisions.md`:816 | D-52. 10 October page review rulings: time-axis overdue zone, 15px/20px strip figures, 8px people pips and incremental shared parts (10 October 2026) | +| `D-53` | `decisions.md`:822 | D-53. Elevate design language and Glare mode adopted for Design System v9 (10 October 2026) | +| `D-54` | `decisions.md`:829 | D-54. Tier time thresholds remain synthetic demo values requiring clinical sign-off (10 October 2026) | +| `D-55` | `decisions.md`:837 | D-55. Supabase is Ward Flow's database and sign-in provider, and Azure is retired (15 October 2026) | +| `D-56` | `decisions.md`:843 | D-56. Josh signs the clinical values that have a recorded source, for the prototype (15 October 2026) | +| `D-57` | `decisions.md`:849 | D-57. Twenty Top 25 items move from the showcase into the real screens, each behind its own flag (15 October 2026) | +| `D-58` | `decisions.md`:876 | D-58. Josh signs three more clinical values that have a national source, for the prototype (15 October 2026) | +| `D-59` | `decisions.md`:882 | D-59. Each role sees only what it needs, from one access table (15 October 2026) | +| `D-60` | `decisions.md`:888 | D-60. Criteria led discharge, for voluntary patients only (15 October 2026) | +| `D-61` | `decisions.md`:897 | D-61. Tasks and Alerts are one queue called Alerts (16 October 2026) | +| `D-62` | `decisions.md`:903 | D-62. The one Alerts queue is signed off and its flag removed (16 October 2026) | +| `D-63` | `decisions.md`:909 | D-63. Josh signs the remaining clinical values and the criteria list, for the prototype (16 October 2026) | +| `D-64` | `decisions.md`:917 | D-64. Criteria led discharge shows on the boards and warns at departure (16 October 2026) | +| `D-65` | `decisions.md`:924 | D-65. Criteria led discharge on in production, typed patient specific criteria, and the AWOL bed hold review paused (17 October 2026) | +| `D-66` | `decisions.md`:940 | D-66. Granted roles work without a second approval (17 October 2026) | +| `D-67` | `decisions.md`:948 | D-67. Recover synthetic form drafts within the browser session (17 October 2026) | +| `D-68` | `decisions.md`:955 | D-68. Bed meeting TV content and access (19 October 2026) | +| `D-69` | `decisions.md`:963 | D-69. A referral with no legal status: "Needs an involuntary-capable bed until status is set." (20 October 2026) | +| `D-70` | `decisions.md`:970 | D-70. No computed Mental Health Act periods: show only the recorded due time (20 October 2026) | +| `D-71` | `decisions.md`:976 | D-71. Audit 1 clinical safety fixes: no suggested wards, wait-order queues, recorded facts only (20 October 2026) | +| `D-72` | `decisions.md`:989 | D-72. Seven product decisions for the 21 October fix plan (21 October 2026) | +| `D-73` | `decisions.md`:1005 | D-73. Batch merge safeguards (21 October 2026) | +| `D-74` | `decisions.md`:1021 | D-74. Owner answers to the 21 October open questions (21 October 2026) | +| `D-75` | `decisions.md`:1042 | D-75. UX audit follow-up, page caching, community gaps and the extra-travel bed hold (21 October 2026) | +| `D-76` | `decisions.md`:1055 | D-76. Community referral gaps: the full move journey and asking more wards (21 October 2026) | +| `D-77` | `decisions.md`:1064 | D-77. The ten bigger UX changes approved for build (22 October 2026) | +| `D-78` | `decisions.md`:1084 | D-78. One decline list for wards and coordinators (22 October 2026) | +| `D-79` | `decisions.md`:1095 | D-79. Wards see the full referral, with name and UMRN, before they answer (23 October 2026) | +| `D-80` | `decisions.md`:1106 | D-80. Role access plan version 2: all 17 recommendations (23 October 2026) | +| `D-81` | `decisions.md`:1121 | D-81. Pulled, with a pull time limit, for a bed kept for an incoming patient (24 October 2026) | +| `D-82` | `decisions.md`:1128 | D-82. A PR may raise a phone size limit by up to 5 KB per screen without asking (26 October 2026) | +| `D-83` | `decisions.md`:1136 | D-83. Patient names stay in full on every screen, copy and TV; privacy work must not make the app less useful (26 October 2026) | +| `D-84` | `decisions.md`:1147 | D-84. The live app stays on Railway Singapore for now, and there is no server-side TV account yet (26 October 2026) | +| `D-85` | `decisions.md`:1155 | D-85. "Held" only for a bed kept for its own patient; "pulled" for an incoming bed; "held up" for a delay (26 October 2026) | +| `D-86` | `decisions.md`:1162 | D-86. No second approver for role grants, at pilot or otherwise (27 October 2026) | +| `D-87` | `decisions.md`:1169 | D-87. D-36 and D-37 are replaced by the real-data gate (27 October 2026) | +| `D-88` | `decisions.md`:1181 | D-88. The public demo opens with a demo code once the front door is on (27 October 2026) | +| `D-89` | `decisions.md`:1188 | D-89. Redesign mock-up copies of large screens may pass the 1,500-line cap (30 October 2026) | +| `D-90` | `decisions.md`:1196 | D-90. Help gets How do I…, Show me runs everywhere, and Help is built without a separate mock-up step (30 October 2026) | +| `D-91` | `decisions.md`:1207 | D-91. One design home for the redesign, and Josh's answers on Help, Settings, search and notifications (31 October 2026) | +| `D-92` | `decisions.md`:1242 | D-92. Help goes live before its mock-up review, one search box on Capacity, and referral rows on Home open the panel (31 October 2026) | +| `D-93` | `decisions.md`:1252 | D-93. Legal form times show only as typed, never as a countdown (31 October 2026) | +| `D-94` | `decisions.md`:1260 | D-94. Design rulings of 31 October 2026 | +| `D-95` | `decisions.md`:1273 | D-95. One page scroll, and a click outside closes a drawer (3 November 2026) | +| `D-96` | `decisions.md`:1283 | D-96. A named bed is pulled, and its patient is not also waiting (8 November 2026) | +| `D-97` | `decisions.md`:1293 | D-97. Owner answers on seven open items: N21, N25, N26, N29, N40, N41 and WF-B008 (8 November 2026) | +| `D-98` | `decisions.md`:1306 | D-98. Friction pass: Quick bar, Patient peek and Ward peek (8 November 2026) | +| `D-99` | `decisions.md`:1315 | D-99. "Real details" in the referral drawer's sample patients (25 September 2026) | +| `D-100` | `decisions.md`:1321 | D-100. "Under a form" means one rule everywhere (9 November 2026) | +| `D-101` | `decisions.md`:1328 | D-101. Clinically ready for discharge, with one delay reason (9 November 2026) | +| `D-102` | `decisions.md`:1337 | D-102. Report-a-problem screenshots are blurred, and patient-table exports carry no names (9 November 2026) | +| `D-103` | `decisions.md`:1346 | D-103. Any coordinator on shift may mark a bed override reviewed (9 November 2026) | +| `D-104` | `decisions.md`:1353 | D-104. Care plans and safety flags: five defaults (9 November 2026) | +| `D-105` | `decisions.md`:1365 | D-105. Optional clerk details on the patient record (8 November 2026) | +| `D-106` | `decisions.md`:1372 | D-106. Clinical values from the 9 November 2026 documentation audit (9 November 2026) | +| `D-107` | `decisions.md`:1384 | D-107. Working rules and documentation from the 9 November 2026 audit (9 November 2026) | +| `D-108` | `decisions.md`:1398 | D-108. Six bed-flow features: keep D-93 and D-72, ED long-wait next steps (9 November 2026) | +| `D-109` | `decisions.md`:1407 | D-109. Home's bed alert line tests the whole number shown (9 November 2026) | +| `D-110` | `decisions.md`:1414 | D-110. ED and referral flow: neutral fit line, clearance timing and alternatives to admission (9 November 2026) | +| `D-111` | `decisions.md`:1424 | D-111. Review and audit plan: first guards and four open answers (9 November 2026) | +| `D-112` | `decisions.md`:1438 | D-112. Phone bottom bar: the floating bar (9 November 2026) | +| `D-113` | `decisions.md`:1447 | D-113. Second patient identifier on accept and Mark done; no initials search (9 November 2026) | +| `D-114` | `decisions.md`:1457 | D-114. Allow pull_request_target for three workflows only (9 November 2026) | +| `D-115` | `decisions.md`:1465 | D-115. One count on every screen, and a missing patient shown everywhere (9 November 2026) | +| `D-116` | `decisions.md`:1479 | D-116. Page tops: the PR #1581 recommendations stand (9 November 2026) | +| `D-117` | `decisions.md`:1496 | D-117. Care plans follow-up: frequent presenter count, tribunal date and ward flags (10 November 2026) | +| `D-118` | `decisions.md`:1505 | D-118. Page tops: Referrals and Ward phone limits up to 8 KB above main (10 November 2026) | +| `D-119` | `decisions.md`:1511 | D-119. Page tops: phone limits raised to measured sizes, trim after merge (10 November 2026) | +| `D-120` | `decisions.md`:1518 | D-120. Discharge and capacity values: pull limit, transport delay and discharge date slip (9 November 2026) | +| `D-121` | `decisions.md`:1527 | D-121. Working rules, guards and your PC from the 10 November 2026 audit (10 November 2026) | +| `D-122` | `decisions.md`:1541 | D-122. Clinical and privacy answers from the 10 November 2026 audit (10 November 2026) | +| `D-123` | `decisions.md`:1554 | D-123. Master audit list answers: two clinical fixes and five working rules (10 November 2026) | +| `D-124` | `decisions.md`:1568 | D-124. Offline saves whose record changed are refused and shown (10 November 2026) | +| `D-125` | `decisions.md`:1575 | D-125. Top 10 audit follow-ups approved (10 November 2026) | +| `D-126` | `decisions.md`:1587 | D-126. Ranked lists: neutral orders approved (10 November 2026) | +| `D-127` | `decisions.md`:1606 | D-127. Neutral wording for a community treatment order at arrival (10 November 2026) | +| `D-128` | `decisions.md`:1613 | D-128. Final master audit: nine answers (10 November 2026) | +| `D-129` | `decisions.md`:1628 | D-129. Master audit findings: every recommendation approved (10 November 2026) | +| `D-130` | `decisions.md`:1678 | D-130. Audit follow-ups: every remaining recommendation approved (10 November 2026) | +| `D-131` | `decisions.md`:1694 | D-131. Hard-case demo data allowed, and the movement diagram follows the engine (10 November 2026) | +| `D-132` | `decisions.md`:1703 | D-132. Audit fixes group 1: docs and CI guards (10 November 2026) | +| `D-133` | `decisions.md`:1713 | D-133. Batch 1 (ED and referral flow): three answers (10 November 2026) | +| `D-134` | `decisions.md`:1723 | D-134. Ward arrival and beds batch: how to hold, advocate line, night list and the feature freeze (10 November 2026) | +| `D-135` | `decisions.md`:1746 | D-135. Batch 4, outages and pilot control: pack age and plan answers (10 November 2026) | +| `D-136` | `decisions.md`:1755 | D-136. Feature batch 3 (shift change and follow-up): two signed values (10 November 2026) | +| `D-137` | `decisions.md`:1767 | D-137. Feature build batch 5: count leak first, TV change mark and QR library (10 November 2026) | +| `D-138` | `decisions.md`:1783 | D-138. Phone alert urgency by kind (10 November 2026) | +| `D-139` | `decisions.md`:1789 | D-139. Phone Statistics ward list A to Z, and leave return times as typed (10 November 2026) | +| `D-140` | `decisions.md`:1799 | D-140. Feature list adopted, and Wave 1 begins (10 November 2026) | +| `D-141` | `decisions.md`:1812 | D-141. Batch 1 (ED and referral flow) design approved, with eleven answers (11 November 2026) | +| `D-142` | `decisions.md`:1830 | D-142. Batch 4: design review and all twelve answers approved, D-80 amended for site features (11 November 2026) | +| `D-143` | `decisions.md`:1842 | D-143. MHERT is MHERL in the glossary; SMHMR deferred (11 November 2026) | +| `D-144` | `decisions.md`:1850 | D-144. Chip rows move only sideways on a phone (11 November 2026) | +| `D-146` | `decisions.md`:1856 | D-146. Performance audit fixes and the phone speed target (11 November 2026) | +| `D-147` | `decisions.md`:1862 | D-147. Demo-code tries keep per-address keying until a trusted proxy is set (11 November 2026) | +| `D-152` | `decisions.md`:1868 | D-152. Returned to ED prompt sees every return in shared mode (11 November 2026) | +| `D-153` | `decisions.md`:1876 | D-153. Keep the drawn-time settle check, and defer a separate agent GitHub identity (11 November 2026) | +| `D-154` | `decisions.md`:1884 | D-154. The community desk's ED heads-up reads a narrow scoped list (11 November 2026) | | `D9-1` | `../history/archive/dated-notes/ward-flow-phase-9-decisions.md`:62 | D9-1 — The wait becomes prominent, and its ceiling is removed; it never outranks urgency (SESSION) | | `D9-2` | `../history/archive/dated-notes/ward-flow-phase-9-decisions.md`:102 | D9-2 — Declaring escalation records it and marks the screens, and changes nothing else (SESSION, and partly blocked) | | `D9-3` | `../history/archive/dated-notes/ward-flow-phase-9-decisions.md`:126 | D9-3 — The retrospective is one person's journey replayed, plus the ward prediction track record last (SESSION) | @@ -627,156 +628,157 @@ safe global key across 30 files. **Title:** Ward Flow — decision log -148 item(s): - -- `D-1` — line 177, heading: "D-1. Ward Flow is local only, with no linked repository (Replaced by D-27)" -- `D-2` — line 187, heading: "D-2. Railway is disconnected" -- `D-3` — line 198, heading: "D-3. The PsychSift and Database code is being retired from Ward Flow" -- `D-4` — line 206, heading: "D-4. Synthetic patients only" -- `D-5` — line 214, heading: "D-5. Parallel threads in separate worktrees, folded one at a time" -- `D-6` — line 225, heading: "D-6. Aboriginal cultural safety review deferred" -- `D-7` — line 233, heading: "D-7. The first four milestones, in this order" -- `D-8` — line 245, heading: "D-8. Josh's standing rulings, numbered R1 to R16, for every session and tool" -- `D-9` — line 277, heading: "D-9. Josh's rulings of 25 September, 11:43 to 12:00 (R17 to R21)" -- `D-10` — line 291, heading: "D-10. Gate build type check (R22)" -- `D-11` — line 300, heading: "D-11. Rulings of 25 September, 12:41 (R23 to R25)" -- `D-12` — line 316, heading: "D-12. Rulings of 25 September, 12:43 (R26 to R31)" -- `D-13` — line 335, heading: "D-13. Tooling tests in batch gates (R32)" -- `D-14` — line 345, heading: "D-14. Standing defaults: decide small things without asking" -- `D-15` — line 357, heading: "D-15. Rulings of 25 September, 13:26 (R33 to R35)" -- `D-16` — line 370, heading: "D-16. Legal overrides and form receipts, 25 September 13:51 UTC" -- `D-17` — line 383, heading: "D-17. Morning roll-up time is Josh's own default (25 September)" -- `D-18` — line 394, heading: "D-18. The privacy lock stops saving only for typed text (25 September)" -- `D-19` — line 405, heading: "D-19. Rulings of 25 September, evening (walkthrough, leave beds, PsychSift, gender display)" -- `D-20` — line 435, heading: "D-20. One high-contrast colour check retired (26 September)" -- `D-21` — line 448, heading: "D-21. Coordinator bed board: all nine recommended answers (26 September)" -- `D-22` — line 460, heading: "D-22. No legal limits in hour rules; the rest are labelled defaults (26 September)" -- `D-23` — line 476, heading: "D-23. Leave-bed fields kept; patient search stops matching by ward (26 September)" -- `D-24` — line 490, heading: "D-24. Hour-rules morning list: all A (26 September)" -- `D-25` — line 514, heading: "D-25. The lone-patient check counts free beds on both matching paths (26 September)" -- `D-26` — line 522, heading: "D-26. Select fold checks by changed risk (27 September)" -- `D-27` — line 540, heading: "D-27. Ward Flow uses its dedicated repository (28 September)" -- `D-28` — line 553, heading: "D-28. Design Modernization & Anti-Box Architecture (30 September 2026)" -- `D-29` — line 567, heading: "D-29. Act time limits shown as a labelled synthetic demo (4 October 2026)" -- `D-30` — line 582, heading: "D-30. Central Coordinator Approval for Inter-Ward Bed Transfers (6 October 2026)" -- `D-31` — line 589, heading: "D-31. Gender-Diverse Bed Placement Policy & Clinical Override Safety (6 October 2026)" -- `D-32` — line 596, heading: "D-32. FIFO Waiting Time with Clinical Triage Badging vs Algorithmic Urgency Sorting (6 October 2026)" -- `D-33` — line 603, heading: "D-33. Separation of Local Ward Shift Notes from Statewide Coordinator Telemetry (6 October 2026)" -- `D-34` — line 610, heading: "D-34. Acute Medical Deterioration Bed Release and Escalation Protocol (6 October 2026)" -- `D-35` — line 617, heading: "D-35. Deferral of Regional Multi-Leg Transport & RFDS Repatriation (6 October 2026)" -- `D-36` — line 624, heading: "D-36. Affirmation of External Governance & Clinical Safety Hard Gates (6 October 2026) (Replaced by D-87)" -- `D-37` — line 639, heading: "D-37. External Governance Hard Gate Operational Postures & Resolution Roadmap (6 October 2026) (Replaced by D-87)" -- `D-38` — line 666, heading: "D-38. Leave, absent without leave and CTO on the Patient page (9 October 2026)" -- `D-39` — line 684, heading: "D-39. Patients are identified by UMRN, never by a WF number (9 October 2026)" -- `D-40` — line 728, heading: "D-40. A second community treatment order keeps the first (9 October 2026)" -- `D-41` — line 739, heading: "D-41. Delays board filters narrow the table and state the hidden count (9 October 2026)" -- `D-42` — line 752, heading: "D-42. 12px typography floor with no uppercase exception reaffirmed in Design System v9 (9–10 October 2026)" -- `D-43` — line 758, heading: "D-43. Colour lives in glyphs and the hero; red means act now with a thin 1px edge, never a fill (9 October 2026)" -- `D-44` — line 765, heading: "D-44. Compact sizing, white cards and smaller text retained over expression-test card tints (9 October 2026)" -- `D-45` — line 771, heading: "D-45. Phone is its own 390×844 design, never a desktop reflow (9 October 2026)" -- `D-46` — line 778, heading: "D-46. Every page has a focal part, a part of its own, a page-specific hero and command-bar action rules (9 October 2026)" -- `D-47` — line 784, heading: "D-47. Glass stays about 80% opaque with the top sheen kept (10 October 2026)" -- `D-48` — line 790, heading: "D-48. Figures stay in Geist Mono with tabular digits while chart axes use Geist Sans (10 October 2026)" -- `D-49` — line 796, heading: "D-49. Ward Flow 44px default row target (dense 36px, touch 52px) vs retired 48px PsychSift tap knob (10 October 2026)" -- `D-50` — line 802, heading: "D-50. Neutral T1 urgency pill vs Form 1A amber statutory warning badge (10 October 2026)" -- `D-51` — line 808, heading: "D-51. Delays filters hide rows with a stated hidden count while other queues highlight by default (10 October 2026)" -- `D-52` — line 815, heading: "D-52. 10 October page review rulings: time-axis overdue zone, 15px/20px strip figures, 8px people pips and incremental shared parts (10 October 2026)" -- `D-53` — line 821, heading: "D-53. Elevate design language and Glare mode adopted for Design System v9 (10 October 2026)" -- `D-54` — line 828, heading: "D-54. Tier time thresholds remain synthetic demo values requiring clinical sign-off (10 October 2026)" -- `D-55` — line 836, heading: "D-55. Supabase is Ward Flow's database and sign-in provider, and Azure is retired (15 October 2026)" -- `D-56` — line 842, heading: "D-56. Josh signs the clinical values that have a recorded source, for the prototype (15 October 2026)" -- `D-57` — line 848, heading: "D-57. Twenty Top 25 items move from the showcase into the real screens, each behind its own flag (15 October 2026)" -- `D-58` — line 875, heading: "D-58. Josh signs three more clinical values that have a national source, for the prototype (15 October 2026)" -- `D-59` — line 881, heading: "D-59. Each role sees only what it needs, from one access table (15 October 2026)" -- `D-60` — line 887, heading: "D-60. Criteria led discharge, for voluntary patients only (15 October 2026)" -- `D-61` — line 896, heading: "D-61. Tasks and Alerts are one queue called Alerts (16 October 2026)" -- `D-62` — line 902, heading: "D-62. The one Alerts queue is signed off and its flag removed (16 October 2026)" -- `D-63` — line 908, heading: "D-63. Josh signs the remaining clinical values and the criteria list, for the prototype (16 October 2026)" -- `D-64` — line 916, heading: "D-64. Criteria led discharge shows on the boards and warns at departure (16 October 2026)" -- `D-65` — line 923, heading: "D-65. Criteria led discharge on in production, typed patient specific criteria, and the AWOL bed hold review paused (17 October 2026)" -- `D-66` — line 939, heading: "D-66. Granted roles work without a second approval (17 October 2026)" -- `D-67` — line 947, heading: "D-67. Recover synthetic form drafts within the browser session (17 October 2026)" -- `D-68` — line 954, heading: "D-68. Bed meeting TV content and access (19 October 2026)" -- `D-69` — line 962, heading: "D-69. A referral with no legal status: "Needs an involuntary-capable bed until status is set." (20 October 2026)" -- `D-70` — line 969, heading: "D-70. No computed Mental Health Act periods: show only the recorded due time (20 October 2026)" -- `D-71` — line 975, heading: "D-71. Audit 1 clinical safety fixes: no suggested wards, wait-order queues, recorded facts only (20 October 2026)" -- `D-72` — line 988, heading: "D-72. Seven product decisions for the 21 October fix plan (21 October 2026)" -- `D-73` — line 1004, heading: "D-73. Batch merge safeguards (21 October 2026)" -- `D-74` — line 1020, heading: "D-74. Owner answers to the 21 October open questions (21 October 2026)" -- `D-75` — line 1041, heading: "D-75. UX audit follow-up, page caching, community gaps and the extra-travel bed hold (21 October 2026)" -- `D-76` — line 1054, heading: "D-76. Community referral gaps: the full move journey and asking more wards (21 October 2026)" -- `D-77` — line 1063, heading: "D-77. The ten bigger UX changes approved for build (22 October 2026)" -- `D-78` — line 1083, heading: "D-78. One decline list for wards and coordinators (22 October 2026)" -- `D-79` — line 1094, heading: "D-79. Wards see the full referral, with name and UMRN, before they answer (23 October 2026)" -- `D-80` — line 1105, heading: "D-80. Role access plan version 2: all 17 recommendations (23 October 2026)" -- `D-81` — line 1120, heading: "D-81. Pulled, with a pull time limit, for a bed kept for an incoming patient (24 October 2026)" -- `D-82` — line 1127, heading: "D-82. A PR may raise a phone size limit by up to 5 KB per screen without asking (26 October 2026)" -- `D-83` — line 1135, heading: "D-83. Patient names stay in full on every screen, copy and TV; privacy work must not make the app less useful (26 October 2026)" -- `D-84` — line 1146, heading: "D-84. The live app stays on Railway Singapore for now, and there is no server-side TV account yet (26 October 2026)" -- `D-85` — line 1154, heading: "D-85. "Held" only for a bed kept for its own patient; "pulled" for an incoming bed; "held up" for a delay (26 October 2026)" -- `D-86` — line 1161, heading: "D-86. No second approver for role grants, at pilot or otherwise (27 October 2026)" -- `D-87` — line 1168, heading: "D-87. D-36 and D-37 are replaced by the real-data gate (27 October 2026)" -- `D-88` — line 1180, heading: "D-88. The public demo opens with a demo code once the front door is on (27 October 2026)" -- `D-89` — line 1187, heading: "D-89. Redesign mock-up copies of large screens may pass the 1,500-line cap (30 October 2026)" -- `D-90` — line 1195, heading: "D-90. Help gets How do I…, Show me runs everywhere, and Help is built without a separate mock-up step (30 October 2026)" -- `D-91` — line 1206, heading: "D-91. One design home for the redesign, and Josh's answers on Help, Settings, search and notifications (31 October 2026)" -- `D-92` — line 1241, heading: "D-92. Help goes live before its mock-up review, one search box on Capacity, and referral rows on Home open the panel (31 October 2026)" -- `D-93` — line 1251, heading: "D-93. Legal form times show only as typed, never as a countdown (31 October 2026)" -- `D-94` — line 1259, heading: "D-94. Design rulings of 31 October 2026" -- `D-95` — line 1272, heading: "D-95. One page scroll, and a click outside closes a drawer (3 November 2026)" -- `D-96` — line 1282, heading: "D-96. A named bed is pulled, and its patient is not also waiting (8 November 2026)" -- `D-97` — line 1292, heading: "D-97. Owner answers on seven open items: N21, N25, N26, N29, N40, N41 and WF-B008 (8 November 2026)" -- `D-98` — line 1305, heading: "D-98. Friction pass: Quick bar, Patient peek and Ward peek (8 November 2026)" -- `D-99` — line 1314, heading: "D-99. "Real details" in the referral drawer's sample patients (25 September 2026)" -- `D-100` — line 1320, heading: "D-100. "Under a form" means one rule everywhere (9 November 2026)" -- `D-101` — line 1327, heading: "D-101. Clinically ready for discharge, with one delay reason (9 November 2026)" -- `D-102` — line 1336, heading: "D-102. Report-a-problem screenshots are blurred, and patient-table exports carry no names (9 November 2026)" -- `D-103` — line 1345, heading: "D-103. Any coordinator on shift may mark a bed override reviewed (9 November 2026)" -- `D-104` — line 1352, heading: "D-104. Care plans and safety flags: five defaults (9 November 2026)" -- `D-105` — line 1364, heading: "D-105. Optional clerk details on the patient record (8 November 2026)" -- `D-106` — line 1371, heading: "D-106. Clinical values from the 9 November 2026 documentation audit (9 November 2026)" -- `D-107` — line 1383, heading: "D-107. Working rules and documentation from the 9 November 2026 audit (9 November 2026)" -- `D-108` — line 1397, heading: "D-108. Six bed-flow features: keep D-93 and D-72, ED long-wait next steps (9 November 2026)" -- `D-109` — line 1406, heading: "D-109. Home's bed alert line tests the whole number shown (9 November 2026)" -- `D-110` — line 1413, heading: "D-110. ED and referral flow: neutral fit line, clearance timing and alternatives to admission (9 November 2026)" -- `D-111` — line 1423, heading: "D-111. Review and audit plan: first guards and four open answers (9 November 2026)" -- `D-112` — line 1437, heading: "D-112. Phone bottom bar: the floating bar (9 November 2026)" -- `D-113` — line 1446, heading: "D-113. Second patient identifier on accept and Mark done; no initials search (9 November 2026)" -- `D-114` — line 1456, heading: "D-114. Allow pull_request_target for three workflows only (9 November 2026)" -- `D-115` — line 1464, heading: "D-115. One count on every screen, and a missing patient shown everywhere (9 November 2026)" -- `D-116` — line 1478, heading: "D-116. Page tops: the PR #1581 recommendations stand (9 November 2026)" -- `D-117` — line 1495, heading: "D-117. Care plans follow-up: frequent presenter count, tribunal date and ward flags (10 November 2026)" -- `D-118` — line 1504, heading: "D-118. Page tops: Referrals and Ward phone limits up to 8 KB above main (10 November 2026)" -- `D-119` — line 1510, heading: "D-119. Page tops: phone limits raised to measured sizes, trim after merge (10 November 2026)" -- `D-120` — line 1517, heading: "D-120. Discharge and capacity values: pull limit, transport delay and discharge date slip (9 November 2026)" -- `D-121` — line 1526, heading: "D-121. Working rules, guards and your PC from the 10 November 2026 audit (10 November 2026)" -- `D-122` — line 1540, heading: "D-122. Clinical and privacy answers from the 10 November 2026 audit (10 November 2026)" -- `D-123` — line 1553, heading: "D-123. Master audit list answers: two clinical fixes and five working rules (10 November 2026)" -- `D-124` — line 1567, heading: "D-124. Offline saves whose record changed are refused and shown (10 November 2026)" -- `D-125` — line 1574, heading: "D-125. Top 10 audit follow-ups approved (10 November 2026)" -- `D-126` — line 1586, heading: "D-126. Ranked lists: neutral orders approved (10 November 2026)" -- `D-127` — line 1605, heading: "D-127. Neutral wording for a community treatment order at arrival (10 November 2026)" -- `D-128` — line 1612, heading: "D-128. Final master audit: nine answers (10 November 2026)" -- `D-129` — line 1627, heading: "D-129. Master audit findings: every recommendation approved (10 November 2026)" -- `D-130` — line 1677, heading: "D-130. Audit follow-ups: every remaining recommendation approved (10 November 2026)" -- `D-131` — line 1693, heading: "D-131. Hard-case demo data allowed, and the movement diagram follows the engine (10 November 2026)" -- `D-132` — line 1702, heading: "D-132. Audit fixes group 1: docs and CI guards (10 November 2026)" -- `D-133` — line 1712, heading: "D-133. Batch 1 (ED and referral flow): three answers (10 November 2026)" -- `D-134` — line 1722, heading: "D-134. Ward arrival and beds batch: how to hold, advocate line, night list and the feature freeze (10 November 2026)" -- `D-135` — line 1745, heading: "D-135. Batch 4, outages and pilot control: pack age and plan answers (10 November 2026)" -- `D-136` — line 1754, heading: "D-136. Feature batch 3 (shift change and follow-up): two signed values (10 November 2026)" -- `D-137` — line 1766, heading: "D-137. Feature build batch 5: count leak first, TV change mark and QR library (10 November 2026)" -- `D-138` — line 1782, heading: "D-138. Phone alert urgency by kind (10 November 2026)" -- `D-139` — line 1788, heading: "D-139. Phone Statistics ward list A to Z, and leave return times as typed (10 November 2026)" -- `D-140` — line 1798, heading: "D-140. Feature list adopted, and Wave 1 begins (10 November 2026)" -- `D-141` — line 1811, heading: "D-141. Batch 1 (ED and referral flow) design approved, with eleven answers (11 November 2026)" -- `D-142` — line 1829, heading: "D-142. Batch 4: design review and all twelve answers approved, D-80 amended for site features (11 November 2026)" -- `D-143` — line 1841, heading: "D-143. MHERT is MHERL in the glossary; SMHMR deferred (11 November 2026)" -- `D-144` — line 1849, heading: "D-144. Chip rows move only sideways on a phone (11 November 2026)" -- `D-146` — line 1855, heading: "D-146. Performance audit fixes and the phone speed target (11 November 2026)" -- `D-147` — line 1861, heading: "D-147. Demo-code tries keep per-address keying until a trusted proxy is set (11 November 2026)" -- `D-152` — line 1867, heading: "D-152. Returned to ED prompt sees every return in shared mode (11 November 2026)" -- `D-153` — line 1875, heading: "D-153. Keep the drawn-time settle check, and defer a separate agent GitHub identity (11 November 2026)" +149 item(s): + +- `D-1` — line 178, heading: "D-1. Ward Flow is local only, with no linked repository (Replaced by D-27)" +- `D-2` — line 188, heading: "D-2. Railway is disconnected" +- `D-3` — line 199, heading: "D-3. The PsychSift and Database code is being retired from Ward Flow" +- `D-4` — line 207, heading: "D-4. Synthetic patients only" +- `D-5` — line 215, heading: "D-5. Parallel threads in separate worktrees, folded one at a time" +- `D-6` — line 226, heading: "D-6. Aboriginal cultural safety review deferred" +- `D-7` — line 234, heading: "D-7. The first four milestones, in this order" +- `D-8` — line 246, heading: "D-8. Josh's standing rulings, numbered R1 to R16, for every session and tool" +- `D-9` — line 278, heading: "D-9. Josh's rulings of 25 September, 11:43 to 12:00 (R17 to R21)" +- `D-10` — line 292, heading: "D-10. Gate build type check (R22)" +- `D-11` — line 301, heading: "D-11. Rulings of 25 September, 12:41 (R23 to R25)" +- `D-12` — line 317, heading: "D-12. Rulings of 25 September, 12:43 (R26 to R31)" +- `D-13` — line 336, heading: "D-13. Tooling tests in batch gates (R32)" +- `D-14` — line 346, heading: "D-14. Standing defaults: decide small things without asking" +- `D-15` — line 358, heading: "D-15. Rulings of 25 September, 13:26 (R33 to R35)" +- `D-16` — line 371, heading: "D-16. Legal overrides and form receipts, 25 September 13:51 UTC" +- `D-17` — line 384, heading: "D-17. Morning roll-up time is Josh's own default (25 September)" +- `D-18` — line 395, heading: "D-18. The privacy lock stops saving only for typed text (25 September)" +- `D-19` — line 406, heading: "D-19. Rulings of 25 September, evening (walkthrough, leave beds, PsychSift, gender display)" +- `D-20` — line 436, heading: "D-20. One high-contrast colour check retired (26 September)" +- `D-21` — line 449, heading: "D-21. Coordinator bed board: all nine recommended answers (26 September)" +- `D-22` — line 461, heading: "D-22. No legal limits in hour rules; the rest are labelled defaults (26 September)" +- `D-23` — line 477, heading: "D-23. Leave-bed fields kept; patient search stops matching by ward (26 September)" +- `D-24` — line 491, heading: "D-24. Hour-rules morning list: all A (26 September)" +- `D-25` — line 515, heading: "D-25. The lone-patient check counts free beds on both matching paths (26 September)" +- `D-26` — line 523, heading: "D-26. Select fold checks by changed risk (27 September)" +- `D-27` — line 541, heading: "D-27. Ward Flow uses its dedicated repository (28 September)" +- `D-28` — line 554, heading: "D-28. Design Modernization & Anti-Box Architecture (30 September 2026)" +- `D-29` — line 568, heading: "D-29. Act time limits shown as a labelled synthetic demo (4 October 2026)" +- `D-30` — line 583, heading: "D-30. Central Coordinator Approval for Inter-Ward Bed Transfers (6 October 2026)" +- `D-31` — line 590, heading: "D-31. Gender-Diverse Bed Placement Policy & Clinical Override Safety (6 October 2026)" +- `D-32` — line 597, heading: "D-32. FIFO Waiting Time with Clinical Triage Badging vs Algorithmic Urgency Sorting (6 October 2026)" +- `D-33` — line 604, heading: "D-33. Separation of Local Ward Shift Notes from Statewide Coordinator Telemetry (6 October 2026)" +- `D-34` — line 611, heading: "D-34. Acute Medical Deterioration Bed Release and Escalation Protocol (6 October 2026)" +- `D-35` — line 618, heading: "D-35. Deferral of Regional Multi-Leg Transport & RFDS Repatriation (6 October 2026)" +- `D-36` — line 625, heading: "D-36. Affirmation of External Governance & Clinical Safety Hard Gates (6 October 2026) (Replaced by D-87)" +- `D-37` — line 640, heading: "D-37. External Governance Hard Gate Operational Postures & Resolution Roadmap (6 October 2026) (Replaced by D-87)" +- `D-38` — line 667, heading: "D-38. Leave, absent without leave and CTO on the Patient page (9 October 2026)" +- `D-39` — line 685, heading: "D-39. Patients are identified by UMRN, never by a WF number (9 October 2026)" +- `D-40` — line 729, heading: "D-40. A second community treatment order keeps the first (9 October 2026)" +- `D-41` — line 740, heading: "D-41. Delays board filters narrow the table and state the hidden count (9 October 2026)" +- `D-42` — line 753, heading: "D-42. 12px typography floor with no uppercase exception reaffirmed in Design System v9 (9–10 October 2026)" +- `D-43` — line 759, heading: "D-43. Colour lives in glyphs and the hero; red means act now with a thin 1px edge, never a fill (9 October 2026)" +- `D-44` — line 766, heading: "D-44. Compact sizing, white cards and smaller text retained over expression-test card tints (9 October 2026)" +- `D-45` — line 772, heading: "D-45. Phone is its own 390×844 design, never a desktop reflow (9 October 2026)" +- `D-46` — line 779, heading: "D-46. Every page has a focal part, a part of its own, a page-specific hero and command-bar action rules (9 October 2026)" +- `D-47` — line 785, heading: "D-47. Glass stays about 80% opaque with the top sheen kept (10 October 2026)" +- `D-48` — line 791, heading: "D-48. Figures stay in Geist Mono with tabular digits while chart axes use Geist Sans (10 October 2026)" +- `D-49` — line 797, heading: "D-49. Ward Flow 44px default row target (dense 36px, touch 52px) vs retired 48px PsychSift tap knob (10 October 2026)" +- `D-50` — line 803, heading: "D-50. Neutral T1 urgency pill vs Form 1A amber statutory warning badge (10 October 2026)" +- `D-51` — line 809, heading: "D-51. Delays filters hide rows with a stated hidden count while other queues highlight by default (10 October 2026)" +- `D-52` — line 816, heading: "D-52. 10 October page review rulings: time-axis overdue zone, 15px/20px strip figures, 8px people pips and incremental shared parts (10 October 2026)" +- `D-53` — line 822, heading: "D-53. Elevate design language and Glare mode adopted for Design System v9 (10 October 2026)" +- `D-54` — line 829, heading: "D-54. Tier time thresholds remain synthetic demo values requiring clinical sign-off (10 October 2026)" +- `D-55` — line 837, heading: "D-55. Supabase is Ward Flow's database and sign-in provider, and Azure is retired (15 October 2026)" +- `D-56` — line 843, heading: "D-56. Josh signs the clinical values that have a recorded source, for the prototype (15 October 2026)" +- `D-57` — line 849, heading: "D-57. Twenty Top 25 items move from the showcase into the real screens, each behind its own flag (15 October 2026)" +- `D-58` — line 876, heading: "D-58. Josh signs three more clinical values that have a national source, for the prototype (15 October 2026)" +- `D-59` — line 882, heading: "D-59. Each role sees only what it needs, from one access table (15 October 2026)" +- `D-60` — line 888, heading: "D-60. Criteria led discharge, for voluntary patients only (15 October 2026)" +- `D-61` — line 897, heading: "D-61. Tasks and Alerts are one queue called Alerts (16 October 2026)" +- `D-62` — line 903, heading: "D-62. The one Alerts queue is signed off and its flag removed (16 October 2026)" +- `D-63` — line 909, heading: "D-63. Josh signs the remaining clinical values and the criteria list, for the prototype (16 October 2026)" +- `D-64` — line 917, heading: "D-64. Criteria led discharge shows on the boards and warns at departure (16 October 2026)" +- `D-65` — line 924, heading: "D-65. Criteria led discharge on in production, typed patient specific criteria, and the AWOL bed hold review paused (17 October 2026)" +- `D-66` — line 940, heading: "D-66. Granted roles work without a second approval (17 October 2026)" +- `D-67` — line 948, heading: "D-67. Recover synthetic form drafts within the browser session (17 October 2026)" +- `D-68` — line 955, heading: "D-68. Bed meeting TV content and access (19 October 2026)" +- `D-69` — line 963, heading: "D-69. A referral with no legal status: "Needs an involuntary-capable bed until status is set." (20 October 2026)" +- `D-70` — line 970, heading: "D-70. No computed Mental Health Act periods: show only the recorded due time (20 October 2026)" +- `D-71` — line 976, heading: "D-71. Audit 1 clinical safety fixes: no suggested wards, wait-order queues, recorded facts only (20 October 2026)" +- `D-72` — line 989, heading: "D-72. Seven product decisions for the 21 October fix plan (21 October 2026)" +- `D-73` — line 1005, heading: "D-73. Batch merge safeguards (21 October 2026)" +- `D-74` — line 1021, heading: "D-74. Owner answers to the 21 October open questions (21 October 2026)" +- `D-75` — line 1042, heading: "D-75. UX audit follow-up, page caching, community gaps and the extra-travel bed hold (21 October 2026)" +- `D-76` — line 1055, heading: "D-76. Community referral gaps: the full move journey and asking more wards (21 October 2026)" +- `D-77` — line 1064, heading: "D-77. The ten bigger UX changes approved for build (22 October 2026)" +- `D-78` — line 1084, heading: "D-78. One decline list for wards and coordinators (22 October 2026)" +- `D-79` — line 1095, heading: "D-79. Wards see the full referral, with name and UMRN, before they answer (23 October 2026)" +- `D-80` — line 1106, heading: "D-80. Role access plan version 2: all 17 recommendations (23 October 2026)" +- `D-81` — line 1121, heading: "D-81. Pulled, with a pull time limit, for a bed kept for an incoming patient (24 October 2026)" +- `D-82` — line 1128, heading: "D-82. A PR may raise a phone size limit by up to 5 KB per screen without asking (26 October 2026)" +- `D-83` — line 1136, heading: "D-83. Patient names stay in full on every screen, copy and TV; privacy work must not make the app less useful (26 October 2026)" +- `D-84` — line 1147, heading: "D-84. The live app stays on Railway Singapore for now, and there is no server-side TV account yet (26 October 2026)" +- `D-85` — line 1155, heading: "D-85. "Held" only for a bed kept for its own patient; "pulled" for an incoming bed; "held up" for a delay (26 October 2026)" +- `D-86` — line 1162, heading: "D-86. No second approver for role grants, at pilot or otherwise (27 October 2026)" +- `D-87` — line 1169, heading: "D-87. D-36 and D-37 are replaced by the real-data gate (27 October 2026)" +- `D-88` — line 1181, heading: "D-88. The public demo opens with a demo code once the front door is on (27 October 2026)" +- `D-89` — line 1188, heading: "D-89. Redesign mock-up copies of large screens may pass the 1,500-line cap (30 October 2026)" +- `D-90` — line 1196, heading: "D-90. Help gets How do I…, Show me runs everywhere, and Help is built without a separate mock-up step (30 October 2026)" +- `D-91` — line 1207, heading: "D-91. One design home for the redesign, and Josh's answers on Help, Settings, search and notifications (31 October 2026)" +- `D-92` — line 1242, heading: "D-92. Help goes live before its mock-up review, one search box on Capacity, and referral rows on Home open the panel (31 October 2026)" +- `D-93` — line 1252, heading: "D-93. Legal form times show only as typed, never as a countdown (31 October 2026)" +- `D-94` — line 1260, heading: "D-94. Design rulings of 31 October 2026" +- `D-95` — line 1273, heading: "D-95. One page scroll, and a click outside closes a drawer (3 November 2026)" +- `D-96` — line 1283, heading: "D-96. A named bed is pulled, and its patient is not also waiting (8 November 2026)" +- `D-97` — line 1293, heading: "D-97. Owner answers on seven open items: N21, N25, N26, N29, N40, N41 and WF-B008 (8 November 2026)" +- `D-98` — line 1306, heading: "D-98. Friction pass: Quick bar, Patient peek and Ward peek (8 November 2026)" +- `D-99` — line 1315, heading: "D-99. "Real details" in the referral drawer's sample patients (25 September 2026)" +- `D-100` — line 1321, heading: "D-100. "Under a form" means one rule everywhere (9 November 2026)" +- `D-101` — line 1328, heading: "D-101. Clinically ready for discharge, with one delay reason (9 November 2026)" +- `D-102` — line 1337, heading: "D-102. Report-a-problem screenshots are blurred, and patient-table exports carry no names (9 November 2026)" +- `D-103` — line 1346, heading: "D-103. Any coordinator on shift may mark a bed override reviewed (9 November 2026)" +- `D-104` — line 1353, heading: "D-104. Care plans and safety flags: five defaults (9 November 2026)" +- `D-105` — line 1365, heading: "D-105. Optional clerk details on the patient record (8 November 2026)" +- `D-106` — line 1372, heading: "D-106. Clinical values from the 9 November 2026 documentation audit (9 November 2026)" +- `D-107` — line 1384, heading: "D-107. Working rules and documentation from the 9 November 2026 audit (9 November 2026)" +- `D-108` — line 1398, heading: "D-108. Six bed-flow features: keep D-93 and D-72, ED long-wait next steps (9 November 2026)" +- `D-109` — line 1407, heading: "D-109. Home's bed alert line tests the whole number shown (9 November 2026)" +- `D-110` — line 1414, heading: "D-110. ED and referral flow: neutral fit line, clearance timing and alternatives to admission (9 November 2026)" +- `D-111` — line 1424, heading: "D-111. Review and audit plan: first guards and four open answers (9 November 2026)" +- `D-112` — line 1438, heading: "D-112. Phone bottom bar: the floating bar (9 November 2026)" +- `D-113` — line 1447, heading: "D-113. Second patient identifier on accept and Mark done; no initials search (9 November 2026)" +- `D-114` — line 1457, heading: "D-114. Allow pull_request_target for three workflows only (9 November 2026)" +- `D-115` — line 1465, heading: "D-115. One count on every screen, and a missing patient shown everywhere (9 November 2026)" +- `D-116` — line 1479, heading: "D-116. Page tops: the PR #1581 recommendations stand (9 November 2026)" +- `D-117` — line 1496, heading: "D-117. Care plans follow-up: frequent presenter count, tribunal date and ward flags (10 November 2026)" +- `D-118` — line 1505, heading: "D-118. Page tops: Referrals and Ward phone limits up to 8 KB above main (10 November 2026)" +- `D-119` — line 1511, heading: "D-119. Page tops: phone limits raised to measured sizes, trim after merge (10 November 2026)" +- `D-120` — line 1518, heading: "D-120. Discharge and capacity values: pull limit, transport delay and discharge date slip (9 November 2026)" +- `D-121` — line 1527, heading: "D-121. Working rules, guards and your PC from the 10 November 2026 audit (10 November 2026)" +- `D-122` — line 1541, heading: "D-122. Clinical and privacy answers from the 10 November 2026 audit (10 November 2026)" +- `D-123` — line 1554, heading: "D-123. Master audit list answers: two clinical fixes and five working rules (10 November 2026)" +- `D-124` — line 1568, heading: "D-124. Offline saves whose record changed are refused and shown (10 November 2026)" +- `D-125` — line 1575, heading: "D-125. Top 10 audit follow-ups approved (10 November 2026)" +- `D-126` — line 1587, heading: "D-126. Ranked lists: neutral orders approved (10 November 2026)" +- `D-127` — line 1606, heading: "D-127. Neutral wording for a community treatment order at arrival (10 November 2026)" +- `D-128` — line 1613, heading: "D-128. Final master audit: nine answers (10 November 2026)" +- `D-129` — line 1628, heading: "D-129. Master audit findings: every recommendation approved (10 November 2026)" +- `D-130` — line 1678, heading: "D-130. Audit follow-ups: every remaining recommendation approved (10 November 2026)" +- `D-131` — line 1694, heading: "D-131. Hard-case demo data allowed, and the movement diagram follows the engine (10 November 2026)" +- `D-132` — line 1703, heading: "D-132. Audit fixes group 1: docs and CI guards (10 November 2026)" +- `D-133` — line 1713, heading: "D-133. Batch 1 (ED and referral flow): three answers (10 November 2026)" +- `D-134` — line 1723, heading: "D-134. Ward arrival and beds batch: how to hold, advocate line, night list and the feature freeze (10 November 2026)" +- `D-135` — line 1746, heading: "D-135. Batch 4, outages and pilot control: pack age and plan answers (10 November 2026)" +- `D-136` — line 1755, heading: "D-136. Feature batch 3 (shift change and follow-up): two signed values (10 November 2026)" +- `D-137` — line 1767, heading: "D-137. Feature build batch 5: count leak first, TV change mark and QR library (10 November 2026)" +- `D-138` — line 1783, heading: "D-138. Phone alert urgency by kind (10 November 2026)" +- `D-139` — line 1789, heading: "D-139. Phone Statistics ward list A to Z, and leave return times as typed (10 November 2026)" +- `D-140` — line 1799, heading: "D-140. Feature list adopted, and Wave 1 begins (10 November 2026)" +- `D-141` — line 1812, heading: "D-141. Batch 1 (ED and referral flow) design approved, with eleven answers (11 November 2026)" +- `D-142` — line 1830, heading: "D-142. Batch 4: design review and all twelve answers approved, D-80 amended for site features (11 November 2026)" +- `D-143` — line 1842, heading: "D-143. MHERT is MHERL in the glossary; SMHMR deferred (11 November 2026)" +- `D-144` — line 1850, heading: "D-144. Chip rows move only sideways on a phone (11 November 2026)" +- `D-146` — line 1856, heading: "D-146. Performance audit fixes and the phone speed target (11 November 2026)" +- `D-147` — line 1862, heading: "D-147. Demo-code tries keep per-address keying until a trusted proxy is set (11 November 2026)" +- `D-152` — line 1868, heading: "D-152. Returned to ED prompt sees every return in shared mode (11 November 2026)" +- `D-153` — line 1876, heading: "D-153. Keep the drawn-time settle check, and defer a separate agent GitHub identity (11 November 2026)" +- `D-154` — line 1884, heading: "D-154. The community desk's ED heads-up reads a narrow scoped list (11 November 2026)" ### `../history/archive/dated-notes/ward-management-decisions.md` (2026-08-18 – 2026-10-24 (mixed, see file)) diff --git a/docs/ward-flow/decisions.md b/docs/ward-flow/decisions.md index 76ec77d0a1..29c942bc78 100644 --- a/docs/ward-flow/decisions.md +++ b/docs/ward-flow/decisions.md @@ -171,6 +171,7 @@ Checked 9 November 2026 (D-107 audit). "Partly replaced" means part of the entry | [D-147](#d-147-demo-code-tries-keep-per-address-keying-until-a-trusted-proxy-is-set-11-november-2026) | Demo-code tries keep per-address keying until a trusted proxy is set | Active | | [D-152](#d-152-returned-to-ed-prompt-sees-every-return-in-shared-mode-11-november-2026) | Returned to ED prompt sees every return in shared mode | Active | | [D-153](#d-153-keep-the-drawn-time-settle-check-and-defer-a-separate-agent-github-identity-11-november-2026) | Keep the drawn-time settle check, and defer a separate agent GitHub identity | Active | +| [D-154](#d-154-the-community-desks-ed-heads-up-reads-a-narrow-scoped-list-11-november-2026) | The community desk's ED heads-up reads a narrow scoped list | Active | --- @@ -1879,3 +1880,12 @@ is inferred. 1. **Phone release gate settle check:** the shared helper `waitForAccessibleReadiness` (`tests/helpers/ward-release-gate.ts`, changed in PR #1607) stays as it is. It counts a 100 ms tick against its 5-second settle budget only when the browser drew a frame in that tick, or while fonts load. A cold WebKit page held by D-137 can pause drawing after its first frame. Finite motion, or geometry that keeps changing while the browser draws, still fails after 5 seconds, and the test timeout still bounds a renderer that never recovers. The helper ignores infinite animations and the running Undo availability bar, so those can carry on while the page settles. 2. **A9-01, a separate GitHub identity for the agents:** deferred until after the pilot. Agents keep publishing as they do now. - **Boundary:** synthetic data only. Changes no clinical value or rule, weakens no release gate check, and approves no merge, release or settings change. + +## D-154. The community desk's ED heads-up reads a narrow scoped list (11 November 2026) + +- **Date:** 11 November 2026 (`2026-11-11`). **Decided by:** Josh, choosing "Yes, in a follow-up PR" on a decision card in the Ward Flow project thread "Batch 1: ED and referral flow", then "Yes I approve" in the project chat (15:43 UTC) when asked again whether to build it. Numbered D-154 because D-153 belongs to the counts thread's docs PR and D-145 to D-152 belong to other threads. +- **Decision:** the item 46 "Your patients in ED" card (D-133, D-141) now works on a community team desk. That desk's movements hold only the journeys its own referrals touch, so the card was empty there. When `scopeWorkspace` cuts a community team desk's view, it now finds that team's open-episode patients who are in an ED in the whole workspace, and adds `communityEdArrivals` beside the scoped records. The card reads that list on a community desk and its own movements anywhere else. +- **Role access, kept narrow:** each item is the UMRN, the ED's name and the time the stay was recorded, keyed by the journey id, and nothing else. The ED journey and the person's record stay out of the desk's movements and patients. Only a community desk scoped to one team gets the list; every other desk's view has none. +- **Episode list:** the mock-up community episodes' team and status moved to `patients/community-episode-teams.ts`, the one place they are typed. The patient record mock-ups spread them in. That keeps the record mock-ups out of the shared access code. +- **Not covered:** shared mode. A shared community desk's copy comes from the server's `scopeWardFlowState`, which does not send this list yet, so the card stays empty there, as before. Sending it the way D-152 sends `diversionReturns` is a separate change. +- **Boundary:** synthetic data only. Display only. No event, stored field or signed clinical value changes, and this approves no merge or release. diff --git a/src/components/ward-management/home-team-heads-up-card.tsx b/src/components/ward-management/home-team-heads-up-card.tsx index 58123c13a9..e48dded615 100644 --- a/src/components/ward-management/home-team-heads-up-card.tsx +++ b/src/components/ward-management/home-team-heads-up-card.tsx @@ -4,22 +4,15 @@ import { useId, useMemo } from "react"; import { Hospital } from "lucide-react"; import { Card, CardBody, CardHead } from "@/components/wf"; -import { recordExtrasFor } from "@/components/ward-management/patients/patient-record-extras"; +import { communityEpisodeTeamsOf } from "@/components/ward-management/patients/community-episode-teams"; +import { useCommunityEdArrivals } from "@/components/ward-management/shell/ward-access"; import { formatInstantWithDay, type Instant } from "@/components/ward-management/ward-clock"; import { useOptionalWardFlowSelect } from "@/components/ward-management/ward-flow-provider"; import type { CommunityTeam } from "./community/community-derivations"; -import { - homeTeamHeadsUps, - homeTeamHeadsUpWho, - type CommunityEpisodesOf, - type UmrnOf, -} from "./community/home-team-heads-up"; +import { homeTeamHeadsUps, homeTeamHeadsUpWho, type UmrnOf } from "./community/home-team-heads-up"; import styles from "./out-of-area/return-early-alerts.module.css"; import headsUpStyles from "./community/home-team-heads-up.module.css"; -/** The patient record's community team episodes (the record's own list; mock-up data for now). */ -const recordedEpisodes: CommunityEpisodesOf = (patientId) => recordExtrasFor(patientId)?.community; - /** * Home team heads-up (item 46, D-133): this team's patients with an open episode who are in an * emergency department now. The UMRN (D-141), the ED name and the time only: no name, reason, @@ -33,8 +26,11 @@ export function HomeTeamHeadsUpCard({ team, now }: { team: CommunityTeam; now: I const byId = new Map((patients ?? []).map((patient) => [patient.id as string, patient.umrn])); return (patientId) => byId.get(patientId); }, [patients]); + // D-154: a community team desk gets its list from its scoped view, since the ED stays are not + // in its movements. Any other desk (a statewide coordinator previewing the page) reads its own. + const projected = useCommunityEdArrivals(); if (!source) return null; - const items = homeTeamHeadsUps(source.movements, team, recordedEpisodes, now, umrnOf); + const items = projected ?? homeTeamHeadsUps(source.movements, team, communityEpisodeTeamsOf, now, umrnOf); if (items.length === 0) return null; return ( diff --git a/src/components/ward-management/patients/community-episode-teams.ts b/src/components/ward-management/patients/community-episode-teams.ts new file mode 100644 index 0000000000..8949a190b7 --- /dev/null +++ b/src/components/ward-management/patients/community-episode-teams.ts @@ -0,0 +1,21 @@ +import type { CommunityEpisode, CommunityEpisodesOf } from "@/components/ward-management/community/home-team-heads-up"; + +/** + * MOCK-UP ONLY, like `patient-record-extras.ts`. The team and the open or ended status of each + * invented community team episode, and nothing else. This is the only place they are typed: + * the record extras spread these entries into their fuller mock-ups. + * + * The list is kept apart from the extras so the community desk's scoped view (D-154) can test + * "open episode with this team" without loading the record mock-ups into every screen. + */ +export const COMMUNITY_EPISODE_TEAMS = { + "PT-001": [{ status: "active", team: "Midland Community Team" }], + "PT-003": [{ status: "ended", team: "Bentley Community Team" }], + "PT-036": [{ status: "active", team: "Midland Community Team" }], + "PT-002": [{ status: "active", team: "Midland Community Team" }], +} as const satisfies Record; + +const EPISODES: Readonly> = COMMUNITY_EPISODE_TEAMS; + +/** The patient's community team episodes, team and status only, or `undefined` when none is recorded. */ +export const communityEpisodeTeamsOf: CommunityEpisodesOf = (patientId) => EPISODES[patientId]; diff --git a/src/components/ward-management/patients/patient-record-extras.ts b/src/components/ward-management/patients/patient-record-extras.ts index 89e124626a..f9c0a067b2 100644 --- a/src/components/ward-management/patients/patient-record-extras.ts +++ b/src/components/ward-management/patients/patient-record-extras.ts @@ -8,6 +8,7 @@ */ import { siteByCode } from "../ward-sites"; +import { COMMUNITY_EPISODE_TEAMS } from "./community-episode-teams"; /** Site names come from the data layer, never typed a second time here. */ const GRAYLANDS = siteByCode("GRY")?.name ?? "Graylands"; @@ -240,8 +241,7 @@ const PATIENT_RECORD_EXTRAS: Record = { episodes: [], community: [ { - status: "active", - team: "Midland Community Team", + ...COMMUNITY_EPISODE_TEAMS["PT-001"][0], program: "Case management", since: "Jun 2026", caseManager: { name: "Okafor, Lin", role: "Nurse, case manager", phone: "08 0000 3124" }, @@ -373,8 +373,7 @@ const PATIENT_RECORD_EXTRAS: Record = { ], community: [ { - status: "ended", - team: "Bentley Community Team", + ...COMMUNITY_EPISODE_TEAMS["PT-003"][0], program: "Case management", since: "Mar 2025", ended: "Jan 2026", @@ -520,8 +519,7 @@ const PATIENT_RECORD_EXTRAS: Record = { ], community: [ { - status: "active", - team: "Midland Community Team", + ...COMMUNITY_EPISODE_TEAMS["PT-036"][0], program: "Case management", since: "Apr 2024", caseManager: { name: "Pereira, Dan", role: "Social worker, case manager", phone: "08 0000 3120" }, @@ -710,8 +708,7 @@ const PATIENT_RECORD_EXTRAS: Record = { ], community: [ { - status: "active", - team: "Midland Community Team", + ...COMMUNITY_EPISODE_TEAMS["PT-002"][0], program: "Case management", since: "Nov 2024", caseManager: { name: "Tran, Minh", role: "Clinical nurse, case manager", phone: "08 0000 3114" }, diff --git a/src/components/ward-management/shell/ward-access.tsx b/src/components/ward-management/shell/ward-access.tsx index 1f8848162e..0c3f30b7d2 100644 --- a/src/components/ward-management/shell/ward-access.tsx +++ b/src/components/ward-management/shell/ward-access.tsx @@ -47,6 +47,7 @@ import { smallNumberParts, smallNumberText, } from "@/components/ward-management/ward-access-scope"; +import type { HomeTeamHeadsUp } from "@/components/ward-management/community/home-team-heads-up"; import type { AuditReview } from "@/components/ward-management/ward-audit"; import { isBreakGlassReviewId } from "@/components/ward-management/ward-break-glass-review-id"; import type { RecordRead, WardRecordActor } from "@/components/ward-management/ward-discharge-records"; @@ -153,6 +154,17 @@ export function useIsDatesOnlyStay(): (admissionId: string | undefined) => boole return useCallback((admissionId) => admissionId !== undefined && ids.has(admissionId), [ids]); } +/** D-154: a community desk's own patients in ED now, or `undefined` on any other desk. */ +const CommunityEdArrivalsContext = createContext(undefined); + +/** + * The community team desk's patients with an open episode who are in an ED now (UMRN, ED name and + * time only, D-154), or `undefined` when this desk is not a community team's. + */ +export function useCommunityEdArrivals(): readonly HomeTeamHeadsUp[] | undefined { + return useContext(CommunityEdArrivalsContext); +} + /** * Whether a movement or stay belongs to a person this desk sees only through break glass. The * patient link is read here, inside the archived D-14 allowlist, so callers never touch it themselves. @@ -328,6 +340,7 @@ export function WardAccessScope({ children }: { children: ReactNode }) { scoped: WardFlowContextValue; glass: ReadonlySet; datesOnly: ReadonlySet; + edArrivals?: readonly HomeTeamHeadsUp[]; }>(() => { if (accessIsWholeNetwork(access) && activeGrants.length === 0) return { scoped: context, glass: NO_IDS, datesOnly: NO_IDS }; @@ -473,6 +486,7 @@ export function WardAccessScope({ children }: { children: ReactNode }) { return { glass: breakGlassPatientIds, datesOnly: scoped.datesOnlyAdmissionIds, + edArrivals: baseScoped.communityEdArrivals, scoped: { ...rest, dispatch, @@ -565,7 +579,9 @@ export function WardAccessScope({ children }: { children: ReactNode }) { - {children} + + {children} + diff --git a/src/components/ward-management/ward-access-scope.ts b/src/components/ward-management/ward-access-scope.ts index 9a4859fdb3..4f20f0e53f 100644 --- a/src/components/ward-management/ward-access-scope.ts +++ b/src/components/ward-management/ward-access-scope.ts @@ -24,6 +24,8 @@ import { communityDischargeCriteria } from "./ward-discharge-criteria"; */ import { communityTeamOptions } from "@/components/ward-management/referrals/referral-destination-options"; import { communityTeamSlug } from "@/components/ward-management/community/community-derivations"; +import { homeTeamHeadsUps, type HomeTeamHeadsUp } from "@/components/ward-management/community/home-team-heads-up"; +import { communityEpisodeTeamsOf } from "@/components/ward-management/patients/community-episode-teams"; import { CLINICAL_VALUES } from "@/components/ward-management/ward-clinical-values"; import { withWardReadmission } from "@/components/ward-management/ward-readmission-copy"; import type { Instant } from "@/components/ward-management/ward-clock"; @@ -90,6 +92,12 @@ export type ScopedWorkspace = T & { readonly breakGlassPatientIds: ReadonlySet; /** Stays sent as ward and dates only, so nothing hung off them (leave, a release) goes too. */ readonly datesOnlyAdmissionIds: ReadonlySet; + /** + * D-154: a community team desk's own patients in an emergency department now, for the Home + * team heads-up. Present only on a community desk. Each item is the UMRN, the ED's name and the + * time, and nothing else; the ED stay itself stays out of `movements`. + */ + readonly communityEdArrivals?: readonly HomeTeamHeadsUp[]; }; function activeGrantIds(grants: readonly BreakGlassGrant[] | undefined, now: Instant): Set { @@ -924,6 +932,7 @@ export function scopeWorkspace( let referrals: Referral[] = []; let admissions: Admission[] = []; const datesOnlyAdmissionIds = new Set(); + let communityEdArrivals: HomeTeamHeadsUp[] | undefined; let anonymise = false; let officer = false; @@ -1164,6 +1173,19 @@ export function scopeWorkspace( .map((movement) => movement.id), ); const movementIds = new Set(movements.map((movement) => movement.id)); + // D-154 (Josh, 11 Nov 2026): the team's patients with an open episode who are in an ED now, + // as UMRN, ED name and time only. Read from the whole workspace, so the ED stay itself is + // never sent. + if (teamKey !== "" && scope.kind === "team") { + const umrns = new Map(workspace.patients.map((patient) => [patient.id as string, patient.umrn])); + communityEdArrivals = homeTeamHeadsUps( + workspace.movements, + { id: communityTeamSlug(scope.teamName), name: scope.teamName }, + communityEpisodeTeamsOf, + now, + (patientId) => umrns.get(patientId), + ); + } admissions = workspace.admissions.flatMap((admission) => { if ( (admission.referralId !== null && askedOfTeam.has(admission.referralId)) || @@ -1328,6 +1350,7 @@ export function scopeWorkspace( notices, breakGlassPatientIds: visibleOnlyByGrant, datesOnlyAdmissionIds, + ...(communityEdArrivals ? { communityEdArrivals } : {}), }; } diff --git a/tests/ward-community-ed-arrivals-scope.test.ts b/tests/ward-community-ed-arrivals-scope.test.ts new file mode 100644 index 0000000000..9861c1df0c --- /dev/null +++ b/tests/ward-community-ed-arrivals-scope.test.ts @@ -0,0 +1,66 @@ +import { describe, expect, it } from "vitest"; + +import { communityTeamById } from "@/components/ward-management/community/community-derivations"; +import { homeTeamHeadsUps } from "@/components/ward-management/community/home-team-heads-up"; +import { wardPlaceLookup } from "@/components/ward-management/ward-access-places"; +import { scopeWorkspace } from "@/components/ward-management/ward-access-scope"; +import type { WardAccess } from "@/components/ward-management/ward-role-access"; +import { seedWardFlowState } from "@/components/ward-management/ward-flow-reducer"; +import { communityEpisodeTeamsOf } from "@/components/ward-management/patients/community-episode-teams"; +import { recordExtrasFor } from "@/components/ward-management/patients/patient-record-extras"; +import { NOW_ANCHOR as NOW } from "@/components/ward-management/ward-sites"; + +/* + * D-154 (Josh, 11 Nov 2026): a community team desk's scoped view carries its own open-episode + * patients who are in an ED now, as UMRN, ED name and time only. The ED stay itself stays out of + * the desk's movements, and no other desk gets the list. Synthetic seed data only. + */ +const midland = communityTeamById("midland")!; +const desk = (teamName: string): WardAccess => ({ role: "community", scope: { kind: "team", teamName } }); + +function scoped(access: WardAccess) { + const state = seedWardFlowState(); + return { state, view: scopeWorkspace(state, access, { now: NOW, places: wardPlaceLookup(state.units) }) }; +} + +describe("community desk ED arrivals projection (D-154)", () => { + it("gives the Midland desk its open-episode patient in ED: UMRN, ED name and time only", () => { + const { state, view } = scoped(desk(midland.name)); + const arrivals = view.communityEdArrivals ?? []; + expect(arrivals).toHaveLength(1); + const [item] = arrivals; + expect(Object.keys(item!).sort()).toEqual(["edName", "key", "since", "umrn"]); + expect(item!.umrn).toMatch(/^UM\d{6}$/u); + expect(item!.edName).toBe("Armadale ED"); + // The ED stay is not sent with it. + expect(view.movements.some((movement) => movement.id === item!.key)).toBe(false); + // The patient's record is not sent either: the UMRN is all the desk learns. + const source = state.movements.find((movement) => movement.id === item!.key)!; + expect(view.patients.some((patient) => patient.id === source.patientId)).toBe(false); + }); + + it("matches what the whole workspace says, so the desk and the coordinator agree", () => { + const { state, view } = scoped(desk(midland.name)); + const umrns = new Map(state.patients.map((patient) => [patient.id as string, patient.umrn])); + expect(view.communityEdArrivals).toEqual( + homeTeamHeadsUps(state.movements, midland, communityEpisodeTeamsOf, NOW, (id) => umrns.get(id)), + ); + }); + + it("gives a team with no open-episode patient in ED an empty list", () => { + expect(scoped(desk(communityTeamById("bentley")!.name)).view.communityEdArrivals).toEqual([]); + }); + + it("gives no other desk the list", () => { + const ed: WardAccess = { role: "ed", scope: { kind: "ed", edId: "rph-ed" } }; + expect(scoped(ed).view.communityEdArrivals).toBeUndefined(); + expect(scoped({ role: "coordinator", scope: { kind: "statewide" } }).view.communityEdArrivals).toBeUndefined(); + }); + + it("reads the episode team and status from the one list the record mock-ups spread", () => { + for (const id of ["PT-001", "PT-002", "PT-003", "PT-036"] as const) { + const episodes = recordExtrasFor(id)?.community ?? []; + expect(episodes.map(({ status, team }) => ({ status, team }))).toEqual(communityEpisodeTeamsOf(id)); + } + }); +}); From 77e47c205ea966e2ef6d9aa8e196df2c45625f57 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 11 Nov 2026 22:28:22 +0000 Subject: [PATCH 2/3] Update the decision facts for D-154 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01GxPPxjdesrEjVU1zKyiFhd --- docs/FACTS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/FACTS.md b/docs/FACTS.md index 6515eed8b9..135225891f 100644 --- a/docs/FACTS.md +++ b/docs/FACTS.md @@ -13,8 +13,8 @@ green. Quote a fact instead of restating it, and it updates itself when the sour | `migration-count` | 18 | Numbered database migrations | `backend/ward-flow/migrations/` | | `ward-route-count` | 61 | `page.tsx` routes under `/ward-flow` | `src/app/ward-flow/` | | `app-route-count` | 65 | Pages and route handlers: the Ward Flow routes plus sign-in and the `/mockups` digest | `src/app/ward-flow/, src/app/ward-flow-sign-in/, src/app/mockups/` | -| `latest-decision` | D-153 | Newest entry in the decision log | `docs/ward-flow/decisions.md` | -| `next-decision` | D-154 | Number to use for the next decision | `docs/ward-flow/decisions.md` | +| `latest-decision` | D-154 | Newest entry in the decision log | `docs/ward-flow/decisions.md` | +| `next-decision` | D-155 | Number to use for the next decision | `docs/ward-flow/decisions.md` | | `node-engine` | >=24.22.1 <25 | Supported Node.js range | `package.json` | | `backend-env-vars` | 33 names, [listed below](#backend-env-vars) | Environment variables the shared backend reads | `backend/ward-flow/*.mjs` | From bd2bc0ea344df47834c90ae66458c77247dd7e67 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 11 Nov 2026 22:36:54 +0000 Subject: [PATCH 3/3] Raise six phone size limits for the community desk's scoped ED list Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01GxPPxjdesrEjVU1zKyiFhd --- .../2026-11-11-pr1632-community-ed-arrivals.md | 17 +++++++++++++++++ script-budget.json | 12 ++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 docs/script-budget-history/2026-11-11-pr1632-community-ed-arrivals.md diff --git a/docs/script-budget-history/2026-11-11-pr1632-community-ed-arrivals.md b/docs/script-budget-history/2026-11-11-pr1632-community-ed-arrivals.md new file mode 100644 index 0000000000..f09aa352bf --- /dev/null +++ b/docs/script-budget-history/2026-11-11-pr1632-community-ed-arrivals.md @@ -0,0 +1,17 @@ +# 11 Nov 2026, community desk ED heads-up (PR #1632, D-154) + +Changed on top of `main` at `0b657ad` (just after #1606 merged). Each raise is under 1 KB, well within the per-screen allowance in HOW-WE-WORK section 6: + +- Home `/ward-flow`: 587.7 to 588.3 +- ED `/ward-flow/ed`: 543.4 to 543.9 +- Movement `/ward-flow/movements/WF-001`: 618.7 to 619.0 +- Capacity `/ward-flow/capacity`: 665.7 to 665.9 +- Bed meeting `/ward-flow/bed-meeting`: 600.1 to 600.7 +- Statistics `/ward-flow/statistics`: 640.5 to 641.0 +- Referrals, Ward and ED site: unchanged + +Hosted CI (job 130831009655) measured, in KB: Home 588.1, Referrals 594.0, ED 543.7, Ward 625.1, Movement 618.8, Capacity 665.7, ED site 676.1, Bed meeting 600.5 and Statistics 640.8. Each changed limit is the measurement plus 0.2. + +Why it changed: the scoped workspace builder (`ward-access-scope.ts`), which every screen loads, now builds the community desk's narrow ED list (D-154). So it imports the heads-up list builder and the small episode team list, and the access shell gains one context. That costs about 0.3 to 0.6 KB a screen. + +Trim tried: building the list only on the community desk's Home card would keep it off other screens. That would mean the card reads the whole workspace again, which is the exposure D-154 removes. The scoped view has to carry the list, so it is built where the scope is built. diff --git a/script-budget.json b/script-budget.json index d511d8fcce..d70965f0a7 100644 --- a/script-budget.json +++ b/script-budget.json @@ -1,14 +1,14 @@ { "$comment": "Phone first-load script budgets in KB gzipped, checked by scripts/check-script-budget.mjs after the production build. Set on 16 October 2026 at the measured size plus about 10 KB, and lowered the same day after the rail and search left a phone's first load. Lower a budget when a route shrinks. Raise one only with a reason in the PR. Raise and lowering history: docs/script-budget-history.md up to 4 November 2026, then one file per PR in docs/script-budget-history/ (see its README), not here.", "budgets": { - "/ward-flow": 587.7, + "/ward-flow": 588.3, "/ward-flow/referrals": 594.3, - "/ward-flow/ed": 543.4, + "/ward-flow/ed": 543.9, "/ward-flow/ward/rph-adult-secure": 625.4, - "/ward-flow/movements/WF-001": 618.7, - "/ward-flow/capacity": 665.7, + "/ward-flow/movements/WF-001": 619.0, + "/ward-flow/capacity": 665.9, "/ward-flow/ed/arm-ed": 678.1, - "/ward-flow/bed-meeting": 600.1, - "/ward-flow/statistics": 640.5 + "/ward-flow/bed-meeting": 600.7, + "/ward-flow/statistics": 641.0 } }