HL7 v2 MSH Explained: Structure, Fields, and Common Mistakes
MSH is the first segment of every single HL7 v2 message, no exceptions — it defines the delimiters, names the sender and receiver, timestamps the message, and tells the parser what kind of message is coming next. Get MSH wrong and nothing downstream even has a chance to run.
MSH (Message Header) is the mandatory first segment of every HL7 v2 message — it carries delimiter definitions, sending and receiving system identifiers, the message timestamp, message type, a unique control ID, and the HL7 version in use.
The fields that actually matter in practice
Example
A synthetic ADT admit message header — not a real transmission.
Where this trips people up
MSH-1 and MSH-2 define the delimiters the rest of the message uses, which means a mismatch here — a trading partner sending a different component separator, for instance — can make every subsequent segment parse incorrectly even though each individual field downstream looks perfectly well-formed. Teams that hardcode delimiter assumptions instead of reading them from MSH-1/MSH-2 on every message are the ones who get burned when a new interface partner comes online with nonstandard characters.