Implementation plan / Session plan / Handover RC-1-S01
Handover RC-1-S01 Contract: Contracts and stubs: D10 ESS¶
Card: RC-1-S01. Issue: cema-care/his#15. Branch: session/RC-1-S01. Slice: RC-1.
What was built and where¶
Everything the D10 shared services offer to slice RC-1 is in contracts/ess/, in the layout of contracts/common/example/. The decisions are in ADR-HIS-048.
- Ten APIs (
api/*.v1.openapi.yaml), 176 operations:
| API | Interface and module | Operations |
|---|---|---|
policy-decision.v1 |
IF-ESS-003, MOD-ESS-002 | 5 |
emergency-access.v1 |
IF-ESS-004, MOD-ESS-002 | 8 |
identity.v1 |
IF-ESS-001, MOD-ESS-001 | 35 |
terminology.v1 |
IF-ESS-006, MOD-ESS-004 | 19 |
master-data.v1 |
IF-ESS-007, MOD-ESS-005 | 19 |
registry.v1 |
IF-ESS-007, MOD-ESS-010 | 8 |
audit.v1 |
IF-ESS-008, MOD-ESS-006 | 13 |
workflow.v1 |
IF-ESS-010, MOD-ESS-008 | 23 |
configuration.v1 |
IF-ESS-012, MOD-ESS-012 | 35 |
api-catalogue.v1 |
IF-ESS-014, MOD-ESS-012 | 11 |
- Nine events (
events/), each in the event catalogue with ESS as producer: IdentityChanged, PolicyUpdated, EmergencyAccessInvoked, TerminologyPublished, MasterDataChanged, AuditEventRecorded, TaskStateChanged, ConfigurationChanged and WorkflowInstanceStateChanged. - The audit intake schema
schemas/AuditEventSubmission.v1.schema.json. It is the body ofsubmitAuditEventand also the payload of the intake topichis.ess.auditintake.v1(typehis.ess.AuditEventSubmitted) that the service kit writes. - The token profile of IF-ESS-002 (OpenID Connect on Keycloak), in
contracts/ess/README.md. - Generated stubs in
stubs/, apackage.jsonandpnpm-lock.yamllinking@his/contract-tools, and the scriptsscripts/verify-stub.shandscripts/ends-when.sh. contracts/ess/TRACE.md: the trace of every contract field to a section 7.3 attribute, a requirement or a business rule.contracts/ess/CONTRACT-POINTS.md: the contract points each later session must meet. It covers RC-1-S04, S05, S06, S07, S15, S16 and S17, the screen sessions RC-1-S23 to S25, RC-1-S03 (what ADM uses from ESS), and every unit's enforcement point and audit emitter.- Section 7.3 of D10-ESS data, for approval by the domain leads:
- new entity sections DE-ESS-002, 003, 004, 008, 009, 010, 011, 012, 015 and 019;
- the master-data governance records (domain register entry and change proposal);
- additions to DE-ESS-001, 005, 006, 013 (with the audit service's quarantine, completeness, integrity and export records) and 018;
- a classification line for each, from section 9.3.
The section 7.2 rows of the newly detailed entities now link to their 7.3 sections. No new entity identifiers were introduced. - ADR-HIS-048 and its row in the decision record index (48 records).
The scenario test is not here. The card's Scope gives it to the last contract session of the slice, RC-1-S03, which writes e2e/scenarios/RC-1/ against the stubs of ESS, ISE and ADM. The stack names this folder as "stubs": ["ess"].
Checks and their result¶
In contracts/ess, with Node.js 22.18 and pnpm 10.34.9 (run through the node:22.18-bookworm image, since the host has no Node.js), after pnpm install --frozen-lockfile in contracts/common:
| Check | Command | Result |
|---|---|---|
| Conventions | pnpm build (his-contract lint .) |
passed |
Compatibility with origin/main, stubs up to date |
pnpm test (his-contract check .) |
passed ("contract ess: new") |
| Stub answers the provider contract test, no violations | scripts/verify-stub.sh |
passed, 454 cases, violations [] |
| The "Ends when" check, in the integration environment | HIS_SESSION=RC-1-S01, full profile, his-env env exported, scripts/ends-when.sh |
passed: check, stubs, verify with a synthetic token and again with a token of the realm his (user dev.registrar), and the nine event schemas registered in Apicurio twice (the second time unchanged) |
| Documentation links | python3 docs/implementation_plan/tools/check_links.py |
0 broken, 0 duplicate anchors |
| Documentation site | .venv/bin/mkdocs build |
passed |
How the "Ends when" lines are met:
- Contracts pass the compatibility check:
pnpm testagainstorigin/main. - Every contract field traces to a requirement, a business rule or a section 7.3 attribute:
contracts/ess/TRACE.md, with the 7.3 additions above. - Stubs run in the integration environment:
scripts/ends-when.shstep 3. - The scenario test: RC-1-S03's, as above.
Requirements and test scenarios¶
A contract session covers requirements by contract, not by test. Each requirement of the card's modules in RC-1, with the contract that serves it and the check that proves the contract:
| Requirement | Contract | Covered by |
|---|---|---|
| FR-ESS-AUZ-001 | policy-decision.v1, PolicyUpdated |
verify cases of decide, decideBatch, decideSearchFilter, readDecision, listPolicyVersions; event sample checked by check |
| FR-ESS-IAM-001, IAM-003, IAM-004 | identity.v1, IdentityChanged |
verify cases of the 35 identity operations |
| FR-ESS-IAM-002 | Token profile in contracts/ess/README.md (OpenID Connect) |
ends-when.sh step 3 uses a realm token; the claims acr, amr and auth_time are not issued by the development realm yet (follow-up) |
| FR-ESS-TRM-001, TRM-002 | terminology.v1, TerminologyPublished |
verify cases of the 19 terminology operations |
| FR-ESS-MDM-001 to MDM-003 | master-data.v1, MasterDataChanged |
verify cases of the 19 master-data operations |
| FR-ESS-REG-001 | registry.v1 |
verify cases of the 8 registry operations |
| FR-ESS-AUD-001, AUD-002 | audit.v1, AuditEventSubmission.v1, AuditEventRecorded |
verify cases of the 13 audit operations |
| FR-ESS-WFL-001, WFL-002 | workflow.v1, TaskStateChanged, WorkflowInstanceStateChanged |
verify cases of the 23 workflow operations |
| FR-ESS-CFG-001, CFG-002 | configuration.v1, ConfigurationChanged |
verify cases of the 35 configuration operations, including the facility denial cases (ARC-7.5) of its facility-owned operations |
| FR-ESS-CFG-003 | api-catalogue.v1 |
verify cases of the 11 catalogue operations |
| (UI-ESS-004, the slice's screen) | emergency-access.v1, EmergencyAccessInvoked |
verify cases of the 8 operations; FR-ESS-AUZ-002 is not an RC-1 requirement |
The test scenarios of D10-ESS section 15.2 for these requirements belong to the build sessions, as listed on their cards. CONTRACT-POINTS.md names, per session, what in the contract each must meet.
Review round 1¶
The review asked for three changes, all made on this branch:
- Q5, the outage marker. The client could set
accessChecksUnavailablewhen starting emergency access, and so assert or suppress the "Started while access checks were unavailable" marker of UI-ESS-004. The request field is removed.startedWhileChecksUnavailableis now set by the emergency access service alone, which is the restrictive reading of UI-ESS-004 and DEC-ESS-018; section 7.3 states it. - Q4, extension.
extendEmergencyAccess, the end causeextendedandreplacesSessionId(in the API, in EmergencyAccessInvoked and in section 7.3) are removed. Version 1 now fixes only what the specification states: a new invocation with a new reason (FR-ESS-AUZ-002 part 6.8), and a repeat invocation while a session is Active returns that session (IF-ESS-004). What extension does while a session is still Active stays open as Q4. Once it is answered, an extend operation can be added as a compatible minor version, before FR-ESS-AUZ-002 is built. - The questions on the issue. Q1 to Q10 below are posted on issue #15.
Differences from the card or specification¶
- No scenario test in this session. The card's "Leaves behind" and "Ends when" name it, but its Scope gives it to RC-1-S03, which comes after the ESS and ISE contract sessions.
- Contracts beyond the card's requirements.
emergency-access.v1serves the slice's screen UI-ESS-004, although FR-ESS-AUZ-002 is not an RC-1 requirement. No RC-1 build session builds it, so the screen works against the stub. The notification API (IF-ESS-009, MOD-ESS-007) and the consent API (IF-ESS-005, MOD-ESS-003) are not written. They are not among the card's modules, and their first slice is RC-2. - The service template's provisional shapes are not what the contract fixes. The template is outside this card. Its follow-ups are listed below.
- ConfigurationChanged and TaskStateChanged are enterprise-scoped events that carry the facility of a facility override or a facility queue's task in the payload, not in the envelope (ADR-HIS-048).
- A part 11 state is added in the contracts: role assignment
suspended, for CFG-ESS-005 and FR-ESS-IAM-004 AC-05. It is in the 7.3 additions with its sources.
Questions for a person¶
None blocks this session or the build sessions after it: in each case the contract leaves the behaviour open, or takes the most restrictive reading, and says so in its description.
| # | Question | Owner | What the contract does now |
|---|---|---|---|
| Q1 | FR-ESS-IAM-004: how does a role assignment suspended at the recertification due date (CFG-ESS-005) come back: by approval, or only by a new request? | Security and Privacy Office | No reinstate operation; a new request is needed |
| Q2 | Who approves a segregation-of-duties exception, and where is it recorded? | Security and Privacy Office | Carries only sodExceptionRef |
| Q3 | FR-ESS-IAM-003 part 3 names no actor for retiring a service identity | Security and Privacy Office | The identity administrator retires it on the owner's request (part 6.8) |
| Q4 | FR-ESS-AUZ-002 part 6.8 and UI-ESS-004: when a session is extended with a new reason, does the current session end, or run on to its own expiry? | Security and Privacy Office | Nothing fixed: version 1 has no extend operation and no end cause extended. A repeat invocation while Active returns the existing session (IF-ESS-004); an extension can be added compatibly once answered (review round 1) |
| Q5 | UI-ESS-004: who sets "started while access checks were unavailable": the dialogue or the emergency access service? | Security and Privacy Office | Settled from UI-ESS-004 and DEC-ESS-018 as the restrictive reading: only the emergency access service sets it, and no request field can assert or suppress it (review round 1). The person confirms how the service knows |
| Q6 | UI-ESS-007 lists "Activate version", but section 4.3 activates terminology versions at their effective time | Terminology owner | No manual activate; approving with an effective time of now has the same effect |
| Q7 | FR-ESS-MDM-003 part 6.10: when a clinician proceeds with "Emergency, no current privilege", who records the override and opens the 7-day review task? | Owner of D10-ESS, medical committee | Left to the asking domain, with D10 audit and the task service |
| Q8 | FR-ESS-MDM-002 part 6.5: which side offers the "dependency check API" through which domains report active dependants, and in what shape? | Owner of D10-ESS | Reported dependants are only shown as a warning on the proposal |
| Q9 | Section 9.5 has no audit event type for an access check that could not be made (decision point outage, DEC-ESS-018); the template emits access-check-unavailable |
Security and Privacy Office | Event type is free text in the catalogue's pattern |
| Q10 | The value set of the audit query purpose (queryPurpose, FR-ESS-AUD-002 part 7) is not named; CFG-HIM-027 covers record review only |
Owner of D10-ESS | The code is free |
Follow-ups outside the card¶
For the service template (services/_template, before a unit made from it meets the real ESS services; the next session that changes the template):
- T1. Leave absent fields out instead of sending JSON null, in
PolicyRequestand in the audit payload. - T2.
PolicyRequest: renamepatientandencountertopatientRefandencounterRef. - T3.
AuditEmitter: renamedetailstobeforeAfter(changedFields,before,after). The refusal reason thatPolicyEnforcerputs there goes to the decision trace instead. - T4. Drop
emittedTime. - T5. Send no
resourceRefwith an emptyid. - T6. Use registered audit event type codes in place of
access-deniedandaccess-check-unavailable(see Q9). - T7. Fill
actorRole,locationDeviceand the category-mandatory fields of section 9.5; set the envelope'sschemaversionto1.0. - T8. Report emitted counts per period with
submitCompletenessReport. - The e2e harness's stub decision point (FN-S07) answers in the provisional shape, which matches this contract except the request names of T1 and T2.
For other sessions:
- Development realm: it issues no
acr,amrorauth_timeand has no MFA. Configure them inplatform/dev-environment(FN-S02 territory) or in the identity build session RC-1-S16. - Notification API (IF-ESS-009): for RC-2's ESS contract session. Until then:
- the failed-delivery list of UI-ESS-009 and the notification inbox of UI-ESS-010 have no contract;
- task escalation (FR-ESS-WFL-002) and deprecation notices (FR-ESS-CFG-003 part 6.3) use an internal port.
- Stewardship items (MOD-ESS-011, IF-ESS-013): reported by terminology (
reportValidationFailure), master data and the registry. They are not scheduled in RC-1, so RC-1-S06 and RC-1-S07 keep them behind an internal port. - Not yet in the contracts:
- concept maps and translation (FR-ESS-TRM-003), a minor version of
terminology.v1; - accepting a quarantined audit event with an annotation, and the evidence hold, retention and disposal actions of FR-ESS-AUD-002 part 6.7.
- For RC-1-S03: the Case Identification Number format of CFG-ADM-008 assumes a two-character facility code, which does not fit facility codes such as
RSU-01. - Shared types (
contracts/common), possible additive changes: - a
WorkforceAccountreference type; - a problem code for "step-up required", which the contracts answer today as 403
unauthorizedwith that detail. - Value sets to register in terminology: task priority, and the purpose-of-use codes.
- Design system (screens in RC-1-S23 to S25): none from this session.