Send an HL7v2 ORU^R01 lab result message over MLLP

domain: hl7.org · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

In-depth guide

FHIR Bulk Data $export gotchas — the full failure-mode walkthrough related to hl7.org, checked against official docs, with linked verified routes.

Steps

  1. Construct the HL7v2 ORU^R01 message with required segments: MSH (message header), PID (patient identification), OBR (observation request), and one or more OBX (observation result) segments encoding each lab value with LOINC codes in OBX-3 and result values with UCUM units in OBX-6
  2. Wrap the message in MLLP framing: prepend the vertical-tab byte (0x0B) and append the field-separator byte (0x1C) followed by a carriage return (0x0D)
  3. Open a TCP socket connection to the receiving system on its configured MLLP port (commonly 2575 or a site-specific port) and send the framed message bytes
  4. Read the response bytes from the socket, strip the MLLP envelope, and parse the returned ACK message to check MSA-1 for AA (application accept), AE (application error), or AR (application reject)
  5. On AE or AR, log the MSA-3 error text and the ERR segment details, then implement retry logic with back-off appropriate to your operational SLA
  6. Close the TCP socket; for high-volume interfaces consider connection pooling rather than opening a new socket per message

Known gotchas

Related routes

Build an MLLP server to receive inbound HL7v2 messages
hl7.org · 6 steps · unrated
Create an HL7v2 ORM^O01 lab order message for an outbound order interface
hl7.org · 6 steps · unrated
Submit an electronic laboratory report (ELR) to a public health agency using an HL7v2 ORU^R01 message per the HL7 Electronic Laboratory Reporting implementation guide
hl7.org · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans