HL7Online

MSH — Message Header

HL7 v2.5.1 Message Header segment reference

Defines the intent, source, destination, and framing of the message. Required as the first segment of every HL7 message.

Non-repeating ALL
Try it now — free, no sign-up

Paste a message containing a MSH segment into the free HL7 Online parser to see every field decoded, validated, and explained in your browser.

Open the HL7 Online parser →

MSH field reference

The table below lists the commonly used fields of the MSH (Message Header) segment. Field positions follow the HL7 v2.5.1 specification.

FieldNameTypeLenUseDescription
MSH-1 Field Separator ST 1 R The character used to separate fields. Almost always "|".e.g. |
MSH-2 Encoding Characters ST 4 R Characters used for component, repetition, escape, and subcomponent delimiters.e.g. ^~\&
MSH-3 Sending Application HD 227 O Identifies the application that sent the message.e.g. LabSystem
MSH-4 Sending Facility HD 227 O Identifies the facility of the sending application.e.g. LabFacility
MSH-5 Receiving Application HD 227 O Identifies the application that should receive the message.e.g. HIS
MSH-6 Receiving Facility HD 227 O Identifies the facility of the receiving application.e.g. HISFacility
MSH-7 Date/Time of Message TS 26 R Date and time the message was created.e.g. 20240315120000
MSH-8 Security ST 40 O Implementation-specific security value. Often used to label synthetic or test messages.e.g. SYNTHETIC
MSH-9 Message Type MSG 15 R Message code + trigger event. Example: ORU^R01 for an observation result.e.g. ORU^R01
MSH-10 Message Control ID ST 199 R Unique identifier used to match the message to its acknowledgment.e.g. MSG00001
MSH-11 Processing ID PT 3 R Indicates whether the message is production (P), debug (D), or training (T).e.g. P HL7 table 0103
MSH-12 Version ID VID 60 R HL7 version the message conforms to.e.g. 2.5.1

Use column: R Required · C Conditional · O Optional. Type column uses HL7 data-type codes (ST = string, NM = numeric, TS = timestamp, CX = extended composite ID, XPN = extended person name, and so on).

Other HL7 segments