Implementation plan / Session plan / Handover RC-2-S07
Handover RC-2-S07 Screens: ADM screens (part 1 of 2)¶
Card: RC-2-S07. Issue: cema-care/his#52. Branch: session/RC-2-S07. Slice: RC-2. Decision record: ADR-HIS-078.
What was built and where¶
This session added three screen folders to the ADM workspace and changed nothing else in web/. All three are in the Front desk workspace W09 with context none. Each opens without a patient and draws the patient context zone itself once it has one (ADR-HIS-069 point 6).
| Folder | Screen | Nav order | Calls (contracts/adm) |
|---|---|---|---|
web/domains/adm/UI-ADM-005/ |
UI-ADM-005 Scheduling workspace | 20 | scheduling.v1: listAppointmentTemplates, searchSlots, bookAppointment, listAppointments, readAppointment, rescheduleAppointment, cancelAppointment, checkInAppointment, recordAppointmentNoShow, listAppointmentRequests, decideAppointmentRequest, listResourceCalendars, addAvailabilityException, listAffectedAppointments; flow.v1 listQueues (check-in); patient-identity.v1 searchPersons, readPerson |
web/domains/adm/UI-ADM-006/ |
UI-ADM-006 Waitlist management | 30 | scheduling.v1: listWaitlistEntries, readWaitlistEntry, createWaitlistEntry, changeWaitlistPriority, listWaitlistProposals, offerWaitlistSlot, respondToWaitlistOffer, closeWaitlistEntry, listAppointmentTemplates; searchPersons, readPerson; contracts/ess terminology.v1 expandValueSet (value set adm.clinical-urgency) |
web/domains/adm/UI-ADM-007/ |
UI-ADM-007 Queue console | 5 (the W09 home of Shell 3) | flow.v1: listQueues, listQueueItems, readQueueItem, recordArrival, actOnQueueItem, changeQueuePriority; searchPersons, readPerson; encounters.v1 listEncounters |
Every change sends If-Match from the version read, every command carries an idempotency key per intent, and a lost response is checked again with the same key (CUX-35, CUX-36).
UI-ADM-007 Queue console (QueueConsole.tsx, QueueTable.tsx, ItemPanel.tsx, ArrivalPanel.tsx, model.ts, api/flow.ts):
- Service point bar.
- The queues of the facility, with counts by state and "As at" (CUX-53).
- The watermark goes to the status line, stale after 5 minutes. The list reloads every 30 seconds.
- "Call next patient" calls the head of the queue. It is disabled while this desk has a called or in-service patient ("Finish with queue number … first: one called patient per desk."), whichever row is open.
- Ordered queue.
- The rows keep the unit's rule order. Each shows position, queue number, name and No. RM (PH-01), arrival type, triage, state, arrival and waiting time, the priority basis in words, and the override mark with actor, approver and reason.
- There is no allergy, diagnosis or alert (CUX-48).
- Row actions are the list moves of ruling 4: "Call this patient", "Claim", "Override position", "Priority flags", "Open".
- A call that is not the head of the queue needs a reason. A 403 shows "Supervisor authority required. A registration supervisor can approve it." (Q-RC2-3).
- An item awaiting triage reads "Awaiting triage" and "Triage category required.", and cannot be called.
- While a row is open or a row form is in use, a newer order is not applied. A notice offers "Show the new order".
- Current patient panel.
- The full identity line comes from
readPerson, so the date of birth is there to check, in the design system's zone, counter variant. The panel also shows the time since the call, the call count, waiting and service durations, linked items and the item's history. - Only the next valid actions of the state are offered (D01-ADM 4.3).
- "Start service for [name]" is enabled only after "The patient gave this name and date of birth" is ticked. It follows the part 10 message "Ask the patient's name and date of birth, then start service for (patient name)", and sends
patient(AC-06). - Cancel needs a reason.
- The unit's state-specific refusal is shown, and the item is read again.
- Record arrival.
- Find the patient by No. RM or NIK, then choose the open encounter at this facility, the arrival type the queue accepts, and the clerk's priority flags.
- Scheduled arrivals come from check-in. "Aged 60 or more" is derived by the unit (Q-RC2-2).
- A duplicate (400 on
/encounterId, PR-FLW-001-2) shows the unit's message and the existing item. - A patient without an open encounter is sent to Patient registration.
UI-ADM-006 Waitlist management (WaitlistView.tsx, EntryPanel.tsx, AddEntry.tsx, model.ts, api/waitlist.ts, api/terminology.ts):
- Clinical urgency is the governed value set, read, not written in the screen (FR-ADM-SCH-004 part 7; review round 1; ADR-HIS-078 point 7).
- The members come from the D10 terminology service (
expandValueSetofadm.clinical-urgency). The screen offers them with their displays and sends the member's own system and code. - While the set cannot be read, urgency cannot be set or changed, and the control says why: "The clinical urgency value set cannot be read from the terminology service, so urgency cannot be set or changed now." "Add to waitlist" cannot be completed; the other changes of an entry stay possible.
-
A record's urgency is shown with its own display, then the value set's, then the code.
-
List header. The waiting list selector, counts, "As at", "Refresh list" and "Add to waitlist".
- Saved views.
- "Waiting": Active entries, in policy order.
- "Offers": released slots with the proposed entries by position, and the entries Offered.
- "Referral expiring or expired".
- Rows (OV-01).
- Each row shows the position with the basis of the order (policy attributes), the override mark, name and No. RM, urgency as a category, referral validity with its flag, state, date placed and waiting time, and availability.
- There is no sort control, and the only row action is "Open entry".
- Entry work area.
- The patient zone and the entry details.
- "Save entry changes" sends the changed clinical urgency or referral validity with a reason. Without a reason it is blocked with "Enter the reason for the priority change.".
- "Override priority" sends a position and a reason. A 403 shows "Supervisor authority required. …".
- The read-only priority change history shows actor, time, change, before and after values and positions, and reason.
- Offer panel.
- It shows the proposed or offered slot, the position, the answer-by time, and the referral flag. An expired referral reads "Referral expired on (date).".
- The actions are "Offer slot", "Book offered slot" (hands patient, template, slot and entry to UI-ADM-005), "Patient declined…" with the patient's reason, and "Withdraw offer" disabled with its reason.
- Close entry with a closing reason and a note.
- Add to waitlist takes the patient (No. RM or NIK), appointment type, waiting list, clinical urgency (a member of the governed value set), referral and availability days and times. It is also reached from UI-ADM-005 with the patient and service. The unit's answer to a duplicate is shown.
UI-ADM-005 Scheduling workspace (SchedulingWorkspace.tsx, SlotSearch.tsx, BookPanel.tsx, AppointmentDetail.tsx, Worklists.tsx, model.ts, api/scheduling.ts). It has four tabs:
- Appointments.
- Find the patient (No. RM or NIK), then see the zone and the patient's current and future appointments.
- Slot search. Choose the service and appointment type and the period in whole facility days. The slots are shown by day, with every resource, location and capacity.
- "Patient has another appointment at this time" marks a slot with a patient conflict, without its content.
- "Preparation step not scheduled: (step)" marks a slot with an unmet preparation step.
- Full slots are asked for, and offered as "Overbook slot", only where the template allows overbooking.
- When nothing fits: "No slots found" with the unit's unmet dependencies.
- Booking.
- The overlap is shown again before confirmation.
- The referral is asked for where the template requires it.
- An overbooking needs a reason, and "Supervisor approves here" is shown disabled.
- "Slot is no longer available." and other refusals are shown as the unit words them.
- Appointment detail.
- It shows status, time, resources, location, referral, warnings, cancellation, No. Registrasi, the reminders with their delivery status, and the history.
- "Appointment committed; reminder not yet sent." shows while a reminder is pending.
- Its actions: Reschedule (new slot, and a reason from the governed list), Cancel (who cancelled, and the reason), Check in (the service point queue), Mark no-show (with a reason; the unit's automatic rule of CFG-ADM-016 is stated), and Add to waitlist.
- After check-in it offers "Open queue console", which hands over the queue and the item.
- It also opens with a waitlist offer handed over by UI-ADM-006 ("Book offered slot", booked with
waitlistEntryId). - Patient requests. The pending worklist shows kind, patient, received, the state in staff words ("Submitted") and the channel. The detail offers:
- "Book requested slot";
- "Offer another time", which runs a slot search with several times selected;
- "Decline request" with a governed reason.
A 404 reads "This request is no longer open. It may have been withdrawn by the patient." - Affected appointments. Time, patient, cause and listed time. "Open appointment" opens it with the patient in context, to reschedule from there. The list says none is cancelled automatically. - Availability exception. Resource, kind, from and to in the facility's time, and reason. The answer lists the overlapped appointments, each one to open ("None is cancelled automatically; reschedule each one.").
Shared by the three folders, as identical copies (ADR-HIS-078 point 4): api/http.ts and ui.tsx (both identical to UI-ADM-001's), api/persons.ts, failure.tsx, intents.ts, navigation.tsx, patients.tsx, time.ts, fake-gateway.ts, check-against-stubs.sh. Each folder also has stubs.test.tsx.
ADR-HIS-078 records three interim rules: supervisor approval (OV-20), the handoff between screens, and patient lines in rows. Its row is in the decision record index, which now holds 74 records. Numbers 073, 075, 076 and 077 are held by the open pull requests of RC-2-S02, RC-2-S04, RC-1-S26 and RC-2-S05, so this record is 078.
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 |
101 passed, 8 skipped (the five stub test files, which need a stub). New: UI-ADM-005 20, UI-ADM-006 15, UI-ADM-007 20 |
| The pipeline's web jobs | web/shell/scripts/ci.sh web/domains/adm, web/shell/scripts/ci.sh web/shell |
passed. The shell bundles SchedulingWorkspace, WaitlistView and QueueConsole; shared versions and screen discovery pass |
| Against the contract stubs | each folder's stubs.test.tsx against his-contract serve contracts/adm and contracts/ess |
passed: UI-ADM-005 2 tests, UI-ADM-006 1, UI-ADM-007 2; neither stub recorded a violation |
| Static analysis | platform/delivery-pipeline/bin/static-analysis web/domains/adm/UI-ADM-005 web/domains/adm/UI-ADM-006 web/domains/adm/UI-ADM-007 |
no blocking finding |
| Secret scan | platform/delivery-pipeline/bin/secret-scan code origin/main HEAD and secret-scan docs origin/main HEAD |
no secret. A first wording of ADR-HIS-078 tripped the generic-api-key rule (a false positive); it was reworded and the unpushed commit amended, so no commit holds it |
| 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. In node:22.18-bookworm, check-against-stubs.sh would have had to reinstall the host's node_modules (pnpm refuses to purge them without a TTY). So the same steps were run by hand:
1. The ADM and ESS stubs ran in node:22.18-bookworm: 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 set to them, after POST /__stub/reset on both.
3. GET /__stub/violations answered [] on both after each run.
The ESS stub holds only its example value set (fornas), so it answers adm.clinical-urgency as not found. The stub tests therefore take the unavailable path: UI-ADM-006's has urgency disabled and changes the referral validity instead; UI-ADM-005's has declining disabled and books the requested slot instead.
check-against-stubs.sh runs exactly these steps on a host whose Node.js strips types.
The stub keeps commands on an appointment only for its example record, so UI-ADM-005's stub test checks in the listed example appointment, not the one it just booked. This is the RC-2-S01 follow-up "stub seeding of sub-resources from the record their collection created".
"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 contract or the shell does not offer yet is shown disabled, with its reason.
- Component and accessibility checks pass: pnpm test. Every test that renders a full screen state runs expectNoAxeViolations (WCAG 2.0 to 2.2 A and AA; NFR-ADM-008). Every control is labelled and keyboard operable through React Aria (UX-ADM-002), and no state is shown by colour alone.
- The screen works against the stubs of the contracts: stubs.test.tsx in 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-005/, UI-ADM-006/ and UI-ADM-007/, this handover, ADR-HIS-078 and the decision record index.
Requirements, test scenarios and tests¶
Tests are in UI-ADM-005/SchedulingWorkspace.test.tsx, UI-ADM-006/WaitlistView.test.tsx and UI-ADM-007/QueueConsole.test.tsx, and in each stubs.test.tsx. Each describe names its requirement and test scenario.
| Requirement | Scenario | What the screen does | Tests |
|---|---|---|---|
| FR-ADM-SCH-001 | TEST-ADM-020 | Ad hoc availability exception in facility time; overlapped appointments listed, none cancelled; affected-appointment worklist opened with the patient in context | "UI-ADM-005 availability exception and affected appointments" (2); stub test 2 |
| FR-ADM-SCH-002 | TEST-ADM-021 | Reasons from the governed lists, actions disabled while a list cannot be read; book with referral and idempotency key; appointment detail with reminders, delivery status and history; "Appointment committed; reminder not yet sent."; reschedule with reason and If-Match; cancel with canceller and reason; check-in to the queue and exit to the console; no-show with reason; add to waitlist; book a waitlist offer; the patient request worklist with book, offer another time and decline; withdrawn request | "UI-ADM-005 appointment lifecycle" (9), "UI-ADM-005 patient request worklist" (3), "UI-ADM-005 governed reason lists" (2); stub tests 1 and 2 |
| FR-ADM-SCH-003 | TEST-ADM-022 | Slot search over facility days with the patient; slots by day and resource; "No slots found" with the unmet dependency; patient conflict marked and shown before confirmation; overbooking only where allowed, with a reason, 403 as "Supervisor authority required." | "UI-ADM-005 multi-resource slot search" (4); stub test 1 |
| FR-ADM-SCH-004 | TEST-ADM-023 | Policy order with its basis, no re-sort, open-only rows; override mark; referral view; urgency offered from the governed value set only, and not settable without it; priority change blocked without reason, then sent with reason and If-Match; override refused as "Supervisor authority required."; released capacity with proposed entries, offer; "Referral expired on (date)."; decline with reason; book offered slot handed to UI-ADM-005; close with reason; add to waitlist; duplicate shown | "UI-ADM-006 waitlist in policy order" (4), "entry work area" (3), "offers on released capacity" (4), "add to waitlist" (2), "governed clinical urgency" (2); stub test |
| FR-ADM-FLW-001 | TEST-ADM-024 | Ordered queue with basis, counts, As at, stale threshold; override mark; awaiting triage not callable; empty queue and no service point; rows held while one is open; call the head with If-Match; one called patient per desk; panel with name, No. RM and date of birth; start only after the identity check, sending the patient, from the panel only; state-specific refusal; cancel with reason; out-of-order call with reason and the supervisor refusal; claim; lost response checked with the same key; override with reason and position, the governed reason or words alone; priority flags with the derived older-adult flag kept; record arrival, duplicate, no open encounter; opening from check-in | "UI-ADM-007 ordered queue" (6), "call and current patient panel" (7), "override and priority flags" (3), "record arrival" (4); stub tests 1 and 2 |
| NFR-ADM-008 | WCAG 2.2 AA rules with axe-core on each screen state; labelled controls, keyboard operation (React Aria), status in text and symbol | expectNoAxeViolations in all three test files |
Safety rules with a test of their own: - CUX-04 and ruling 4: no start from a row; start from the one-patient panel after the identity check. - CUX-48: no clinical data on the counter. - CUX-53: freshness and the status line. - CUX-34 and CUX-35: one key per intent, and the button pending while it runs. - CUX-36: a lost response checked with the same key. - BR-ADM-018 and BR-ADM-019: an override never silent, a reason mandatory, the supervisor refusal. - OV-01: a row offers no patient-level action. - PR-SCH-001-1: nothing cancelled automatically. - DEC-ADM-002: the person identifier is never displayed and never in a URL.
Safety: the triage routing and queue order are a safety-critical function of D01-ADM 11.1. The unit orders the queue and applies the rule. The screen shows the order as given, never re-sorts it, holds it still while a row is open, and makes every override visible. The card has no "Safety" row.
Differences from the brief, the contract or the design¶
Shown on screen, disabled with their reason, until their contract or component exists:
- In-place supervisor approval (OV-20, CUX-64) for overbooking, waitlist override and queue override. The step-up dialog of UI-ESS-001 is not built, and the contracts carry no approver. The command is sent under the signed-in user's own authority and the policy decision point decides (ADR-HIS-078 point 1).
- "Withdraw offer" (brief [A]). scheduling.v1 has no transition out of Offered other than the answer, closure or expiry.
Other differences:
- Waiting list selector. scheduling.v1 1.0 has no list of the waiting lists (CFG-ADM-018), so UI-ADM-006 offers the lists its facility's entries name. A list with no entry yet cannot be chosen until one is added through another list's service.
- Patient lines in rows are read with
readPerson, one read per person (ADR-HIS-078 point 3). Each is audited by the unit asadm.person.view. - Patient lookup in the three screens is by No. RM or NIK, the PH-01 search keys. Search by name and registration of a new person are in UI-ADM-001, to which the screens point.
- The patient context zone is drawn by the screen, as in RC-1-S21 (ADR-HIS-069 point 6).
- The identity check before "Start service" is a tick box, "The patient gave this name and date of birth", under the part 10 message. Ruling 4 asks staff to ask; the tick makes the check a deliberate step before the button is enabled. The unit checks
patientin any case. - The triage badge shows the category's text in a neutral badge. The colours of the adopted triage scale (ruling 3, CFG-ADM-028) are configuration that no contract serves yet. Triage is set by the triage nurse, not on this console.
- "Under review", one of the staff words of UI-ADM-005, has no request state in scheduling.v1 (pending, booked, alternative-offered, declined). Pending reads "Submitted".
- A withdrawn request has no state either. A 404 on a decision reads "This request is no longer open. It may have been withdrawn by the patient."
- The requested slot of a patient request is an opaque slot identifier with no time in the contract. The detail says the request has a requested slot, and "Book requested slot" books it.
- No ticket is printed (brief [A]): no print service in the slice.
- Downtime and read-only states come from the shell banner, which has no signal for a screen yet (as in RC-1-S21).
- Governed lists are read, not proposed (review rounds 1 and 2; ADR-HIS-078 point 7). The first version of this pull request proposed codes for clinical urgency and for six reason lists, three of them in code systems of its own. The review refused that, rightly: the specification calls these lists governed, some of the proposed values were clinical justifications, and the override reason goes with moving a patient in the queue. Now:
- the screens read clinical urgency, the appointment change, cancellation and request-decline reasons, and the queue override reason from the D10 terminology service, and send the member's own system and code;
- while one of these lists cannot be read, an action that needs a member of it is disabled with its reason (reschedule, cancel, decline, urgency). The queue override reason is "code / text" (FR-ADM-FLW-001 part 7), so it is then sent as the user's words;
- reasons the specification gives no list for are the user's words, sent as text: overbooking, queue item cancellation, no-show, and the waitlist priority-change and offer-decline reasons.
No reason code and no code system of the screens' own is left. - English only, like the shell and RC-1-S21's screens.
Questions for a person¶
None about behaviour. The contract points of contracts/adm/README.md ("RC-2-S07") and the answers to Q-RC2-1 to Q-RC2-7 on #46 settled every behaviour the screens show. Access is decided by the units and the policy decision point, not by the screens.
The screens propose no member of a governed list. They read the lists from D10, and the people who own the lists register them: clinical governance for adm.clinical-urgency, the owner of the D01-ADM code lists for the four reason lists. Until they do, the actions that need a member are disabled and say why (ADR-HIS-078 point 7). These are registrations to be made, not questions the session can answer: the specification settles what each field is.
Follow-ups outside the card¶
- Shell SDK (
web/shell), as ADR-HIS-078 sets out: - navigation with context, which replaces
navigation.tsx; - the UI-ESS-001 step-up for OV-20;
- the service client and
openPatientof ADR-HIS-069.
The identical copies of point 4 then move.
- Design system (web/design-system):
- the items RC-1-S21 listed (select, radio group, notice, disabled action with reason);
- a triage badge bound to the CFG-ADM-028 scale (ruling 3);
- a checkbox and checkbox group, which these screens draw as native inputs;
- a tabs component, which the screens build on React Aria Tabs.
- ADM contract (contracts/adm, compatible minor versions; the README's "D10 registrations"): add appointment-request-decline-reason to the code lists. Also:
- patientDisplay on Appointment, WaitlistEntry and AppointmentRequest;
- a list of the waiting lists;
- the requested slot's time on AppointmentRequest;
- the approver of an override or overbooking once step-up exists;
- a withdraw-offer transition and an "under review" request state, if the owners confirm the brief's assumptions;
- contracts/common stub (RC-2-S01 follow-up): sub-resource commands on a record its collection created. UI-ADM-005's stub test would then check in the appointment it booked.
- D10 registrations:
- the value sets the screens read (ADR-HIS-078 point 7), with the code lists of the contracts/adm README behind them:
- adm.clinical-urgency, supplied by clinical governance. Until it exists, UI-ADM-006 cannot place an entry on a waiting list or change its urgency;
- adm.appointment-change-reason and adm.appointment-cancellation-reason. Until they exist, UI-ADM-005 cannot reschedule or cancel;
- adm.appointment-request-decline-reason, which is not yet in the README's list. Until it exists, a patient request cannot be declined;
- adm.queue-override-reason. Until it exists, the override reason is the user's words;
- the triage scale with its colours (CFG-ADM-028).
- RC-2-S10 (integrate): run the three check-against-stubs.sh, or the same tests against the built adm-scheduling-flow unit, beside the slice scenario.
- This host: the system Node.js (22.22.1) has no TypeScript type stripping, so his-contract and check-against-stubs.sh need the node:22.18-bookworm image or a Node.js build with type stripping.