Reference·HL7 v2·RXR
HL7 v2 Reference

HL7 v2 RXR Segment Guide: Fields, Format, and Testing Gotchas

Jul 28, 2026 · 5 min read

RXA tells you a dose was given — RXR tells you how. Without a valid route, site, and device, an administration record is incomplete no matter how correct the drug and dose look, and RXR is the segment that most integrations treat as an afterthought until a route code shows up that nobody mapped.

Quick answer

RXR (Pharmacy/Treatment Route) records how a drug or vaccine was physically administered: the route the substance took into the body, the anatomical site where it was given, and the device used to deliver it. It follows directly after an RXA segment in pharmacy and immunization messages, and most systems only require RXR-1, but real-world feeds lean heavily on RXR-2 and RXR-3 for injectable and infused products.

The fields that actually matter in practice

RXR-1 →
Route — the coded path the substance entered the body by — oral, intramuscular, intravenous, and so on; almost always present and almost always coded against a route table
RXR-2 →
Administration Site — the coded body location for the dose — left deltoid, right thigh, etc.; required in practice for injectables even though the standard treats it as optional
RXR-3 →
Administration Device — the coded delivery mechanism — syringe, infusion pump, nebulizer — that receiving systems use to distinguish delivery methods that share a route

Example

Synthetic example Generated by Synthibase
RXA|0|1|20260726090000||08^Hep B, adult^CVX|0.5|mL^^UCUM|||||||||||CP|A
RXR|IM^Intramuscular^HL70162|LD^Left Deltoid^HL70163|SY^Syringe^HL70164

A synthetic RXA/RXR pair: the RXA records a 0.5 mL adult Hepatitis B dose, and the paired RXR shows it was given intramuscularly, into the left deltoid, via syringe.

Where this trips people up

Teams often build test data that only varies RXA and leaves RXR fixed to a single route/site/device combination, usually IM/deltoid/syringe. That hides bugs in how the receiving system handles oral doses with no meaningful site, infusions where RXR-3 carries a pump identifier instead of a simple device code, or nebulized treatments where RXR-2 is legitimately absent. Because RXR-2 and RXR-3 are optional in the standard, some parsers assume they can be blank without consequence — until a downstream MAR display or registry submission expects a site for every injectable and silently drops or flags the record instead.

HL7 ADT Messages: A01 through A08 Explained
How to Write EDI Test Cases
Generate realistic RXA/RXR pairs in seconds
Synthibase produces synthetic HL7 v2 pharmacy and immunization messages with correctly paired RXA and RXR segments — covering the full range of routes, sites, and devices — so your test suite handles more than the one combination someone hardcoded years ago.
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.