Architecture / Decision records / ADR-HIS-049
ADR-HIS-049 D01-ADM contracts: identifiers, API split by unit, facility scope and the duplicate check¶
| Status | Accepted |
| Decided | 2026-11-25 by session RC-1-S03 |
| Record | Drafted 2026-11-25; approved 2026-11-25 by the Enterprise Architecture Board |
| Where the rule lives | contracts/adm/ (its README.md, contract.yaml, api/, events/, schemas/, TRACE.md); D01-ADM section 7.3; e2e/scenarios/RC-1/ |
Context¶
Every domain refers to a patient and an encounter of D01-ADM. The contract session of slice RC-1 for D01, RC-1-S03, fixes the contracts of MOD-ADM-001 to 004 for the slice's eight ADM requirements. It comes after the ESS and ISE contract sessions (RC-1-S01, ADR-HIS-048; RC-1-S02). Its contracts bind:
- the ADM build sessions RC-1-S08 (services/adm-identity) and RC-1-S09 (services/adm-patient-administration);
- the ADM screen session RC-1-S21;
- every later domain that stores a patient or encounter reference.
What was open:
- The enterprise person identifier. D01-ADM gives it no format: an internal identifier, never displayed (DEC-ADM-002), called "MPI GUID" in ADM-001. The ESS contracts used two forms in their examples for the same patient.
- The aggregate of an encounter. IF-ADM-004 names the CIN as the aggregate identifier. The CIN is a display identifier, in a per-facility format (CFG-ADM-008), qualified by its authority. The key of DE-ADM-008 is "CIN (with assigning authority)", a pair.
- The unit boundary. IF-ADM-001 has three producer modules in two units: MOD-ADM-001 and 003 in adm-identity, MOD-ADM-002 in adm-patient-administration.
- Facility scope of person, registration, No. RM and encounter, under architecture 7.5.
- How the mandatory duplicate prompt crosses an API. FR-ADM-REG-003 requires that a prompt is answered before a person is created, and IF-ADM-001 that creation always runs the duplicate check.
- The CIN format of CFG-ADM-008 assumes a 2-character facility code, which the D10 facility codes (RSU-01) are not.
Options considered¶
- One API per interface (IF-ADM-001 as one document served by two units), with the CIN as the encounter's key and identifier, and the duplicate prompt as an error answer of the creating command.
- One API per unit, a UUID key for person and encounter beside their business identifiers, and the duplicate check as a step of its own whose answer the creating command carries.
Decision¶
Option 2.
- Three APIs, each served by one unit:
patient-identity.v1: IF-ADM-001 person index, duplicate check, matches and identifiers; adm-identity;registration.v1: IF-ADM-001 registration, demographic versions and verification; adm-patient-administration;encounters.v1: IF-ADM-003 creation and reads; adm-patient-administration.
Shared types are in contracts/adm/schemas/adm-types.v1.json. A unit's provider contract test covers whole documents.
- Identifiers:
- The enterprise person identifier is a UUID (PersonId). It is the id of every patient reference, D10's patientRef and the aggregate id of the Person events.
- An encounter has encounterId, a UUID one-to-one with its CIN (DE-ADM-008 encounter_id, added). It is the id of an EncounterReference and the aggregate id of its events.
- The CIN stays the identifier shown and exchanged, qualified by its authority and facility.
- The contract fixes the CIN only as up to 14 letters and digits (CFG-ADM-008). The 2-character facility code inside it is a per-facility setting of CFG-ADM-008, not the D10 facility code.
- Identifier namespaces: urn:his:adm:enterprise-person-id, urn:his:facility:<F>:mrn (as the D10 registry already writes it), urn:his:facility:<F>:cin, and the SATUSEHAT systems for NIK and IHS.
- Facility scope (architecture 7.5):
- Enterprise-scoped: person, demographics, duplicate check, identity matches, benchmark.
- Facility-owned: registration record, No. RM and encounter. Of these, a registration of another facility is answered as not found (hidden; the registration desk is administrative).
- Decided by the policy decision point (policy): assigning a No. RM for a person at another facility (FR-ADM-XRF-001 AC-02), and reading one encounter, where clinical access crosses facilities under a care relationship (7.5).
- Listing encounters and registrations is filtered to the caller's facility.
- The events PatientRegistered and EncounterOpened are facility-scoped; the person and match events are enterprise-scoped.
- The duplicate check is a step. runDuplicateCheck answers the prompts with a duplicateCheckId. createPerson, registerPatient and updateDemographics carry it with one response per prompt. The unit runs the check again on commit and refuses a missing response or a new candidate. Match records are stored and review tasks raised only when the person is created or changed. The stewardship work item is a D10 task (adm.duplicate-review in adm.identity-stewardship, as the ESS contract points name it), with the match id as idempotency key.
- Refusals of a business rule answer 400 validation-failed, with errors[].pointer and the user message of the requirement. This is the same choice as RC-1-S02, until contracts/common has a code for a refused precondition.
- No personal data in URLs: searches, resolutions and duplicate checks are POST.
- Events are thin: identifiers, status, and which attribute groups changed, never values.
- One producer per topic. adm-identity owns his.adm.person.v1: demographic changes of adm-patient-administration reach it through INT-ADM-001, and it publishes IdentityUpdated for them.
- The registration record (completeness, field set, referral, review items) is written into 7.3 next to DE-ADM-006 as part of the registration record that FR-ADM-REG-001 part 9 names. It is not a new entity identifier.
- The slice scenario in e2e/scenarios/RC-1/ calls the units under their folder names.
- Until a unit is built it is not in the stack, so each test fails only on that.
- A contract walk through the stubs of ADM, ESS and ISE passes now and asserts no contract violation.
- The platform event operations API of D02 is addressed as event-backbone, which RC-1-S26 wires into the stack.
Rationale¶
- A unit serves whole documents, so
his-contract verifyper unit needs no operation filter to be complete. It also keeps the API of a unit versioned with that unit. - A key apart from the CIN keeps references stable whatever the facility's CIN setting is, and gives every domain the same reference shape for patient and encounter. The CIN remains the exchanged business identifier, as IF-ADM-004 and FHIR Encounter.identifier want.
- Answering a prompt through an error would need a problem code that
contracts/commondoes not have, and it would hide the candidates in an error body. As a step, the check is reusable for changes of matching-relevant data (FR-ADM-REG-003 part 6.2) and testable on its own. The re-check on commit keeps the guarantee of IF-ADM-001. - The facility choices follow architecture 7.5 as written: administrative functions limited to permitted facilities; person identity enterprise-wide; clinical context by policy.
- One topic producer is the rule of architecture 6.3, and it keeps the per-person sequence without gaps.
Consequences¶
- RC-1-S08 and RC-1-S09 build to
contracts/adm/README.md, "Contract points". RC-1-S09 calls adm-identity for person creation, No. RM and demographic events. - The ESS contracts' examples were repaired to the ADM forms: the enterprise person identifier, the ADM audit event type
adm.person.change, the registration endpoint, and an ADM feature flag. Only the examples changed; no schema or version changed.contracts/adm/scripts/cross-references.tskeeps the slice's references in step. - Later slices add to these APIs as minor versions: encounter transitions and validation, merge and unmerge, cross-reference query, payer and consent references, and emergency registration.
- The registration-governance owner of CFG-ADM-008 confirms the 2-character CIN facility code per facility (handover of RC-1-S03).
- The e2e harness has no way yet to address a platform API. RC-1-S26 adds one, in the harness (FN-S07's folder) or the stack, or changes the step that uses it.