Provides detailed error information when a message is rejected or has issues, including the error location (segment, field, component), error code, severity (warning, error, or fatal), and diagnostic text. It accompanies the MSA segment in ACK and response messages. Integration engines and receiving applications populate ERR to help sending systems diagnose and correct interface problems.
from zato.hl7v2.v2_9 import ERR
from zato.hl7v2.v2_9 import CWE
err = ERR()
err.hl7_error_code = CWE(
identifier='0',
text='Message accepted',
name_of_coding_system='HL70357',
)
err.severity = 'I'How to construct and work with real-world ERR segments.
Severity I with a friendly user message about optional follow-up for a preventive panel
from zato.hl7v2.v2_9 import ERR
from zato.hl7v2.v2_9 import CWE, ERL
err = ERR()
err.error_location = [
ERL(
segment_id='MSH',
segment_sequence='1',
field_position='9',
field_repetition='0',
component_number='0',
sub_component_number='0',
),
]
err.hl7_error_code = CWE(
identifier='0',
text='Message accepted',
name_of_coding_system='HL70357',
)
err.severity = 'I'
err.user_message = 'Optional coaching session available this week'Application-level CWE plus informational diagnostic text for a wellness portal reminder
from zato.hl7v2.v2_9 import ERR
from zato.hl7v2.v2_9 import CWE, ERL
err = ERR()
err.error_location = [
ERL(
segment_id='PID',
segment_sequence='1',
field_position='5',
field_repetition='0',
component_number='0',
sub_component_number='0',
),
]
err.hl7_error_code = CWE(
identifier='101',
text='Supplemental info',
name_of_coding_system='HL70357',
)
err.severity = 'I'
err.application_error_code = CWE(
identifier='REMIND',
text='Portal reminder',
name_of_coding_system='HL70533',
)
err.application_error_parameter = 'PORTAL'
err.diagnostic_information = 'Profile refresh suggested before next visit'InformPerson, override CWEs, and XTN help-desk contact for configuration clarifications
from zato.hl7v2.v2_9 import ERR
from zato.hl7v2.v2_9 import CWE, ERL, XTN
err = ERR()
err.error_location = [
ERL(
segment_id='OBR',
segment_sequence='1',
field_position='4',
field_repetition='0',
component_number='0',
sub_component_number='0',
),
]
err.hl7_error_code = CWE(
identifier='0',
text='Message accepted',
name_of_coding_system='HL70357',
)
err.severity = 'I'
err.inform_person_indicator = CWE(
identifier='STAFF',
text='Care team',
name_of_coding_system='HL70517'
)
err.override_type = CWE(
identifier='CFG',
text='Config note',
name_of_coding_system='HL70518',
)
err.override_reason_code = CWE(
identifier='OK',
text='Documented',
name_of_coding_system='HL70519'
)
err.help_desk_contact_point = XTN(
telephone_number='5551000',
telecommunication_use_code='PRN',
telecommunication_equipment_type='PH'
)Step-by-step guides for working with HL7 v2 in Zato.
HL7 reserved ERR-1 in older specifications; current payloads treat the first data field after the segment name as position 2, beginning with error_location.
Use a CWE bound to HL70357 with identifier, text, and coding system on separate lines:
from zato.hl7v2.v2_9 import ERR
from zato.hl7v2.v2_9 import CWE
err = ERR()
err.hl7_error_code = CWE(
identifier='0',
text='Message accepted',
name_of_coding_system='HL70357',
)
err.severity = 'I'Reserve I for informational companion text—registration reminders, coaching suggestions, or documented configuration notes that do not block wellness message processing.
Populate error_location with one or more ERL rows naming the segment, sequence, field index, and component numbers so interfaces can highlight the context for informational notices.
user_message is end-user friendly language for portals or staff consoles. diagnostic_information carries longer technical notes that integration teams log while keeping patient-facing text concise.
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.
Complete list of fields in the ERR segment, HL7 v2.9.
| # | Python name | Datatype | Usage | Repeatable | Table |
|---|---|---|---|---|---|
| 2 | error_location | ERL | Optional | Yes | - |
| 3 | hl7_error_code | CWE | Required | No | HL70357 |
| 4 | severity | ID | Required | No | HL70516 |
| 5 | application_error_code | CWE | Optional | No | HL70533 |
| 6 | application_error_parameter | ST | Optional | No | - |
| 7 | diagnostic_information | TX | Optional | No | - |
| 8 | user_message | TX | Optional | No | - |
| 9 | inform_person_indicator | CWE | Optional | Yes | HL70517 |
| 10 | override_type | CWE | Optional | No | HL70518 |
| 11 | override_reason_code | CWE | Optional | Yes | HL70519 |
| 12 | help_desk_contact_point | XTN | Optional | Yes | - |
Get started with Zato and connect your systems in minutes.