Allergy.fml · fhir2omop
refs/refs/fhir-omop-ig/input/maps/Allergy.fml
lines 20–38
52 lines · fml
1/// url = 'http://hl7.org/fhir/uv/omop/StructureMap/AllergyMap' 3/// title = 'Mapping Allergy resource to Observation OMOP Domain' 6/// description = "This mapping maps FHIR AllergyIntolerance instances to OMOP Observation Table objects." 8uses "http://hl7.org/fhir/StructureDefinition/AllergyIntolerance" alias Allergy as source 9uses "http://hl7.org/fhir/uv/omop/StructureDefinition/Observation" alias ObservationTable as target 11group Observation(source src: Allergy, target tgt : ObservationTable) { 13 // src.id as id -> tgt.observation_id = cast(id, "integer"); 14 src.code as s -> tgt then { 15 s.coding as sc -> tgt then { 16 sc.code -> tgt.observation_concept_id, tgt.observation_source_value, tgt.observation_source_concept_id; 20 // src.patient as s -> tgt then { 21 // s.identifier as sid -> tgt then { 22 // sid.value as a -> tgt.person_id = a; 26 // src.encounter as s -> tgt then { 27 // s.identifier as sid -> tgt then { 28 // sid.value as a -> tgt.visit_occurrence_id = a; 32 // src.participant as s -> tgt then { 33 // s.actor as sa -> tgt then { 34 // sa.identifier as sid -> tgt then { 35 // sid.value as b -> tgt.provider_id = b; 40 src.onset : dateTime as osd -> tgt.observation_date = cast(osd, "date"), tgt.observation_datetime = osd; 42 src.reaction as s -> tgt then { 43 s.manifestation as sman -> tgt then { 44 sman.concept as smanc -> tgt then { 45 smanc.coding as sc -> tgt then { 46 sc.code -> tgt.value_as_concept_id, tgt.value_source_value;