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.
from zato.hl7v2 import PR1
pr1 = PR1()
pr1.set_id_pr1 = '1'
pr1.procedure_code = '99213'
pr1.procedure_date_time = '20260601'How to construct and work with real-world PR1 segments.
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'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'
)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'
)Step-by-step guides for working with HL7 v2 in Zato.
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.
Complete list of fields in the PR1 segment, HL7 v2.9.
| # | Python name | Datatype | Usage | Repeatable | Table |
|---|---|---|---|---|---|
| 1 | set_id_pr1 | SI | Required | No | - |
| 3 | procedure_code | CNE | Required | No | HL70088 |
| 5 | procedure_date_time | DTM | Required | No | - |
| 6 | procedure_functional_type | CWE | Optional | No | HL70230 |
| 7 | procedure_minutes | NM | Optional | No | - |
| 9 | anesthesia_code | CWE | Optional | No | HL70019 |
| 10 | anesthesia_minutes | NM | Optional | No | - |
| 13 | consent_code | CWE | Optional | No | HL70059 |
| 14 | procedure_priority | NM | Optional | No | HL70418 |
| 15 | associated_diagnosis_code | CWE | Optional | No | HL70051 |
| 16 | procedure_code_modifier | CNE | Optional | Yes | HL70340 |
| 17 | procedure_drg_type | CWE | Optional | No | HL70416 |
| 18 | tissue_type_code | CWE | Optional | Yes | HL70417 |
| 19 | procedure_identifier | EI | Optional | No | - |
| 20 | procedure_action_code | ID | Optional | No | HL70206 |
| 21 | drg_procedure_determination_status | CWE | Optional | No | HL70761 |
| 22 | drg_procedure_relevance | CWE | Optional | No | HL70763 |
| 23 | treating_organizational_unit | PL | Optional | Yes | - |
| 24 | respiratory_within_surgery | ID | Optional | No | HL70136 |
| 25 | parent_procedure_id | EI | Optional | No | - |
Get started with Zato and connect your systems in minutes.