Reference·HL7 v2·RXA
HL7 v2 Reference

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

Jul 27, 2026 · 6 min read

RXA is the segment that tells a receiving system a dose actually went into a patient — what was given, how much, when, and whether it counted. Immunization registries, MAR feeds, and VXU messages all lean on it, and most of the RXA bugs QA teams chase down live in a handful of fields.

Quick answer

RXA (Pharmacy/Treatment Administration) records a single administration or non-administration event for a drug, vaccine, or treatment. It shows up in VXU immunization messages and in pharmacy administration feeds, almost always paired with an RXR (route) segment and often an ORC. Testing it well means covering the timing fields, the coded product, the dose, and the two status/action fields that decide whether the event even counts.

The fields that actually matter in practice

RXA-3 →
Date/Time Start of Administration — when the dose was given — precision and timezone handling here trip up more integrations than any other RXA field
RXA-5 →
Administered Code — the coded product itself, usually CVX for vaccines or a local/NDC code for pharmacy — wrong table, wrong result
RXA-6 →
Administered Amount — the dose quantity; needs to be read alongside RXA-7 (units) to mean anything
RXA-9 →
Administration Notes — free-text or coded context about the event — often where lot-consent or refusal reasoning leaks in unexpectedly
RXA-20 →
Completion Status — CP, RE, NA, PA — whether the administration completed, was refused, or never happened
RXA-21 →
Action Code — A, U, D — add, update, or delete; governs whether downstream systems create or reconcile a record

Example

Synthetic example Generated by Synthibase
RXA|0|1|20260726090000||08^Hep B, adult^CVX|0.5|mL^^UCUM|||||||||||CP|A

A synthetic RXA line for a single-dose adult Hepatitis B administration, showing the give sub-ID counters, timing, coded product, dose, completion status, and action code.

Where this trips people up

Teams test the "happy path" administration and stop there, but RXA carries just as much meaning when nothing was actually given. A refused dose, a historical record entered after the fact, or a deleted/corrected entry all still produce an RXA segment — just with different values in RXA-20 and RXA-21. If your test suite only ever generates CP/A combinations, you will never catch the code that mishandles a refusal or a delete, and that gap tends to surface first in a live immunization registry submission.

HL7 ADT Messages: A01 through A08 Explained
Synthetic Patient Data: Complete Guide for Software Testing
Generate realistic RXA test messages in seconds
Synthibase produces synthetic HL7 v2 VXU and pharmacy messages with valid RXA segments — including refusals, deletes, and edge-case dosing — so you can test immunization and MAR feeds without waiting on real patient data.
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.