Schedule a demo
Segment

Observation request

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.

43fields
1required
v2.9HL7 version
obr.py
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')

Build OBR segments in Python

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

1

Wellness screening panel

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',
    )
2

Nutrition assessment

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'
3

Fitness evaluation

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',
)

Learn by building

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

Frequently asked questions

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_number

Several 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.

OBR field reference

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

#Python nameDatatypeUsageRepeatableTable
1set_id_obrSIOptionalNo-
2placer_order_numberEIOptionalNo-
3filler_order_numberEIOptionalNo-
4universal_service_identifierCWERequiredNo-
7observation_date_timeDTMOptionalNo-
8observation_end_date_timeDTMOptionalNo-
9collection_volumeCQOptionalNo-
10collector_identifierXCNOptionalYes-
11specimen_action_codeIDOptionalNoHL70065
12danger_codeCWEOptionalNoHL70613
13relevant_clinical_informationCWEOptionalYesHL70916
17order_callback_phone_numberXTNOptionalNo-
18placer_field_1STOptionalNo-
19placer_field_2STOptionalNo-
20filler_field_1STOptionalNo-
21filler_field_2STOptionalNo-
22results_rpt_status_chng_date_timeDTMOptionalNo-
23charge_to_practiceMOCOptionalNo-
24diagnostic_serv_sect_idIDOptionalNoHL70074
25result_statusIDOptionalNoHL70123
26parent_resultPRLOptionalNo-
29parent_results_observation_identifierEIPOptionalNo-
30transportation_modeIDOptionalNoHL70124
31reason_for_studyCWEOptionalYesHL70951
36scheduled_date_timeDTMOptionalNo-
37number_of_sample_containersNMOptionalNo-
38transport_logistics_of_collected_sampleCWEOptionalYesHL70614
39collectors_commentCWEOptionalYesHL70619
40transport_arrangement_responsibilityCWEOptionalNoHL70620
41transport_arrangedIDOptionalNoHL70224
42escort_requiredIDOptionalNoHL70225
43planned_patient_transport_commentCWEOptionalYesHL70621
44procedure_codeCNEOptionalNoHL70088
45procedure_code_modifierCNEOptionalYesHL70340
46placer_supplemental_service_informationCWEOptionalYesHL70411
47filler_supplemental_service_informationCWEOptionalYesHL70411
48medically_necessary_duplicate_procedure_reasonCWEOptionalNoHL70476
49result_handlingCWEOptionalNoHL70507
51observation_group_idEIOptionalNo-
52parent_observation_group_idEIOptionalNo-
53alternate_placer_order_numberCXOptionalYes-
54parent_orderEIPOptionalYes-
55action_codeIDOptionalNo-

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python