Where to find the standard HL7v2 message schemas

The HL7v2 standard defines a set of message types, each with a specific structure. The structure of each message therefore follows an underlying model or schema (a formal description). When available in a structured format, these schemas can be used to validate the messages, generate code for parsing and serializing the messages, and perform other kinds of automated processing.

HL7 Abstract Message Syntax

The most "native" way to represent the HL7v2 message structure is by using the HL7 Abstract Message Syntax. This special notation is used in the normative HL7v2 documents and looks like this (example for the ACK^A01^ACK message type):

MSH
[{ SFT }]
[ UAC ]
MSA
[{ ERR }]

Official XML Schemas

In addition to the textual descriptions of the message types, HL7 provides a set of XML Schemas, which are suitable for automated processing. These XML Schemas can be downloaded from the HL7 website.

HL7 Database

The XML Schemas provided by HL7 are themselves based on the HL7 Database (HL7-DB), a structured representation of the HL7v2 specification. You can read more about the HL7 Database on Frank Oemig's website.

Other sources

There are also a number of other sources of the HL7v2 message schemas, including:

Related projects

Convert HL7 messages to FHIR online.
HL7v2, FHIR
Libraries for parsing HL7v2 messages in JavaScript.
HL7v2
An online editor for HL7v2 messages.
HL7v2, ER7
A curated list of awesome resources on HL7 version 2.
hl7v2, awesome
Useful links to help you browse the HL7v2 specification.
HL7v2
Validate HL7v2 messages against the HL7 abstract message syntax.
HL7v2, data validation
An online parser for HL7v2 messages.
HL7v2, ER7
Translating HL7v2 messages to FHIR.
HL7v2, FHIR
A browser for the HL7v2 specification.
HL7v2, ER7
Generate HL7v2 schemas from the HL7 abstract message syntax.
HL7v2, schema

Made by Anton Vasetenkov.

If you want to say hi, you can reach me on LinkedIn or via email. If you like my work, you can support me by buying me a coffee.