Schedule a demo
Message type

Request additional information

Supports health care services invoicing workflows. Key segments include MSH, OBR. Payer and provider systems exchange this for claims processing, authorization, and payment reconciliation.

18segments
6required
1group
v2.9HL7 version
ehc-e12.py
# Zato
from zato.hl7v2 import HL7Message

# An incoming message ..
raw = 'MSH|^~\&|SENDER|FAC|RCV|DEST|20260701||' \
      'EHC^E12^EHC_E12|MSG001|P|2.9\r' \
      'IVC|INV001|20260701|1500.00|USD\r' \
      'PID|1||MRN-10045||SMITH^JOHN||19850315|M'

# .. parsed into a Python object ..
msg = HL7Message.parse(raw)

# .. whose fields we can now access.
invoice_number = msg.ivc.provider_invoice_number
invoice_amount = msg.ivc.invoice_amount
name = msg.pid.patient_name
dob = msg.pid.date_time_of_birth

Build and parse EHC^E12 messages in Python

How to construct, send, receive, and extract fields from real-world EHC^E12 messages.

1

Parse an incoming EHC^E12 message

Demonstrates receiving and extracting key fields from a request additional information transaction

# Zato
from zato.hl7v2 import HL7Message

# An incoming message ..
raw = 'MSH|^~\&|SENDER|FAC|RCV|DEST|20260701||' \
      'EHC^E12^EHC_E12|MSG001|P|2.9\r' \
      'IVC|INV001|20260701|1500.00|USD\r' \
      'PID|1||MRN-10045||SMITH^JOHN||19850315|M'

# .. parsed into a Python object ..
msg = HL7Message.parse(raw)

# .. whose fields we can now access.
invoice_number = msg.ivc.provider_invoice_number
invoice_amount = msg.ivc.invoice_amount
name = msg.pid.patient_name
dob = msg.pid.date_time_of_birth

Learn by building

Step-by-step guides for working with HL7 v2 in Zato.

Frequently asked questions

Use the HL7v2 message parser to extract the typed structure. The parsed message gives you direct access to every segment and field by name.

from zato.hl7v2 import HL7Message

raw = 'MSH|^~\&|SENDER|FACILITY|RECEIVER|DEST|20260401120000||EHC^E12^EHC_E12|MSG00001|P|2.9\rRFI|20260401|20260430\rCTD|PRD^Provider\rIVC|INV-001|INV-001\rPSS|1|PSS-001\rPSG|1|PSG-001\rPID|1||MRN-10045||JOHNSON^SARAH^M||19880612|F|||100 Oak Lane^^Portland^OR^97201\rPRT|1||AT^Attending||1234^CHEN^DAVID^L^^^MD\rPSL|1|PSL-001'
msg = HL7Message.parse(raw)

invoice_number = msg.ivc.provider_invoice_number
invoice_amount = msg.ivc.invoice_amount

Beyond the mandatory MSH header, the required segments are: RFI, IVC, PSS, PSG, OBR. Optional segments provide additional detail when available.

Zato connects to any system that speaks HL7v2 over MLLP or FHIR over REST. This includes Epic, Cerner, Meditech, Allscripts, and other EHR platforms.

Yes, Zato has built-in MLLP support for sending and receiving HL7v2 messages. MLLP channels handle the framing protocol automatically.

Zato supports HL7 v2.9, which is backward compatible with earlier versions including v2.3, v2.5, and v2.7. Standard segments and datatypes are available as typed Python classes.

Yes. Zato handles both HL7v2 and FHIR natively, so you can parse v2 messages and build FHIR resources with IG-specific extensions in the same service. Typed Python classes are available for both protocols, including extensions from US Core, UK Core, Da Vinci, and other Implementation Guides.

EHC^E12 segment composition

Segments that make up the EHC^E12 message, in order. Groups are shown with their child segments.

#SegmentUsageRepeatsDescriptionGroup
1MSHRequiredNoMessage header-
2ARVOptionalYesAccess restriction-
3SFTOptionalYesSoftware segment-
4UACOptionalYesUser authentication credential-
5RFIRequiredNoRequest for information-
6CTDOptionalYesContact data-
7IVCRequiredNoInvoice segment-
8PSSRequiredNoProduct / service section-
9PSGRequiredNoProduct / service group-
10PIDOptionalNoPatient identification-
11PRTOptionalYesParticipation information-
12PSLOptionalYesProduct / service line item-
13CTDOptionalNoContact dataREQUEST
14OBRRequiredNoObservation requestREQUEST
15PRTOptionalYesParticipation informationREQUEST
16NTEOptionalNoNotes and commentsREQUEST
17OBXOptionalYesObservation resultREQUEST
18PRTOptionalYesParticipation informationREQUEST

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python