MedicationRequest
— maps to 1 OMOP table| OMOP Table | Status | Mapped | |
|---|---|---|---|
|
drug_exposure
primary
Prescription/order stage of the medication lifecycle. One FHIR MedicationRequest maps to one OMOP drug_exposure row. MedicationRequest is the richest of the four FHIR medication-event resources for OMOP purposes because it carries dispense, refill, and supply-duration metadata that the other three lack. Type concept 38000177 (Prescription written).
|
implemented | 23 fields | detail → |
MedicationRequest → OMOP Mapping
MedicationRequest represents the prescription/order stage of the medication lifecycle. It is the richest of the four FHIR medication-event resources for OMOP purposes because it carries dispense, refill, and supply-duration metadata that the other three lack.
Source FHIR Resource
| FHIR Resource | Lifecycle Stage | OMOP target | OMOP type_concept_id |
|---|---|---|---|
MedicationRequest | Prescription/order | drug_exposure | 38000177 (Prescription written) |
Target OMOP Tables
| OMOP Table | Purpose | Required? |
|---|---|---|
drug_exposure | One row per prescription event | Yes |
drug_era | Derived: continuous drug exposure periods | No -- computed post-ETL |
dose_era | Derived: continuous dose periods | No -- computed post-ETL |
Mapping Strategy
-
Status / intent filtering.
entered-in-errorshould always be skipped. This project also skipsstopped,on-hold,draft, andunknown. Non-order intents (proposal,plan) are filtered out -- onlyorder,original-order,reflex-order,filler-order,instance-orderproduce rows. omoponfhir maps all statuses and intents exceptentered-in-error. -
Medication resolution.
medication[x]can be a CodeableConcept (inline code) or a Reference to a Medication resource. omoponfhir resolves contained#-references; fhir-to-omop-demo merges by ID in a post-processing phase; this project and most others handle inline codes only. RxNorm is the standard OMOP drug vocabulary (US); ATC is used in European data. -
Vocabulary lookup. The
drug_concept_idrequires mapping FHIR medication codes (RxNorm, ATC, NDC, SNOMED) to OMOP standard concepts via the OMOP vocabulary tables. Route codes (SNOMED to OMOP Route domain) also require lookup. Only omoponfhir performs runtime concept lookups for MedicationRequest; FhirToCdm uses pre-built vocabulary files; this project uses placeholder0. -
Date handling.
authoredOnmaps todrug_exposure_start_date.dispenseRequest.validityPeriod.endmaps todrug_exposure_end_date(fallback to start date when absent). FhirToCdm derives dates from the linked VisitOccurrence. NACHC falls back to encounter start date whenauthoredOnis null. -
Dosage parsing. OMOP captures only:
quantity(dose per administration),days_supply,sig(free-text instructions),route_concept_id. Most implementations extract dose quantity and route from the firstdosageInstruction[], ignoring timing complexity. -
Days supply. Calculated from
MedicationRequest.dispenseRequest.expectedSupplyDuration. This project converts UCUM duration units (h, d, wk, mo, a). No reference implementation populates this field. -
Refills.
MedicationRequest.dispenseRequest.numberOfRepeatsAllowedmaps torefills. omoponfhir reads this from thedispenseRequestblock. Only applicable to MedicationRequest. -
Type concept. Constant
38000177("Prescription written"). fhir-to-omop-demo uses 32838 (EHR prescription); FhirToCdm and ETL-German use 32817 (EHR / CLAIM).
Reference Implementations
- omoponfhir-omopv5-r4-mapping (Georgia Tech, Java) --
OmopMedicationRequest.java(746 lines). Most complete: RxNorm concept lookup, contained reference resolution, route concept lookup, dosage parsing, dispense-request fallback for refills/quantity, provider fromrecorder. Status: stale (2022). - FhirToCdm (OHDSI, C#) --
FhirToCdmMappings.csCreateDrugExposure()(lines 310-405, MedicationRequest branch lines 322-373). Vocabulary file lookup. Dates derived from VisitOccurrence. Sig fromdosageInstruction[0].text. Status: low activity. - fhir-to-omop-demo (jq) --
MedicationRequest.jq(81 lines). Two-phase merge approach: partial rows from MedicationRequest are joined with partial rows fromMedication.jqby ID. Pre-computed vocabulary concepts. Type concept32838(EHR prescription). Status: maintained. - NACHC-fhir-to-omop (Java, DSTU3) --
MedicationRequestParser.java(155 lines). Parses medication code, status, intent, dates. Falls back to encounter start date whenauthoredOnis null. Status: active.
Status in This Project
src/mapper/medication.ts-- MedicationRequest mapper (93 lines). Implements: status/intent filtering, inline medication only, days_supply fromexpectedSupplyDuration, refills, sig, route source value.drug_concept_idis hardcoded to0(no vocabulary lookup).route_concept_idis hardcoded to null (source value only).medicationReferenceresolution is not implemented (returns null).
Related Resources
MedicationDispense-- pharmacy dispensing stage.MedicationAdministration-- inpatient administration stage.MedicationStatement-- patient self-report stage.Medication-- vocabulary/codeable concept resource (not an event).