Architecture / Decision records / ADR-HIS-048
ADR-HIS-048 D10-ESS contracts: decision API, audit intake, token profile and facility scope of the shared services¶
| Status | Accepted |
| Decided | 2026-11-24 by session RC-1-S01 |
| Record | Drafted 2026-11-24; approved 2026-11-25 by the Enterprise Architecture Board |
| Where the rule lives | contracts/ess/ (its README.md, contract.yaml, api/, events/, schemas/, TRACE.md, CONTRACT-POINTS.md); D10-ESS section 7.3 |
Context¶
Every domain calls the D10 shared services: to authenticate, to ask for an access decision, to emit audit, to validate codes, to read the facility register and other master data, to raise tasks and to read configuration. The contract session of slice RC-1 for D10, RC-1-S01, fixes these contracts for the eight modules of the slice. They then bind the D10 build sessions RC-1-S04 to RC-1-S17, the ESS screen sessions RC-1-S23 to RC-1-S25, the D1 contract session RC-1-S03, and every unit made from the service template.
Three things were already in place before this session, without a contract:
- The service template (ADR-HIS-044) calls the decision point at
POST /v1/decisionsin a provisional shape. - The template emits audit on a provisional intake topic
his.ess.auditintake.v1, typehis.ess.AuditEventSubmitted. - The contract tooling (ADR-HIS-045) accepts in
contract.yamlonly events of the event catalogue that the domain itself produces.
Architecture 7.5 makes workforce identity, terminology, enterprise master data and audit enterprise-scoped. It makes facility configuration overrides, HIM queues and registration functions facility-owned.
Options considered¶
- Audit intake: an event of the domain contract (not possible: the submission is no ESS fact and is not in the catalogue); a topic with a schema of its own, unchecked by the tooling; an API only, with the outbox relaying to it; or one schema serving both an API and the topic.
- Authentication (IF-ESS-002): an OpenAPI description of sign-on, step-up and session operations; or OpenID Connect as Keycloak provides it, with the contract fixing the access token's claims.
- Facility scope of the shared services: facility-owned operations wherever a record names a facility; or enterprise operations with facility as a field and a policy attribute, owned only where architecture 7.5 names the data.
- Policy version: a free label, or the version of the configuration item that carries the policy.
Decision¶
- Ten APIs and nine events, version 1, listed in
contracts/ess/README.md: policy decision, emergency access, identity, terminology, master data, registry, audit, workflow, configuration and API catalogue. They cover IF-ESS-001, 003, 004, 006, 007, 008, 010, 012 and 014. Consent, notification, document reference and data governance come with their slices. - The decision API keeps the template's path and wire form.
POST /v1/decisionsanswersdecisionId,outcome(permit,deny,deny-override-available),obligations(id,attributes),policyVersionandcacheLifetimeSeconds. A Deny is a 200 answer. A batch and a search-filter operation serve part 6.7 of FR-ESS-AUZ-001. Request fields follow DE-ESS-005, so the template'spatientandencounterbecomepatientRefandencounterRef. - Audit intake is one schema with two bindings.
schemas/AuditEventSubmission.v1.schema.json(DE-ESS-013 in camelCase) is the body ofPOST /v1/audit-eventsand its batch form. It is also thedataofhis.ess.AuditEventSubmittedonhis.ess.auditintake.v1, which is now fixed. The event identifier is the idempotency key on both. The tooling checks the schema through the API that references it. The channel is not incontract.yaml, because only the audit unit reads it and every domain writes it. - No JSON null in any ESS contract. An optional field that does not apply is left out. Allowing null later would be a compatible widening of an input; forbidding it later would not.
- IF-ESS-002 is OpenID Connect on Keycloak, realm
his. The contract fixes the claims units may rely on:iss,sub,preferred_username(with theservice-account-prefix for service identities),azp,acr(aal1,aal2),amr,auth_time,sid,expandiat. Roles and permitted facilities are not claims: the decision service holds them, so that a revocation acts at the next decision (DEC-ESS-008). - Facility scope. Every ESS operation is enterprise-scoped except configuration versions and the resolution of active configuration. Those are facility-owned (
x-his-cross-facility: hidden), because architecture 7.5 names facility configuration overrides and limits configuration to the permitted facilities. An enterprise-scope version carries no facility. Records that belong to a facility carry it as a mandatory, immutable field, and the decision point decides with it: - locations of the D10 structural register (D1 owns beds and allocation, DEC-ESS-013);
- tasks of a facility queue;
- the facility an emergency access session was invoked at.
Operations where policy needs the caller's facility take the optional X-Facility.
- Event scope. All nine events are enterprise-scoped. ConfigurationChanged keys on the configuration item (<itemType>/<itemKey>), so that changes stay ordered across enterprise, facility and unit scope; the facility of an override is in the payload. TaskStateChanged carries a task's facility in the payload, as the task operations do. This departs from "facility-owned aggregate, facility in the envelope" only for these two payload fields, and the departure is stated on each schema.
- One policy version. policyVersion is the integer version of the configuration item version (DE-ESS-018) that carries the policy, written as text. Policies, roles, workflow definitions, task types, queues and feature flags are authored through the configuration lifecycle. Their own APIs read them.
- References and commands:
- other domains' records are referenced as <domain>.<Entity> and an identifier, since the common ReferenceType names FHIR resources only;
- creates and transitions are POST with Idempotency-Key;
- transitions on versioned records add If-Match, and a stale version answers 412;
- a refused business rule answers 400 validation-failed naming the rule;
- lists page with pageSize and pageToken.
- Section 7.3 is completed for every entity the contracts use, in the same merge, as architecture 6.6 point 3 requires:
- new sections DE-ESS-002, 003, 004, 008, 009, 010, 011, 012, 015 and 019, and the master-data governance records;
- additions to DE-ESS-001, 005, 006, 013 and 018, with the audit service's records.
No new entity identifiers were added. contracts/ess/TRACE.md traces every field.
Rationale¶
The decision API and the audit channel are already called by the template's every unit. Keeping their paths, topic and wire names means the template changes in its field details only. These are the null handling and the DE-ESS-005 and DE-ESS-013 names, listed for it in the session's handover. One schema for both audit bindings keeps the API, the topic and the stored record one shape, and gives the topic the tooling's checks without changing contracts/common.
Sign-on is a standard protocol that the selected identity provider implements (DEC-ESS-005). An OpenAPI description of it would restate the protocol and could only drift from it. What units need fixed is what they read from the token.
Facility is a policy attribute, not a partition (architecture 7.5). Most D10 data is enterprise reference or governance data that all facilities read. Declaring those operations facility-owned would hide shared reference data behind the caller's facility, which 7.5 does not intend. Configuration overrides are the D10 data that 7.5 names as facility-owned, so only they are.
Consequences¶
- RC-1-S03 builds the D1 contracts on these: the facility register and assigning authorities (
master-data.v1,registry.v1), the duplicate-review task (workflow.v1), audit and decisions. - The service template must change before a unit made from it talks to the real ESS services. It must omit nulls, use
patientRefandencounterRef, renamedetailstobeforeAfter, dropemittedTime, and use registered audit event type codes. Until then the e2e harness's stub decision point and the template's fake keep the provisional form. - A breaking change to any of these contracts is a version 2 beside version 1 (session rule 4).
- The development realm issues no
acroramrand has no MFA. The identity build session configures them.