Testing HL7 v2 MSH-9: What Message Type Actually Needs to Handle
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.
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
Example
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.