Reference·OBR Segment·OBR-1
HL7 v2 Reference

Testing HL7 v2 OBR-1: What Set ID Actually Needs to Handle

Jul 27, 2026 · 4 min read
OBR-2 →

A single ORM or ORU message can carry several OBR segments for the same encounter — one per order — and OBR-1 is the only field that tells a receiving system the order they belong in. Drop or renumber it and a downstream system can silently associate the wrong result set with the wrong order.

Quick answer

OBR-1 is the first field of the HL7 v2 OBR segment — a simple integer that numbers each repeating OBR within the message, starting at 1, so systems can tell multiple orders in the same message apart.

What this field contains

1
First order — the first OBR segment in the message
2, 3...
Subsequent orders — each additional OBR increments by one, in segment order
gaps/resets
Malformed sequence — a skipped or repeated number usually signals an upstream generation bug

Example

Synthetic example Generated by Synthibase
OBR|1|ORD44219^SYNTHIB|FIL98831^SYNTHIB|CBC^Complete Blood Count^L|||20260726090000|||||||||3021^HAYES^DEREK^A^^^MD||||||||CH|F||||||R/O anemia

OBR-1 is set to 1, marking this as the first (and here, only) order in the message. Synthetic order — not a real patient.

Where this trips people up

Set ID looks trivial, so it's rarely on anyone's test checklist — until a message with three orders gets split into individual messages by an interface engine, and the splitting logic forgets to renumber OBR-1 back to 1 for each new message. Receiving systems that use OBR-1 to key a lookup table then start overwriting one order's data with another's. Test multi-order messages explicitly, not just single-order ones.

HL7 v2 OBR Segment Guide: Fields, Format, and Testing Gotchas
HL7 ADT Messages: A01 through A08 Explained
Regression Testing for EHR Upgrades: A Complete Guide
Generate multi-order HL7 messages automatically
Synthibase generates synthetic ORM and ORU messages with correctly sequenced, repeating OBR segments — no manual message-building required.
Start free trial →
This page is written independently by Synthibase for testing and informational purposes. It is not an official publication of HL7 International or X12/Washington Publishing Company, and is not a substitute for reviewing the official standard or your trading partner's companion guide. See our Terms of Service for full legal terms.