Implementation plan / Session plan / Handover RC-2-S09
Handover RC-2-S09 Screens: ESS screens (UI-ESS-006)¶
Card: RC-2-S09. Issue: cema-care/his#54. Branch: session/RC-2-S09. Slice: RC-2. Decision record: ADR-HIS-080.
What was built and where¶
One new screen folder, web/domains/ess/UI-ESS-006/. Nothing else in web/ was changed.
| Part | What | Calls |
|---|---|---|
| A, consent directive panel (shared component) | ConsentDirectivePanel, exported from index.ts for the shell to offer to host screens (ADR-HIS-070 point 1), with consentLines and useConsentLines for the host's consent lines |
contracts/ess consent.v1: all seven operations. terminology.v1 expandValueSet. master-data.v1 listOrganizations, identity.v1 listRoles and registry.v1 listExternalSystems, for recipients |
| B, privacy request workspace | The screen "Privacy requests", in W14 Privacy, security and audit, nav order 30, item context: /ess/ui-ess-006, and /ess/ui-ess-006/conflict/<taskId> from a task link |
workflow.v1 listTasks (queueId=ess.privacy-review, taskType=ess.consent-conflict-review), readTask; consent.v1 readConsentDirective; contracts/adm patient-identity.v1 readPerson |
| Preview of Part A | /ess/ui-ess-006/panel/<patientRef>; ?counter=1 for a counter workstation, ?officer=1 for the privacy officer. The patient is read from Domain 1 for the reference in the address and named above the panel and in its confirmations, never taken from the shell's patient in context |
As Part A, and patient-identity.v1 readPerson |
Part A (DirectivePanel.tsx, DirectiveForm.tsx, History.tsx, model.ts, lines.ts, lists.tsx):
- Directive list. One line per consent type of the model, with the PH-02 labels:
- no directive: "Not recorded";
- Active: "Recorded", from its start;
- Proposed with outstanding attributes: "Recorded, incomplete". The line says which attributes are missing, says the directive is not used to permit access, and offers "Record consent" to complete it (PR-CNS-001-4);
- Proposed and complete: "Recorded · applies from [date]" (Q-RC2-5);
- Withdrawn, with its date and time; Expired, with its end;
- Entered in error: the shared Shell 5 display (name, time, reason), struck through (CUX-09);
- Superseded: in the history only;
- a directive in conflict also shows "Under privacy review" (PR-CNS-001-2).
- Actions, each as the brief's table says:
- "Record consent" on a type with no current directive (recordConsentDirective), or on a proposed line (recordConsentDirectiveVersion);
- "Record new version" on an active directive;
- "Withdraw consent", with a confirmation summary;
- "Mark entered in error", offered only with privacyOfficer, with a confirmation summary and a required reason;
- "Show history": every version newest first, with author, channel, recorded and effective time.
- Every change sends If-Match with the version shown and one Idempotency-Key per intent. After a lost answer the panel says "Not known whether this was saved" and offers "Check again", with the same key (CUX-35, CUX-36).
- Confirmation summaries (CUX-11, CUX-12):
- they name the patient (from the shell's patient in context, or the host's patient), the directive and version, and the time it applies from;
- the confirming button repeats the action, Cancel has the focus, and Enter does not confirm;
- the withdrawal summary says that it affects decisions after its effective time only, deletes nothing, does not stop disclosures the law requires and does not recall copies already released (BR-ESS-012);
- the effective time defaults to now and may not be earlier.
- The form (FR-ESS-CNS-001 part 7):
- decision; purposes; scope with only the parts the type allows (data categories, labels, "this encounter only" where the host has an encounter, a period); recipients where the type allows them, found in their register;
- valid from (now by default, may be in the future, as WF-ESS-003 allows) and valid until, within the type's maximum;
- legal basis; given by: the patient, or a representative with name, relationship and authority;
- a new version keeps the encounter limit of the version it starts from, shown as "Keep the limit of version N …" and checked. It is never dropped where the host has no encounter, nor moved to the host's encounter; removing it is the user's choice, with a warning that the directive then covers more (ADR-HIS-080 point 5);
- every code is a member of the value set the model names. Entered dates and times are wall times in the facility zone, sent as UTC instants;
- missing fields are named before sending (DAT-002), and nothing is sent. The provider's part 10 messages are shown at the field their pointer names, as the provider words them;
- a list that cannot be read stops the form, with its reason and "The form you came from can still be saved."
- Screen states:
- loading;
- error: a 403 gives the Shell 13 text;
- read-only (readOnly): history only, with the reason;
- consent service unavailable (503, a lost answer, or access not checkable): every line "Not recorded" with the reason and "Try again", and no recording. The host is not blocked.
- for the host's lines (useConsentLines), a refusal is told apart from unavailability: a 403 gives no lines and the refusal text, never "Not recorded".
- Counter workstation (counter, CUX-47, CUX-48): the list shows type and state only, and "Show details" opens scope, labels and the rest per line.
- The patient's name is not repeated in the panel (CUX-01): the host's patient context zone shows it. The enterprise identifier is never shown.
Part B (PrivacyWorkspace.tsx, View.tsx):
- Queues. Two tabs:
- "Data subject requests": not available, with its reason. "Register request" is disabled with its reason, because consent.v1 version 1 has no FR-ESS-CNS-003 operation (CONTRACT-POINTS);
- "Consent conflicts": the work list row anatomy of OV-01 (item, patient name and No. RM, due, priority on the glossary's scale, state, assignee, source), open tasks only, sorted by due time, with the overdue symbol and its duration (Shell 9). The header has "As at [time]" with the stale indicator after 5 minutes, which is also reported to the status line, and "Refresh". The empty state reads "No consent conflicts waiting for review."
- Conflict detail:
- the patient read from Domain 1 in the header (brief, assumption 6), with state, due and priority;
- the conflicting directives side by side, with their detail;
- "Open directives" opens Part A for that patient, with the privacy officer's actions and the channel privacy-office. After a change, the conflict and the queue are read again.
- The opened conflict is kept in the address (Shell 3 rule 5).
Shared files, as identical copies (ADR-HIS-078 point 4, ADR-HIS-080 point 7):
- api/http.ts is UI-ESS-009's;
- intents.ts and time.ts are UI-ADM-008's;
- ui.tsx is UI-ESS-009's, with a radio group, a checkbox group and a date-and-time field added;
- check-against-stubs.sh is UI-ESS-009's.
Decision record: ADR-HIS-080. It covers: - how Part A is offered; - the consent model (CFG-ESS-010) as a host input that names value sets, never codes; - what the host and the provider each decide; - the rule that the host is never blocked; - one rule for lines and states; - Part B within version 1.
Its row is in the decision record index, which now holds 76 records. ADR-HIS-073 and 075 to 077 are taken by the open branches of RC-2-S02, RC-2-S04, RC-1-S26 and RC-2-S05, so this record is 080.
Checks and their result¶
| Check | Command | Result |
|---|---|---|
| Type check | pnpm build in web/domains/ess |
passed |
| Component and accessibility tests | pnpm test in web/domains/ess |
223 passed, 22 skipped (the stub test files). New: UI-ESS-006 31 |
| The pipeline's web jobs | web/shell/scripts/ci.sh web/shell |
passed; the shell bundles the screen |
| Against the contract stubs | UI-ESS-006/stubs.test.tsx against his-contract serve contracts/ess and contracts/adm |
3 passed; neither stub recorded a violation |
| Static analysis | platform/delivery-pipeline/bin/static-analysis web/domains/ess/UI-ESS-006 |
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 and RC-2-S08 found). So:
1. The ESS and ADM stubs ran in node:22.18-bookworm, each with node src/cli.ts serve /repo/contracts/<domain> --port 4010 --host 0.0.0.0, published on the host's loopback.
2. stubs.test.tsx ran on the host with HIS_ESS_STUB_URL and HIS_ADM_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 terminology stub knows only its example value set (fornas). The value sets of the PH-02 model are not registered in D10 yet, so through the stub, with the PH-02 model, the form shows that it cannot be completed, and says why. That is the first stub test.
- The second stub test uses a model that names fornas for every list. It records a first directive, records a new version, withdraws and marks entered in error, all through the stub.
- The stub's task example is not a consent conflict, so Part B through the stub shows the queue and opens an item. The side-by-side view and "Open directives" are covered by the component tests, and against the built unit by RC-2-S10.
"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 or not available, with its reason.
- Component and accessibility checks pass: pnpm test.
- Every test of a full screen state, and the two dialogs, runs expectNoAxeViolations (WCAG 2.0 to 2.2 A and AA; NFR-ESS-010, UX-ESS-001).
- Controls are labelled and keyboard operable through React Aria.
- States are text with a symbol, never colour alone. Validation messages are in caution colours, never red (CUX-15).
- The screen works against the stubs of the contracts: stubs.test.tsx, as above.
- The change touches only the folders of its screens: git diff --name-only origin/main lists web/domains/ess/UI-ESS-006/, this handover, ADR-HIS-080 and the decision record index.
Requirements, test scenarios and tests¶
Each describe names its requirement and test scenario.
| Requirement or rule | Scenario | What the screen does | Tests |
|---|---|---|---|
| FR-ESS-CNS-001 parts 3, 6.2 to 6.4, 6.6, 6.9, 7, 10; PR-CNS-001-1, PR-CNS-001-4 | TEST-ESS-012 | Part A: lines and states, record, new version (keeping its encounter limit), complete a proposed directive, withdraw, entered in error, history, field checks and the provider's messages; the host's lines on refusal and unavailability | DirectivePanel.test.tsx (22), stubs.test.tsx |
| PR-CNS-001-2 (conflict) | TEST-ESS-012 | "Under privacy review"; Part B conflict queue and side-by-side detail opening Part A | DirectivePanel.test.tsx, PrivacyWorkspace.test.tsx |
| FR-ESS-CNS-003 (Part B) | none in the card | The data subject request queue not available with its reason; "Register request" disabled | PrivacyWorkspace.test.tsx, stubs.test.tsx |
| BR-ESS-012, BR-ESS-013; CUX-09, CUX-11, CUX-12 | TEST-ESS-012 | Withdrawal summary and its wording; entered in error kept and struck through; every change a new version with If-Match; Cancel focused, Enter does not confirm | DirectivePanel.test.tsx "Withdraw consent and Mark entered in error" |
| CUX-35, CUX-36 | One key per intent; "Check again" with the same key | DirectivePanel.test.tsx |
|
| CUX-47, CUX-48 | Counter workstation: type and state only, detail on demand | DirectivePanel.test.tsx |
|
| CUX-01, CUX-11 (preview) | The preview names the patient read for the address's reference, and opens nothing until read | PrivacyWorkspace.test.tsx |
|
| OV-09, PH-02 | One line per type; host's lines from consentLines; the host never blocked when consent or a list is unavailable |
DirectivePanel.test.tsx |
|
| NFR-ESS-010, UX-ESS-001 | axe-core WCAG 2.2 AA on every full state and dialog | every test file |
The card names no test scenario of section 15.2. TEST-ESS-012 is the scenario of FR-ESS-CNS-001, so the Part A tests carry it.
Differences from the specification or the contract¶
None in behaviour. These are choices where neither the brief nor the contract decides, all recorded in ADR-HIS-080:
- The consent model is a host input, with PH_02_CONSENT_MODEL as the placeholder for the preview and the tests. No contract serves CFG-ESS-010. The scope parts and recipient kinds given per type follow FR-ESS-CNS-001 part 4 and PH-02. The configuration item is what decides them.
- The value set identifiers the model names are proposals. They are D10 registrations to make, and they are listed under follow-ups. Until they exist, recording is not possible against the real terminology service, and the form says why. Registration and the host are not blocked: consent never gates care (PH-02).
- "Who may record" is learned from the provider's refusal. The host can also pass readOnly. The shell gives a screen no policy decision to ask first. "Mark entered in error" is offered only when the host says the user acts as privacy officer (brief, assumption 4); the provider still decides.
- Evidence is shown, not captured. The document registry contract (IF-ESS-011) is not written yet. A new version keeps the evidence reference of the version it starts from.
- The withdrawal reason is free text ({ text }). The brief says "Code or text" and names no list, as ADR-HIS-078 point 7 provides.
- Part B's conflict queue is the folder's own table in the OV-01 row anatomy. UI-ESS-010's work list is not offered to screens through the SDK yet (ADR-HIS-071 point 2), and a folder imports nothing from another.
Questions for a person¶
None. No clinical, financial or access behaviour was left open. Each choice above is about how the screen is built, and the specification decides what it does.
Follow-ups outside the card¶
- D10 registrations (a D10 session or configuration):
- the value sets
ess.consent-purpose,ess.consent-legal-basis,ess.consent-data-category,ess.security-label,ess.communication-channel,ess.representative-relationshipandess.representative-authority-basis; - a CFG-ESS-010 configuration item type whose content is a
ConsentModel; - the recording channel
privacy-office. - contracts/ess (a later ESS contract session):
- a read of the active consent model in
consent.v1; - the data subject request operations of FR-ESS-CNS-003, as the README plans. Part B then lists them in the tab that now says they are not available.
- Shell (a session owning
web/shell): - offer
ConsentDirectivePanelthrough the SDK, with the active model; - a policy decision a screen can ask before offering a write;
- jsdom's
CSS.escapestand-in in the workspace kit (as RC-1-S25 noted). - UI-ADM-001 (an ADM screen session or fix): replace the disabled "Record consent" and the fixed consent lines of
RegistrationForm.tsxwithuseConsentLinesand the panel, once the shell offers it. - Design system: the radio group, checkbox group and date-and-time field of
ui.tsx, with the other copied pieces. - RC-2-S10 (integrate): run Part A and Part B against the built
ess-runtime-decision(RC-2-S02), with a conflict task from PR-CNS-001-2, and the value sets above registered.
Review round 1¶
The review agent asked for three changes, all made:
1. A new version could drop or move an encounter scope. It now keeps the encounters of the version it starts from, shows the limit, and removes it only on the user's visible choice (DirectiveForm.tsx, model.ts scopeOf; ADR-HIS-080 point 5). Test: "keeps the encounter limit of the version shown".
2. The preview named the shell's patient while writing to the address's patient. The preview now reads the patient from Domain 1 for that reference, names them, and opens nothing until they are read (View.tsx; ADR-HIS-080 point 1). Tests: the two "Part A preview" tests of PrivacyWorkspace.test.tsx.
3. useConsentLines showed a refusal as "Not recorded". A refusal now has its own state with the Shell 13 text (lines.ts; ADR-HIS-080 point 4). Test: "tells the host a refusal apart from an unavailable service".
After these changes the checks above were run again: type check, 223 tests, and the stub test (3 passed, no violation).