Implementation plan / Session plan / Handover RC-4-S05
Handover RC-4-S05 Screens: ESS screens (slice RC-4)¶
Card: RC-4-S05. Issue: cema-care/his#172. Branch: session/RC-4-S05. Slice: RC-4. Decision record: ADR-HIS-124.
What was built and where¶
One screen, UI-ESS-005 Emergency access review workspace. It is in web/domains/ess/UI-ESS-005/. Apart from this handover and ADR-HIS-124, the change touches nothing else.
| Route | /ess/ui-ess-005 (the review queue) and /ess/ui-ess-005/session/<sessionId> (one session's review), as ADR-HIS-117 point 1 expects |
| Shell workspace | W14 Privacy, security and audit, context: "none" (the review draws the patient context zone itself, as UI-ESS-008 does) |
| Users | Privacy officer and security officer (FR-ESS-AUZ-002 part 3) |
| Contracts | contracts/ess emergency-access.v1 1.1, workflow.v1 (listTasks, reassignTask), audit.v1 (searchAuditEvents, listIntegrityVerifications), identity.v1 readAccount; contracts/adm patient-identity.v1 readPerson |
The folder follows the layout of the other ESS screens:
screen.ts;api/http.ts, UI-ESS-008's service layer, unchanged but for its comment;api/review.ts, one function per contract operation;model.ts, the presentation rules;- the views:
ReviewWorkspace.tsx, the workspace and the queue;SessionReview.tsx, the patient, the session detail, the outcome form and reassignment;Activity.tsx, the embedded audit query;Patterns.tsx, the pattern panel;people.tsx, names beside references;ui.tsx, UI-ESS-008's layout pieces, unchanged;failure.tsx, the Shell 13 states in the screen's words;test-support.ts, a fake gateway with synthetic examples;ReviewWorkspace.test.tsx, the component and accessibility tests;stubs.test.tsxandcheck-against-stubs.sh.
What the screen does, against the specification entry:
- Review queue. In the row anatomy of the work list (OV-01): item, patient (name and No. RM, PH-01), due time with "Overdue · [duration]", priority, state, assignee and source.
- The rows are the review tasks of workflow.v1 (task type
ess.emergency-access-review), earliest due first. - An overdue session whose task does not exist yet (PR-AUZ-002-3) is added as "Review task not created yet" (ADR-HIS-124 point 2).
- The header shows "As at" and turns stale after 15 minutes (CUX-53).
- When the queue is empty, it says "No emergency access sessions waiting for review".
- Session detail.
- The patient context zone. A merged patient is shown under the surviving record, with the merge notice.
- The session: user, role (
subjectRole), unit (careSetting), facility, reason, justification, resource type, start, and end or expiry with the cause, state, review due, escalation, and a link to the decision trace. - Badges for Emergency access, the state, "Started while access checks were unavailable" (CUX-67) and "Overdue · [duration]". "Active" is shown as "In force" (F-44).
- Activity list. UI-ESS-008's result table and evidence view, filtered by the session, with "Open in audit workspace" (
/ess/ui-ess-008/session/<sessionId>). - It is read with the purpose
privacy-investigationand the text "Emergency access review of session …", and the screen says so. - Opening it is audited by the audit service.
- Pattern panel. Sessions per user, per unit or per patient over the default 90 days. It starts with the session's user, can be widened to all users, and marks this session's group.
- Outcome form.
- "Start review" (
openEmergencyAccessReview), then the three outcomes, each with what it does, and the comment. - Recording asks for a confirmation that names the outcome. The first focus is on "Cancel", and Enter does not confirm (CUX-11, CUX-12, UX-ESS-006).
- It is disabled, with the reason:
- while the session is in force;
- for the reviewer's own session;
- once an outcome is recorded.
- "Inappropriate" requires a comment. Afterwards, "Referred to security monitoring as a security incident" and a focused link to UI-ISE-006 (ADR-HIS-124 point 5).
- "Appropriate with follow-up" shows the follow-up task, or that it will be created on recovery.
- Reassign.
reassignTaskwith a reason and the new reviewer's account identifier, sent with If-Match. - States. Loading, Empty, Error with the service desk reference and "Checking whether this was saved" (CUX-36), Stale, No permission (what was tried, the role, who grants access), "Access cannot be checked" (CUX-67), and Not found or moved.
Checks and their result¶
Web packages ran with the host's Node.js 22.22.1 and pnpm 10.34.9 through corepack. The host's Node.js cannot run the TypeScript contract tool, so check-against-stubs.sh ran in node:22.18-bookworm with CI=true, as RC-3-S21 and RC-3-S23 did. The integration environment was not needed: the script serves the stubs itself.
| Check | Command | Result |
|---|---|---|
| Type check | pnpm build in web/domains/ess |
Passed |
| Component and accessibility tests of the screen | pnpm exec vitest run UI-ESS-005 in web/domains/ess |
26 passed; the 3 stub tests are skipped there |
| All the workspace's tests | pnpm test in web/domains/ess |
285 passed, 31 skipped (the stub tests of every screen); 0 failed |
| Against the ESS and ADM contract stubs | web/domains/ess/UI-ESS-005/check-against-stubs.sh (in node:22.18-bookworm) |
3 of 3 passed, no violation recorded by either stub |
| The shell with the screen | pnpm build and pnpm test in web/shell |
Bundle built, with the ReviewWorkspace chunk; 19 passed, 1 skipped, the shared-version check and the screen discovery check passed |
| Secret scan | platform/delivery-pipeline/bin/secret-scan code origin/main and docs origin/main |
No secret found |
| Links and documentation site | python3 docs/implementation_plan/tools/check_links.py; mkdocs build |
0 broken, 0 duplicate anchors; site builds |
Accessibility is checked with axe-core on the queue, on the session review, and on the outcome confirmation while it is open. As in RC-3-S21, the test file sets vi.setConfig({ testTimeout: 30_000 }), because a screen session may not change vitest.config.ts.
How the "Ends when" lines are met:
- Each screen meets its brief and the clinical UX safety rules: the components, actions, validation rules, screen states and navigation of the specification entry, as listed above, each with a test in the table below.
- Component and accessibility checks pass:
pnpm test. - The screen works against the stubs of the contracts:
check-against-stubs.sh. - The change touches only the folders of its screens:
web/domains/ess/UI-ESS-005/, plus this handover and ADR-HIS-124.
Requirements and test scenarios¶
The card lists the screen and NFR-ESS-010. The requirements the specification entry cites are covered for their screen part. TEST-ESS-006 to TEST-ESS-009 belong to RC-4-S02, the build session. Where the screen shows a part of TEST-ESS-008 or TEST-ESS-009, the test names it.
| Requirement or rule | What the screen does | Tests (describe and it titles in ReviewWorkspace.test.tsx unless named) |
|---|---|---|
| FR-ESS-AUZ-002 part 3, PR-AUZ-002-4 | Reviewers only; not one's own session | "PR-AUZ-002-4 is disabled for the reviewer's own session"; "Shell 13 no permission …"; "works for the security officer too …"; the rules test "PR-AUZ-002-4 part 6.9 closes the form …" |
| FR-ESS-AUZ-002 part 6.9, D10-ESS 4.3 | Outcome only after Expired; start, then record once | "is disabled, saying why, while the session is in force"; "starts the review with If-Match, then records Appropriate …" |
| FR-ESS-AUZ-002 part 7 | Three outcomes; comment for Inappropriate | "requires a comment for Inappropriate, then takes the reviewer to security monitoring"; "part 7 requires a comment for Inappropriate only" |
| FR-ESS-AUZ-002 part 6.9, OV-27 | Follow-up task; referral to UI-ISE-006 | "links to the security incident when the service returns its reference"; "TEST-ESS-009 says the follow-up task …" |
| FR-ESS-AUZ-002 part 6.10, F-47 | Pattern panel per user, unit and patient, 90 days | "reads sessions per user for the session's user over the default period …"; stub test "opens the example session …" |
| TEST-ESS-008 (screen part) | Overdue and escalated reviews visible in the queue | "lists the review tasks earliest due first, with 'Overdue · [duration]' and the escalation …" |
| TEST-ESS-009 (screen part) | Session visible without its task; follow-up created on recovery | "TEST-ESS-009 puts an overdue session whose review task is not created yet in the queue …"; "TEST-ESS-009 says the follow-up task …" |
| FR-ESS-AUD-002, PR-AUD-002-2, OV-116 | Activity as the embedded audit query, with purpose | "embeds the audit query filtered by the session, with the stated purpose …"; "says when the audit service does not answer …" |
| FR-ESS-WFL-002, OV-01 | Queue of review tasks; reassign | "lists the review tasks …"; "says when nothing is waiting"; "reassigns the review task with a reason and If-Match"; stub test "lists the review queue …" |
| CUX-67 | "Started while access checks were unavailable" | "CUX-67 marks a session started during a policy-service outage" |
| Shell 13 Not found or moved | Merged patient under the survivor with the notice | "Shell 13 not found or moved: a merged patient opens under the surviving record …"; "says so when the session is not found" |
| CUX-36 | A lost outcome checked with the same key | "CUX-36 checks whether a lost outcome was saved …" |
| UX-ESS-001, NFR-ESS-010 | Keyboard and screen-reader paths, no axe violation; one queue, one review view, the reason beside every disabled action | The three tests that call expectNoAxeViolations; usability with representative reviewers is not a component test (below) |
Done differently from the specification or contract, and why¶
- "Inappropriate" does not open an incident, and the screen does not move by itself. The emergency access service cannot open a D02 incident yet and leaves
securityIncidentIdabsent (ADR-HIS-120 point 6, question on #169). The screen says the outcome was referred. It offers a focused link to the security monitoring console, or to the incident once there is a reference. The shell SDK offers screens no navigation call (ADR-HIS-124 point 5). - The queue and the activity list are copies in the folder, not the shared components: the work list of UI-ESS-010 and UI-ESS-008's query view are not in the design system, and screens import nothing from each other (ADR-HIS-124 points 2 and 3).
- Overdue sessions without a review task are added to the queue. The specification's queue is the work list of the review tasks. A session whose task waits to be created would otherwise be out of sight (ADR-HIS-124 point 2).
- The new reviewer is entered as an account identifier. No contract lists the accounts that hold a reviewer role.
- NFR-ESS-010 is designed for, not measured. Its usability measure needs representative reviewers. The screen keeps to one queue and one review view, shows the reason beside every disabled action, and is checked for keyboard and screen-reader paths.
Needs a person¶
The card names no approval or review.
- Enterprise Architecture Board: approval of ADR-HIS-124.
- No question is left for this card. The open question on #169 (the security incident of an Inappropriate outcome) belongs to RC-4-S02. Its answer changes this screen only if it asks for something other than the referral and the link.
Follow-ups outside the card¶
- UI-ESS-008 (
people.tsx): the name cache can miss a read that ends before the component subscribes, so the name stays "Person ID …". This screen corrects its copy (ADR-HIS-124 point 7). UI-ESS-008, and any copy made from it, needs the same few lines. - Design system (FN-S06 owner):
- the layout pieces of
ui.tsx; - a radio group with a description per option (the outcome choice, built in
SessionReview.tsx); - the OV-01 work list and the P10 audit query view, so that UI-ESS-005 configures them instead of copying them.
- Shell SDK: a navigation call for screens, so that "Inappropriate" can take the reviewer to UI-ISE-006 by itself.
- UI-ISE-006 (ISE screens): serve an incident by its reference once
security-monitoring.v1has incidents. Today the path segment is read as an alert identifier. - Identity (MOD-ESS-001 contract owner): a list of the accounts holding the privacy or security officer role, for choosing the new reviewer when reassigning.
- RC-4-S06 (integrate): run the review through this screen against the built ess-runtime-decision. The development realm needs
dev.privacyanddev.security(RC-4-S01 follow-up), and the privacy officer's token needsacr: aal2(RC-4-S02). - Usability (NFR-ESS-010, UX-ESS-001): a usability session with privacy and security officers, before go-live.