NEWFree ROI Calculators — quantify what prior auth and siloed data are costing your organization.Prior Auth ROI Siloed Data ROI
HL7 v2Segment10 min read

HL7 RXE Segment: Pharmacy / Treatment Encoded Order

The RXE (Pharmacy/Treatment Encoded Order) segment carries the pharmacy's or treatment supplier's encoded interpretation of a medication order. Where the RXO segment represents what the ordering provider requested, the RXE represents the order as the pharmacy or treatment system has resolved it — with a confirmed Give Code, give and dispense amounts, units, refill counts, and a prescription number. It is the backbone segment of the RDE (Pharmacy/Treatment Encoded Order) message.

Purpose

The RXE segment exists to communicate a fully encoded, pharmacy-ready treatment order. After an ordering provider submits a request (often as an RXO segment), the pharmacy application validates and encodes it: selecting the dispensable product, computing the give and dispense quantities, assigning a prescription number, and recording refill information. The resulting RXE is the authoritative, machine-actionable representation of that order, ready for downstream dispensing (RXD), giving (RXG), and administration (RXA) workflows.

Used in

The RXE segment appears in RDE messages (Pharmacy/Treatment Encoded Order), where it is the central order-detail segment within each order group. It is typically accompanied by one or more RXR (route) segments and optional RXC (component) segments, all preceded by the common ORC order-control segment.

Field-by-field reference

Source: HAPI HL7v2 v2.5.1 javadocs (RXE javadoc) for sequence, name, data type, and repetition. Length is not published in the javadocs (); Required and Table # are filled from the HL7 v2.5.1 standard where well-established.

SeqNameData TypeLengthReqRepeatTable #Description
RXE-1Quantity/TimingtqOQuantity and timing of the encoded order
RXE-2Give CodeceRCoded identifier of the medication to give
RXE-3Give Amount - MinimumnmRMinimum amount to give per administration
RXE-4Give Amount - MaximumnmOMaximum amount to give per administration
RXE-5Give UnitsceRUnits for the give amount
RXE-6Give Dosage FormceOForm in which the drug is given
RXE-7Provider's Administration InstructionsceOYFree-text or coded administration instructions
RXE-8Deliver-To Locationla1OLocation where the drug is to be delivered
RXE-9Substitution StatusidOHL70167Whether substitution is allowed or occurred
RXE-10Dispense AmountnmOQuantity to dispense
RXE-11Dispense UnitsceOUnits for the dispense amount
RXE-12Number Of RefillsnmOTotal number of refills authorized
RXE-13Ordering Provider's DEA NumberxcnOYDEA number of the ordering provider
RXE-14Pharmacist/Treatment Supplier's Verifier IDxcnOYIdentifier of the verifying pharmacist
RXE-15Prescription NumberstOPharmacy-assigned prescription number
RXE-16Number of Refills RemainingnmORefills still available
RXE-17Number of Refills/Doses DispensednmORefills or doses already dispensed
RXE-18D/T of Most Recent Refill or Dose DispensedtsOTimestamp of most recent dispense
RXE-19Total Daily DosecqOTotal amount given per day
RXE-20Needs Human ReviewidOHL70136Flag indicating manual review is required
RXE-21Pharmacy/Treatment Supplier's Special Dispensing InstructionsceOYSpecial dispensing instructions
RXE-22Give Per (Time Unit)stOTime unit over which the dose is given
RXE-23Give Rate AmountstORate at which the drug is given
RXE-24Give Rate UnitsceOUnits for the give rate
RXE-25Give StrengthnmOStrength of the medication to give
RXE-26Give Strength UnitsceOUnits for the give strength
RXE-27Give IndicationceOYReason or indication for giving the drug
RXE-28Dispense Package SizenmOSize of the dispense package
RXE-29Dispense Package Size UnitceOUnits for the dispense package size
RXE-30Dispense Package MethodidOHL70321Method of dispense packaging
RXE-31Supplementary CodeceOYAdditional codes such as billing modifiers
RXE-32Original Order Date/TimetsODate/time the original order was placed
RXE-33Give Drug Strength VolumenmOVolume associated with the drug strength
RXE-34Give Drug Strength Volume UnitscweOUnits for the drug strength volume
RXE-35Controlled Substance SchedulecweOHL70477DEA controlled substance schedule
RXE-36Formulary StatusidOHL70478Formulary status of the drug
RXE-37Pharmaceutical Substance AlternativecweOYAlternative pharmaceutical substances
RXE-38Pharmacy of Most Recent FillcweOPharmacy that performed the most recent fill
RXE-39Initial Dispense AmountnmOAmount dispensed on the initial fill
RXE-40Dispensing PharmacycweOPharmacy responsible for dispensing
RXE-41Dispensing Pharmacy AddressxadOAddress of the dispensing pharmacy
RXE-42Deliver-to Patient LocationplOPatient location for delivery
RXE-43Deliver-to AddressxadOAddress to deliver the medication
RXE-44Pharmacy Order TypeidOHL70480Type of pharmacy order (inpatient/outpatient)

Most-used fields

In practice, most integrations focus on a small subset of RXE. RXE-2 (Give Code) identifies the medication, usually with an NDC or RxNorm code. RXE-3 and RXE-5 (Give Amount - Minimum and Give Units) define the dose per administration. RXE-10 and RXE-11 (Dispense Amount and Dispense Units) drive the quantity dispensed. RXE-12 (Number Of Refills) and RXE-15 (Prescription Number) anchor the prescription lifecycle, and RXE-1 (Quantity/Timing) ties the order to a schedule. RXE-9 (Substitution Status) is closely watched for generic-substitution rules.

Version differences (2.3 to 2.8.2)

The RXE segment has grown steadily across versions. In v2.3 it ended around field 25, covering the core give/dispense fields. v2.3.1 and v2.4 added the give-rate and indication fields. v2.5 and v2.5.1 introduced fields 33 through 44, including Give Drug Strength Volume, Controlled Substance Schedule, Formulary Status, the dispensing pharmacy block (38–41), and Pharmacy Order Type (RXE-44). Later releases (v2.6 through v2.8.2) refined data types — for example migrating several CE fields toward CWE — and clarified table bindings, but the field sequence documented here for v2.5.1 remains stable through the later 2.x line.

Common mistakes

A frequent error is treating RXE as interchangeable with RXO; they serve different roles, with RXO representing the requested order and RXE the encoded, pharmacy-resolved order. Another is omitting units (RXE-5, RXE-11) while populating amounts, which makes the dose ambiguous. Integrators sometimes confuse RXE-12 (total refills authorized) with RXE-16 (refills remaining), producing incorrect refill counts. Repeating fields such as RXE-7, RXE-13, RXE-14, RXE-21, RXE-27, RXE-31, and RXE-37 must be encoded with the repetition separator (~) rather than collapsed into one value. Finally, RXE-15 (Prescription Number) should be consistent across the dispensing lifecycle so RDS and RGV messages can be correlated.

Examples

A minimal valid RXE segment:

RXE|1^^^20260612^^R|00093-0058-01^Amoxicillin 500 MG Capsule^NDC|1||CAP

A fully-populated RXE segment:

RXE|1^^^20260612080000^^R|00093-0058-01^Amoxicillin 500 MG Capsule^NDC|1|1|CAP|CAP^Capsule^HL70488|Take with food~Finish entire course|^^^WARD3^^^^^Pharmacy Hold|G|30|CAP|2|AA1234567^Welby^Marcus^^^^Dr^^DEA|PH9981^Stone^Rita^^^^RPh|RX0000457821|1|0|20260612083000|500^mg/day|N|Refrigerate after opening|day|500|mg|PO^By mouth^HL70162|500|mg|J01CA04^Bacterial infection^ICD10|100|CAP|F|MOD3^Modifier|20260610090000|5|mL|RX^Schedule RX^HL70477|F|00093-0059-01^Amoxicillin alt^NDC|PHARM-CENTRAL^Central Pharmacy|30|MAIN-PHARM^Main Pharmacy|123 Health Way^^Springfield^IL^62704|WARD3^^^GENHOSP|456 Patient Ln^^Springfield^IL^62704|O

Annotated breakdown:

RXE|1^^^20260612080000^^R|00093-0058-01^Amoxicillin 500 MG Capsule^NDC|1|1|CAP|...
    |                     |                                            | | |
    |                     |                                            | | +--> RXE-5 Give Units (CAP)
    |                     |                                            | +----> RXE-4 Give Amount - Maximum (1)
    |                     |                                            +------> RXE-3 Give Amount - Minimum (1)
    |                     +-----------------------------------------------> RXE-2 Give Code (NDC for Amoxicillin)
    +---------------------------------------------------------------------> RXE-1 Quantity/Timing (start 20260612080000, priority R)

In context inside an RDE message (new encoded order):

MSH|^~&|PHARMSYS|GENHOSP|EHR|GENHOSP|20260612083000||RDE^O11^RDE_O11|MSG00072145|P|2.5.1
PID|1||MRN556677^^^GENHOSP^MR||Calloway^Dana^E||19840722|F
ORC|NW|ORD778899^EHR|RX0000457821^PHARMSYS|||||20260612080000|||AA1234567^Welby^Marcus^^^^Dr
RXE|1^^^20260612080000^^R|00093-0058-01^Amoxicillin 500 MG Capsule^NDC|1||CAP|CAP^Capsule^HL70488|Take with food|||30|CAP|2|||RX0000457821|2|0
RXR|PO^By mouth^HL70162

A second in-context excerpt (encoded order with a route and component):

MSH|^~&|PHARMSYS|GENHOSP|EHR|GENHOSP|20260612090000||RDE^O11^RDE_O11|MSG00072146|P|2.5.1
PID|1||MRN112233^^^GENHOSP^MR||Okafor^Jane^L||19771103|F
ORC|NW|ORD778900^EHR|RX0000457822^PHARMSYS|||||20260612085500|||BB7654321^Patel^Anya^^^^Dr
RXE|1^^^20260612090000^^R|0338-0049-04^Sodium Chloride 0.9% IV^NDC|1000||mL|SOL^Solution^HL70488|Infuse over 8 hours|||1000|mL|0|||RX0000457822|0|0
RXR|IV^Intravenous^HL70162
RXC|B|0338-0049-04^Sodium Chloride 0.9%^NDC|1000|mL

FHIR mapping

No segment-level ConceptMap is published in the v2-to-FHIR IG for RXE. Conceptually, an RXE segment corresponds to a FHIR MedicationRequest resource: the Give Code maps to medication, the give and dispense amounts inform dosageInstruction and dispenseRequest, the prescription number aligns with identifier, and the refill counts populate dispenseRequest.numberOfRepeatsAllowed. Because no published ConceptMap exists, integrators must define field-level mappings themselves.

Engine considerations

Most interface engines parse RXE as a flat, well-structured segment, but the heavy use of CE and CWE composites means engines must respect component (^) and subcomponent (&) separators when extracting coded values. Repeating fields (RXE-7, RXE-13, RXE-14, RXE-21, RXE-27, RXE-31, RXE-37) require iterating over repetition (~) instances rather than reading only the first. Engines should preserve the empty trailing fields when re-emitting RXE so that downstream systems expecting positional fields are not misaligned, and should validate that units accompany every populated amount.

How Vorro parses and produces RXE

Vorro parses RXE positionally, mapping each sequence to a typed field and decomposing CE/CWE/XCN composites into their constituent components so that codes, descriptions, and coding systems are individually addressable. Repeating fields are exposed as ordered collections, preserving repetition order. When producing RXE, Vorro emits only the fields populated by the mapping while maintaining correct field positions with placeholder delimiters, normalizes coded values against configured terminologies (NDC, RxNorm, route and dosage-form tables), and guarantees that amount fields are always paired with their unit fields before the segment is serialized.

Sources

← Back to HL7 v2 Guide

Ready to Integrate This Into Your Workflow?

Talk to a Vorro expert about implementing HL7 v2 in your specific environment.

Browse HL7 v2 Guides
HL7 RXE Segment: Pharmacy / Treatment Encoded Order | Vorro Academy | Vorro