An HL7 message consists of one or more segments. Each segment consists of one or more composites, also known as fields.
The following article provides a typical sample HL7 message, and describe segments and composites in more detail.
Example HL7 Message
HL7 messages are in human-readable (ASCII) format, though they may require some effort to interpret.
Each HL7 message consists of one or more segments. A carriage return character (\r, which is 0D in hexadecimal) separates one segment from another. Each segment is displayed on a different line of text. (as seen in the sample HL7 message below)
Each HL7 segment consists of one or more composites (also known as fields). A pipe (|) character is used to separate one composite from another.
If a composite contains other composites, these sub-composites (or sub-fields) are normally separated by ^ characters.
Sample HL7 message:
PID||0493575^^^2^ID 1|454721||DOE^JOHN^^^^|DOE^JOHN^^^^|19480203|M||B|254 MYSTREET AVE^^MYTOWN^OH^44123^USA||(216)123-4567|||M|NON|400003403~1129086|
PV1||O|168 ~219~C~PMA^^^^^^^^^||||277^ALLEN MYLASTNAME^BONNIE^^^^|||||||||| ||2688684|||||||||||||||||||||||||199912271408||||||002376853