HL7 for pharmacy
HL7 pharmacy messaging lives in the order-entry chapter but has its own vocabulary and risks. An RDE_O11 order, an RXE encoded order, RXO requested order details, RXR route, and RXC components can all describe medication behavior that must not be guessed from display text.
The best pharmacy interface is conservative. Preserve the coded drug, dose, units, route, schedule, order control, provider, patient class, location, and status. Do not turn "500 mg twice daily by mouth" into one free-text string and hope the receiving medication system can reconstruct safe intent.
This is synthetic sample data for learning and testing. Open it in HL7 Soup Web before mapping it so the segment groups, repeated fields, and coded values are visible.
Order Control Comes First
ORC-1 tells the receiver whether the order is new, changed, discontinued, held, released, or otherwise controlled by local agreement. Pharmacy systems commonly have stronger order-lifecycle rules than general clinical systems, so treating every message as a new medication order is dangerous.
Timing can appear in legacy quantity/timing fields, order effective fields, RXE timing, and local profile fields. Agree one source of truth for administration schedule, dispense schedule, and order effective dates.
- Keep drug code system identity with the code.
- Preserve dose amount and units separately.
- Route, site, frequency, dispense quantity, and order status should be testable as structured values.
Orders, Dispenses, And Administrations Are Different
Pharmacy HL7 can cover orders, dispense notifications, administration records, refill behavior, and formulary-like master data. Do not force all medication messages into one receiver action. Ask whether the workflow is ordering, dispensing, administering, reconciling, or charging.
A Practical Integration Soup Workflow
In Integration Soup, route pharmacy messages by MSH-9, ORC-1, patient class, facility, and destination. Keep medication code, dose, units, route, provider, and order number visible in logs. If the receiver needs local code conversion, make that mapping an explicit transformer rather than buried text manipulation.
The transformers tutorial and custom transformers tutorial are useful when medication codes or local route tables need careful conversion.
The Test Pack I Would Ask For
Ask for a new medication order, changed dose, discontinued order, hold/release behavior if supported, allergy warning context if sent, compounded medication, PRN medication, and a medication with unusual units.