Skip to content

Implementation plan / Session plan / Handover RC-3-S19

Handover RC-3-S19 Screens: ADM screens (part 2 of 2)

Card: RC-3-S19. Issue: cema-care/his#75. Branch: session/RC-3-S19. Slice: RC-3. Decision record: ADR-HIS-112.

What was built and where

This session added two screen folders to the ADM workspace and changed nothing else in web/.

Folder Screen Workspace, nav order Calls
web/domains/adm/UI-ADM-009/ UI-ADM-009 Transfer and handover panel W02 Nursing ("transfers"), 30 transfers.v1 requestTransfer, listTransfers, decideTransfer (accept, reject, cancel), recordTransferHandover (give, change-receiver), confirmTransferArrival (with the urgent path), correctTransfer, changeResponsibility, readResponsibilityTimeline (with asAt); beds.v1 searchEligibleBeds, reserveBed, readBedReservation, listBeds; encounters.v1 readEncounter, listEncounters; patient-identity.v1 searchPersons, readPerson; contracts/ess master-data.v1 and terminology.v1 expandValueSet
web/domains/adm/UI-ADM-010/ UI-ADM-010 ADT reconciliation and operational worklists W09 Front desk ("registration worklists"), 50 adt.v1 listEventReconciliationItems, readEventDelivery, resolveEventReconciliationItem, listAdtWorklistItems (all five kinds); registration.v1 listRegistrations?status=incomplete; encounters.v1 readEncounter (patient of an item); patient-identity.v1 readPerson; contracts/ise event-operations.v1 requestReplay, readSubscriptionCounts; terminology.v1 expandValueSet

readTransfer is not called: listTransfers by encounter answers every transfer with its handover and history.

UI-ADM-009 Transfer and handover panel. The code is in TransferPanel.tsx, panels.tsx, Actions.tsx, model.ts and api/transfers.ts.

  • Opening (ADR-HIS-112 point 2). No encounter reaches a URL. The panel opens:
  • on an encounter handed to UI-ADM-009;
  • from "Open transfers at this facility" (Requested and Accepted, with patient name and No. RM, state, handover and urgency), the receiving unit's way in;
  • by a search by No. RM or NIK. One Admitted or On leave encounter opens at once, otherwise the user chooses.
  • Layout:
  • The patient context zone shows the encounter line as the unit answers it, so until arrival the patient is at the origin under the origin team (AC-03), with "Transfer pending".
  • Transfer in progress (or Latest transfer):
    • the status tracker Requested → Accepted → Completed with times;
    • "Rejected by / Cancelled by [name] · [reason]";
    • "Destination bed lost" in amber with the return to Requested;
    • Corrected · entered in error;
    • the request as recorded: from, to, receiving team, reason, urgency, requested and arrived times.
  • Destination bed: the reservation summary.
  • Handover:
    • the glossary labels "Not yet given", "Awaiting acknowledgement · [receiver]", "Acknowledged by [name] · [time]" and "Declined · [reason]". The label "Given" is never used;
    • the escalation timeline of OV-34 (submitted, escalated, acknowledged);
    • "Handover not acknowledged · [time]" in amber after an urgent arrival.
  • Transfer history, newest first, and Earlier transfers.
  • Responsibility timeline: every period with unit, team, attending, location, from and to ("In force"), cause and "corrects period n", and "Show who was responsible" at a chosen time (asAt).
  • The action bar offers what the transfer state permits (model.ts permittedActions). Destructive actions stand apart, and an action that cannot be taken yet shows its reason.
  • Actions:
  • Request transfer: destination unit, care team and attending practitioner from the registry; reason and urgency from adm.transfer-reason and adm.transfer-urgency; requested time (now); a note. Disabled with its reason while a list cannot be read.
  • Accept transfer: for the receiving unit. A refusal reads "Only the receiving unit can do this."
  • Reject transfer and Cancel transfer: a reason in words, then the summary in place ("Cancel" focused, Enter does not confirm).
  • Reserve destination bed (ADR-HIS-112 point 4):
    • the isolation need, with no default;
    • the eligible beds of the destination unit for the transfer;
    • beds failing a soft constraint listed apart and not offered;
    • "Reserve bed" with transferId, replacing an earlier reservation. A 409 refreshes the list with "Bed was just reserved by another user. List refreshed.".
  • Record handover given: named receiver from the registry and the Domain 3 handover reference. Change handover receiver: with a reason. There is no acknowledge or decline action.
  • Confirm arrival:
    • offered only when Accepted, with a destination bed and an acknowledged handover. Otherwise the reason is shown: "The receiving unit has not accepted the transfer yet.", "No destination bed is reserved for this transfer.", "Handover has not been acknowledged.";
    • the summary lists every change applied together: location, responsible unit, care team, attending, effective time, destination bed → Occupied, origin bed → Cleaning, handover, the "Transferred" history entry, the encounter at another facility, and who is notified;
    • it sends the encounter's version.
  • Confirm urgent arrival: for the receiving charge nurse while the handover is not acknowledged. It needs a reason and the reserved bed, or one chosen from the eligible beds, and the summary says the ward board shows the unacknowledged handover until it is acknowledged.
  • Correct transfer: the latest completed transfer only, by a supervisor:
    • a reason from adm.encounter-correction-reason (or words);
    • the summary, then the sign step (PH-03);
    • when the unit says the origin bed is no longer free, a free bed of the origin unit to restore to.
  • Accept responsibility: changeResponsibility:
    • unit, team and attending, defaulting to the signed-in physician where the registry links the account;
    • effective time;
    • a reason from adm.responsibility-change-reason;
    • "Responsibility must be continuous." is shown at the time field.
  • Every command:
  • carries one Idempotency-Key per intent, and the version in If-Match;
  • disables its button while it runs;
  • after a lost answer, offers "Check again whether it was saved" with the same key.
  • A stale version (412) reloads the transfer and the encounter, says "Encounter changed. Review and retry." and keeps the entries.
  • An open transfer is read again every 30 seconds while no form is open, because its handover is acknowledged elsewhere. The watermark goes to the status line.

UI-ADM-010 ADT reconciliation and operational worklists. The code is in Worklists.tsx, ItemDetail.tsx, model.ts and api/reconciliation.ts.

  • Tabs, each with its count: ADT reconciliation, Incomplete registrations, Aged open encounters, Overdue leave returns, Cancelled with linked activity, Future appointments after death and Awaiting attribution after unmerge (ADR-HIS-112 point 6). A list the role may not read says so on its tab ("not available") and in its panel; the other tabs stay.
  • ADT reconciliation:
  • the freshness indicator;
  • the completeness indicator by consumer (ADR-HIS-112 point 8);
  • the list with the fixed row (item, patient name and No. RM, due and age, priority, state, source) and event type, consumer, delivery status and cause with the reject reason;
  • clinical consumers first, then oldest first;
  • empty state "Nothing to reconcile".
  • When the status feed cannot be read, the last list is kept, the indicator reads "Not updated for …" and the completeness heading says "not current".
  • Item detail:
  • business transaction, patient, event identifier, type and schema version, facility, producer and topic, sequence, effective and recorded times, the correlation identifier with "Copy", cause, priority, item state and resolution;
  • the status per required consumer.
  • The action bar:
    • Claim: disabled with its reason.
    • Open encounter: hands the encounter to UI-ADM-003.
    • Mark as reconciled: a reason, then the summary.
    • Request replay: a reason, then the summary (the event, its order, the consumer, "No encounter is created or changed"), then requestReplay and the resolution with its replayId (ADR-HIS-112 point 5). It is disabled with its reason for an interface or a sequence gap.
  • The other lists open the screen where the item is resolved (OV-01, CUX-04). Aged open, overdue return and cancelled rows hand the encounter to UI-ADM-003. The others link to UI-ADM-001, 005 and 002.
  • Unmet criteria are named: "Coding complete, Charges final".
  • An overdue return shows how long it is overdue.
  • Cancelled rows show the domains with linked activity.

Shared files (ADR-HIS-112 point 1): - Identical to UI-ADM-003's: failure.tsx, intents.ts, ui.tsx, time.ts, fake-gateway.ts, patients.tsx, fields.tsx, confirm.tsx, api/persons.ts, api/terminology.ts, and in UI-ADM-009 also api/http.ts, api/registry.ts, api/beds.ts, api/adt.ts, api/encounters.ts and check-against-stubs.sh. - handoff.tsx is identical in UI-ADM-009 and UI-ADM-010 and adds the UI-ADM-009 entry and four link targets to UI-ADM-003's. - UI-ADM-010's api/http.ts adds the domain ise, and its check-against-stubs.sh serves the ISE stub as well.

ADR-HIS-112 records nine decisions. Number 112 was checked free on origin/main on 2026-12-02. This pull request does not edit the decision record index: its row is written on main after the merge, when the sessions workflow rebuilds the index (CLAUDE.md section 5, as changed by #300).

Checks and their result

Check Command Result
Type check pnpm build in web/domains/adm passed
Component and accessibility tests pnpm exec vitest run UI-ADM-009 UI-ADM-010 in web/domains/adm; pnpm test for the workspace new tests all pass: UI-ADM-009 16, UI-ADM-010 8. The whole workspace run on this host: 177 passed, 25 failed, all in other screens (see below)
The pipeline's web job for the shell web/shell/scripts/ci.sh web/shell passed (19 tests; shared versions; screen discovery). The shell bundles TransferPanel and Worklists
Against the contract stubs each new folder's stubs.test.tsx against his-contract serve contracts/adm, contracts/ess and, for UI-ADM-010, contracts/ise passed: UI-ADM-009 3 tests, UI-ADM-010 2; no stub recorded a violation
Static analysis platform/delivery-pipeline/bin/static-analysis web/domains/adm/UI-ADM-009 web/domains/adm/UI-ADM-010 no blocking finding; no clinical artifact
Secret scan platform/delivery-pipeline/bin/secret-scan code origin/main HEAD, secret-scan docs origin/main HEAD no secret
Documentation links and site python3 docs/implementation_plan/tools/check_links.py; mkdocs build 0 broken links, 0 duplicate anchors; the site builds

Failures of other screens on this host. The whole workspace run failed 25 tests, all in UI-ADM-001, 004, 006, 007 and 011, most at their 30-second timeout. This session changed none of them. - They fail on a clean checkout of origin/main too: a run of UI-ADM-004 and UI-ADM-007 there failed 7. - Which tests fail changes from run to run, and the shell's first test also timed out once and passed when run again. So they depend on the load of this shared host, where other sessions run side by side. - main's latest pipeline run failed only in platform/gateways. - Follow-up below.

How the stub check was run. The host's Node.js 22.22.1 cannot run his-contract, as earlier sessions found. So: 1. contracts/common was installed in node:22.18-bookworm, in a container named after this session. 2. The ADM, ESS and ISE stubs ran there on the host network. 3. Each stubs.test.tsx ran on the host with HIS_ADM_STUB_URL, HIS_ESS_STUB_URL and HIS_ISE_STUB_URL, after POST /__stub/reset. 4. GET /__stub/violations answered [] on all three.

check-against-stubs.sh runs exactly these steps on a host whose Node.js strips types.

What the stubs can and cannot show: - The stub keeps one record per example identifier. It serves the encounters.v1 example encounter (4b6d…), but the transfers.v1 transfer and the responsibility timeline belong to the adt.v1 example encounter (7d9f…). - Through the stub the panel shows the encounter with the example transfer, its reservation and handover, and it accepts the transfer, records a handover and reserves a bed. - The timeline panel may say "not found", and the test tolerates that alone. The timeline and "who was responsible at" are covered by the component tests. - The ESS stub's terminology service holds no adm. list, so reasons are given in words. - The registration.v1 example is a complete registration, which the incomplete list leaves out. - Through the stub the worklists show every list, the completeness counts, a replay through Domain 2 with its replayId recorded, and a manual reconciliation.

"Ends when", line by line: - Each screen meets its brief and the clinical UX safety rules: see above, the tests below, and "Differences". What the contracts, the shell or other screens do not offer yet is shown disabled or stated, with its reason. - Component and accessibility checks pass: pnpm test. Every test of a full screen state runs expectNoAxeViolations (WCAG 2.0 to 2.2 A and AA; NFR-ADM-008, UX-ADM-002). Controls are React Aria and keyboard operable, and every state is text with a symbol (UX-ADM-005). - The screen works against the stubs of the contracts: the two stubs.test.tsx, as above. - The change touches only the folders of its screens: git diff --name-only origin/main lists web/domains/adm/UI-ADM-009/, web/domains/adm/UI-ADM-010/, this handover and ADR-HIS-112.

Requirements, test scenarios and tests

Tests are in UI-ADM-009/TransferPanel.test.tsx, UI-ADM-010/Worklists.test.tsx and each stubs.test.tsx. Each describe names its requirement and test scenario.

Requirement Scenario What the screens do Tests
FR-ADM-TRF-001 TEST-ADM-027 Request with registry and governed lists; open transfers list; tracker; accept and reject with refusal by role; cancelled and rejected by another user; destination bed lost; confirm arrival only when permitted, with the full set of changes, the encounter's version, a failed condition named, a stale version reloaded and a lost answer checked with the same key; urgent path; correction with sign step and a restore bed "UI-ADM-009 transfer panel, tracker and request" (6), "arrival" (3), "correction" (2), "destination bed" (1); stub test of 009
FR-ADM-TRF-002 TEST-ADM-028 Handover given and receiver changed; glossary labels, never "Given"; acknowledgement only shown; escalation timeline; "Handover not acknowledged" after urgent arrival; responsibility timeline across two transfers; who was responsible at a time; responsibility change with continuity refusal "UI-ADM-009 handover" (3), "responsibility" (1), "arrival" (urgent path); stub test of 009
FR-ADM-BED-002 TEST-ADM-019 Isolation need asked; eligible and soft-constraint beds apart; reservation for the transfer; conflict refreshes the list "UI-ADM-009 destination bed" (1); stub test of 009
FR-ADM-ADT-002 TEST-ADM-016 Reconciliation list with priority and cause; item detail with status per consumer; replay through Domain 2 after a summary, replayId recorded, no encounter created; manual reconciliation with reason; interface replay pointed to UI-ISE-001; completeness by consumer; not current when the feed fails "UI-ADM-010 ADT reconciliation worklist" (5); stub tests of 010 (2)
FR-ADM-REG-001, FR-ADM-FLW-003 TEST-ADM-006 Incomplete registrations with outstanding fields, opening registration "UI-ADM-010 operational worklists"
FR-ADM-ADT-003 TEST-ADM-017 Aged open encounters with unmet criteria named, opening the console with the encounter "UI-ADM-010 operational worklists"
FR-ADM-ADT-001 TEST-ADM-015 Overdue leave returns with how long overdue "UI-ADM-010 operational worklists"
FR-ADM-ENC-003 TEST-ADM-014 Cancelled with linked activity, the domains named, opening the console read-only "UI-ADM-010 operational worklists"
NFR-ADM-008 WCAG 2.2 AA rules with axe-core on each screen state expectNoAxeViolations in both test files

Safety rules with a test of their own: - CUX-06: states as text with a symbol. - CUX-10, 11, 12: summaries in place with the patient visible, "Cancel" focused, Enter not confirming, and the button repeating the action. - CUX-34, 35, 36: one key per intent, the button disabled while running, lost answers checked with the same key. - PH-03: the sign step on a correction, and disabled without a step-up host. - CUX-53, UX-ADM-004: As at, and "not current" when the feed fails. - OV-01, CUX-04: no business action in a list; rows open the owning screen. - PR-ADT-002-3: a replay creates no encounter.

Differences from the brief, the contract or the design

  • "Open transfer panel" in UI-ADM-003 and UI-ADM-004 stays disabled. The card allows changes only in this session's folders. The panel takes { encounterId } handed to UI-ADM-009, and has its own list and search meanwhile (ADR-HIS-112 point 2).
  • The destination bed is searched in the panel, not on the bed board, whose finder has no transfer purpose and is not this session's to change. Soft-constraint overrides are not offered in the panel (ADR-HIS-112 point 4).
  • Accept and confirm are offered to everyone and refused by the unit for others (screen state "No permission"). The shell does not say which unit the user belongs to (ADR-HIS-112 point 3).
  • Transfer between facilities: the panel shows one and confirms it, but does not request one. The screen has no list of the enterprise's facilities.
  • Link to the Domain 3 clinical handover: shown as its reference. No Domain 3 screen exists to link to yet.
  • Escalation timeline: shows when the unit escalated (escalatedAt). The screen does not compute the CFG-CLI-021 due time itself.
  • Read-only and downtime modes come from the shell banner, which gives a screen no signal yet (as in RC-3-S18).
  • UI-ADM-010 shows two lists more than the brief (future appointments after death, awaiting attribution after unmerge), which the contract points at this screen (ADR-HIS-112 point 6).
  • Not shown, because no contract carries them (ADR-HIS-112 point 7): Claim, Assign and Defer and the assignee column; the "Downtime" source tag; compensating events and the causation identifier; the unit and bed hold of an overdue return; the reason and actor of a cancellation. Incomplete registrations, appointments and unmerge attribution open their screens without the patient.
  • Request replay is offered for subscription consumers only. Interface messages and sequence gaps are pointed to UI-ISE-001 (ADR-HIS-112 point 5).
  • Completeness for interfaces: "No count for interfaces". Domain 2 offers counts for subscriptions only (ADR-HIS-112 point 8).

Needs a person

None of these blocks the merge.

  • Enterprise Architecture Board: approval of ADR-HIS-112.
  • No question under rule 3 was raised. Where the specification leaves behaviour to Domain 3 (acknowledgement, decline) or to the policy decision point (who acts), the screens leave it there.

Follow-ups outside the card

  • UI-ADM-003 and UI-ADM-004 (a later screen session on those folders): take the handoff.tsx of UI-ADM-009 and enable "Open transfer panel" by handing { encounterId } to UI-ADM-009. UI-ADM-012's ward board can do the same.
  • UI-ADM-004: give the eligible bed finder the purpose transfer (reserve with transferId, overrides included). The panel then hands off to it and drops its own search (OV-21).
  • UI-ADM-001, 002, 005: take a handoff with the patient, so worklist rows open them in context.
  • Contracts:
  • D01 adt.v1: the origin ("Downtime") and a task or assignee on reconciliation items; the causation identifier and compensating events on EventDelivery; unit, bed hold, cancellation reason and actor on WorklistItem.
  • D01 transfers.v1 and D03: the decline of a handover (Q2 of RC-3-S02, issue #58).
  • D02 event-operations.v1 or integration.v1: delivery counts for interface consumers; a way to replay a sequence gap by aggregate.
  • D10: a list of the enterprise's facilities for a request between facilities.
  • D10 registrations: the value sets the screens read: adm.transfer-reason, adm.transfer-urgency, adm.responsibility-change-reason, adm.encounter-correction-reason, adm.reconciliation-reason.
  • Shell and SDK: navigation with a payload, the user's unit, a step-up host, and a read-only and downtime signal. The shared copies then move there.
  • Design system: the work list component of OV-01 (tabs with counts, the fixed row), the tracker, and the select, radio group and confirmation summary already listed by RC-3-S18.
  • Host tooling: as before, the server's Node.js cannot run the contract tool.
  • ADM workspace tests (owners of UI-ADM-001, 004, 006, 007, 011): tests that time out at 30 seconds under load on the shared host. They fail on origin/main as well. Their timeouts or their waits need a look.