Skip to content

Architecture / Decision records / ADR-HIS-056

ADR-HIS-056 Master data and registries: one governed version store, kind rules per module, states from effective periods

Status Accepted
Decided 2026-11-25 by session RC-1-S07
Record Drafted 2026-11-25; approved 2026-11-30 by the Enterprise Architecture Board
Where the rule lives services/ess-reference/ (its README.md; modules mod-ess-005 and mod-ess-010, migration mod-ess-005/src/main/resources/db/mod_ess_005/; the contract test in mod-ess-010/src/test/java/care/cema/his/ess/mod010/contract/)

Context

RC-1-S07 builds MOD-ESS-005 (FR-ESS-MDM-001 to FR-ESS-MDM-003) and MOD-ESS-010 (FR-ESS-REG-001) in services/ess-reference, behind master-data.v1, registry.v1 and MasterDataChanged of ADR-HIS-048. The contract routes every change of a registry entry through master-data.v1's change proposals (WF-ESS-005), and both modules publish on one topic. The card and the contract leave open:

  • where the versions of registry entries live, and how two modules share one workflow without breaking module boundaries;
  • how the lifecycle states (proposed, approved, active, superseded, retired) are kept;
  • what "overlapping effective periods" means for a chain of versions;
  • how a change proposal carries its attributes, and which attributes go to the steward route;
  • how statuses that follow from validity dates (credential lapsed, privileges expired) are recorded and published;
  • the permitted hierarchy of the "configurable hierarchy" (FR-ESS-MDM-002 part 1);
  • where stewardship items and the seed of the registers live.

Decision

  1. One governed store, in MOD-ESS-005. Every version of every kind (organization, facility, location, resource, practitioner, service, and the registry kinds) is a row of mod_ess_005.entity_version: kind, stable id, version, domain, effective period, attributes as JSON in the kind's schema, author, approver, proposal. The proposals, the identifier index and MasterDataChanged are MOD-ESS-005's for all kinds.
  2. Rules per kind, contributed through an api port. mod005.api.EntityKindRules validates a proposed version, names the identifiers it gives, the facility it belongs to, and acts on publication. MOD-ESS-005 contributes the master-data kinds and MOD-ESS-010 the registry kinds. MOD-ESS-010 reads through mod005.api.GovernedEntities and registers hosted naming systems with MOD-ESS-004's TerminologyRegistration. The Gradle dependency runs one way, MOD-ESS-010 to MOD-ESS-005 and MOD-ESS-004, through api packages only (the unit's boundary test).
  3. States follow from effective periods, read at the time asked. A version is approved before it starts, active while in force, superseded once a later version took over, and retired once its retirement version is in force or the last version has ended. A retirement is a version of its own that keeps the attributes, so a retired entity resolves with its name (BR-ESS-019). A read at asOf answers the version in force then, or after the end, the last one. Proposed exists only on the proposal.
  4. Versions form a chain. A new version must start after the start of every existing version of the entity. Otherwise it overlaps (PR-MDM-001-2). The version it follows is closed at its start, so the periods never overlap.
  5. A proposal carries the whole entity. A change proposal's attributes replace the previous version's; nothing is merged. A create and a retirement always go to the owner. A change goes the steward route only when every changed attribute is in a class the domain register gives to stewards: display (name, short name) in the seed (CFG-ESS-020).
  6. The author never decides. This holds on both routes. It meets FR-ESS-MDM-001 part 13 and section 9 rule 5 of D10-ESS alike. Who may decide is the policy decision point's, on the domain's owner, stewards and route sent as attributes. A service identity never decides.
  7. Publication when in force. MasterDataChanged is written in the approval's transaction when the version is already in force, and otherwise by the job (his.master-data.job.*, 15 s) when its start comes. The aggregate is <kind>/<id>.
  8. Validity ends become versions. Licences and appointments are dated to their last valid day. That day ends at midnight in the facility's time zone. Reads derive the statuses as of the time asked. The job records each change as a version of its own, written by the unit, and publishes it with status:

    • lapsed, when a qualification ends (PR-MDM-003-1);
    • sip-expired, with the facility, when one facility's SIP ends. That SIP shows expired and only that facility's privileges end; the credential status does not change (GAP-ESS-017);
    • privileges-expired, when an SPK ends.

    MOD-ESS-001 learns of each change from that event. 9. Identifiers are indexed once and for good. identifier_index (system, value) gives an identifier to one entity forever. It is unique within the authority and never reused (FR-ESS-REG-001 part 6.8). A cross-reference's identifier is indexed to the entity it identifies. A facility's identifiers belong to its organization. Every kind's identifiers need a registered authority and meet its format rule. 10. The default hierarchy is the table in MasterDataRules (PR-MDM-002-1). Organizations run enterprise → legal entity → facility → department or service line; an external organization has no parent. Locations run campus (under the facility organization) → building → floor → ward → room → bed position, with a clinic under a floor, building or campus, and a mobile location under a campus or the facility. 11. Privilege groups (GAP-ESS-018) are services of category privilege-group whose members are procedure codes of the list, never groups. An RKK entry for the procedure itself decides. Otherwise a Granted group entry holds a current member at the entry's level. A change or retirement of a group lists the practitioners who hold it as dependants before approval. 12. Stewardship items and seeds. Stewardship items are held in mod_ess_005.stewardship_item behind mod005.api.StewardshipItems until MOD-ESS-011 exists. This follows ADR-HIS-051 for terminology. The seeds are loaded once into empty registers while his.reference.seed.enabled is on (default true): - the domain register and the stub facilities, in MOD-ESS-005; - the authorities, identifier types, naming systems and external systems, in MOD-ESS-010.

Consequences

  • MOD-ESS-011 (data governance) can take over the stewardship port without a contract change. A later registry kind needs only its rules.
  • An as-of read is exact whether or not the job has run. The job's lag affects only when the event goes out.
  • A production deployment turns the seed off and loads its registers by migration (MIG-ESS-002, MIG-ESS-003) through change-proposal-batches.
  • The hierarchy table and the attribute classes are code and seed today. Making them configuration items (MOD-ESS-012) is a later change that leaves the rules as they are.