Schedule a demo
Segment

Appointment information

Identifies a general resource (equipment, device, or other non-personnel, non-location resource) needed for the appointment, including the resource identifier, type, start time, and duration. It appears in SIU and SRM/SRR messages when specific resources like portable imaging equipment or specialized instruments must be scheduled alongside the appointment.

14fields
2required
v2.9HL7 version
aig.py
from zato.hl7v2.v2_9 import AIG
from zato.hl7v2.v2_9 import XCN, CWE, DTM

aig = AIG()
aig.aig_primary_key_value = '1'
aig.aig_set_id_aig = '1'
aig.aig_scheduling_activity_id = 'APT202401150900'
aig.aig_action_code = CWE(
    identifier='NEW',
    text='New Appointment',
    name_of_coding_system='HL70287'
)
aig.aig_appointment_type = CWE(
    identifier='ROUTINE',
    text='Routine',
    name_of_coding_system='HL70276'
)
aig.aig_appointment_reason = CWE(
    identifier='PREVENTIVE',
    text='Preventive Care',
    name_of_coding_system='HL70464'
)

Build AIG segments in Python

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

1

Wellness check-up appointment

New routine preventive care visit appointment

from zato.hl7v2.v2_9 import AIG
from zato.hl7v2.v2_9 import XCN, CWE, DTM

aig = AIG()
aig.aig_primary_key_value = '1'
aig.aig_set_id_aig = '1'
aig.aig_scheduling_activity_id = 'APT202401150900'
aig.aig_action_code = CWE(
    identifier='NEW',
    text='New Appointment',
    name_of_coding_system='HL70287'
)
aig.aig_appointment_type = CWE(
    identifier='ROUTINE',
    text='Routine',
    name_of_coding_system='HL70276'
)
aig.aig_appointment_reason = CWE(
    identifier='PREVENTIVE',
    text='Preventive Care',
    name_of_coding_system='HL70464'
)
aig.aig_appointment_location = CWE(
    identifier='FITNESS',
    text='Fitness Center',
    name_of_coding_system='HL70464'
)
aig.aig_start_date_time = DTM('20240115090000')
aig.aig_end_date_time = DTM('20240115100000')
aig.aig_appointment_status = 'SCHEDULED'
2

Nutrition consultation appointment

Follow-up nutrition counseling appointment

from zato.hl7v2.v2_9 import AIG
from zato.hl7v2.v2_9 import XCN, CWE, DTM

aig = AIG()
aig.aig_primary_key_value = '2'
aig.aig_set_id_aig = '1'
aig.aig_scheduling_activity_id = 'APT20240116140000'
aig.aig_action_code = CWE(
    identifier='MODIFY',
    text='Modify Appointment',
    name_of_coding_system='HL70287'
)
aig.aig_appointment_type = CWE(
    identifier='NUTRITION',
    text='Nutrition Counseling',
    name_of_coding_system='HL70276'
)
aig.aig_appointment_reason = CWE(
    identifier='DIETARY',
    text='Dietary Counseling',
    name_of_coding_system='HL70464'
)
aig.aig_appointment_location = CWE(
    identifier='NUTRITION',
    text='Nutrition Services',
    name_of_coding_system='HL70464'
)
aig.aig_start_date_time = DTM('20240116140000')
aig.aig_end_date_time = DTM('20240116150000')
aig.aig_appointment_status = 'CONFIRMED'
3

Group fitness class appointment

New group fitness program appointment

from zato.hl7v2.v2_9 import AIG
from zato.hl7v2.v2_9 import XCN, CWE, DTM

aig = AIG()
aig.aig_primary_key_value = '3'
aig.aig_set_id_aig = '1'
aig.aig_scheduling_activity_id = 'APT20240117180000'
aig.aig_action_code = CWE(
    identifier='NEW',
    text='New Appointment',
    name_of_coding_system='HL70287'
)
aig.aig_appointment_type = CWE(
    identifier='GROUP',
    text='Group Class',
    name_of_coding_system='HL70276'
)
aig.aig_appointment_reason = CWE(
    identifier='FITNESS',
    text='Fitness Program',
    name_of_coding_system='HL70464'
)
aig.aig_appointment_location = CWE(
    identifier='GROUP',
    text='Group Fitness Room',
    name_of_coding_system='HL70464'
)
aig.aig_start_date_time = DTM('20240117180000')
aig.aig_end_date_time = DTM('20240117190000')
aig.aig_appointment_status = 'PENDING'

Learn by building

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

Frequently asked questions

AIG contains appointment information including general details, resource allocation, scheduling preferences, and appointment status. It's used to coordinate wellness appointments and preventive care visits.

Use HL70287 table values for appointment actions like NEW, MODIFY, or CANCEL:

aig.aig_action_code = CWE(
    identifier='NEW',
    text='New Appointment',
    name_of_coding_system='HL70287'
)

Common status values include SCHEDULED, CONFIRMED, PENDING, CANCELLED, or COMPLETED. These help track the lifecycle of wellness center appointments.

Use DTM datatype with YYYYMMDDHHMMSS format for appointment date-time values:

aig.aig_start_date_time = DTM('20240115090000')
aig.aig_end_date_time = DTM('20240115100000')

AIS contains patient-specific appointment information, while AIG contains general appointment details and resource allocation. Both are used together for complete appointment management in wellness centers.

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.

AIG field reference

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

#Python nameDatatypeUsageRepeatableTable
1set_id_aigSIRequiredNo-
2segment_action_codeIDOptionalNoHL70206
3resource_idCWEOptionalNo-
4resource_typeCWERequiredNo-
5resource_groupCWEOptionalYes-
6resource_quantityNMOptionalNo-
7resource_quantity_unitsCNEOptionalNo-
8start_date_timeDTMOptionalNo-
9start_date_time_offsetNMOptionalNo-
10start_date_time_offset_unitsCNEOptionalNo-
11durationNMOptionalNo-
12duration_unitsCNEOptionalNo-
13allow_substitution_codeCWEOptionalNoHL70279
14filler_status_codeCWEOptionalNoHL70278

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python