medOS Interoperability
The integration hub for legacy and standards-based healthcare protocols — internal scope.
The Interoperability service is where external clinical and administrative messages enter and leave medOS. It owns HL7v2 parsing and acknowledgement (with a built-in MLLP TCP listener for direct connections from lab instruments, ADT feeds, and pharmacy systems), C-CDA document generation and ingestion, IHE integration profiles, Health Information Network (HIN) querying, EHI bulk export, and X12 EDI claim/eligibility parsing. Each protocol is implemented as a self-contained module with its own mappers that translate the wire format to and from the canonical medOS domain model, and every inbound and outbound message is recorded in an integration audit trail.
Responsibilities
- Inbound HL7v2 — accept pipe-delimited messages over MLLP (
0x0B … 0x1C 0x0Dframing) or REST, auto-detect message type, parse segments (MSH, PID, PV1, ORC, OBR, OBX), map to medOS domain operations, and return a conformant ACK or NAK. - Document exchange — generate and ingest C-CDA Continuity of Care Documents via per-section mappers (problems, medications, allergies, results, vitals, immunizations, procedures, encounters, patient).
- IHE profiles — provide PIX, PDQ, and XDS-style behaviors that define how the underlying standards are used for specific clinical workflows.
- Network connectors — query patient documents from external Health Information Networks through pluggable adapters.
- Compliance exports — package a patient's electronic health information (EHI) for portability requests.
- EDI parsing — read X12 healthcare transactions for claims, remittance, and eligibility.
- Audit of record — log every integration message with type, direction, and status for traceability.
Major modules
| Module | Purpose |
|---|---|
hl7v2 | HL7v2 parser, ACK/NAK builder, ADT/ORM/ORU mappers, and the MLLP TCP listener |
ccda | C-CDA document generation and ingestion with per-section bidirectional mappers |
ihe | IHE integration profiles (PIX, PDQ, XDS, ATNA) for cross-enterprise workflows |
hin | Health Information Network connector with pluggable network adapters |
ehi-export | Patient EHI bulk export (C-CDA, FHIR Bundle, or NDJSON output) |
x12 | X12 EDI parsing for claims (837P/837I), remittance (835), and eligibility (270/271) |
audit | Integration audit log of all inbound and outbound messages |
_setting | Per-deployment interoperability settings and configuration |
HL7v2 message flow
The HL7v2 module is the primary inbound path. Messages arrive either over the MLLP socket or via REST, are parsed and mapped, and a synchronous acknowledgement is returned to the sender.
Lab / ADT feed Interoperability service
─────────────── ─────────────────────────
│ MLLP (:2575) │
│ <0x0B> HL7 message <0x1C><0x0D> │
├─────────────────────────────────────▶ mllp.listener
│ │ │ detect type
│ │ ▼
│ │ hl7v2-parser (MSH/PID/PV1/ORC/OBR/OBX)
│ │ │
│ │ ▼
│ │ ADT / ORM / ORU mapper → medOS ops
│ │ │
│ │ ▼
│ <0x0B> ACK <0x1C><0x0D> │ hl7v2-ack.builder + audit record
◀─────────────────────────────────────┤
REST callers reach the same pipeline through POST /hl7/raw (auto-detect) or the
typed POST /hl7/adt, /hl7/orm, and /hl7/oru endpoints, and can review the
recorded messages via GET /hl7/messages.
Config flags
| Flag | Default | Purpose |
|---|---|---|
HL7V2_MLLP_ENABLED | false | Enable the MLLP TCP listener |
HL7V2_MLLP_PORT | 2575 | TCP port for MLLP connections |
HL7V2_MLLP_TIMEOUT | 30000 | Connection idle timeout in milliseconds |
HL7V2_MLLP_ALLOWED_IPS | (empty) | Optional comma-separated source-IP allowlist; empty allows any |
HL7v2 over MLLP
Lab instruments, ADT feeds, and pharmacy systems connect directly over the framed TCP transport, with an optional source-IP allowlist.
C-CDA exchange
Section-level mappers convert clinical summaries to and from the canonical medOS model for both generation and ingestion.
HIN + IHE
Pluggable network adapters and IHE profiles (PIX/PDQ/XDS) cover cross-enterprise patient lookup and document sharing.
Standards coverage
Related catalog items
INT-4…INT-7— HL7v2 ADT / ORM / ORU / MLLPINT-8— C-CDA generationINT-9— EHI exportINT-11— EDI X12 claimsINT-20— IHE profiles