Defines what service, test, or procedure is being ordered or resulted, identified by a universal service identifier such as a LOINC code. It is the primary detail segment for lab orders, radiology orders, and other diagnostic studies, and carries data such as specimen received date and time, result status, and ordering provider. OBR is found in ORM and OML order messages sent from EHR or CPOE systems to ancillary systems, and in ORU result messages sent back.
from zato.hl7v2 import OBR, CWE, EI
obr = OBR()
obr.universal_service_identifier = CWE(
identifier='WELLNESS01',
text='Annual Wellness',
)
obr.placer_order_number = EI(
entity_identifier='ORD001')How to construct and work with real-world OBR segments.
Preventive screening order with timing, specimen volume, collector, transport, and procedure coding
from zato.hl7v2.v2_9 import OBR
from zato.hl7v2.v2_9 import (
CWE, CQ, CNE, EI, EIP, MOC, PRL, XCN, XTN,
)
obr = OBR()
obr.set_id_obr = '1'
obr.placer_order_number = EI(
entity_identifier='SCR001',
universal_id_type='WELL',
)
obr.filler_order_number = EI(
entity_identifier='LAB001',
universal_id_type='GV',
)
obr.universal_service_identifier = CWE(
identifier='WELLNESS01',
text='Annual Wellness',
name_of_coding_system='L',
)
obr.observation_date_time = '20240415100000'
obr.observation_end_date_time = '20240415103000'
obr.collection_volume = CQ(
quantity='5',
units='mL',
)
obr.collector_identifier = XCN(
person_identifier='1234567890',
family_name='LEE',
given_name='JENNY'
)
obr.specimen_action_code = 'G'
obr.danger_code = CWE(
identifier='HANDLE',
text='Careful handling',
name_of_coding_system='L',
)
obr.relevant_clinical_information = CWE(
identifier='DIET',
text='Balanced nutrition',
name_of_coding_system='L'
)
obr.order_callback_phone_number = XTN(
telephone_number='5551002000',
telecommunication_use_code='PRN',
telecommunication_equipment_type='PH',
)
obr.placer_field_1 = 'REF-WELL'
obr.placer_field_2 = 'GRP2024'
obr.filler_field_1 = 'NOTE1'
obr.filler_field_2 = 'NOTE2'
obr.results_rpt_status_chng_date_time = '20240415120000'
obr.charge_to_practice = MOC(
monetary_amount='50',
charge_code='WELL',
)
obr.diagnostic_serv_sect_id = 'LAB'
obr.result_status = 'F'
obr.parent_result = PRL(
parent_observation_identifier='WELL',
parent_observation_subidentifier='1',
parent_observation_value_descriptor='2',
)
obr.parent_results_observation_identifier = EIP(
placer_assigned_identifier='PO200^^^WELL',
filler_assigned_identifier='FI200^^^GV',
)
obr.transportation_mode = 'WALK'
obr.reason_for_study = CWE(
identifier='WELL',
text='General wellness',
name_of_coding_system='L'
)
obr.scheduled_date_time = '20240416100000'
obr.number_of_sample_containers = '1'
obr.transport_logistics_of_collected_sample = CWE(
identifier='LOG',
text='Courier',
name_of_coding_system='L'
)
obr.collectors_comment = CWE(
identifier='COM',
text='Collected on time',
name_of_coding_system='L'
)
obr.transport_arrangement_responsibility = CWE(
identifier='FACILITY',
text='Clinic staff',
name_of_coding_system='L',
)
obr.transport_arranged = 'Y'
obr.escort_required = 'N'
obr.planned_patient_transport_comment = CWE(
identifier='RIDE',
text='Shuttle arranged',
name_of_coding_system='L'
)
obr.procedure_code = CNE(
identifier='99395',
text='Preventive visit',
name_of_coding_system='CPT',
)
obr.procedure_code_modifier = [
CNE(
identifier='59',
text='Modifier',
name_of_coding_system='CPT',
),
]
obr.placer_supplemental_service_information = CWE(
identifier='SUPP',
text='Panel info',
name_of_coding_system='L'
)
obr.filler_supplemental_service_information = CWE(
identifier='SUPP2',
text='Add-on',
name_of_coding_system='L'
)
obr.medically_necessary_duplicate_procedure_reason = CWE(
identifier='DUP',
text='Same-day scheduling',
name_of_coding_system='L',
)Focused nutrition observation request with placer, filler, and timing
from zato.hl7v2.v2_9 import OBR
from zato.hl7v2.v2_9 import CWE, EI
obr = OBR()
obr.set_id_obr = '1'
obr.placer_order_number = EI(
entity_identifier='NUT200',
universal_id_type='CLINIC',
)
obr.filler_order_number = EI(
entity_identifier='REG88',
universal_id_type='INTAKE',
)
obr.universal_service_identifier = CWE(
identifier='NUTR01',
text='Nutrition Assessment',
name_of_coding_system='L',
)
obr.observation_date_time = '20240510140000'Exercise capacity testing with collection volume and observation window
from zato.hl7v2.v2_9 import OBR
from zato.hl7v2.v2_9 import CWE, CQ, EI
obr = OBR()
obr.set_id_obr = '2'
obr.placer_order_number = EI(
entity_identifier='FIT100',
universal_id_type='GYM',
)
obr.filler_order_number = EI(
entity_identifier='REG50',
universal_id_type='LAB',
)
obr.universal_service_identifier = CWE(
identifier='FITEVAL',
text='Fitness Evaluation',
name_of_coding_system='L',
)
obr.observation_date_time = '20240420120000'
obr.observation_end_date_time = '20240420130000'
obr.collection_volume = CQ(
quantity='10',
units='mL',
)Step-by-step guides for working with HL7 v2 in Zato.
OBR describes the observation or service being requested or reported: universal service codes, order identifiers, timing, specimen and transport details, and status fields. It links ORC order context to OBX results in result messages.
Create an OBR segment and assign typed values to its attributes:
from zato.hl7v2.v2_9 import OBR, CWE, EI
obr = OBR()
obr.placer_order_number = EI(
entity_identifier='SCR001',
universal_id_type='WELL',
)
obr.universal_service_identifier = CWE(
identifier='WELLNESS01',
text='Annual Wellness',
name_of_coding_system='L',
)
svc = obr.universal_service_identifier
placer = obr.placer_order_numberSeveral positions were withdrawn in HL7 v2.9 (for example 5, 6, 14–16, 27–28, and 32–35). Implementations keep those slots as empty fields so later positions stay aligned with the standard numbering.
Field 4 is required and uses the CWE datatype:
from zato.hl7v2.v2_9 import OBR, CWE
obr = OBR()
obr.universal_service_identifier = CWE(
identifier='WELLNESS01',
text='Annual Wellness',
name_of_coding_system='L',
)OBR-2 and OBR-3 repeat the placer and filler order numbers from ORC so observation rows stay tied to the same order when multiple OBR segments appear in one message.
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 OBR segment, HL7 v2.9.
| # | Python name | Datatype | Usage | Repeatable | Table |
|---|---|---|---|---|---|
| 1 | set_id_obr | SI | Optional | No | - |
| 2 | placer_order_number | EI | Optional | No | - |
| 3 | filler_order_number | EI | Optional | No | - |
| 4 | universal_service_identifier | CWE | Required | No | - |
| 7 | observation_date_time | DTM | Optional | No | - |
| 8 | observation_end_date_time | DTM | Optional | No | - |
| 9 | collection_volume | CQ | Optional | No | - |
| 10 | collector_identifier | XCN | Optional | Yes | - |
| 11 | specimen_action_code | ID | Optional | No | HL70065 |
| 12 | danger_code | CWE | Optional | No | HL70613 |
| 13 | relevant_clinical_information | CWE | Optional | Yes | HL70916 |
| 17 | order_callback_phone_number | XTN | Optional | No | - |
| 18 | placer_field_1 | ST | Optional | No | - |
| 19 | placer_field_2 | ST | Optional | No | - |
| 20 | filler_field_1 | ST | Optional | No | - |
| 21 | filler_field_2 | ST | Optional | No | - |
| 22 | results_rpt_status_chng_date_time | DTM | Optional | No | - |
| 23 | charge_to_practice | MOC | Optional | No | - |
| 24 | diagnostic_serv_sect_id | ID | Optional | No | HL70074 |
| 25 | result_status | ID | Optional | No | HL70123 |
| 26 | parent_result | PRL | Optional | No | - |
| 29 | parent_results_observation_identifier | EIP | Optional | No | - |
| 30 | transportation_mode | ID | Optional | No | HL70124 |
| 31 | reason_for_study | CWE | Optional | Yes | HL70951 |
| 36 | scheduled_date_time | DTM | Optional | No | - |
| 37 | number_of_sample_containers | NM | Optional | No | - |
| 38 | transport_logistics_of_collected_sample | CWE | Optional | Yes | HL70614 |
| 39 | collectors_comment | CWE | Optional | Yes | HL70619 |
| 40 | transport_arrangement_responsibility | CWE | Optional | No | HL70620 |
| 41 | transport_arranged | ID | Optional | No | HL70224 |
| 42 | escort_required | ID | Optional | No | HL70225 |
| 43 | planned_patient_transport_comment | CWE | Optional | Yes | HL70621 |
| 44 | procedure_code | CNE | Optional | No | HL70088 |
| 45 | procedure_code_modifier | CNE | Optional | Yes | HL70340 |
| 46 | placer_supplemental_service_information | CWE | Optional | Yes | HL70411 |
| 47 | filler_supplemental_service_information | CWE | Optional | Yes | HL70411 |
| 48 | medically_necessary_duplicate_procedure_reason | CWE | Optional | No | HL70476 |
| 49 | result_handling | CWE | Optional | No | HL70507 |
| 51 | observation_group_id | EI | Optional | No | - |
| 52 | parent_observation_group_id | EI | Optional | No | - |
| 53 | alternate_placer_order_number | CX | Optional | Yes | - |
| 54 | parent_order | EIP | Optional | Yes | - |
| 55 | action_code | ID | Optional | No | - |
Get started with Zato and connect your systems in minutes.