Parse, validate, and transform HL7 v2 messages with typed Python classes. Every segment, field, and datatype from v2.9 at your fingertips.
Parse incoming messages or build new ones from scratch, all with typed Python classes.
Parse, validate, transform, and exchange HL7 v2 messages, all in Python.
Step-by-step guides for HL7 v2 integration patterns.
In-depth documentation for working with HL7 v2 messages in Python.
Zato supports HL7 v2.9, which is backward compatible with earlier versions including v2.3, v2.5, and v2.7. All standard segments and their datatypes are available as typed Python classes.
Configure an MLLP channel in Zato to listen for incoming HL7v2 messages. Your Python service receives parsed message objects automatically:
from zato.hl7v2 import HL7Message
msg = HL7Message.parse(raw_data)
patient = msg.pid.patient_nameUse HL7Message.parse() with the raw ER7 string:
from zato.hl7v2 import HL7Message
msg = HL7Message.parse(raw_data)
name = msg.pid.patient_name.family_name
mrn = msg.pid.patient_identifier_listYes, use semantic Python names instead of positional notation:
# Instead of PID.5, use:
msg.pid.patient_name
# Instead of PID.3, use:
msg.pid.patient_identifier_list
# Subcomponents work too:
msg.pid.patient_name.family_nameYes, Zato has built-in MLLP support for sending and receiving HL7v2 messages. MLLP channels handle the framing protocol automatically, so you only work with parsed message objects in your Python code.
Yes, validate field lengths, cardinality, required fields, and datatype conformance:
from zato.hl7v2 import validate_message
result = validate_message(raw_data)
for error in result.errors:
print(error.message)Use parse_batch and parse_file to process multiple messages wrapped in BHS/BTS and FHS/FTS segments. Each message in the batch is parsed individually.
Yes, Zato supports transforming HL7v2 messages and segments to FHIR resources. You can map fields between standards and build FHIR bundles from HL7v2 messages.
Every HL7 segment, grouped by domain.
Get started with Zato and connect your healthcare systems in minutes.