Architecture / Decision records / ADR-HIS-051
ADR-HIS-051 The terminology module: registration port, resolution by effective period, store of record and the Java contract test¶
| Status | Accepted |
| Decided | 2026-11-25 by session RC-1-S06 |
| Record | Drafted 2026-11-25; approved 2026-11-25 by the Enterprise Architecture Board |
| Where the rule lives | services/ess-reference/ (its README.md; module mod-ess-004, migrations db/mod_ess_004/; the contract test in mod-ess-004/src/test/java/care/cema/his/ess/mod004/contract/) |
Context¶
RC-1-S06 builds the D10 terminology service, MOD-ESS-004, as the first module of the unit services/ess-reference. It covers FR-ESS-TRM-001 and FR-ESS-TRM-002, behind terminology.v1 of ADR-HIS-048. Every domain looks up and validates codes through it, and RC-1-S07 builds MOD-ESS-005 and MOD-ESS-010 beside it. The card and contract leave these choices open:
- how code systems and value sets come to be registered (part 4 makes registration a precondition), when terminology.v1 has no operation for it and the registry (MOD-ESS-010, FR-ESS-REG-001) comes in the next session;
- how "current" and "as of" are answered, given that section 4.3 makes Approved to Active a system transition at the effective time;
- whether content is held by the unit or by a FHIR terminology server. Technology stack row 21 names HAPI FHIR, with Snowstorm for SNOMED CT;
- where stewardship items live before MOD-ESS-011 exists (RC-1-S01 asked for a port);
- how a Java unit's contract test runs
his-contract, a Node.js tool, when the host may have no Node.js.
Options considered¶
- Registration: an extra API operation; a seed migration; a Java port of the module that the registry module calls.
- Current and as of: the state alone (Active is current); the effective periods, with a job that moves the states.
- Store of record: HAPI FHIR JPA server now; the unit's own PostgreSQL schema, with HAPI FHIR as the FHIR facade of RC-3 (row 20).
- Stewardship items: call a missing service; a table of this module behind a port.
- Contract test runner: require Node.js on every host; run the tool in a pinned container when the host has none.
Decision¶
- Registration is a Java port,
care.cema.his.ess.mod004.api.TerminologyRegistration. MOD-ESS-010 calls it when it registers a naming system whose content terminology hosts (RC-1-S07). - Code systems and value sets share one registry key namespace (
ArtifactId), which is also the aggregate key of TerminologyPublished. A key and a canonical URI each belong to one artifact. - A value set's binding behaviour follows its safety class (DE-ESS-009, CFG-ESS-012): reject for Safety-relevant, flag for Standard.
- The class is proposed at registration. Part 6.10 has Clinical Governance confirm it at first publication. So the approval of a first publication, or of a version that changes the class, is also the confirmation of the class.
- The approver must then be permitted the action
ess.trm.safety-class.confirm; the policy decision point holds who acts for Clinical Governance (DEC-ESS-008). Otherwise the approval is refused. - The version records who confirmed. A version of Safety-relevant content cannot be Standard.
- Resolution by effective period. A request without a version uses the version in force at
asOf, or now. That is a published version (Approved, Active, Superseded or Retired) whose period contains the time, the latest start winning. Rolled Back versions are never in force. A named version answers whenever it was published, Rolled Back and Retired included, so a stored version keeps its meaning (BR-ESS-016). - The activation job (default every 15 s) only moves states and publishes the event. An approval whose effective time has come activates at once.
- Activation ends the prior Active version at the new start, so periods never overlap (DQ-ESS-005).
- A rollback restores the version it superseded, with no end. A rollback without one is refused, and the version is retired instead.
- Retiring an Active version is never retroactive. A Superseded version keeps its end.
- The unit is the store of record for code systems, value sets, versions and concepts, in schema
mod_ess_004. HAPI FHIR, which row 21 names, comes as the FHIR terminology facade over it in RC-3 (row 20, "FHIR terminology resources where selected"), and Snowstorm if SNOMED CT is loaded at scale. - UCUM uses
org.fhir:ucum1.0.10 (BSD-3-Clause), the library HAPI FHIR uses, so units stay the same when the facade comes. contentRef(the D02 storage channel, RC-2) is stored, but the impact report blocks until the content is loaded.- Stewardship items live in this module's table behind the port
StewardshipItems. One item per code, code system and source, with an occurrence count. An adapter to MOD-ESS-011 replaces the table when that module exists. - Severity follows CFG-ESS-027 with the binding rule of part 6.11. Safety-relevant content, and content nobody has classified yet, is Critical: its binding rejects the code, so the clinical data is blocked.
- Standard content is Medium: its binding accepts the code with a flag, so only data quality is affected.
- A merged report never lowers the severity.
- Expansions return the membership as defined, effective at the time asked (AC-04). Inactive members are included, because the specification does not filter membership. Validation answers
inactivefor them, and the binding rejects or flags them (BR-ESS-015). - The impact report counts an inactivated code as used when an Active or Approved value set version enumerates it in an include bound to current. The use is resolved by a later value set version, in review or approved, that drops the code. terminology.v1 has no operation to accept a use explicitly, so publication stays blocked until it is resolved.
- Policy and persons.
- The decision point is asked with the steward, author and second reviewer as attributes, so the steward assignment and the clinical qualification of part 6.11 are decided there (DEC-ESS-008).
- The unit itself refuses an author reviewing or approving their own version, a second reviewer approving, a second review of Standard content, and approval of a Safety-relevant version without its second review (PR-TRM-001-5).
- Review, return, approval, rollback and retirement are a person's acts; a service identity is refused.
- Licensed content is read under a separate action,
ess.trm.licensed-content.read. A Deny of it is answerednot-available(PR-TRM-002-4), never as an error. - The Java contract test runs the FN-S04 tool itself. With Node.js 22.18 or later and
contracts/common/node_moduleson the host, it runs there. Otherwise it runs innode:22.18-bookwormpinned by digest, on the host network, with the contracts mounted read-only and the tool's runtime dependencies installed from its lockfile. - Each operation runs
his-contract verify --operation <id>against the unit on a port, on a fixture in the state its documented example needs. - The clock is fixed at the examples' time, 2026-11-24T06:00:00Z.
Rationale¶
- A port keeps registration where the specification puts it, in the registry (FR-ESS-REG-001), without an operation the contract does not have. It also lets MOD-ESS-010 register without a network hop inside one unit.
- Answering from periods makes AC-01 and AC-04 hold from the effective time exactly, whatever the job's timing. It also makes historical answers a query rather than a state, so the meaning of any stored version can be reconstructed.
- The contract is IF-ESS-006, not FHIR. A FHIR server holding the governance lifecycle (two-person review, impact report, Fornas details) would need that lifecycle built around it anyway. The FHIR representation is a facade the architecture already plans.
- A container keeps the Java build's only extra requirement Docker, which the integration environment already needs. The same tool checks stub and provider, so the unit cannot drift from the contract.
Consequences¶
- RC-1-S07 registers the code systems and value sets through
TerminologyRegistrationwhen MOD-ESS-010 registers naming systems. Until then, an environment has no terminology content. The slice's integrate session (RC-1-S26) loads synthetic content through RC-1-S07's registry and the authoring operations. - The policy content (RC-1-S16, RC-1-S17) needs rules for the actions and resource types above. They include steward assignment, clinical qualification, licence terms and who acts for Clinical Governance in
ess.trm.safety-class.confirm. Until such a rule permits it, no first publication can be approved. - A FHIR facade (RC-3) maps
$lookup,$validate-codeand$expandonto these services. - The contract test of any Java unit can use the same runner; a copy of
ContractToolis all it takes. A unit's build then needs network access to the npm registry when the host has no Node.js. - Concept maps and translation (FR-ESS-TRM-003) add tables and a minor version of terminology.v1, and join the impact report as uses.