Schedule a demo
Segment

Procedures

Contains procedure information for a patient encounter including the procedure code, date/time, functional type, duration in minutes, anesthesia details, consent code, priority, and associated diagnosis. It also carries DRG-related fields such as procedure determination status and relevance. This segment appears in ADT, BAR, and DFT messages to support clinical documentation, billing, and DRG assignment workflows.

20fields
3required
v2.9HL7 version
pr1.py
from zato.hl7v2 import PR1

pr1 = PR1()
pr1.set_id_pr1 = '1'
pr1.procedure_code = '99213'
pr1.procedure_date_time = '20260601'

Build PR1 segments in Python

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

1

Surgical procedure

Records a surgical procedure with code, date, type, duration, and anesthesia details

from zato.hl7v2.v2_9 import PR1
from zato.hl7v2.v2_9 import CNE, CWE

pr1 = PR1()
pr1.set_id_pr1 = '1'
pr1.procedure_code = CNE(
    identifier='44950',
    text='Appendectomy',
    name_of_coding_system='CPT'
)
pr1.procedure_date_time = (
    '20240601100000'
)
pr1.procedure_functional_type = CWE(
    identifier='SUR',
    text='Surgery',
    name_of_coding_system='HL70230'
)
pr1.procedure_minutes = '120'
pr1.anesthesia_code = CWE(
    identifier='GEN',
    text='General',
    name_of_coding_system='HL70019'
)
pr1.anesthesia_minutes = '90'
pr1.procedure_priority = '1'
2

Diagnostic procedure

Records a diagnostic procedure with consent, associated diagnosis, and DRG relevance

from zato.hl7v2.v2_9 import PR1
from zato.hl7v2.v2_9 import CNE, CWE

pr1 = PR1()
pr1.set_id_pr1 = '2'
pr1.procedure_code = CNE(
    identifier='43239',
    text='EGD with biopsy',
    name_of_coding_system='CPT'
)
pr1.procedure_date_time = (
    '20240715080000'
)
pr1.procedure_functional_type = CWE(
    identifier='DX',
    text='Diagnostic',
    name_of_coding_system='HL70230'
)
pr1.procedure_minutes = '45'
pr1.anesthesia_code = CWE(
    identifier='LOC',
    text='Local',
    name_of_coding_system='HL70019'
)
pr1.anesthesia_minutes = '15'
pr1.associated_diagnosis_code = CWE(
    identifier='K21.0',
    text='GERD',
    name_of_coding_system='ICD10'
)
pr1.drg_procedure_determination_status = CWE(
    identifier='DRG1',
    text='Primary',
    name_of_coding_system='HL70761'
)
pr1.drg_procedure_relevance = CWE(
    identifier='REL',
    text='Relevant',
    name_of_coding_system='HL70763'
)
3

Child procedure

Records a procedure linked to a parent procedure with identifier and action code

from zato.hl7v2.v2_9 import PR1
from zato.hl7v2.v2_9 import CNE, CWE, EI

pr1 = PR1()
pr1.set_id_pr1 = '3'
pr1.procedure_code = CNE(
    identifier='27447',
    text='Knee replacement',
    name_of_coding_system='CPT'
)
pr1.procedure_date_time = (
    '20240820090000'
)
pr1.procedure_functional_type = CWE(
    identifier='SUR',
    text='Surgery',
    name_of_coding_system='HL70230'
)
pr1.procedure_minutes = '180'
pr1.procedure_identifier = EI(
    entity_identifier='PR1-2024-001',
    namespace_id='MAIN'
)
pr1.procedure_action_code = 'AD'
pr1.respiratory_within_surgery = 'N'
pr1.parent_procedure_id = EI(
    entity_identifier='PR1-2024-000',
    namespace_id='MAIN'
)

Learn by building

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

Frequently asked questions

PR1 carries procedure information for a patient encounter including the procedure code, date/time, functional type, duration, anesthesia details, priority, associated diagnosis, and DRG-related fields. It appears in ADT, BAR, and DFT messages for clinical documentation and billing.

The procedure_code field uses CNE with HL7 table 0088:

from zato.hl7v2.v2_9 import PR1, CNE

pr1 = PR1()
pr1.procedure_code = CNE(
    identifier='44950',
    text='Appendectomy',
    name_of_coding_system='CPT'
)

Use the anesthesia_code and anesthesia_minutes fields:

from zato.hl7v2.v2_9 import PR1, CWE

pr1 = PR1()
pr1.anesthesia_code = CWE(
    identifier='GEN',
    text='General',
    name_of_coding_system='HL70019'
)
pr1.anesthesia_minutes = '90'

Use the parent_procedure_id field with the EI datatype:

from zato.hl7v2.v2_9 import PR1, EI

pr1 = PR1()
pr1.procedure_identifier = EI(
    entity_identifier='PR1-001',
    namespace_id='MAIN'
)
pr1.parent_procedure_id = EI(
    entity_identifier='PR1-000',
    namespace_id='MAIN'
)

The associated_diagnosis_code field uses CWE with HL7 table 0051:

from zato.hl7v2.v2_9 import PR1, CWE

pr1 = PR1()
pr1.associated_diagnosis_code = CWE(
    identifier='K21.0',
    text='GERD',
    name_of_coding_system='ICD10'
)

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.

PR1 field reference

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

#Python nameDatatypeUsageRepeatableTable
1set_id_pr1SIRequiredNo-
3procedure_codeCNERequiredNoHL70088
5procedure_date_timeDTMRequiredNo-
6procedure_functional_typeCWEOptionalNoHL70230
7procedure_minutesNMOptionalNo-
9anesthesia_codeCWEOptionalNoHL70019
10anesthesia_minutesNMOptionalNo-
13consent_codeCWEOptionalNoHL70059
14procedure_priorityNMOptionalNoHL70418
15associated_diagnosis_codeCWEOptionalNoHL70051
16procedure_code_modifierCNEOptionalYesHL70340
17procedure_drg_typeCWEOptionalNoHL70416
18tissue_type_codeCWEOptionalYesHL70417
19procedure_identifierEIOptionalNo-
20procedure_action_codeIDOptionalNoHL70206
21drg_procedure_determination_statusCWEOptionalNoHL70761
22drg_procedure_relevanceCWEOptionalNoHL70763
23treating_organizational_unitPLOptionalYes-
24respiratory_within_surgeryIDOptionalNoHL70136
25parent_procedure_idEIOptionalNo-

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python