Skip to content

Architecture / Decision records / ADR-HIS-111

ADR-HIS-111 The integration engine: an ordinary service on the kit rather than Camel routes, its own HL7 v2 codec and a Jackson FHIR facade until the HAPI libraries can enter the dependency register, the registry driving every runtime rule, and messages held rather than dropped

Status Accepted
Decided 2026-11-30 by session RC-3-S15
Record Drafted 2026-11-30; approved 2026-12-02 by the Enterprise Architecture Board
Where the rule lives platform/integration-engine/ (mod-ise-003: Registry, Engine, Er7, Hl7, AdtMapping, NodeTls, MllpListener, Fhir, FhirValidator, Packs, ConformanceSuite, FileTransfers, Sftp; V1__integration_engine.sql, V2__orchestration.sql; OrchestrationStore; src/main/resources/conformance/); platform/supply-chain/register/dependencies.toml (entry apache-mina-sshd)

Context

RC-3-S15 builds part 1 of the integration engine, MOD-ISE-003: FR-ISE-INT-001 (the engine), FR-ISE-INT-002 (the interface registry) and FR-ISE-INT-003 (HL7 v2 and FHIR with jurisdiction packs). The contracts of RC-3-S03 (ADR-HIS-085) fix what the unit serves: 21 operations of contracts/ise integration.v1 in this part, and the events InterfaceStatusChanged, InterfaceMessageQuarantined and InterfaceMessageDeadLettered. Part 2, RC-3-S16, adds replay and reconciliation.

ADR-HIS-019 selected "Apache Camel routes using HAPI HL7 v2, HAPI FHIR and dcm4che libraries, deployed as ordinary services on the event backbone". DEC-ISE-003 leaves open whether the engine is built or assembled. Every third-party component must be in the dependency register before a build may use it (FR-ISE-SUP-001, ADR-HIS-059), under a licence of its compatible list, which legal keeps (platform/supply-chain/register/policy.toml). The pipeline's dependency scan stops a change with an unregistered package or a critical or high finding.

When the libraries were tried: - HAPI HL7 v2 2.6.0 is licensed MPL-1.1 or GPL-2.0, and neither is on the compatible list. A register entry for it would fail the register check until legal adds one of them. - HAPI FHIR 8.12 (structures, server, validator) brought about 30 components outside the register: Saxon, PlantUML, Thymeleaf, JGit, Simple Java Mail, xmlsec and others. Most serve rendering and the full validator, which the facade of this part does not need. It also brought Jackson 2 and Guava versions with high findings. - Apache Camel would add a second runtime model and its components to a unit that the service kit already gives durable storage, an outbox, an inbox, policy, audit and telemetry.

Decision

  1. The engine is an ordinary service of the kit, built in the HIS. The unit ise-integration-engine is made from the service template (ADR-HIS-044) at the root of platform/integration-engine/, with the one module MOD-ISE-003 and its database ise_integration_engine. Routing, transformation, validation, the durable queue, retries, order and circuits are the module's own code, on its PostgreSQL tables. No external or Camel engine runs (FR-ISE-INT-001 AC-01, DEP-001). This refines ADR-HIS-019, whose purpose (maintained, replaceable open components, no proprietary engine) holds.
  2. HL7 v2 is read and written by the engine's own ER7 codec (Er7), until legal admits HAPI HL7 v2's licence.
  3. The codec implements the encoding rules of HL7 v2.5.1 chapter 2: delimiters from MSH-1 and MSH-2, escape sequences, paths such as PID-3(1)-4-2.
  4. Hl7 holds the profile rules: MSH-9 against the 2.5.1 event table, MSH-10, MSH-12, the segments a structure requires, timestamp formats, and assigning authorities (PR-INT-003-2).
  5. The automated conformance suite (hl7v2-adt-2.5.1, 26 cases) and an independent reader in the tests are its safety net (FR-ISE-INT-003 AC-01, AC-05).
  6. Moving to HAPI later is local to Er7, Hl7 and AdtMapping.
  7. The FHIR R4 facade is Spring MVC with Jackson, and its profiles are StructureDefinitions read by a subset validator.
  8. It serves metadata, Patient read, PDQm search and PIXm $ihe-pix, Encounter read, $validate and StructureDefinition read, mapped from Domain 1's APIs (contracts/adm README); FHIR is not a persistence schema (part 6).
  9. The validator reads min, max, slices with patternIdentifier or patternCoding, fixed values, and bindings: the FHIR core value sets in place, every other one with the D10 terminology service, failing as unavailable when it cannot answer.
  10. Every resource is checked against its core profile before it is released (part 7).
  11. HAPI FHIR comes in when the facade grows (writes, many resources, the full validator), with its register entries.
  12. The registry drives every runtime rule. Only an Active registration carries traffic. The engine reads its routes, mapping, throughput limit, retry policy and acknowledgement timeout from it, and onboarding a partner is a registration (FR-ISE-INT-002 parts 3, 5, 6).
  13. A route that names facilities takes only messages of those facilities, and never one whose facility is unknown (architecture 7.5). An inbound message's facility is its receiving facility, MSH-6; a Domain 1 event's is its envelope's, else its payload's.
  14. An identifier is <domain of the contract>-<contract API>-<first label of the endpoint host>-<nn>, for example adm-adt-lis-01.
  15. Activation needs every mandatory attribute and the passed certification. Certification needs the latest conformance run of the registration's test pack to have passed (PR-INT-002-1).
  16. Activation also needs the contract version published in the catalogue (contract-catalogue.v1), a mapping and an adapter the engine carries, and an endpoint that answers.
  17. In production (setting his.integration.production, true unless set otherwise) the Release Manager approves after the interface owner, with the access token of their own step-up as signatureId, used once, as ADR-HIS-108 point 4 verifies an approval. Neither approver may be the author, nor the two the same person.
  18. A suspension's impact names the tier, the partner and route targets as consumers, and the registration's purpose as the clinical function. A Tier 1 or 2 suspension sets the degraded signal of InterfaceStatusChanged.
  19. Retirement is refused while an inbound registration routes to the interface or messages are in flight.
  20. HL7 v2 travels over MLLP and mutual TLS 1.3, and the node is authenticated on every connection.
  21. The trust anchors are a trust store kept by cert-manager. The engine's certificate on an interface is the key store entry named by the interface, else default.
  22. secrets.v1 checkNodeCertificate is asked about the peer's certificate on that interface: before sending, and on the first message of an inbound connection, whose interface is the inbound registration whose routes name the sender's MSH-3.
  23. A refusal, or no answer, closes the connection.
  24. A message is held rather than dropped, and a delivered message is acknowledged at most once.
  25. Each Domain 1 event a route takes becomes a transaction in the inbox's transaction, its source payload the event itself. MSH-10 is made once from the event and the interface and kept across retries.
  26. The worker maps and sends later. A read of Domain 1 that fails holds the message without spending an attempt, and so does a mapping version the engine does not carry, with an alert (section 10).
  27. Order is kept per interface and ordering key. Sent is recorded before the message goes and the answer after it, so a crash in between becomes a timeout and a resend with the same MSH-10.
  28. Retries follow the registration's policy with jitter (CFG-ISE-003). The interface's circuit queues messages while it is open. Exhausted attempts dead-letter the message with InterfaceMessageDeadLettered; replay of dead letters is RC-3-S16's.
  29. A suspended outbound interface holds its messages; a suspended inbound one refuses with AR.
  30. An exchange of several dependent steps (FR-ISE-INT-001 part 6) is an orchestration defined in the settings (his.integration.orchestrations), as file schedules are, since integration.v1 has no operation to define one. Its steps go one after another, each when the previous one is acknowledged. Its explicit state, deadlines and history are in the table orchestration. A step that fails or times out is withdrawn, and the steps done are compensated, last first, with each step's compensating message type (an HL7 v2 cancel event). A compensation that fails alerts, and the exchange is quarantined with what is not undone.
  31. An inbound message is stored, encrypted, before it is acknowledged, and a duplicate MSH-10 gets the first acknowledgement again.
  32. Payloads are encrypted, and kept 30 days. AES-256-GCM, with a key set by the deployment from OpenBao; the unit does not start without one. After the retention of CFG-ISE-009, payloads and retained files are deleted; the metadata stays.
  33. Managed file transfer hands over through a folder, and schedules are settings. integration.v1 has no operation to submit or schedule a file.
  34. The owning domain places the file in <staging>/<interfaceId>/outbound/, and his.integration.files.schedules gives the due times (cron, UTC).
  35. The engine sends the file with a .sha256 file over SFTP (Apache MINA SSHD, entry apache-mina-sshd proposed in the register), with the interface's key and the partner's known host key, and records <file>.ack.
  36. Inbound, the engine fetches each file the partner places with its .sha256, and checks it. It hands the file to the owning domain in <staging>/<interfaceId>/inbound/ and writes <file>.ack back. A bidirectional interface uses the outbound and inbound subfolders of its endpoint's folder.
  37. Missed, Unacknowledged and Failed are alerts: the counter his_integration_file_transfer_alerts_total for the observability rules.
  38. A download link carries a random token, of which only the hash is kept. It is served at /files/<transferId> to an authenticated caller, and expires after 24 hours.
  39. Jurisdiction packs are data, selected by setting.
  40. A pack is a folder conformance/packs/<packId>/ with pack.json, profiles/ and tests.json, in the unit or in a folder of the deployment. The core profiles his-patient and his-encounter apply whatever the pack.
  41. his.integration.packs.enabled selects packs. A selected pack's profiles and implementation guide are declared in the capability statement, and $validate uses them (FR-ISE-INT-003 part 9, AC-04).
  42. The suite runs every pack's tests on every build and writes each run for the pipeline to record with recordConformanceRun.
  43. What the unit asks of Domain 10.
    • Policy actions:
    • ise.interface.read, read-confidential, register, update, bind-credentials, and one per transition (ise.interface.approve-registration to ise.interface.retire);
    • ise.interface-health.read, ise.transaction.read, ise.payload.view;
    • ise.message-exception.read, assign, close;
    • ise.file-transfer.read, download-link, download;
    • ise.conformance-pack.read, ise.conformance-run.record, read;
    • for the facade, ise.fhir.metadata, read, search, pix, validate.
    • Resource types: those ISE registered in ADR-HIS-085, and adm.Person and adm.Encounter for what the facade releases. The caller's scopes are an attribute of the request.
    • Audit types: those of D02-ISE 9.5 (ise.config.changed, ise.exchange.sent, ise.exchange.received, ise.payload.viewed, ise.payload.exported, ise.dead-letter.closed).

Consequences

  • The engine's HL7 v2 code is the HIS's own to keep. The conformance suite runs on every build and stops a change that breaks the profile. A larger set of message types (orders, results into Domain 4) adds rules to Hl7 and cases to the test pack, or comes with HAPI once its licence is approved.
  • Legal is asked whether MPL-1.1 may join the compatible licences. With it, HAPI HL7 v2 and HAPI FHIR may be proposed in the register, and the HAPI parts of ADR-HIS-019 apply as written.
  • The facade validates the parts of a profile it reads. A pack whose profiles need more (FHIRPath invariants, terminology expansion) needs the full validator.
  • The Release Manager's approval is a step-up of the caller's own; production is a setting of the deployment, so a non-production deployment activates on the interface owner's approval alone.
  • Messages held for a missing mapping or a suspended interface wait without spending attempts. They show on the console as queued and in listInterfaceHealth.
  • The engine's Kubernetes objects and the gateway route to its API are not rendered in this part (follow-up).