refs/refs/fhir-omop-ig/input/maps/ImmunizationMap.fml

lines 47–53 55 lines · fml
1/// url = 'http://hl7.org/fhir/uv/omop/StructureMap/ImmunizationMap'
2/// name = 'ImmunizationMap'
3/// title = 'Mapping Immunization resource to Drug Exposure OMOP Domain'
4/// status = 'draft'
5/// description = "This mapping maps FHIR Immunization instances to OMOP Drug Exposure Table objects."
7uses "http://hl7.org/fhir/StructureDefinition/Immunization" alias Immunization as source
8uses "http://hl7.org/fhir/uv/omop/StructureDefinition/DrugExposure" alias DrugExposureTable as target
10group DrugExposure(source src: Immunization, target tgt : DrugExposureTable) {
12 //src.id as id -> tgt.drug_exposure_id = cast(id, "integer");
13 src.vaccineCode as s -> tgt then {
14 s.coding as sc -> tgt then {
15 sc.code -> tgt.drug_concept_id, tgt.drug_source_value, tgt.drug_source_concept_id;
16 };
17 };
19 //src.patient as s -> tgt then {
20 // s.identifier as sid -> tgt then {
21 // sid.value as a -> tgt.person_id = a;
22 // };
23 //};
25 src.doseQuantity as s -> tgt then {
26 s.value as s -> tgt.quantity = cast(s, "decimal");
27 s.code as s -> tgt.dose_unit_source_value = cast(s, "string");
28 };
30 src.route as s -> tgt then {
31 s.text as s -> tgt.route_source_value = cast(s, "string");
32 s.coding as sc -> tgt then {
33 sc.code -> tgt.route_concept_id, tgt.route_source_value;
34 };
35 };
37 src.occurrence : dateTime as odt -> tgt.drug_exposure_start_date = cast(odt, "date"), tgt.drug_exposure_start_datetime = odt, tgt.drug_exposure_end_date = cast(odt, "date"), tgt.drug_exposure_end_datetime = odt;
39 //src.encounter as s -> tgt then {
40 // s.identifier as sid -> tgt then {
41 // sid.value as a -> tgt.visit_occurrence_id = a;
42 // };
43 //};
45 src.lotNumber as s -> tgt.lot_number = cast(s, "string");
47 //src.performer as s -> tgt then {
48 // s.actor as sa -> tgt then {
49 // sa.identifier as sid -> tgt then {
50 // sid.value as b -> tgt.provider_id = b;
51 // };
52 // };
53 //};