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.
| Seq | Name | Data Type | Length | Req | Repeat | Table # | Description |
|---|---|---|---|---|---|---|---|
| RXE-1 | Quantity/Timing | tq | — | O | — | — | Quantity and timing of the encoded order |
| RXE-2 | Give Code | ce | — | R | — | — | Coded identifier of the medication to give |
| RXE-3 | Give Amount - Minimum | nm | — | R | — | — | Minimum amount to give per administration |
| RXE-4 | Give Amount - Maximum | nm | — | O | — | — | Maximum amount to give per administration |
| RXE-5 | Give Units | ce | — | R | — | — | Units for the give amount |
| RXE-6 | Give Dosage Form | ce | — | O | — | — | Form in which the drug is given |
| RXE-7 | Provider's Administration Instructions | ce | — | O | Y | — | Free-text or coded administration instructions |
| RXE-8 | Deliver-To Location | la1 | — | O | — | — | Location where the drug is to be delivered |
| RXE-9 | Substitution Status | id | — | O | — | HL70167 | Whether substitution is allowed or occurred |
| RXE-10 | Dispense Amount | nm | — | O | — | — | Quantity to dispense |
| RXE-11 | Dispense Units | ce | — | O | — | — | Units for the dispense amount |
| RXE-12 | Number Of Refills | nm | — | O | — | — | Total number of refills authorized |
| RXE-13 | Ordering Provider's DEA Number | xcn | — | O | Y | — | DEA number of the ordering provider |
| RXE-14 | Pharmacist/Treatment Supplier's Verifier ID | xcn | — | O | Y | — | Identifier of the verifying pharmacist |
| RXE-15 | Prescription Number | st | — | O | — | — | Pharmacy-assigned prescription number |
| RXE-16 | Number of Refills Remaining | nm | — | O | — | — | Refills still available |
| RXE-17 | Number of Refills/Doses Dispensed | nm | — | O | — | — | Refills or doses already dispensed |
| RXE-18 | D/T of Most Recent Refill or Dose Dispensed | ts | — | O | — | — | Timestamp of most recent dispense |
| RXE-19 | Total Daily Dose | cq | — | O | — | — | Total amount given per day |
| RXE-20 | Needs Human Review | id | — | O | — | HL70136 | Flag indicating manual review is required |
| RXE-21 | Pharmacy/Treatment Supplier's Special Dispensing Instructions | ce | — | O | Y | — | Special dispensing instructions |
| RXE-22 | Give Per (Time Unit) | st | — | O | — | — | Time unit over which the dose is given |
| RXE-23 | Give Rate Amount | st | — | O | — | — | Rate at which the drug is given |
| RXE-24 | Give Rate Units | ce | — | O | — | — | Units for the give rate |
| RXE-25 | Give Strength | nm | — | O | — | — | Strength of the medication to give |
| RXE-26 | Give Strength Units | ce | — | O | — | — | Units for the give strength |
| RXE-27 | Give Indication | ce | — | O | Y | — | Reason or indication for giving the drug |
| RXE-28 | Dispense Package Size | nm | — | O | — | — | Size of the dispense package |
| RXE-29 | Dispense Package Size Unit | ce | — | O | — | — | Units for the dispense package size |
| RXE-30 | Dispense Package Method | id | — | O | — | HL70321 | Method of dispense packaging |
| RXE-31 | Supplementary Code | ce | — | O | Y | — | Additional codes such as billing modifiers |
| RXE-32 | Original Order Date/Time | ts | — | O | — | — | Date/time the original order was placed |
| RXE-33 | Give Drug Strength Volume | nm | — | O | — | — | Volume associated with the drug strength |
| RXE-34 | Give Drug Strength Volume Units | cwe | — | O | — | — | Units for the drug strength volume |
| RXE-35 | Controlled Substance Schedule | cwe | — | O | — | HL70477 | DEA controlled substance schedule |
| RXE-36 | Formulary Status | id | — | O | — | HL70478 | Formulary status of the drug |
| RXE-37 | Pharmaceutical Substance Alternative | cwe | — | O | Y | — | Alternative pharmaceutical substances |
| RXE-38 | Pharmacy of Most Recent Fill | cwe | — | O | — | — | Pharmacy that performed the most recent fill |
| RXE-39 | Initial Dispense Amount | nm | — | O | — | — | Amount dispensed on the initial fill |
| RXE-40 | Dispensing Pharmacy | cwe | — | O | — | — | Pharmacy responsible for dispensing |
| RXE-41 | Dispensing Pharmacy Address | xad | — | O | — | — | Address of the dispensing pharmacy |
| RXE-42 | Deliver-to Patient Location | pl | — | O | — | — | Patient location for delivery |
| RXE-43 | Deliver-to Address | xad | — | O | — | — | Address to deliver the medication |
| RXE-44 | Pharmacy Order Type | id | — | O | — | HL70480 | Type 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.
