Schedule a demo
Segment

Patient adverse reaction information

Records detailed allergy and adverse reaction information for a patient, including allergen type and code, severity, reaction, onset date, and reported-by source. It replaces the older AL1 segment with support for action-code and unique-identifier update mode, and is widely used in ADT, order, and pharmacy messages sent between EHRs, pharmacy systems, and clinical data repositories.

30fields
3required
v2.9HL7 version
iam.py
from zato.hl7v2.v2_9 import IAM
from zato.hl7v2.v2_9 import CWE, EI

iam = IAM()
iam.set_id_iam = '1'
iam.allergen_type_code = CWE(
    identifier='FA',
    text='Food Allergy'
)

Build IAM segments in Python

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

1

Food allergy

Peanut allergy for nutrition planning

from zato.hl7v2.v2_9 import IAM
from zato.hl7v2.v2_9 import CWE, DTM

iam = IAM()
iam.set_id_iam = '1'
iam.allergen_type_code = CWE(
    identifier='FA',
    text='Food Allergy',
    name_of_coding_system='HL70127'
)
iam.allergen_code_mnemonic_description = CWE(
    identifier='PEANUT',
    text='Peanut'
)
iam.allergy_severity_code = CWE(
    identifier='SV',
    text='Severe',
    name_of_coding_system='HL70128'
)
iam.allergy_action_code = CWE(
    identifier='U',
    text='Unknown',
    name_of_coding_system='HL70438'
)
iam.onset_date = DTM('20200315')
2

Supplement sensitivity

Protein powder intolerance

from zato.hl7v2.v2_9 import IAM
from zato.hl7v2.v2_9 import CWE, DTM

iam = IAM()
iam.set_id_iam = '2'
iam.allergen_type_code = CWE(
    identifier='DA',
    text='Drug Allergy',
    name_of_coding_system='HL70127'
)
iam.allergen_code_mnemonic_description = CWE(
    identifier='WHEY',
    text='Whey Protein'
)
iam.allergy_severity_code = CWE(
    identifier='MI',
    text='Mild',
    name_of_coding_system='HL70128'
)
iam.allergy_action_code = CWE(
    identifier='A',
    text='Active',
    name_of_coding_system='HL70438'
)
iam.onset_date = DTM('20230601')
3

Environmental allergy

Latex sensitivity for equipment

from zato.hl7v2.v2_9 import IAM
from zato.hl7v2.v2_9 import CWE, DTM

iam = IAM()
iam.set_id_iam = '3'
iam.allergen_type_code = CWE(
    identifier='EA',
    text='Environmental Allergy',
    name_of_coding_system='HL70127'
)
iam.allergen_code_mnemonic_description = CWE(
    identifier='LATEX',
    text='Latex'
)
iam.allergy_severity_code = CWE(
    identifier='MO',
    text='Moderate',
    name_of_coding_system='HL70128'
)
iam.allergy_action_code = CWE(
    identifier='A',
    text='Active',
    name_of_coding_system='HL70438'
)
iam.onset_date = DTM('20190101')

Learn by building

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

Frequently asked questions

IAM contains patient adverse reaction information including allergen types, severity, and onset dates for wellness program safety tracking.

Common allergen types include FA (food allergy), DA (drug allergy), and EA (environmental allergy) from HL70127 table.

Use allergy_severity_code field with HL70128 values:

iam.allergy_severity_code = CWE(
    identifier='SV',
    text='Severe',
    name_of_coding_system='HL70128'
)

IAM contains allergy information while IAR contains specific reaction details. IAR segments follow IAM to describe reaction symptoms.

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.

IAM field reference

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

#Python nameDatatypeUsageRepeatableTable
1set_id_iamSIRequiredNo-
2allergen_type_codeCWEOptionalNoHL70127
3allergen_code_mnemonic_descriptionCWERequiredNo-
4allergy_severity_codeCWEOptionalNoHL70128
5allergy_reaction_codeSTOptionalYes-
6allergy_action_codeCNERequiredNoHL70206
7allergy_unique_identifierEIOptionalNo-
8action_reasonSTOptionalNo-
9sensitivity_to_causative_agent_codeCWEOptionalNoHL70436
10allergen_group_code_mnemonic_descriptionCWEOptionalNo-
11onset_dateDTOptionalNo-
12onset_date_textSTOptionalNo-
13reported_date_timeDTMOptionalNo-
14reported_byXPNOptionalNo-
15relationship_to_patient_codeCWEOptionalNoHL70063
16alert_device_codeCWEOptionalNoHL70437
17allergy_clinical_status_codeCWEOptionalNoHL70438
18statused_by_personXCNOptionalNo-
19statused_by_organizationXONOptionalNo-
20statused_at_date_timeDTMOptionalNo-
21inactivated_by_personXCNOptionalNo-
22inactivated_date_timeDTMOptionalNo-
23initially_recorded_by_personXCNOptionalNo-
24initially_recorded_date_timeDTMOptionalNo-
25modified_by_personXCNOptionalNo-
26modified_date_timeDTMOptionalNo-
27clinician_identified_codeCWEOptionalNo-
28initially_recorded_by_organizationXONOptionalNo-
29modified_by_organizationXONOptionalNo-
30inactivated_by_organizationXONOptionalNo-

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python