HL7 Interoperability

What Interface Engines Do (Mirth, Rhapsody, Cloverleaf)

  • 6 min
  • 10 steps
  • 2 questions
  • Lesson 46 of 51

In this lesson

  1. The engine is executable interface policy
  2. A channel is a staged decision pipeline
  3. Define the acknowledgment boundary
  4. Transform structure without inventing meaning
  5. Canonical model or pairwise mapping?
  6. Routing and filtering are clinical decisions
  7. Fan-out creates independent delivery states
  8. Handle protected data deliberately
  9. A worked ADT fan-out
  10. Configuration-as-code discipline
Integration Engine

The engine is executable interface policy

An integration engine sits between applications and executes the organization’s interface contracts. Products such as Mirth Connect, Rhapsody, and Cloverleaf listen for data, parse it, validate it, transform it, route it, deliver it, and record operational evidence. The brand changes the configuration language and tooling; the architectural responsibilities remain similar 1.

The engine reduces connection sprawl, but it also concentrates risk. A bad rule can fan one error to every destination. Treat engine configuration as production software: version it, review it, test it, deploy it through controlled environments, and make ownership explicit.

An integration engine receives, validates, transforms, routes, persists, and monitors exchanges. Each stage needs an explicit success and failure contract.
An integration engine receives, validates, transforms, routes, persists, and monitors exchanges. Each stage needs an explicit success and failure contract. source

A channel is a staged decision pipeline

A useful channel model separates these stages:

  1. Receive: accept MLLP, HTTP, file, queue, database, or another transport.
  2. Frame and parse: identify one payload and construct its message or resource structure.
  3. Validate: check version, profile, required data, identifiers, codes, and local business rules.
  4. Filter: decide whether the event belongs on this route.
  5. Transform: map structure, values, identifiers, and terminology without losing provenance.
  6. Route: select one or more destinations and delivery policies.
  7. Persist and deliver: create a durable work item, send, correlate acknowledgments, and retry when allowed.
  8. Observe and reconcile: expose outcome, latency, queue age, exception reason, and downstream state.

The order is not universal, but it must be deliberate. Filtering before identity validation can discard the wrong patient. Acknowledging before durable persistence can lose a message after telling the sender it is safe to delete its copy.

Define the acknowledgment boundary

For an inbound MLLP feed, decide what AA means. Possibilities include:

  • the engine framed and durably queued the message;
  • the engine validated and accepted it into processing;
  • a named destination accepted it;
  • a business workflow completed.

Only one may be practical, but it must be documented. HL7 distinguishes message-control acknowledgment from higher-level application behavior 2. MLLP supplies framing and transport conventions, not a complete business transaction 3.

If the engine acknowledges after durable enqueue, downstream failures become the engine’s responsibility. It needs retry limits, dead-letter handling, alerting, replay controls, and reconciliation. If it waits on every destination, one slow subscriber can stall the source. The architecture chooses where responsibility transfers.

Transform structure without inventing meaning

Transformation may:

  • move fields between version-specific positions;
  • add required constants with documented provenance;
  • normalize dates and times while retaining offset and source precision;
  • map local codes to standard or destination codes;
  • split one message into several or aggregate several into one;
  • convert v2 into a FHIR resource or document index event.

Every transformation should answer:

  1. What source element and version does this value come from?
  2. Is the operation lossless, lossy, defaulting, derived, or terminology-mapped?
  3. What happens when the source is missing, null, repeated, invalid, or unknown?
  4. How can a support analyst reconstruct the result from the input and rule version?

Do not silently replace an unmapped local code with the most common destination code. Quarantine, pass through under an allowed local system, or apply an approved mapping with version and review evidence. Technical success with false meaning is a dangerous failure.

Canonical model or pairwise mapping?

Two common patterns are:

  • source-to-destination transforms: direct and easy to understand for a few routes, but mappings multiply as systems grow;
  • canonical model: transform each source into an internal model, then each destination from that model, reducing pair count but creating a model that the organization must govern.

A canonical model does not eliminate semantic work. It can become an undocumented “universal schema” that erases details no current destination uses. Preserve source payload, provenance, extensions, and exceptions where future replay or audit may need them.

Routing and filtering are clinical decisions

A routing rule such as “send all final microbiology results from facility A to infection prevention” encodes event, status, service, facility, and often patient context. Test boundary cases:

  • preliminary becomes final, then corrected;
  • facility code is new or unmapped;
  • result contains several observations with mixed statuses;
  • message is resent after route configuration changed;
  • one of several destinations is unavailable;
  • privacy or consent restrictions affect only one route.

The U.S. standards platform separates vocabulary, content, and infrastructure because routing depends on all three 4. A syntactically correct message can still be routed incorrectly if a code or organization identifier is misunderstood.

Fan-out creates independent delivery states

If one admission goes to laboratory, pharmacy, billing, and analytics, the engine has four delivery outcomes—not one. Each destination needs its own queue item, correlation, retry policy, and final disposition. A positive response from laboratory cannot mark the billing copy complete.

Replaying after a rule change requires care. Ask whether to replay the original transformed payload, re-run the original message through the old rule version, or process it through current rules. Each choice can produce a different result. Record transformation version and replay reason.

Handle protected data deliberately

Interface engines often see broad clinical data. Operational convenience can create uncontrolled copies in message browsers, logs, error emails, screenshots, backups, and nonproduction environments. Apply minimum-necessary access, encryption in transit and at rest, retention limits, audit logging, masked views, and approved test-data practices.

Do not place full payloads in ordinary application logs by default. Support staff often need control ID, route, event, field location, and error code—not an entire patient message. Separate searchable metadata from restricted payload storage.

A worked ADT fan-out

For an inbound ADT^A01:

  1. MLLP listener receives a complete frame.
  2. The engine stores the original payload and assigns an internal event ID.
  3. Validation confirms message profile, patient identifier authority, visit identifier, event time, and location code.
  4. Routing selects laboratory, pharmacy, and billing.
  5. Three destination-specific transformations are created from the same validated event.
  6. The engine returns AA according to its durable-enqueue contract.
  7. Laboratory accepts; pharmacy times out; billing rejects an unknown account type.
  8. Pharmacy retries with backoff; billing enters a mapped exception queue.
  9. Monitoring shows one source event, three route states, and two open actions.

This is more accurate than a single green “processed” flag.

Configuration-as-code discipline

For each channel retain:

  • purpose, data owner, technical owner, and business owner;
  • source and destination contracts plus sample messages;
  • route, filter, and transformation code in version control;
  • terminology-map version and approval;
  • unit, integration, regression, performance, and failure tests;
  • promotion history, rollback plan, secrets references, and environment differences;
  • dashboards, alert thresholds, runbook, and reconciliation query.

Practice: build a channel dossier

Choose one ADT or result route. Draw its stages and mark the exact durability and acknowledgment boundary. Add a trace table from every transformed destination field back to source location and rule. Then write expected behavior for invalid profile, unknown code, duplicate message, one destination down, ACK lost, configuration rollback, and replay after recovery. The dossier should let another engineer operate the interface without guessing.

Practice

When should an engine normally acknowledge an inbound message?

Practice

What is the main risk of silently defaulting an unmapped code?

Lesson complete

Nice work.

1day streak
0/1today's goal
–correct

Up next · 4 min

Transformation, Routing, and Filtering

Next lesson
Sources for this lesson
  1. 1
    Tim Benson, Grahame Grieve. Principles of Health Interoperability: FHIR, HL7 and SNOMED CT. 4th ed. Springer. 2021. verified Cited at: integration architecture.
  2. 2
    HL7 Version 2.9 — Chapter 2: Control. HL7 International (HL7 Europe public mirror). 2019. verifiedDefines v2 message construction, delimiters, message control, original and enhanced acknowledgment modes, MSH, MSA, ERR, and processing rules. Cited at: acknowledgment rules.
  3. 3
    HL7 Transport Specifications — MLLP (Minimal Lower Layer Protocol). HL7 International. verifiedThe de facto TCP framing wrapper for HL7 v2 messages. Release 2 adds commit acknowledgements for reliable transport. Cited at: transport specification.
  4. 4
    Interoperability. Office of the National Coordinator for Health IT (HealthIT.gov). verified Cited at: standards categories.