Skip to content

Implementation plan / Session plan / Handover RC-2-S08

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

Card: RC-2-S08. Issue: cema-care/his#53. Branch: session/RC-2-S08. Slice: RC-2. Decision record: ADR-HIS-079.

What was built and where

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

Folder Screen Workspace, nav order Calls
web/domains/adm/UI-ADM-008/ UI-ADM-008 Emergency department flow board and rapid registration W10 Patient flow, 10 flow.v1 listFlowBoards, readFlowBoard, readFlowState, readQueueItem, changeQueuePriority (triage-category), actOnQueueItem (place), listQueues, recordArrival; encounters.v1 listEncounters, createEncounter; patient-identity.v1 searchPersons, readPerson; contracts/ess terminology.v1 expandValueSet (adm.triage-category)
web/domains/adm/UI-ADM-011/ UI-ADM-011 Scheduling, queue and bed configuration console W18 Administration, 20 scheduling.v1 listAppointmentTemplates, createAppointmentTemplate, reviseAppointmentTemplate, decideAppointmentTemplateVersion, listResourceCalendars, readResourceCalendar, createResourceCalendar, reviseResourceCalendar, decideResourceCalendarVersion, addAvailabilityException, listAffectedAppointments; flow.v1 listQueues, listFlowBoards; contracts/ess master-data.v1 listServices, listLocations, listPractitioners, listResources
web/domains/adm/UI-ADM-012/ UI-ADM-012 Ward and clinic flow boards (workstation and wall display) W10 Patient flow, 20 flow.v1 listFlowBoards, readFlowBoard, readFlowState, readQueueItem

UI-ADM-012 Flow boards (FlowBoards.tsx, PatientPanel.tsx, board.tsx, api/boards.ts): - Three boards from their definitions: ward, clinic, and admissions and discharges. The emergency layout belongs to UI-ADM-008. - Header (OV-04): - counts by state, and on a ward "Isolation in force" counted apart (PH-04); - "As at [time]", and "Not updated for [n] minutes" in amber when the unit says the board is stale or the screen's copy is older than the board's threshold (BR-ADM-024, CUX-53, UX-ADM-004); - the states whose feed is unavailable, marked "not current" (PR-FLW-002-3). - Groups: ward by room and bed, clinic by service point then flow state, admissions and discharges by state. - Cards: identity line per the privacy setting, state label with symbol, time in state, location, team, and at most four indicators. - Workstation: - "Unit" when the user has more than one board, and "Filter board" by the definition's states; - "Open patient", the card's only action. It reads readFlowState and shows the flow state, location, team, indicators and the data's age. - A 403 reads "You are not permitted to open this patient. The attempt has been recorded." (FR-ADM-FLW-002 part 10). - The way out to the queue console (clinic) hands over the queue and the item (ADR-HIS-078 point 2). The encounter console, the bed board and the transfer panel are disabled with their reason (not built). - Wall display at /adm/ui-adm-012/display?board=<code> (ADR-HIS-079 point 2): - no control at all, large type, and pages of 12 cards that rotate every 20 seconds; - initials and bed under the initials-and-bed setting, even if a name was sent; - the isolation badge still shown, and no patient-detail call; - a refusal reads "This display is not configured for this board." - The board is read every 5 seconds, and its watermark goes to the status line.

UI-ADM-008 Emergency board (EmergencyBoard.tsx, TriagePanel.tsx, RapidRegistration.tsx, triage.tsx, board.tsx, api/boards.ts, api/emergency.ts): - Board: the same header, then the emergency flow states of the definition as columns in its order (D01-ADM 4.3). - "Waiting by category" groups the waiting column by triage category, in the scale's order. The unit's order is kept within each category. - Each row shows identity, the triage badge only (number and name, ruling 3), time in state, location and indicators. Its one action is "Open triage panel" (CUX-04). - Empty board: "No patients in the emergency department". - Triage panel: - opens one patient through readFlowState, readQueueItem and readPerson, with the patient context zone (counter variant, so no allergy claim the unit cannot make); - shows the current category and the previous one from the item's history; - "Set triage category" or "Change triage category to …" sends changeQueuePriority kind triage-category with If-Match and an idempotency key. The result names the previous category; - a patient in Triage with a category can be placed in the waiting queue (place); - the categories come from the value set adm.triage-category. While it cannot be read, triage cannot be set, and the panel says why; - disposition, the admission request, the clinical emergency workspace and the transfer panel are disabled with their reason. - Rapid registration (ADR-HIS-079 point 5): - find the patient by No. RM or NIK; - the arrival date and time in facility time (default now, never in the future), and the emergency queue (listQueues?arrivalType=emergency); - "Register emergency arrival" opens an emergency encounter at the arrival time (EMER, emergency-visit, source emergency), unless one is open here, then records the arrival. There is one key per step, and a lost answer is checked again with the same key; - the unit's PR-FLW-001-2 refusal is shown; - a new or unidentified patient, the arrival mode and downtime entry are disabled with their reason (FR-ADM-REG-004, FR-ADM-FLW-003, slice RC-4), with a link to Patient registration.

UI-ADM-011 Configuration console (ConfigurationConsole.tsx, SchedulingSections.tsx, Lifecycle.tsx, TemplateForm.tsx, CalendarForm.tsx, ConfigurationItems.tsx, dialogs.tsx, registry.ts, model.ts, api/config.ts). It has six sections: - Appointment templates; - Resource calendars; - Scheduling parameters; - Queues and priority rules; - Bed constraints and turnover; - Board definitions.

What each section does: - Templates and calendars, the OV-18 admin template: - the version list (item, version, state, effective period, facility or department); - the version header (version, state, effective period, author, approver) and the definition, with "Not set" for no value; - the impact panel: affected appointments of this item from listAffectedAppointments, none cancelled; - compare between two versions field by field, and the history list; - the draft form, for a new item or a new version from the one shown. References come from the D10 registry, never edited here; - overlapping patterns are refused before sending with "Availability overlaps an existing pattern."; - dated exceptions (leave, maintenance, closure) in the calendar's time zone, listing the overlapped appointments for rescheduling; - "Approve version": a confirmation summary (item, effective date, what it replaces, resulting state; Cancel focused, Enter does not confirm), then the PH-03 sign step. The stepped-up credential is sent with the decision only. Three failed attempts cancel the sign step. The author cannot approve ("You wrote this version. A different approver is required."), and approval is disabled without re-authentication; - "Retire version" with its confirmation summary; - validate, submit, return, activate and roll back are disabled with their reason (scheduling.v1 has no operation for them). - Queues and boards: the definitions in force, read-only from flow.v1. Drafting is disabled with its reason (no D10 item type yet), with a link to UI-ESS-011. - Scheduling parameters (CFG-ADM-016 to 018): "Not set", with the same reason and link. - Beds: no contract yet (MOD-ADM-006, slice RC-3). The bed state rules are shown as hard.

Shared files. - As identical copies of UI-ADM-007's (ADR-HIS-078 point 4): api/http.ts in 008 and 012; api/persons.ts, failure.tsx, intents.ts, ui.tsx, time.ts, fake-gateway.ts and check-against-stubs.sh in all three; navigation.tsx in 008 and 012; patients.tsx, api/terminology.ts and api/flow.ts in 008. - board.tsx and api/boards.ts are identical in 008 and 012 (ADR-HIS-079 point 1). - UI-ADM-011's api/http.ts is UI-ADM-007's with the accountId and stepUp hooks of UI-ESS-011.

ADR-HIS-079 records the six rules. Its row is in the decision record index, which now holds 75 records.

Checks and their result

Check Command Result
Type check pnpm build in web/domains/adm passed
Component and accessibility tests pnpm test in web/domains/adm 146 passed, 14 skipped (the eight stub test files). New: UI-ADM-008 15, UI-ADM-011 18, UI-ADM-012 12
The pipeline's web jobs web/shell/scripts/ci.sh web/domains/adm, web/shell/scripts/ci.sh web/shell passed; the shell bundles EmergencyBoard, ConfigurationConsole and FlowBoards; screen discovery passes
Against the contract stubs each new folder's stubs.test.tsx against his-contract serve contracts/adm and contracts/ess passed: UI-ADM-008 1 test, UI-ADM-011 3, UI-ADM-012 2; neither stub recorded a violation
Static analysis platform/delivery-pipeline/bin/static-analysis web/domains/adm/UI-ADM-008 web/domains/adm/UI-ADM-011 web/domains/adm/UI-ADM-012 no blocking finding
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

How the stub check was run. The host's Node.js 22.22.1 has no TypeScript type stripping, which his-contract needs (as RC-2-S07 found). So: 1. The ADM and ESS stubs ran in node:22.18-bookworm, each with node src/cli.ts serve contracts/<domain> --port 4010 --host 0.0.0.0, published on the host's loopback. 2. Each stubs.test.tsx ran on the host with HIS_ADM_STUB_URL and HIS_ESS_STUB_URL, after POST /__stub/reset. 3. GET /__stub/violations answered [] on both.

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

What the stubs can and cannot show: - The ADM stub's only board example is a clinic board, so UI-ADM-008's stub test shows the empty emergency state and covers rapid registration. The triage panel and the triage change are covered by the component tests, and against the built unit by RC-2-S10. - The stub answers a template revision with its example (an Active version), so approval through the stub is not shown. It is covered by the component tests.

"Ends when", line by line: - Each screen meets its brief and the clinical UX safety rules: see the lists above, the tests below, and "Differences". What the contracts, the shell or D10 do not offer yet is shown disabled 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). Controls are labelled and keyboard operable through React Aria (UX-ADM-002), and states are text with a symbol, never colour alone (UX-ADM-005). - The screen works against the stubs of the contracts: the stubs.test.tsx of each folder, as above. - The change touches only the folders of its screens: git diff --name-only origin/main lists web/domains/adm/UI-ADM-008/, UI-ADM-011/ and UI-ADM-012/, this handover, ADR-HIS-079 and the decision record index.

Requirements, test scenarios and tests

Tests are in UI-ADM-008/EmergencyBoard.test.tsx, UI-ADM-011/ConfigurationConsole.test.tsx and UI-ADM-012/FlowBoards.test.tsx, and in each stubs.test.tsx. Each describe names its requirement and test scenario.

Requirement Scenario What the screens do Tests
FR-ADM-FLW-002 TEST-ADM-025 Boards with counts, As at and the status line; stale from the unit and by age; not-current states; groups and cards; unit change and filter; open patient with the authorization refusal; wall display read-only with initials and bed, rotating pages, display refusal; emergency columns and waiting by category "UI-ADM-012 ward board (workstation)" (5), "clinic board, change unit and filter" (2), "opening a patient without authorization" (2), "wall display" (3); "UI-ADM-008 emergency board" (4); stub tests of 012 (2) and 008
FR-ADM-FLW-001 TEST-ADM-024 Triage set or changed in the panel only, with the previous category, If-Match and key; place after triage; triage scale unavailable; role refusal; rapid registration with encounter and arrival, open encounter reused, future time refused, lost answer checked with the same key, PR-FLW-001-2 shown "UI-ADM-008 triage panel" (5), "rapid registration" (6); stub test of 008
FR-ADM-SCH-001 TEST-ADM-020 Versions with OV-18 words; header, definition, impact, history, compare; draft version with If-Match and key; new template from the registry with blocked incomplete draft; approval with summary and sign step, author refused, no sign step, three failures, unit refusal; retire; calendar patterns, overlap refused, dated exception in facility time with affected appointments "UI-ADM-011 appointment templates" (4), "approval with the sign step, and retirement" (7), "resource calendars" (3); stub tests of 011 (2)
FR-ADM-FLW-001, FR-ADM-FLW-002 (configuration) Queue and board definitions read-only with drafting disabled and the D10 link; parameters Not set; beds not yet available; privilege refusal "UI-ADM-011 queue and board definitions, parameters and beds" (4); stub test of 011
NFR-ADM-008 WCAG 2.2 AA rules with axe-core on each screen state expectNoAxeViolations in all three test files

FR-ADM-REG-004 and FR-ADM-FLW-003 (rapid and unidentified registration, downtime entry, disposition; TEST-ADM-009, 026, 033, 036) are slice RC-4. The screen shows them disabled, and their tests come with RC-4.

Safety rules with a test of their own: - CUX-04: no triage change in a row, and no state change from a card; - CUX-47 and UX-ADM-008: initials and bed on the wall display, no action and no patient-detail call; - CUX-53, BR-ADM-024: As at, stale and not current; - CUX-10, CUX-11, CUX-12: confirmation summaries with Cancel focused and the action repeated; - PH-03: re-authentication on approval, three attempts; - CUX-35, CUX-36: one key per intent, lost answers checked with the same key; - CUX-51: "Not set", never zero; - PR-SCH-001-1 and 2: nothing cancelled, appointments keep their version.

Safety: triage routing and queue order and the flow boards are safety-critical functions of D01-ADM 11.1. The unit orders and projects. The screens show the order and the board as given, never re-sort or edit them, and set triage only in the one-patient panel. The card has no "Safety" row.

Differences from the brief, the contract or the design

  • Rapid registration takes a patient already in the index. Registration of a new or unidentified patient (name or "Unidentified", sex, date of birth or estimated age), the arrival mode and the downtime arrival are disabled with their reason. registration.v1 says the emergency unidentified workflow of FR-ADM-REG-004 is not registerPatient, and the contracts/adm README places it in RC-4. A new person with a name can be registered in UI-ADM-001.
  • The emergency encounter's class and type are the codes UI-ADM-001 and the RC-2 scenario already send (EMER, emergency-visit). They are not read from a value set.
  • Arrival time is the encounter's startTime. flow.v1 records the arrival at the time it is recorded.
  • Disposition, admission request, the clinical emergency workspace, the transfer panel, the encounter console and the bed board are disabled with their reason: no contract or screen yet.
  • Read-only and degraded modes come from the shell banner, which gives a screen no signal yet (as in RC-1-S21 and RC-2-S07). Rapid registration is not withdrawn in read-only mode until it does.
  • Wall display runs inside the shell frame, which still shows its navigation. A display frame is a shell follow-up (ADR-HIS-079).
  • Indicators:
  • isolation shows "Isolation in force" without the precaution type, which flow.v1 does not carry;
  • time in state has no overdue mark, since there is no overdue flag or threshold in the contract;
  • the similar-name indicator is not shown, because it needs the PH-01 name score of identity policy, which no board field carries.
  • The triage badge is neutral, with the number and name. The scale's colours (CFG-ADM-028) are not served.
  • The patient context zone in the triage panel is the counter variant, so it shows no allergy status. Domain 1 cannot read allergies, and "Not assessed" would be a false statement.
  • OV-18 in scheduling.v1: no In review, Rolled back or validation step. Approval makes a draft Approved, and Active on its date. Validate, submit, return, activate and roll back are disabled with their reason. A draft is saved once; changing it means a new draft version.
  • Queue and board definitions, CFG-ADM-016 to 018: read-only, or "Not set", until D10 registers their item types. Bed configuration has no contract yet.
  • The author check compares the signed-in account (accountId, the token's sub) with the version's createdBy. The unit decides in any case.
  • English only, like the other ADM screens.

Questions for a person

None about behaviour. Every behaviour the screens show is settled by the briefs, the contract points of contracts/adm/README.md ("RC-2-S08"), and the answers to Q-RC2-1 to Q-RC2-7 on #46. Access is decided by the units and the policy decision point. What the contracts do not offer is shown disabled, not guessed.

The registrations below are to be made by their owners, not questions the session can answer: - adm.triage-category, by clinical governance; - the configuration item types of CFG-ADM-016 to 021.

Follow-ups outside the card

  • Design system:
  • the board component of OV-04 (header, card, indicators, three layouts, two modes), replacing board.tsx in UI-ADM-008 and UI-ADM-012;
  • the triage badge bound to CFG-ADM-028;
  • the select, radio group, notice, disabled action with reason, checkbox and tabs, as RC-2-S07 listed;
  • the patient context zone with a partial date of birth.
  • Shell:
  • a wall-display frame under the display-device identity of FR-ESS-IAM-003;
  • a step-up hook offered to screens;
  • the read-only and degraded-mode signal;
  • the service client and navigation with context of ADR-HIS-078.
  • ADM contracts (compatible minor versions):
  • flow.v1: the precaution type on the isolation indicator, an overdue flag, a similar-name indicator, the board's filters and display devices, and a queue's call display flag;
  • the arrival mode;
  • scheduling.v1: a signature reference on decide…Version;
  • emergency and unidentified registration and disposition (RC-4 contract session).
  • D10:
  • the value set adm.triage-category;
  • the configuration item types and content schemas of CFG-ADM-016 to 021, so UI-ADM-011 can draft them through configuration.v1;
  • the display-device identities of the boards.
  • RC-2-S10 (integrate): run the three check-against-stubs.sh, or the same tests against the built adm-scheduling-flow unit. The emergency layout and triage need a configured emergency board and the igd-triage queue.
  • RC-3 and RC-4: UI-ADM-008's admission request, disposition, rapid and unidentified registration and downtime entry; UI-ADM-011's bed section; UI-ADM-012's ways to UI-ADM-003, UI-ADM-004 and UI-ADM-009.
  • This host: the system Node.js has no type stripping. his-contract and check-against-stubs.sh need node:22.18-bookworm or a newer Node.js.