-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqr2vmp.map
96 lines (65 loc) · 3.32 KB
/
qr2vmp.map
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
map "http://webiste.be/transformtovmp/" = "qr2vmp"
uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QuestionnaireResponse as source
uses "http://hl7.org/fhir/StructureDefinition/MedicationKnowledge" alias MedicationKnowledge as target
group doseform(source src: QuestionnaireResponse, target tgt: MedicationKnowledge) {
src.item as item where linkId.value in ('route') -> tgt as route then route_format(item,route) "rule for routes";
src.item as item where linkId.value in ('code') -> tgt as code then code_format(item, code) "rule for code";
src.item as item where linkId.value in ('doseform') -> tgt as doseform then doseform_format(item, doseform) "rule for doseForm";
src.item as item where linkId.value in ('ingredient') -> tgt.ingredient as ingre then ingredient_group(item, ingre) "rule for ingredient";
}
group ingredient_group(source src, target tgt: BackboneElement) {
src.item as item where linkId.value in ('ingredient-element') log item -> tgt.item = create('CodeableConcept') as cc then ingre_format(item, cc) "rule for ingredient";
src.item as item where linkId.value in ('strength') -> tgt.strength as strn then strn_format(item, strn) "rule for strength";
src.item as item where linkId.value in ('role') -> tgt as role then role_format(item, role) "rule for role";
}
//strength
group strn_format(source src, target tgt: Ratio) {
src.answer as ans -> tgt as numer then creat_numer(ans,numer) "create numearator" ;
}
group creat_numer(source src, target tgt: Quantity) {
src-> tgt.numerator = (src.valueQuantity) "create strength value";
}
//ingredient
group ingre_format(source src, target tgt) {
src.answer as ans -> tgt as cc then ingre_cc_format(ans,cc) "ingredient create CC";
}
//ingredient CC
group ingre_cc_format(source src, target tgt) {
src -> tgt.coding = (src.valueCoding) "ingredient create";
}
//role
group role_format(source src, target tgt) {
src.answer as ans -> tgt then role_trasnform(ans,tgt);
}
group role_trasnform(source src, target tgt) {
src.valueCoding as vc where code in ("AP") -> tgt.isActive = true "bool";
src.valueCoding as vc where code in ("NAP") -> tgt.isActive = false "bool";
src.valueCoding as vc where code in ("EXP") -> tgt.isActive = false "bool";
}
///route
group route_format(source src, target tgt) {
src.answer as ab -> tgt.intendedRoute as route then itemcoding_route(ab,route); // copy ab inside aa
}
group itemcoding_route(source src, target tgt ) {
src -> tgt.coding = (src.valueCoding) "create route as is";
}
////Code
group code_format(source src, target tgt) {
src.answer as ab -> tgt.code as code then itemcoding_code(ab,code); // copy ab inside aa
}
group itemcoding_code(source src, target tgt: CodeableConcept ) {
src -> tgt.coding as y then codingcode(src, y) "xx";
}
group codingcode(source src, target tgt : Coding) {
src -> tgt.code = (src.valueInteger) "value coding";
src -> tgt.system = 'http://website.be/code' "system coding";
src -> tgt.display = 'Product Code' "display coding";
}
///Dose Form
group doseform_format(source src, target tgt) {
src.answer as ab -> tgt.doseForm as df then cc_df(ab,df); // copy ab inside aa
}
group cc_df(source src, target tgt: CodeableConcept) {
//src -> tgt.text="dose form" "text";
src -> tgt.coding = (src.valueCoding) "cc dose form";
}