MajwareMAJWARE
MSH
Message Control21 fields

MSH — Message Header

Required in every HL7 message. Always the first segment.

The MSH segment defines the intent, source, destination, and syntax rules of the message. Every HL7 v2.x message begins with MSH. It controls how the receiving system parses the rest of the message.

Real-World Context

When an interface fails to parse incoming messages, MSH is the first place to check. Encoding character mismatches between sending and receiving systems are the #1 cause of parsing failures in production. Verify MSH.9 (message type) matches your channel filter exactly, including the trigger event code.

Field Reference

Click any row to see the full description, common values, and troubleshooting tip.

#Field NameTypeReqMax Len
1Field SeparatorSTR1▶
2Encoding CharactersSTR4▶
3Sending ApplicationHDO227▶
4Sending FacilityHDO227▶
5Receiving ApplicationHDO227▶
6Receiving FacilityHDO227▶
7Date/Time Of MessageTSO26▶
8SecuritySTO40▶
9Message TypeMSGR15▶
10Message Control IDSTR199▶
11Processing IDPTR3▶
12Version IDVIDO60▶
13Sequence NumberNMO15▶
14Continuation PointerSTO180▶
15Accept Acknowledgment TypeIDO2▶
16Application Acknowledgment TypeIDO2▶
17Country CodeIDO3▶
18Character SetIDO16▶
19Principal Language Of MessageCEO250▶
20Alternate Character Set Handling SchemeIDO13▶
21Message Profile IdentifierEIO427▶

Example Segment

1MSH||^~\&|EPIC|HOSPITAL_A|MIRTH|LAB_MAIN|20260310143205||ADT^A01^ADT_A01|MSG00001|P|2.5.1

Related Segments

Used In Message Types

Parse messages with MSH in real time

Paste any HL7 message into our free viewer. Decodes every segment and field instantly, client-side.

Open HL7 Message Viewer →

Need a message to test with?

Copy a realistic sample for any message type, or open it directly in the viewer. Free, no signup.

Browse HL7 Sample Messages →
← Back to HL7 Segment Reference