Mapping HL7v2 RDE^O11 to US Core MedicationRequest: Field Reference
Pharmacy/treatment encoded order. Maps RXE into a MedicationRequest with code, dose, frequency.
Field-by-field mapping
Every rule in the Interoperall template is shown below: the source field, the FHIR target path it populates, and the transform applied. This table is generated from the live template, so it matches exactly what runs when you fork it.
| Source | FHIR path | Transform |
|---|---|---|
| (literal "active") | MedicationRequest.status | Copied directly |
| (literal "order") | MedicationRequest.intent | Copied directly |
| RXE-2.1 | MedicationRequest.medicationCodeableConcept.coding[0].code | Copied directly |
| RXE-2.2 | MedicationRequest.medicationCodeableConcept.coding[0].display | Copied directly |
| RXE-2.3 | MedicationRequest.medicationCodeableConcept.coding[0].system | Value-set lookup (RXNORM→http://www.nlm.nih.gov/research/umls/rxnorm, RX→http://www.nlm.nih.gov/research/umls/rxnorm; fallback "http://terminology.hl7.org/CodeSystem/v2-0396") |
| RXE-3 | MedicationRequest.dosageInstruction[0].doseAndRate[0].doseQuantity.value | Copied directly |
| RXE-5 | MedicationRequest.dosageInstruction[0].doseAndRate[0].doseQuantity.unit | Copied directly |
Source HL7v2 message
The sample input this template is designed to handle:
MSH|^~\&|PHARM|HOSP|REC|REC|20240115120000||RDE^O11|MSGCTRL7777|P|2.5.1
PID|1||MRN12345^^^EPIC^MR||DOE^JOHN^A||19800101|M
ORC|NW|PLAC1234|FILL5678
RXE|^Q6H^^^^R|209387^Amoxicillin 500mg^RXNORM|500||mg|TABCommon gotchas
- HL7v2 identifiers (PID-3) carry an assigning authority and ID type in later components. FHIR needs an `identifier.system` (a URI/OID), so you must map your local authority to a real, stable system URI, not just copy the code.
- HL7v2 dates are `YYYYMMDD` (or `YYYYMMDDHHMMSS`); FHIR `date`/`dateTime` need ISO-8601 (`YYYY-MM-DD`). A date-format transform is required or validation will reject the value.
- Coded fields (gender, status, units) almost always need a value-set lookup. HL7v2 `M`/`F` is not the same token as FHIR `male`/`female`, and an unmapped code should fall back rather than pass through raw.
- Repeating segments (multiple OBX, multiple PID-11 address repetitions) map to FHIR arrays. A single template rule targets one array index, so duplicate the rules (or iterate) for additional repetitions.
Target profile
This mapping targets http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest. After mapping, validate the output against the profile — the template populates the Must Support elements, but required elements missing from your source data will still fail. Score it against US Core.
Frequently asked questions
How do I map an HL7v2 RDE^O11 message to a FHIR MedicationRequest?
Parse the RDE^O11 message into segments, then map each relevant field to its FHIR path: identifiers and coded values need value-set lookups, and HL7v2 date fields need reformatting to ISO-8601. The field table on this page lists every source-to-target rule used by the Interoperall template, which you can fork and run in the Mapping Builder.
Which segments does the RDE^O11 → MedicationRequest mapping read?
It reads the RXE segment. Other segments in the message are left unmapped unless you add rules for them.
Is this MedicationRequest mapping US Core compliant?
It targets http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest. The template populates the elements US Core marks as Must Support, but you should always validate the output against the profile. Required elements that are absent in your source data will still fail.
Can I customize this mapping?
Yes. Fork the template in the Mapping Builder to get an editable copy, then add, remove, or re-target rules, for example to handle repeating segments, extra identifiers, or a different value set.