Medication drug_exposure documented primary

The FHIR Medication resource is a vocabulary/codeable-concept resource, not a medication event. It does NOT directly produce a drug_exposure row. Instead, its code and ingredient data are resolved into drug_concept_id and drug_source_value on drug_exposure rows produced by the four event resources (MedicationRequest, MedicationDispense, MedicationAdministration, MedicationStatement). This edge documents how Medication fields contribute to drug_exposure columns when referenced.

Conversion profile omop-medication-drug-exposure
A FHIR instance converts to drug_exposure iff it validates against this profile.
Routing key Medication.code ∈ omop-drug-codes (OMOP domain Drug)
Path Card Type Binding / Fixed Comment
Medication.code 1..*MS CodeableConcept omop-drug-codesrequired
ViewDefinition (Stage 1 flattener) omop-medication-drug-exposure
6 columns · resource Medication
column name FHIRPath type
id Medication.id id
drug_rxnorm Medication.code.coding.where(system='http://www.nlm.nih.gov/research/umls/rxnorm').first().code code
drug_ndc Medication.code.coding.where(system='http://hl7.org/fhir/sid/ndc').first().code code
drug_atc Medication.code.coding.where(system='http://www.whocc.no/atc').first().code code
drug_snomed Medication.code.coding.where(system='http://snomed.info/sct').first().code code
drug_text Medication.code.text string
Condition: Medication does not directly produce drug_exposure rows. Its code/ingredient data flows into drug_exposure via event resources (MedicationRequest, MedicationDispense, MedicationAdministration, MedicationStatement) when they carry a medicationReference pointing to a Medication resource.

Fields (3)

  • drug_concept_id Medication.code.coding[best] integer · Coding
    FK→CONCEPTrequired
    transform:Vocabulary lookup: resolve best coding (RxNorm > NDC > ATC > SNOMED) to OMOP standard concept via CONCEPT table
    Set by the event mapper after resolving medicationReference. The 'best' coding is selected by vocabulary priority.
  • drug_source_value Medication.code.coding[best].code varchar(50) · code
    Raw source code from the highest-priority coding in Medication.code
  • drug_source_concept_id Medication.code.coding[best] integer · Coding
    FK→CONCEPT
    transform:Look up source vocabulary concept_id for the raw code (non-standard concept)
    The source concept before mapping to standard vocabulary

Vocabularies

drug_code_systems

Source Display Concept ID Concept Name
http://www.nlm.nih.gov/research/umls/rxnorm RxNorm - RxNorm
http://hl7.org/fhir/sid/ndc NDC (National Drug Code) - NDC
http://www.whocc.no/atc ATC (Anatomical Therapeutic Chemical) - ATC
http://snomed.info/sct SNOMED CT (product codes) - SNOMED

Edge Cases

medicationReference vs medicationCodeableConcept
Event resources may carry either medicationReference (pointing to a Medication resource) or inline medicationCodeableConcept. When only medicationReference is present, the Medication resource must be resolved to extract the code. Several implementations skip medicationReference entirely and only process inline codes.
Contained reference (#id)
Medication is embedded in the event resource's contained[] array. Iterate contained resources to find a Medication matching the fragment ID. Extract Medication.code. Fall back to Reference.display if no code found.
Bundle-level reference resolution
Medication resources appear as separate entries in a Bundle alongside event resources. Requires pre-indexing all Medications by fullUrl/id before processing events. Two strategies: build an in-memory map (ETL-German) or produce partial rows and merge in post-processing (fhir-to-omop-demo).
Medication.code absent but ingredient present
Some Medication resources carry no top-level code but have ingredient[].itemCodeableConcept with ATC codes. ETL-German extracts ATC from ingredients as the drug source value.
Multiple codings in Medication.code
Pick best coding by vocabulary priority: RxNorm > NDC > ATC > SNOMED > first. Use the selected code for drug_source_value and vocab lookup for drug_concept_id.
Medication.form (dosage form)
Not directly mapped to any OMOP column. Dose form is captured implicitly via drug_concept_id when using RxNorm clinical/branded drug products that encode form.
Medication.manufacturer and Medication.batch
Dropped. No corresponding OMOP drug_exposure columns.

Reference Implementations