Skip to content

Architecture / Decision records / ADR-HIS-083

ADR-HIS-083 The D01-ADM contracts of the inpatient stay: ADT, beds and transfers as their own APIs, bed events on their own topic, merges through the work item, and one delivery tracker for every Domain 1 event

Status Accepted
Decided 2026-11-27 by session RC-3-S02
Record Drafted 2026-11-27; approved 2026-11-30 by the Enterprise Architecture Board
Where the rule lives contracts/adm/api/adt.v1.openapi.yaml, beds.v1, transfers.v1 (version 1.0); encounters.v1 1.2; patient-identity.v1 1.2; the twelve events of slice RC-3 and PatientDischarged 1.1, EncounterCorrected 1.1 in contracts/adm/contract.yaml; contracts/adm/README.md

Context

Slice RC-3 brings the inpatient stay to D01-ADM: admission, leave, return, discharge and closure (MOD-ADM-005), beds (MOD-ADM-006), transfers and responsibility (MOD-ADM-009), encounter context validation (FR-ADM-ENC-003), stewardship, merge and unmerge (FR-ADM-MPI-004, FR-ADM-MPI-005) and the cross-reference query (FR-ADM-XRF-002). ADR-HIS-049 and ADR-HIS-067 fixed the units, identifiers and topics of RC-1 and RC-2. The specification leaves these questions of build open:

  1. Whether the ADT transactions are values of the RC-2 operation transitionEncounter, as the RC-2 handover planned, or operations of their own.
  2. Where bed events go. Section 8.5 orders them per bed, and the encounter topic is ordered per encounter.
  3. Which aggregate a merge event belongs to. A merge concerns two persons.
  4. How a merge is entered, and how records made after a merge reach an identity again at unmerge.
  5. Who tracks consumer acknowledgements (FR-ADM-ADT-002 parts 6 and 7, FR-ADM-MPI-005 part 8), and how the status reaches Domain 1. The events of Domain 1 come from two units, and the statuses come from Domain 2.
  6. How a vacate entered in error is undone, when the bed state model has no Cleaning to Occupied transition.
  7. The facility scope of a transfer between facilities.

Decision

  1. The ADT transactions, beds and transfers are APIs of their own, one per module, all served by adm-patient-administration: adt.v1 (MOD-ADM-005), beds.v1 (MOD-ADM-006) and transfers.v1 (MOD-ADM-009).
  2. Each transaction is an operation: confirmAdmission, admitFromEmergency, recordLeave, recordReturn, recordDischarge, closeEncounter, confirmTransferArrival and the others.
  3. The reason is that each carries inputs and effects a bare transition does not: a bed, a responsibility, an admission request, a waiver, a handover.
  4. Each still applies its state change through the encounter state model and history of section 4.3 (BR-ADM-010).
  5. transitionEncounter keeps the transitions of an outpatient or emergency visit (end-visit, cancel). RC-2's plan to add ADT values to it is dropped.
  6. The reversals of an admission and of an inpatient discharge are correctEncounter reverse-transition values (admit, discharge), because FR-ADM-ADT-003 part 8 makes them corrections of FR-ADM-ENC-002.
  7. The correction of a transfer is correctTransfer in transfers.v1.
  8. The four modules are one unit, so every transaction commits in one database transaction (INT-ADM-006).
  9. Topics.
  10. The encounter-level events go on his.adm.encounter.v1, aggregate Encounter, adm-patient-administration's topic: PatientAdmitted, PatientTransferred, PatientLeaveStarted, PatientReturnedFromLeave, EncounterClosed, TransferHandoverAcknowledged and ResponsibilityChanged. Section 8.5 orders encounter, ADT and transfer events per encounter.
  11. BedStateChanged and BedReserved go on a new topic, his.adm.bed.v1, aggregate Bed. The aggregate id is the bed's D10 location identifier, so the events are ordered per bed (section 8.5).
  12. The release, expiry and invalidation of a bed reservation are BedStateChanged with their cause. ResourceReleased stays the release of an appointment's scheduled resources, as ADR-HIS-067 recorded: an event type has one schema and one topic.
  13. ResponsibilityChanged is published for every new responsibility period, including at admission, because Domain 10 authorization takes the care-team attribute from it.
  14. Merge events belong to the person whose status changes.
  15. PatientMerged has as aggregate the retired person (active to merged). PatientUnmerged has the restored person (merged to active).
  16. Both go on his.adm.person.v1, ordered per person.
  17. The survivor's gained or lost identifiers are IdentityUpdated of the survivor, in the same outbox transaction.
  18. A merge is made only by resolving a work item.
  19. resolveIdentityMatch with the outcome merge is the only way a steward merges. Every merge therefore has a match record, its evidence and a D10 task.
  20. A clerk's reported duplicate or merge request first becomes a work item (reportIdentityWorkItem).
  21. An unmerge is POST /v1/unmerges by the Head of HIM.
  22. Each encounter created after the merge is attributed on the unmerge panel. adm-identity then calls encounters.v1 correctEncounter (kind attributes, attributes.patient, unmergeId) with its service identity. adm-patient-administration, the owner of the encounter topic, publishes EncounterCorrected with patient among the corrected attributes. This is the patient correction FR-ADM-MPI-005 part 6.9.1 asks for, and the encounter topic keeps one producer.
  23. One delivery tracker for every Domain 1 event, fed by Domain 2.
  24. adm-patient-administration (FA-ADM-012) keeps the delivery record of every Domain 1 event per required consumer, and the ADT reconciliation worklist (UI-ADM-010). It learns what was published by consuming Domain 1's own topics, including his.adm.person.v1 for merges.
  25. The D02 integration engine and event backbone push the status per event and consumer: delivered, acknowledged through the consumer's inbox or an HL7 v2 ACK, rejected, processed, or a reported sequence gap. They push it to submitEventDeliveryStatuses, as Domain 2 pushes audit receipts in ADR-HIS-082.
  26. Overdue acknowledgements (CFG-ADM-012) open items in the tracker.
  27. Replay stays Domain 2's controlled replay (contracts/ise requestReplay). The worklist records only that it was requested.
  28. Undoing a vacate entered in error is a compensating bed entry.
  29. When a discharge or a transfer is reversed as entered in error, the bed the patient never left is re-occupied by a "corrected" entry of the bed history that compensates the vacate (BR-ADM-012). This is not a Cleaning to Occupied transition, which the state model forbids and AC-04 of FR-ADM-BED-001 tests.
  30. The entry is allowed only while the bed is still free, Cleaning or Available. Otherwise the reversal names another bed.
  31. A transfer between facilities is policy-scoped, and is a discharge plus a linked admission.
  32. A transfer belongs to the encounter's facility and to its destination facility, so reads and actions by transfer identifier are x-his-cross-facility: policy. The policy decision point permits the users of the origin and destination units.
  33. On arrival, the sending encounter is Discharged with the disposition of a transfer within the enterprise. A linked encounter opens Admitted at the receiving facility, in the same care episode (DEC-ADM-008). The events are PatientDischarged, EncounterOpened and PatientAdmitted, not PatientTransferred.
  34. Encounter validation is a facility-owned POST that always answers a decision.
  35. validateEncounterContext takes the CIN and the patient in the body, not in the URL, with X-Facility as the facility of the activity.
  36. It answers 200 with valid, valid-emergency-exception or not-valid and a reason code, the current context and the policy version.
  37. An unreachable dependency is 503, never a default "valid" (PR-ENC-003-4).

Consequences

  • RC-3-S06, RC-3-S07 and RC-3-S08 each serve the operations of their module's API in one unit. They share the unit's transaction boundary and topics, and work one after another (session plan).
  • Consumers of the bed board subscribe to his.adm.bed.v1. Those of the ADT backbone subscribe to his.adm.encounter.v1. Consumers that already read the encounter topic get the new event types there and ignore what they do not know.
  • RC-3-S03 maps the Domain 2 adapters (A01, A02, A03, A08, A21, A22, A40, the cancels) to these events and to the encounter and person reads. It also makes the integration engine and backbone call submitEventDeliveryStatuses.
  • The appointment attribution after an unmerge needs a patient correction in scheduling.v1, which no RC-3 session builds. Until then appointments are listed and stay pending (follow-up).
  • Every change to the RC-1 and RC-2 contracts is additive: new operations, optional fields, input enum values and extensible output enum values. his-contract check passes against main.