Establish an MLLP TCP connection between your ordering system and the LIS; define the interface direction (bidirectional is typical: orders flow from ordering system to LIS, results flow from LIS to ordering system) and agree on port assignments and message types with the LIS vendor
Send lab orders as ORM^O01 messages: the ORM contains MSH, PID (patient), PV1 (visit), ORC (common order), and OBR (observation request) segments; populate OBR-4 with the ordered test code using the code system agreed with the LIS (often a local code or LOINC)
Handle ORM acknowledgments: the LIS responds with an ORR^O02 or plain ACK; check MSA-1 for acceptance and store the filler order number returned in ORC-3 for subsequent result correlation
Receive ORU^R01 result messages from the LIS containing OBR (observation request) and OBX (observation result) segments; correlate results to orders using the filler order number in OBR-3 / ORC-3
Parse each OBX segment for LOINC code (OBX-3), result value (OBX-5), units (OBX-6), reference range (OBX-7), and abnormal flag (OBX-8); store all fields to support clinical decision support and display
Implement order status update handling for ORM cancellations and result corrections (ORU with OBX-11 set to 'C' for corrected); treat corrections as a new authoritative result that supersedes prior values
Known gotchas
LIS systems commonly use proprietary local test codes rather than LOINC in OBR-4 and OBX-3; you must maintain a local-to-LOINC mapping table aligned with the specific LIS installation, not assume a universal code set
Result messages for panels (e.g., CBC) produce multiple OBX segments within a single OBR group; your parser must associate each OBX with its parent OBR using the set ID in OBX-1 and not treat OBX segments as independent records
Reflex orders triggered by abnormal results may arrive as additional ORM messages referencing the original order; without explicit reflex order tracking your system may treat them as unrelated new orders
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp