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

lines 22–23 49 lines · fml
1/// url = 'http://hl7.org/fhir/uv/omop/StructureMap/ConditionMap'
2/// name = 'ConditionMap'
3/// title = 'Mapping Condition resource to Condition Occurrence OMOP Domain'
4/// status = 'draft'
5/// description = "This mapping maps FHIR Condition instances to OMOP Condition Occurence Table objects."
7uses "http://hl7.org/fhir/StructureDefinition/Condition" alias Condition as source
8uses "http://hl7.org/fhir/uv/omop/StructureDefinition/ConditionOccurrence" alias ConOccTable as target
10group ConditionOccurrence(source src : Condition, target tgt : ConOccTable) {
11 // src.id as id -> tgt.condition_occurrence_id = cast(id, "integer");
12 //src.subject as s -> tgt then {
13 //s.identifier as sid -> tgt then {
14 // sid.value as a -> tgt.person_id = a;
15 // };
16 //};
17 src.code as s -> tgt then {
18 s.coding as sc -> tgt then {
19 sc.code as a -> tgt.condition_concept_id = a;
20 };
21 };
22 src.recordedDate as rd -> tgt.condition_start_datetime = cast(rd,"dateTime"), tgt.condition_start_date = rd;
23 src.onset : dateTime as osd -> tgt.condition_start_datetime = osd, tgt.condition_start_date = cast(osd, "date");
24 src.abatement : dateTime as abdt -> tgt.condition_end_datetime = adt, tgt.condition_end_date = cast(abdt, "date");
25 src.category as s -> tgt then {
26 s.coding as sc -> tgt then {
27 sc.code as a -> tgt.condition_type_concept_id = a;
28 };
29 };
30 src.clinicalStatus as s -> tgt then {
31 s.coding as sc -> tgt then {
32 sc.code as a -> tgt.condition_status_concept_id = a;
33 };
34 };
36 //src.encounter as s -> tgt then {
37 // s.identifier as sid -> tgt then {
38 // sid.value as b -> tgt.visit_occurrence_id = b;
39 // };
40 //};
41 src.evidence as s -> tgt then {
42 s.concept as sc -> tgt then {
43 sc.coding as sci -> tgt then {
44 sci.code as a -> tgt.condition_source_concept_id = a;
45 };
46 };
47 };
48};