Schedule a demo
Segment

Pharmacy/treatment component order

Specifies individual components of a compound or IV admixture, including the component drug code, amount, units, and component type (base versus additive). It follows the RXO or RXE segment and is used when a pharmacy order involves multiple ingredients, for example an IV bag with a base solution plus one or more additives. Pharmacy systems use RXC in compounding workflows within RDE and related messages.

11fields
4required
v2.9HL7 version
rxc.py
from zato.hl7v2 import RXC, CWE

rxc = RXC()
rxc.rx_component_type = 'B'
code = CWE(identifier='VITA', text='Vitamin A')
rxc.component_code = code
rxc.component_amount = '5000'

Build RXC segments in Python

How to construct and work with real-world RXC segments.

1

Vitamin A base component

Required component type, code, amount, and units for an oral supplement

from zato.hl7v2.v2_9 import RXC
from zato.hl7v2.v2_9 import CWE

rxc = RXC()
rxc.rx_component_type = 'B'
rxc.component_code = CWE(
    identifier='VITA',
    text='Vitamin A 5000 IU',
)
rxc.component_amount = '5000'
rxc.component_units = CWE(identifier='IU', text='IU')
2

Zinc with strength and dispense

Strength, units, repeatable supplementary codes, volume, and bottle dispense

from zato.hl7v2.v2_9 import RXC
from zato.hl7v2.v2_9 import CWE

rxc = RXC()
rxc.rx_component_type = 'B'
rxc.component_code = CWE(
    identifier='ZINC', text='Zinc Chelate 25 mg')
rxc.component_amount = '25'
rxc.component_units = CWE(
    identifier='MG', text='mg')
rxc.component_strength = '25'
rxc.component_strength_units = CWE(
    identifier='MG', text='mg')
rxc.supplementary_code = [
    CWE(identifier='PLAN', text='Wellness plan'),
    CWE(identifier='TIER', text='Gold tier'),
]
rxc.component_drug_strength_volume = '50'
rxc.component_drug_strength_volume_units = CWE(
    identifier='ML', text='mL')
rxc.dispense_amount = '60'
rxc.dispense_units = CWE(
    identifier='BOT', text='Bottle')
3

Amino blend additive for infusion

Additive component type, concentration volume, and vial dispense for nutrition support

from zato.hl7v2.v2_9 import RXC
from zato.hl7v2.v2_9 import CWE

rxc = RXC()
rxc.rx_component_type = 'A'
rxc.component_code = CWE(
    identifier='AMIX', text='Amino wellness blend')
rxc.component_amount = '20'
rxc.component_units = CWE(
    identifier='ML', text='mL')
rxc.component_strength = '8'
rxc.component_strength_units = CWE(
    identifier='GM', text='g')
rxc.component_drug_strength_volume = '250'
rxc.component_drug_strength_volume_units = CWE(
    identifier='ML', text='mL')
rxc.dispense_amount = '1'
rxc.dispense_units = CWE(
    identifier='VIAL', text='Vial')

Learn by building

Step-by-step guides for working with HL7 v2 in Zato.

Frequently asked questions

RXC describes a single component line in a compound or multi-part pharmacy order: component role (base or additive), coded ingredient, quantities, optional strength and supplementary codes, and dispense amounts for nutrition and wellness workflows. It appears with ORC, RXO, RXE, RXD, RXR, and PID.

Fields 1–4 are required: rx_component_type, component_code, component_amount, and component_units. Populate optional fields only when your interface guide calls for them.

from zato.hl7v2.v2_9 import RXC, CWE

rxc = RXC()
rxc.rx_component_type = 'B'
rxc.component_code = CWE(
    identifier='MV', text='Daily multivitamin')
rxc.component_amount = '1'
rxc.component_units = CWE(
    identifier='TAB', text='Tablet')

Field 7 repeats in ER7 with ~ between occurrences. In Python, assign a list of CWE instances to supplementary_code.

from zato.hl7v2.v2_9 import RXC, CWE

rxc = RXC()
rxc.rx_component_type = 'B'
rxc.component_code = CWE(
    identifier='OM3', text='Omega-3')
rxc.component_amount = '2'
rxc.component_units = CWE(
    identifier='GEL', text='Softgel')
rxc.supplementary_code = [
    CWE(identifier='PKG', text='Family pack'),
    CWE(identifier='NOTE', text='Store in a cool place'),
]

HL7 table HL70166 classifies the component role (for example base versus additive) within a compound order. Use the codes your trading partner documents so pharmacy systems can assemble the mixture correctly.

RXO and RXE carry the overall requested or encoded order lines; RXC breaks out individual ingredients or parts when the order is compound or multi-component. Your specification should tie RXC lines to the parent order with ORC and related segments.

Zato connects to any system that speaks HL7v2 over MLLP or FHIR over REST. This includes Epic, Cerner, Meditech, Allscripts, and other EHR platforms.

Yes, Zato has built-in MLLP support for sending and receiving HL7v2 messages. MLLP channels handle the framing protocol automatically.

Zato supports HL7 v2.9, which is backward compatible with earlier versions including v2.3, v2.5, and v2.7. Standard segments and datatypes are available as typed Python classes.

Yes. Zato handles both HL7v2 and FHIR natively, so you can parse v2 messages and build FHIR resources with IG-specific extensions in the same service. Typed Python classes are available for both protocols, including extensions from US Core, UK Core, Da Vinci, and other Implementation Guides.

RXC field reference

Complete list of fields in the RXC segment, HL7 v2.9.

#Python nameDatatypeUsageRepeatableTable
1rx_component_typeIDRequiredNoHL70166
2component_codeCWERequiredNoHL70697
3component_amountNMRequiredNo-
4component_unitsCWERequiredNoHL70698
5component_strengthNMOptionalNo-
6component_strength_unitsCWEOptionalNoHL70699
7supplementary_codeCWEOptionalYesHL70700
8component_drug_strength_volumeNMOptionalNo-
9component_drug_strength_volume_unitsCWEOptionalNoHL70701
10dispense_amountNMOptionalNo-
11dispense_unitsCWEOptionalNoHL70703

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python