Schedule a demo
Segment

Error

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.

11fields
2required
v2.9HL7 version
err.py
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'

Build ERR segments in Python

How to construct and work with real-world ERR segments.

1

Informational screening notice

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'
2

Registration reminder detail

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'
3

Override and help-desk context

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'
)

Learn by building

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

Frequently asked questions

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.

ERR field reference

Complete list of fields in the ERR segment, HL7 v2.9.

#Python nameDatatypeUsageRepeatableTable
2error_locationERLOptionalYes-
3hl7_error_codeCWERequiredNoHL70357
4severityIDRequiredNoHL70516
5application_error_codeCWEOptionalNoHL70533
6application_error_parameterSTOptionalNo-
7diagnostic_informationTXOptionalNo-
8user_messageTXOptionalNo-
9inform_person_indicatorCWEOptionalYesHL70517
10override_typeCWEOptionalNoHL70518
11override_reason_codeCWEOptionalYesHL70519
12help_desk_contact_pointXTNOptionalYes-

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python