Schedule a demo
Segment

Event type

Communicates trigger event information including the recorded date/time, the planned event date/time, the reason code, and the facility where the event occurred. It is sent in ADT and other patient administration messages to convey the context under which the triggering event took place, enabling downstream systems to correlate clinical and administrative actions with the originating event.

6fields
1required
v2.9HL7 version
evn.py
from zato.hl7v2 import EVN

evn = EVN()
evn.recorded_date_time = '20260601'
evn.event_reason_code = 'REQ'
evn.event_occurred = '20260601120000'

Build EVN segments in Python

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

1

Admission trigger

Records an admission event with the recorded timestamp and the facility where it occurred

from zato.hl7v2.v2_9 import EVN
from zato.hl7v2.v2_9 import CWE, HD

evn = EVN()
evn.recorded_date_time = '20240601120000'
evn.event_reason_code = CWE(
    identifier='01',
    text='Admission',
    name_of_coding_system='HL70062'
)
evn.event_occurred = '20240601120000'
evn.event_facility = HD(
    namespace_id='MAIN',
    universal_id='Main Hospital',
    universal_id_type='LOCAL'
)
2

Transfer notification

Planned transfer event with a future date and the reason code indicating patient request

from zato.hl7v2.v2_9 import EVN
from zato.hl7v2.v2_9 import CWE, HD

evn = EVN()
evn.recorded_date_time = '20240710080000'
evn.date_time_planned_event = (
    '20240715100000'
)
evn.event_reason_code = CWE(
    identifier='02',
    text='Transfer',
    name_of_coding_system='HL70062'
)
evn.event_facility = HD(
    namespace_id='EAST',
    universal_id='East Wing',
    universal_id_type='LOCAL'
)
3

Discharge recording

Discharge event captured with the recorded time and the occurrence timestamp

from zato.hl7v2.v2_9 import EVN
from zato.hl7v2.v2_9 import CWE, HD

evn = EVN()
evn.recorded_date_time = '20240820160000'
evn.event_reason_code = CWE(
    identifier='03',
    text='Discharge',
    name_of_coding_system='HL70062'
)
evn.event_occurred = '20240820160000'
evn.event_facility = HD(
    namespace_id='SOUTH',
    universal_id='South Campus',
    universal_id_type='LOCAL'
)

Learn by building

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

Frequently asked questions

EVN communicates the context of a trigger event in patient administration messages. It carries the recorded date/time, the planned event date, an event reason code, and the facility where the event occurred, allowing receiving systems to properly interpret and process the trigger event.

The event_reason_code field uses the CWE datatype with HL7 table 0062:

from zato.hl7v2.v2_9 import EVN, CWE

evn = EVN()
evn.event_reason_code = CWE(
    identifier='01',
    text='Admission',
    name_of_coding_system='HL70062'
)

The event_facility field uses the HD (hierarchic designator) datatype:

from zato.hl7v2.v2_9 import EVN, HD

evn = EVN()
evn.event_facility = HD(
    namespace_id='MAIN',
    universal_id='Main Hospital',
    universal_id_type='LOCAL'
)

recorded_date_time is when the event was recorded in the system, while event_occurred is when the event actually took place. They may differ when data entry is delayed:

from zato.hl7v2.v2_9 import EVN

evn = EVN()
evn.recorded_date_time = '20240601140000'
evn.event_occurred = '20240601120000'

Use the date_time_planned_event field to indicate when a future event is scheduled:

from zato.hl7v2.v2_9 import EVN

evn = EVN()
evn.recorded_date_time = '20240710'
evn.date_time_planned_event = (
    '20240715100000'
)

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.

EVN field reference

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

#Python nameDatatypeUsageRepeatableTable
2recorded_date_timeDTMRequiredNo-
3date_time_planned_eventDTMOptionalNo-
4event_reason_codeCWEOptionalNoHL70062
5operator_idXCNOptionalYesHL70188
6event_occurredDTMOptionalNo-
7event_facilityHDOptionalNo-

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python