Skip to content

Implementation plan / Session plan / Handover RC-1-S23

Handover RC-1-S23 Screens: ESS screens (part 1 of 3)

Card: RC-1-S23. Issue: cema-care/his#37. Branch: session/RC-1-S23. Decision record: ADR-HIS-070.

What was built and where

Three folders in the ESS workspace. Beyond them the change adds only this handover, ADR-HIS-070 and its row in the decision record index.

Folder Screen Kind Contract
web/domains/ess/UI-ESS-001/ UI-ESS-001 Sign-on and step-up authentication Shared component; preview registration (example, no navigation) The IF-ESS-002 token profile of contracts/ess/README.md; no API (OIDC against Keycloak)
web/domains/ess/UI-ESS-002/ UI-ESS-002 Identity and access administration workspace Screen in W18 Administration, route /ess/ui-ess-002 contracts/ess/api/identity.v1.openapi.yaml
web/domains/ess/UI-ESS-004/ UI-ESS-004 Access-restricted and Break-the-Glass dialogue with session indicator Shared component; preview registration (example, no navigation, patient context) contracts/ess/api/emergency-access.v1.openapi.yaml

How the shared components reach the shell (ADR-HIS-070). No other screen may import a screen folder, and this card may not change web/shell. So each shared component is a library with a public surface, its folder's index.ts, which the shell imports when a shell session mounts it. Its screen.ts registers only a preview, which production builds leave out.

UI-ESS-001

  • authenticator.ts, the port to the identity provider.
  • The outcomes are deliberately coarse: one "failed" for any wrong input (PR-IAM-002-4), one "not available" for every account that may not sign on, plus "second factor", "no factor" and "privileged refused while degraded".
  • Badge and PIN on a shared workstation; security key or device biometric on a personal device.
  • The views never store, log or show a credential, and clear it once the port has answered.
  • SignOn.tsx: views 1 and 2 (sign-on, second factor), the recovery instructions, and the system banner for training and degraded sign-in.
  • views.tsx: view 3 step-up dialog, views 4 and 5 lock screen and fast user switch, view 6 expiry warning with "Sign in again" in place, view 7 sign-out confirmation.
  • QuickFactor.tsx: the quick factor, and QuickFactorField, which has the shape of UI-ESS-004's quick factor slot.
  • SessionGate.tsx, which ties the views together:
  • the idle lock: 10 minutes on a desktop, 5 on a workstation on wheels or a handheld;
  • the 12-hour end, with a warning 10 minutes before;
  • the 5-minute step-up window of PH-03 (model.ts stepUpAsks), which ends at a lock or a switch;
  • each user's work under their own session, so a switched-out user's work is suspended and hidden, not handed over (CUX-39);
  • revocation returns to view 1 with "not available".
  • SessionContent, the content area slot. Views 3, 6 and 7 are drawn inside it, never over the global bar, the patient context zone or the system banner; the content behind a dialog is inert.
  • useWorkforceSession() gives stepUp, lock, requestSignOut and sessionRevoked.
  • synthetic-authenticator.ts: synthetic accounts for the preview and tests only. It follows the provider's rules: five failed full sign-ins block an account (CFG-ESS-002), and three failed PINs close the badge path (CUX-66).
  • words.ts: English and Bahasa Indonesia.

UI-ESS-004

  • api/http.ts and api/emergency-access.ts: the service layer (the pattern of RC-1-S21 and RC-1-S22) and the operations start, list, read, end, suspend and resume. Purpose of use ETREAT. A stepped-up credential is used for one call only.
  • EmergencyAccessDialogue.tsx, drawn in the content area where the record would be (UX-ESS-002, OV-24). It shows:
  • the identity line of CUX-02;
  • the reason codes, and the justification where the reason needs it;
  • the quick factor slot, only after 5 minutes without authentication;
  • the audit and window statement.

"Open with emergency access" is disabled, with its reason beside it, until the conditions hold; it is never the default and Enter does not press it. The screen states of section 6.3 are covered: no permission, excluded category, audit path not confirmed (503), access checks unavailable (read only), and a lost answer (CUX-36). - EmergencyAccessIndicator.tsx: - "Emergency access · [time] left", purple; amber with "Extend emergency access" in the last 10 minutes; - it cannot be dismissed, and "End emergency access" asks once; - indicatorFlag gives the patient context zone's flag; - the time is expiresAt minus now, so a lock or a switch does not stop it. - EmergencyAccessGate.tsx, which a domain screen wraps around a record it could not open: - the dialogue, then the record with the indicator; - at expiry the record closes at once to "Restricted information not shown", and onEnded lets the host keep drafts (CUX-31). - session-control.ts: sign-out ends the user's own sessions in force and suspended (cause signed-out); a fast user switch suspends them; the same user's return resumes them. It acts only on sessions whose subject is the user. - model.ts, words.ts (English and Bahasa Indonesia), quick-factor.ts (the slot), ui.tsx, Preview.tsx.

UI-ESS-002

UI-ESS-002 was built by a subagent of this session in its folder, and reviewed and checked here.

  • api/http.ts and api/identity.ts: 25 identity.v1 operations. No X-Facility is sent, because identity is enterprise-scoped. signedInAccountId() takes the host's accountId setting, or else the token's sub.
  • IdentityWorkspace.tsx with five tabs and deep links: accounts/<id>, service-identities/<id>, access-requests/<id>, recertification/<id>, roles/<id>. A task opens the item through them.
  • Accounts.tsx, AccountDetail.tsx, AccountForms.tsx: the list and detail, and the account actions:
  • create, save changes, activate, suspend with security hold, reinstate, deactivate, reactivate, unblock, reset factors, end all sessions;
  • request and revoke a role assignment.
  • ServiceIdentities.tsx: the register, with the "Owner no longer active" and "Rotation overdue" flags; request, approve, suspend and retire.
  • AccessRequests.tsx: one request per page, with Approve and Reject.
  • Recertification.tsx: campaigns with progress, due date and default action; items with Confirm access and Revoke access; "Export campaign evidence".
  • Roles.tsx: role definitions, read-only with their version header (OV-26).
  • CommandDialog.tsx: one confirmation for every command:
  • the impact summary of UX-ESS-006 for suspend, deactivate, revoke and end sessions;
  • focus starts on Cancel, the button repeats the action, Enter does not confirm;
  • one idempotency key per intent, and "Checking whether this was saved" after a lost answer.
  • model.ts, failure.tsx, ui.tsx, hooks.ts.
  • No self-approval (BR-ESS-006): decision buttons are disabled with the reason when the signed-in account is the subject. The 400 messages of FR part 10 are shown as the provider words them.

Checks and their result

Node.js is not installed on this server. Every Node.js check ran in the node:22-bookworm container with pnpm 10.34.9 through corepack, as earlier sessions did. The integration environment was not needed: each stub check serves the ESS contract stub itself.

Check Command Result
Type check pnpm build in web/domains/ess Passed
Component and accessibility tests pnpm test in web/domains/ess 95 passed (UI-ESS-001: 26, UI-ESS-002: 40, UI-ESS-004: 29). The 9 stub tests are skipped there, as designed
UI-ESS-002 against the ESS contract stub web/domains/ess/UI-ESS-002/check-against-stubs.sh 6 of 6 passed; the stub recorded no violation
UI-ESS-004 against the ESS contract stub web/domains/ess/UI-ESS-004/check-against-stubs.sh 3 of 3 passed; the stub recorded no violation
The shell with the three screens pnpm build and pnpm test in web/shell Bundle built (IdentityWorkspace and the two Preview chunks); 19 passed and 1 skipped, plus the shared-version and screen-discovery checks
Static analysis platform/delivery-pipeline/bin/static-analysis on the three folders No blocking finding
Secret scan platform/delivery-pipeline/bin/secret-scan code origin/main and docs origin/main No finding
Documentation links python3 docs/implementation_plan/tools/check_links.py Passed

UI-ESS-001 has no stub check, because IF-ESS-002 has no API and the component must not call identity.v1 to sign on (CONTRACT-POINTS). Its tests drive the port with the synthetic authenticator, and its tokens follow the token profile (sub, auth_time, acr).

Accessibility (axe-core, WCAG 2.0 to 2.2 A and AA) runs on: - every view of UI-ESS-001: sign-on, second factor, lock, step-up, expiry warning and sign-out; - the dialogue, its states and the indicator of UI-ESS-004; - the lists, details and open confirmations of UI-ESS-002.

Each check runs on the view or dialog element, not on the document body.

Requirements and test scenarios

Every test names its requirement and test scenario in its describe title, and the rule it checks in its it title (session rule 5).

Requirement Test scenario Tests (describe titles)
FR-ESS-IAM-002 TEST-ESS-002 UI-ESS-001: FR-ESS-IAM-002 TEST-ESS-002 UI-ESS-001 sign-on and second factor (views 1 and 2), … lock, unlock and fast user switch (views 4 and 5, Shell 7), FR-ESS-IAM-002 FR-ESS-AUZ-001 TEST-ESS-002 UI-ESS-001 step-up dialog (view 3, PH-03), FR-ESS-IAM-002 FR-ESS-AUZ-002 TEST-ESS-002 UI-ESS-001 session end (views 6 and 7), FR-ESS-IAM-002 UX-ESS-001 UX-ESS-004 UI-ESS-001 locale and registration. UI-ESS-002: FR-ESS-IAM-002 TEST-ESS-002 UI-ESS-002 unblock, factor reset and end all sessions, and against the stub
FR-ESS-IAM-001 TEST-ESS-001 UI-ESS-002: FR-ESS-IAM-001 TEST-ESS-001 UI-ESS-002 accounts list and detail, … create account, … account lifecycle, and against the stub. UI-ESS-001: the revoked session (PR-IAM-001-3)
FR-ESS-IAM-003 TEST-ESS-003 UI-ESS-002: FR-ESS-IAM-003 TEST-ESS-003 UI-ESS-002 service identities, and against the stub. UI-ESS-001: FR-ESS-IAM-003 TEST-ESS-003 UI-ESS-001 service identities (no interactive sign-on)
FR-ESS-IAM-004 TEST-ESS-004 UI-ESS-002: FR-ESS-IAM-004 TEST-ESS-004 UI-ESS-002 access requests, … recertification, … role definitions (OV-26), and against the stub
FR-ESS-AUZ-002 TEST-ESS-006, TEST-ESS-007 (screen part) UI-ESS-004: FR-ESS-AUZ-002 TEST-ESS-006 UI-ESS-004 Break-the-Glass dialogue, FR-ESS-AUZ-002 FR-ESS-IAM-002 UI-ESS-004 quick re-authentication inside the dialogue (PH-03, CUX-43), FR-ESS-AUZ-002 TEST-ESS-007 UI-ESS-004 screen states, FR-ESS-AUZ-002 TEST-ESS-007 UX-ESS-003 UI-ESS-004 session indicator, … sign-out, fast user switch and return (PR-AUZ-002-6, CUX-45), FR-ESS-AUZ-002 UI-ESS-004 registration; against the stub FR-ESS-AUZ-002 TEST-ESS-006 TEST-ESS-007 UI-ESS-004 against the contract stub. UI-ESS-001: FR-ESS-AUZ-002 UI-ESS-001 the quick factor in the Break-the-Glass dialogue of UI-ESS-004
FR-ESS-AUZ-001 (step-up obligation, override outcome) The step-up dialog of UI-ESS-001; the Restriction input of UI-ESS-004

TEST-ESS-008 (overdue review) and TEST-ESS-009 (invocation while notification and workflow are down) concern the provider and the review workspace UI-ESS-005. The screens add nothing to them.

Safety duty, emergency access. What enforces each part of the duty:

  • Time-limited. The indicator counts down from the service's expiresAt on the wall clock, and closes the record on the screen at expiry even before the service has recorded it.
  • Reason-captured. "Open" stays disabled until a reason is selected, and the justification is entered where the reason needs it.
  • Audited. Every call carries a correlation ID and an idempotency key, and the dialogue states the audit.
  • Reviewed. Review is the service's and UI-ESS-005's.
  • Never wider than the patient in context. A session is invoked for the one patientRef in context. Session control acts only on the user's own sessions, and the screen never asserts startedWhileChecksUnavailable.

The screens grant nothing themselves: the emergency access service and the policy decision service decide every time.

NFR-ESS-010 Usability was a design input:

  • Break-the-Glass takes one reason, text only for "Other", the quick factor only when it is due, and no navigation away;
  • every status is in words, never colour alone;
  • each button names its effect;
  • every disabled action says why;
  • keyboard operation throughout (React Aria);
  • English and Bahasa Indonesia.

The NFR's measure is a task-based usability test with representative users, which a session cannot run. It belongs to the slice's readiness work.

Differences from the brief, specification or contract, and why

  • The shared components are not mounted in the shell yet. The card limits the change to the screen folders. They run in their previews and tests, and a shell session mounts them as ADR-HIS-070 describes. Until then, CUX-44 (the flag in the zone, the bar and the band) and UX-ESS-003 (visible in every application) are met by the indicator component but not yet shown by the shell.
  • The sign-on views talk to a port. The Keycloak adapter does not exist yet, and it depends on the badge PIN becoming a factor (PH-03 ruling 1). The views, the rules and the outcomes are built and tested; the binding is a follow-up.
  • Extension while the session is in force (Q4 on #15, still open). The spec offers "Extend emergency access" 10 minutes before the end. Version 1 of IF-ESS-004 answers a repeat invocation while a session is Active with that same session.
  • The screen asks for the new reason and invokes, then says what the service did: "Emergency access was not extended. The current session continues until [time]". It never shows a longer window than the service gives.
  • After the end, extension is a new invocation, which reopens the record with a new window.
  • When Q4 is answered, only the provider changes.
  • How a domain screen tells the dialogue why access was refused. The common 403 carries no override outcome and no decisionId, so the gate takes them as an input (Restriction).
  • The CFG-ESS-006 reason codes and the CFG-ESS-007 window are inputs. configuration.v1 names no item type for the reason codes. The preview uses the specified values (CFG_ESS_006_REASONS, 240 minutes).
  • The Bahasa Indonesia labels of the reason codes are this session's translations, for the glossary owner to confirm.
  • Re-authentication for Break-the-Glass. The service's 403 "re-authentication required" also brings up the quick factor, whatever the token's auth_time said. Without a quick factor from the host, nothing opens.
  • UI-ESS-002, gaps in identity.v1. The following are not shown, because version 1 has no field for them:
  • an identity-source availability indicator: a "Marked for reconciliation" badge comes from lastChangeSource.pendingReconciliation instead;
  • a list of an account's sessions: "End all sessions" is offered for Active and Blocked accounts;
  • an account history: only the source of the last change is shown;
  • the campaign's default action: the CFG-ESS-005 rule is shown as text;
  • If-Match on the recertification decision: none is sent.
  • UI-ESS-002, preconditions with no field. The contract does not record "reinstatement approved", "leaver confirmed" or "identity verification recorded". The dialog requires a reason or verification method before sending.
  • UI-ESS-002, actions added. "Activate account" and "Reactivate account" are in the contract and section 4.3 but not in the brief's actions table. Q3 below asks the design owner to confirm them.
  • UI-ESS-002, actions not offered. updateServiceIdentity, openRecertificationCampaign, recordServiceIdentityRotation (Domain 2's) and submitIdentitySourceEvent (a system interface) are not in the brief.
  • UI-ESS-002, the evidence export (REP-ESS-004) is a client-side CSV of readRecertificationEvidence, marked Confidential. The contract has no file export.
  • UI-ESS-002, routed decisions take the restrictive reading. Only the approver a request or item is routed to gets enabled decision buttons (Q2 below). When the signed-in account cannot be identified, every decision is disabled with the reason.
  • Locked screen and hidden work. A locked or suspended user's work stays mounted but hidden (hidden, out of the accessibility tree), so drafts survive a lock and a switch. Nothing of it is visible on the lock screen.

Questions for a person

None blocks this session. Each is posted on issue #37 and listed under "Needs a person" in the pull request. They stay open for their owners, and the screens keep the interim readings in the last column.

In review round 1, the session first settled Q1 to Q3 by its own judgement, and recorded the emergency-access review and the approval of ADR-HIS-070 as given in the session. The review asked for that to be undone, and it was (the revert of commit 737b251): - the specification gives these answers to their owners (session rule 3); - the review and the approval have no record that can be checked.

They are given on the merged work by the people named.

# Question Owner What the screen does now
Q1 Q4 on #15 still applies: while a session is in force, does "Extend emergency access" end it and start a new window and review, or does the session run on to its own expiry? Security and Privacy Office, Clinical Governance It invokes and shows the service's answer. Under version 1 the session is not extended, and the screen says so
Q2 FR-ESS-IAM-004: may an approver other than the one a request or recertification item is routed to decide it, for example the identity administrator? Security and Privacy Office Only the routed approver decides, never the subject (BR-ESS-006). The provider's 403 is the backstop
Q3 UI-ESS-002: are "Activate account" (Pending activation to Active) and "Reactivate account" (Deactivated to Pending activation, a rehire under WF-ESS-001) wanted on the screen? They are in identity.v1 and section 4.3, but not in the brief's actions table Domain 10 design owner Both are offered to the identity administrator, with a confirmation

Follow-ups outside the card

  • Shell (a session owning web/shell), per ADR-HIS-070:
  • mount SessionGate and SessionContent, the indicator in the global bar and the zone (indicatorFlag), and the gate;
  • pass QuickFactorField to UI-ESS-004;
  • call the session control at sign-out, at a user switch and on return;
  • offer stepUp through the SDK;
  • expose the signed-in account ID in ShellState.user, which UI-ESS-002 now reads from the token's sub;
  • add the CSS.escape stand-in to workspace-kit/test-setup.ts.
  • Identity provider (platform, Keycloak realm his): the Keycloak adapter of Authenticator, using authorization code with PKCE and never the password grant; the badge-PIN factor; and the acr and amr claims the token profile names.
  • contracts/common: carry the override outcome (deny-override-available, or the reason it is not available) and the decisionId on a 403, so every domain screen can fill Restriction.
  • contracts/ess (compatible minor versions):
  • configuration.v1: an item type for the CFG-ESS-006 reason codes, with their "needs text" flag and the justification's minimum length;
  • identity.v1: an identity-source status, a manual-entry-with-approval mark on create, an account's sessions, an account history, the campaign's default action, If-Match on the recertification decision, and an account search for pickers;
  • an extend operation, once Q4 is answered.
  • Design system:
  • the dialog frame of OV-24 inside a content slot;
  • the confirming button that ignores Enter;
  • notice, summary, select, checkbox, radio group, masked field, disabled action with reason, and time with UTC;
  • the command dialog of UI-ESS-002.

Today they are copied in each screen folder. - Glossary: the Bahasa Indonesia of the sentences in the two words.ts files that have no glossary entry, and of the reason code labels. - Shell SDK service client: the api/http.ts copies in UI-ESS-002 and UI-ESS-004 move there with the others. - RC-1-S26 (integrate): it may run the two check-against-stubs.sh scripts beside the slice scenario, since the pipeline does not run them.