Schedule a demo
Segment

Product experience observation

Records clinical observations about an adverse product experience including the event onset, exacerbation, improvement, and end dates, whether the event was serious or expected, and the patient outcome. It appears in product experience report messages (P07/P08) and provides the clinical timeline and severity classification needed for regulatory adverse event reporting.

25fields
1required
v2.9HL7 version
peo.py
from zato.hl7v2 import PEO

peo = PEO()
peo.event_onset_date_time = '20260315'
peo.event_serious = 'Y'
peo.patient_outcome = 'R'

Build PEO segments in Python

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

1

Serious adverse event

Records a serious event with onset, end date, and patient outcome indicating recovery

from zato.hl7v2.v2_9 import PEO

peo = PEO()
peo.event_onset_date_time = (
    '20240315100000'
)
peo.event_ended_data_time = (
    '20240320160000'
)
peo.event_serious = 'Y'
peo.event_expected = 'N'
peo.patient_outcome = 'R'
2

Event with exacerbation

Captures an event that worsened before improving, with observer qualification

from zato.hl7v2.v2_9 import PEO

peo = PEO()
peo.event_onset_date_time = (
    '20240501080000'
)
peo.event_exacerbation_date_time = (
    '20240503120000'
)
peo.event_improved_date_time = (
    '20240510'
)
peo.event_serious = 'Y'
peo.patient_outcome = 'R'
peo.primary_observers_qualification = (
    'PH'
)
3

Observer confirmation

Event record with observer aware date, confirmation source, and identity divulgence flag

from zato.hl7v2.v2_9 import PEO

peo = PEO()
peo.event_onset_date_time = '20240701'
peo.event_serious = 'N'
peo.event_expected = 'Y'
peo.patient_outcome = 'SE'
peo.primary_observers_qualification = (
    'PH'
)
peo.confirmation_provided_by = 'PH'
peo.primary_observer_aware_date_time = (
    '20240702'
)
peo.primary_observers_identity_may_be_divulged = (
    'Y'
)

Learn by building

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

Frequently asked questions

PEO records clinical observations about an adverse product experience, including the event timeline (onset, exacerbation, improvement, end), whether the event was serious or expected, and the patient outcome. It is used in product experience report messages for regulatory adverse event reporting.

The event_serious field uses HL7 table 0238 to indicate whether the event was serious:

from zato.hl7v2.v2_9 import PEO

peo = PEO()

# Y = Yes (serious)
peo.event_serious = 'Y'

# N = No (not serious)
peo.event_serious = 'N'

The patient_outcome field uses HL7 table 0241 to classify the result:

from zato.hl7v2.v2_9 import PEO

peo = PEO()

# R = Recovered
peo.patient_outcome = 'R'

# SE = Sequelae
peo.patient_outcome = 'SE'

# D = Died
peo.patient_outcome = 'D'

Use the DTM-typed date fields to record the full clinical timeline of the event:

from zato.hl7v2.v2_9 import PEO

peo = PEO()
peo.event_onset_date_time = (
    '20240501080000'
)
peo.event_exacerbation_date_time = (
    '20240503120000'
)
peo.event_improved_date_time = (
    '20240510'
)
peo.event_ended_data_time = (
    '20240515'
)

Use the observer fields to record who observed the event and when:

from zato.hl7v2.v2_9 import PEO

peo = PEO()
peo.primary_observers_qualification = (
    'PH'
)
peo.confirmation_provided_by = 'PH'
peo.primary_observer_aware_date_time = (
    '20240702'
)
peo.primary_observers_identity_may_be_divulged = (
    'Y'
)

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.

PEO field reference

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

#Python nameDatatypeUsageRepeatableTable
1event_identifiers_usedCWEOptionalYesHL70678
2event_symptom_diagnosis_codeCWEOptionalYesHL70679
3event_onset_date_timeDTMRequiredNo-
4event_exacerbation_date_timeDTMOptionalNo-
5event_improved_date_timeDTMOptionalNo-
6event_ended_data_timeDTMOptionalNo-
7event_location_occurred_addressXADOptionalYes-
8event_qualificationIDOptionalYesHL70237
9event_seriousIDOptionalNoHL70238
10event_expectedIDOptionalNoHL70239
11event_outcomeIDOptionalYesHL70240
12patient_outcomeIDOptionalNoHL70241
13event_description_from_othersFTOptionalYes-
14event_description_from_original_reporterFTOptionalYes-
15event_description_from_patientFTOptionalYes-
16event_description_from_practitionerFTOptionalYes-
17event_description_from_autopsyFTOptionalYes-
18cause_of_deathCWEOptionalYesHL70680
19primary_observer_nameXPNOptionalYes-
20primary_observer_addressXADOptionalYes-
21primary_observer_telephoneXTNOptionalYes-
22primary_observers_qualificationIDOptionalNoHL70242
23confirmation_provided_byIDOptionalNoHL70242
24primary_observer_aware_date_timeDTMOptionalNo-
25primary_observers_identity_may_be_divulgedIDOptionalNoHL70243

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python