Reference·MSH Segment·MSH-9
HL7 v2 Reference

Testing HL7 v2 MSH-9: What Message Type Actually Needs to Handle

Jul 27, 2026 · 4 min read
← MSH-7 MSH-10 →

MSH-9 is the field a parser typically reads first, before touching any other segment, because it decides what the rest of the message is even supposed to contain — and a parser built to handle only a handful of trigger events will fail hard the moment an unfamiliar one shows up.

Quick answer

MSH-9 is the ninth field of the MSH segment — a composite of message code and trigger event, such as ADT^A01 or ORU^R01, that tells a receiving system how to interpret the rest of the message.

Valid code values

ADT^A01
Admit/visit notification
ADT^A08
Update patient information
ORU^R01
Unsolicited observation result
ORM^O01
Order message
SIU^S12
Notification of new appointment booking
ACK
General acknowledgment

Example

Synthetic example Generated by Synthibase
MSH|^~\&|ADTSYS|HOSP|BILLSYS|HOSP|20260727143000||ADT^A01|MSG00001458|P|2.5.1

The 9th field, ADT^A01, identifies this as an admit/visit notification message. Synthetic message — not a real transmission.

Where this trips people up

Teams frequently build and test a parser against the handful of trigger events their go-live scope calls for — A01, A03, A08 — and hardcode a case statement around exactly those values. Months later a source system starts sending an event type nobody anticipated, like a merge or a pending-admit notification, and the parser either throws an unhandled exception or silently drops the message into a dead-letter queue that nobody is watching.

HL7 v2 MSH Explained: Structure, Fields, and Common Mistakes
HL7 ADT Messages: A01 through A08 Explained
How to Write EDI Test Cases That Actually Catch Go-Live Failures
Test every trigger event your parser might see
Synthibase generates synthetic HL7 messages across the full range of message types and trigger events, so unfamiliar events surface in testing instead of after go-live.
Start free trial →
This page is written independently by Synthibase for testing and informational purposes. It is not an official publication of HL7 International or X12/Washington Publishing Company, and is not a substitute for reviewing the official standard or your trading partner's companion guide. See our Terms of Service for full legal terms.