profiles / StructureDefinition

OMOP-Convertible MedicationDispense → drug_exposure

MedicationDispense drug_exposure edge mapspec

A FHIR MedicationDispense that can be converted to an OMOP `drug_exposure` row of type 38000175 (Prescription dispensed in pharmacy). Routing key: `medicationCodeableConcept` must be in the OMOP Drug domain (RxNorm / NDC / SNOMED CT product). Only in-progress | completed statuses produce rows.

Routing key — code binding
omop-drug-codes OMOP domain: Drug

If MedicationDispense.code resolves to a concept in this ValueSet, the resource converts to drug_exposure.

Path Card Type Binding / Fixed Comment
MedicationDispense.status 1..* MS fhir/medicationdispense-status required
MedicationDispense.medication[x] 1..* MS CodeableConcept omop-drug-codes required
MedicationDispense.subject 1..1 Reference Required for drug_exposure.person_id.
MedicationDispense.whenHandedOver 1..1 MS Required for drug_exposure.drug_exposure_start_date. Falls back to whenPrepared only when whenHandedOver is absent — this profile requires whenHandedOver for OMOP-grade conversion.
Raw JSON
{
  "resourceType": "StructureDefinition",
  "id": "omop-medication-dispense-drug-exposure",
  "url": "https://fhir2omop.health-samurai.io/StructureDefinition/omop-medication-dispense-drug-exposure",
  "version": "0.1.0",
  "name": "OmopMedicationDispenseDrugExposure",
  "title": "OMOP-Convertible MedicationDispense → drug_exposure",
  "status": "draft",
  "experimental": true,
  "description": "A FHIR MedicationDispense that can be converted to an OMOP `drug_exposure` row of type 38000175 (Prescription dispensed in pharmacy). Routing key: `medicationCodeableConcept` must be in the OMOP Drug domain (RxNorm / NDC / SNOMED CT product). Only in-progress | completed statuses produce rows.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "MedicationDispense",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/MedicationDispense",
  "derivation": "constraint",
  "extension": [
    {
      "url": "https://fhir2omop.health-samurai.io/StructureDefinition/omop-target-table",
      "valueString": "drug_exposure"
    },
    {
      "url": "https://fhir2omop.health-samurai.io/StructureDefinition/omop-edge",
      "valueString": "MedicationDispense__drug_exposure"
    }
  ],
  "differential": {
    "element": [
      {
        "id": "MedicationDispense.status",
        "path": "MedicationDispense.status",
        "min": 1,
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "http://hl7.org/fhir/ValueSet/medicationdispense-status",
          "description": "Must be in-progress | completed. Other statuses (preparation, cancelled, on-hold, stopped, declined, unknown, entered-in-error) do not produce a drug_exposure row."
        }
      },
      {
        "id": "MedicationDispense.medication[x]",
        "path": "MedicationDispense.medication[x]",
        "min": 1,
        "mustSupport": true,
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "binding": {
          "strength": "required",
          "valueSet": "https://fhir2omop.health-samurai.io/ValueSet/omop-drug-codes",
          "description": "Routing key. Code must be in the OMOP Drug domain (RxNorm / NDC / SNOMED CT product). Bare Reference(Medication) is not accepted at the routing layer."
        }
      },
      {
        "id": "MedicationDispense.subject",
        "path": "MedicationDispense.subject",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Patient"
            ]
          }
        ],
        "comment": "Required for drug_exposure.person_id."
      },
      {
        "id": "MedicationDispense.whenHandedOver",
        "path": "MedicationDispense.whenHandedOver",
        "min": 1,
        "max": "1",
        "mustSupport": true,
        "comment": "Required for drug_exposure.drug_exposure_start_date. Falls back to whenPrepared only when whenHandedOver is absent — this profile requires whenHandedOver for OMOP-grade conversion."
      }
    ]
  },
  "targetTable": "drug_exposure",
  "edgeKey": "MedicationDispense__drug_exposure"
}