Skip to main content

Interoperability (FHIR & HL7v2)

medOS speaks the two standards healthcare systems actually use to exchange data. FHIR R4 is the front door for modern external exchange — SMART-on-FHIR apps, regional health information exchanges, and patient handoff bundles. HL7v2 is the back door for legacy integration — lab instruments, ADT feeds, and pharmacy systems that still emit pipe-delimited messages. A connector catalog sits above both, cataloguing the adapters a deployment can activate and giving operators one place to monitor live data flow.

This page is a map. Each standard has a dedicated detail page; the goal here is to show how the pieces fit together and where the boundaries are.

FHIR R4
Modern exchange
HL7v2
Legacy instruments
ADT / ORM / ORU
HL7 message types
HMAC
Signed dispatch

Two doors, one domain model

Both standards translate into the same medOS domain model held in MongoDB. The mappers and transformers are the only place a standard-specific shape exists; everything downstream — clinical records, orders, results, billing — works in medOS terms regardless of how the data arrived.

Inbound + outbound

FHIR R4

Read, write, and subscription-based delivery through the public-api service. The standard for external exchange.

Read APIWrite APISubscriptionsCapabilityStatement
Inbound

HL7v2

ADT / ORM / ORU parsing over MLLP or REST, handled by the interoperability service.

ADTORMORUMLLP
Catalog

Connector catalog

A registry of available adapters across interop, EHR/HIS, claims, lab, imaging, pharmacy, devices and more — each with an honest live / available / planned status.

interoplabimagingclaimsdevices
Activate + watch

Integration center

One operator surface to activate connectors and monitor liveness, run history, and a tamper-evident per-run audit trail.

livenessactivity streamaudit

When to use which

ScenarioStandardDirection
SMART-on-FHIR app reads patient dataFHIR R4medOS → app
External system writes back an observationFHIR R4app → medOS
Notify a subscriber when an event matches criteriaFHIR R4medOS → subscriber
Patient handoff / portable record (QR, download)FHIR R4 BundlemedOS → patient
Lab analyzer posts resultsHL7v2 ORUinstrument → medOS
Order placed into an external LISHL7v2 ORMmedOS ↔ LIS
Admit / discharge / transfer feedHL7v2 ADTfeed → medOS

FHIR R4 — modern exchange

FHIR read, write, and subscription operations are served by the public-api service. Writes pass through reverse mappers into the medOS domain model; subscriptions match domain events against stored criteria and dispatch HMAC-signed FHIR Bundles to registered endpoints. A CapabilityStatement endpoint advertises which resources are supported.

SMART / external app
│ FHIR (read / write)

FHIR API (public-api service)
│ reverse mappers

medOS domain model ──▶ MongoDB

│ domain events

subscription matcher ──▶ HMAC-signed FHIR Bundle ──▶ subscriber endpoint

Key capabilities:

CapabilityWhat it does
Read APIGET / search for Patient, Encounter, Observation, Condition and related resources
Write APIPOST / PUT / PATCH mapped back into medOS records
SubscriptionsStored criteria + a delivery log; matches are dispatched outward
Signed dispatchOutbound Bundles are HMAC-signed so subscribers can verify authenticity
Rate limitingA per-subscription dispatch ceiling protects subscribers
Bundle exportIPS-compliant FHIR R4 Bundle for patient handoff workflows

FHIR write-back is governed by a per-tenant kill switch and is off by default, so a deployment opts in deliberately. See the full reference on the FHIR R4 page.

HL7v2 — legacy instruments and feeds

HL7v2 is handled by the interoperability service. Inbound messages arrive either over a TCP MLLP listener (with standard start/end framing) or via REST endpoints, are parsed into structured segments, mapped into medOS operations, and acknowledged with an ACK or NAK. Mapped results then flow into the domain model and emit events like any other write.

Lab / ADT feed
│ MLLP (framed) or REST

Interoperability service
│ parse segments → map → persist

medOS domain model ──▶ MongoDB ──▶ domain events


ACK / NAK ──▶ back to the sending system
MessageMaps to
ADT (A01–A08)Patient and encounter operations (admit, discharge, transfer, update)
ORM (O01)Diagnostic order create / update
ORU (R01)Lab result creation

The MLLP listener is disabled by default and enabled per deployment via configuration. See the full reference on the HL7v2 page.

Connector catalog & integration center

Above the two protocol layers, the connector catalog describes the adapters a deployment can turn on — across interoperability, EHR/HIS migration, claims, lab, imaging, pharmacy, terminology, messaging, identity, and device feeds. Each connector carries an honest status so operators can tell what is live versus what is planned.

The integration center is the single operator surface for this layer:

Activate connectorsLiveness viewPer-run activity streamTamper-evident audit

Connector runs are recorded with a per-run hash chain, so the activity history is tamper-evident and a stalled feed is visible at a glance rather than failing silently.

Design principles

  1. One domain model. FHIR transformers and HL7v2 mappers are the only standard-specific code; everything downstream is medOS-native.
  2. FHIR for external, HL7v2 for legacy. Modern partners use FHIR; only instruments and ADT feeds that require it use HL7v2.
  3. Opt-in by default. FHIR write-back and the HL7v2 MLLP listener both ship off and are enabled deliberately per deployment.
  4. Signed and audited. Outbound FHIR dispatch is HMAC-signed; connector runs are recorded in a tamper-evident log.
  5. Acknowledge everything. Every inbound HL7v2 message produces an ACK or NAK back to the sender.

See also