Implementation plan / Session plan / Handover RC-5-S04
Handover RC-5-S04 Build: Reference services (concept maps and unmapped-code stewardship)¶
Card: RC-5-S04. Issue: cema-care/his#179. Branch: session/RC-5-S04. Slice: RC-5. Decision record: ADR-HIS-128.
Comes after RC-1-S07 and RC-5-S02. It serves the 19 operations that terminology.v1 1.1 added: concept maps, translation, unmapped-code reports and the stewardship queue. It also publishes TerminologyPublished 2.0 on his.ess.terminologyartifact.v2, and StewardshipItemRaised and StewardshipItemResolved on his.ess.stewardshipitem.v1, as ADR-HIS-125 contracted. It extends MOD-ESS-004 as built by RC-1-S06 (ADR-HIS-051). No contract was changed.
What was built and where¶
All the code is in services/ess-reference. The unit's README lists the tables, policy actions, resource types, topics and audit types.
MOD-ESS-004, FR-ESS-TRM-003 (mod-ess-004/src/main/java/care/cema/his/ess/mod004/):
- ConceptMapService:
- list and read maps, versions, entries and the consistency check;
- create a version, with all the checks of parts 6.2, 6.8, 7 and 10;
- the lifecycle: submit, second review, return, approve, roll back, retire, and activation by the job;
- TerminologyPublished 2.0 for maps, on v2 only.
- TranslationService:
- translation as of a date, with outcomes equivalent, non-equivalent, ambiguous, no-map, unmapped and not-available;
- unmapped-code reports.
- StewardshipService: the queue (list, read), assign, resolve and reject.
- MappingController: the 19 paths.
- MapStore, ItemStore and ItemEvents: persistence, and the item events and audit.
- ImpactAnalysis: the impact report of a code system release now lists the concept maps that use an inactivated code (PR-TRM-003-3).
- AuthoringService: publishes TerminologyPublished 2.0 on v2 beside 1.0 on v1 for code systems and value sets.
- JdbcStewardshipItems, which implements the StewardshipItems port: items keyed by kind, system, code, target system and source.
- Migration V3__concept_maps_and_stewardship.sql: concept_map, map_version, map_entry, and the new columns and keys of stewardship_item.
The unit's kit. service-kit/.../events/DomainEventPublisher numbers an aggregate's events per topic on topics that are not .v1, so that one activation has a gap-free sequence on v1 and on v2 (ADR-HIS-128 point 8). On .v1 topics nothing changes.
The design is in ADR-HIS-128: - storage; - the lifecycle and class confirmation; - the check findings; - what each translation outcome means; - the item key and its class; - what a resolution must name; - inactivated targets; - audit; - sequencing.
How to run the checks, and their result¶
In services/ess-reference, with the light profile started under this session (HIS_SESSION=RC-5-S04 platform/dev-environment/his-env start light):
./gradlew build # every module, the app and the kit
./gradlew :mod-ess-004:test # MOD-ESS-004 alone, contract test included
Result on 2026-12-02: ./gradlew build is successful, with 220 tests: mod-ess-004 102 (the contract test included), mod-ess-005 40, mod-ess-010 40, app 5 and service-kit 33. None fails; one kit test is skipped, as it was before this session.
The contract test (contract/TerminologyContractTest) does three things:
- runs his-contract verify for each of the 38 operations of terminology.v1, on a fixture in the state each documented example needs;
- runs his-contract validate-event on TerminologyPublished 1.0 and 2.0 (code system, and concept map activation and rollback) and on StewardshipItemRaised and StewardshipItemResolved;
- sends the unit's audit events to the audit stub.
Requirements and tests¶
| Requirement, criterion or scenario | Test |
|---|---|
| FR-ESS-TRM-003 AC-01, PR-TRM-003-1, BR-ESS-017 | TranslationStewardshipTest.test017UnmappedLocalLabCode |
| TEST-ESS-017 unmapped local lab code from an interface | TranslationStewardshipTest.test017UnmappedLocalLabCode, .reportUnmappedCode, .rejectAndPeopleOnly |
| PR-TRM-003-4 repeated reports from one source: one item with a count | TranslationStewardshipTest.test017UnmappedLocalLabCode, .reportUnmappedCode |
| AC-02, PR-TRM-003-2 ambiguous: all candidates, never a single equivalent | TranslationStewardshipTest.test018Ambiguous, ConceptMapsTest.conflictsBlock |
| AC-03 as-of translation uses the map version effective then | TranslationStewardshipTest.test018AsOf, ConceptMapsTest.historyPreserved |
| AC-04 resolution recorded with its reason; reporting domain notified | TranslationStewardshipTest.test018ResolutionNotifies |
| TEST-ESS-018 ambiguous map, as-of translation, resolution notification | the three test018* tests above |
| AC-05 clinical terminology and administrative classification identified | ConceptMapsTest.ac05ClinicalAndClassification |
| PR-TRM-003-3 target inactivated by a release: flagged, map cannot stay current | ConceptMapsTest.targetInactivatedByRelease |
| Parts 6.1, 6.2 provenance, relationship, owning domain | ConceptMapsTest.entriesWithProvenance |
| Part 10 inactive target rejected; conflicting and circular entries block | ConceptMapsTest.inactiveTargetRejected, .conflictsBlock |
| Parts 6.9, 11 lifecycle, two-person review, history preserved | ConceptMapsTest.lifecycle, .historyPreserved |
Part 12 audit ess.trm.map |
ConceptMapsTest.audited, TranslationStewardshipTest.test018ResolutionNotifies |
| Part 3 policy on every operation | ConceptMapsTest.entriesWithProvenance, .lifecycle; TranslationStewardshipTest.translationPolicyAndValidation, .rejectAndPeopleOnly |
| EVT-ESS-006 2.0 and the item events | ConceptMapsTest.published, TerminologyContractTest.events, .mapAndItemEvents |
| IF-ESS-006 terminology.v1 1.1 | TerminologyContractTest.verify (38 operations), .coversEveryOperation |
Non-functional targets:
- NFR-ESS-007: the policy decision point on every operation; assign, resolve, reject and every approval are acts of a person.
- NFR-ESS-011: FHIR-aligned relationships; the map version and target version in every answer.
- NFR-ESS-015: effective periods; as-of translation; the effective time is not before approval.
- NFR-ESS-016: local displays are kept as given; the test data has Indonesian displays.
- NFR-ESS-017: the counters his.terminology.translations and his.terminology.unmapped.reports by outcome; logs carry the item identifier and no patient data.
Done differently, and why¶
- An item is assigned at creation to the steward of the target code system, or of the code system concerned (part 6.6), so a new item is in state
assigned, notopen. Items with no registered steward stayopen. - Translation without
sourceraises no item. The contract makessourceoptional, and an item names its reporting source (part 6.5). Interfaces should send it. - An unregistered source or target system answers
unmapped, not 404: BR-ESS-017 says a code with no map is not guessed and goes to stewardship.
Questions for a person¶
None.
Follow-ups outside this card¶
services/ess-runtime-decision: rules permittingess.trm.map.*andess.trm.readoness.ConceptMap,ess.trm.item.{read,assign,resolve,reject}, andess.trm.safety-class.confirmoness.ConceptMap. Until then the real decision point denies them.platform/event-backbone: registerhis.ess.terminologyartifact.v2andhis.ess.stewardshipitem.v1(ADR-HIS-125).services/_template: the per-topic sequence ofDomainEventPublisher, for units that publish two majors of an event.- Consumers of StewardshipItemResolved (ANC results ingestion first) reprocess quarantined records from the artifact's
effectiveFrom. - A loader for map content given by
contentRef; until it exists such a version cannot be submitted. - MOD-ESS-011: the queue moves behind the
StewardshipItemsport when that module exists.