-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexampleQueryTest.py
121 lines (117 loc) · 3.55 KB
/
exampleQueryTest.py
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
import requests
query_spec = {
"loinc": ["718-7"],
"include": [
{
"resource": "Observation",
"system": "http://loinc.org",
"search_type": "exact",
"dateField": "effectiveDateTime",
"codes": ["718-7"],
"value_restriction":{
"operator": ">",
"compare_to": 8
},
"time_interval": 0
},
{
"resource": "Observation",
"system": "http://loinc.org",
"search_type": "exact",
"dateField": "effectiveDateTime",
"codes": ["718-7"],
"value_restriction":{
"operator": ">",
"compare_to": 10
},
"time_interval": 0
}
],
"exclude": [
{
"resource": "Condition",
"system": "http://fhir.de/CodeSystem/dimdi/icd-10-gm",
"search_type": "begins",
"codes": ["C"],
"dateField": "recordedDate",
"time_interval": 0
},
{
"resource": "Procedure",
"system": "http://fhir.de/CodeSystem/dimdi/ops",
"search_type": "begins",
"codes": ["8-80"],
"dateField": "recordedDate",
"time_interval": 1
},
{
"resource": "Observation",
"system": "http://loinc.org",
"search_type": "exact",
"dateField": "effectiveDateTime",
"codes": ["718-7"],
"value_restriction":{
"operator": "<",
"compare_to": 8
},
"time_interval": 0
}
]
,
"feature_set": [
{
"resource": "Patient",
"name": "pid",
"resource_val_path": "identifier.0.value"
},
{
"resource": "Patient",
"name": "sex",
"resource_val_path": "gender"
},
{
"resource": "Observation",
"name": "age",
"computed":{
"field_1":{
"resource": "Observation",
"resource_val_path": "effectiveDateTime"
},
"field_2":{
"resource": "Patient",
"resource_val_path": "birthDate"
},
"operation": "diffYearsDate"
}
},
{
"resource": "Observation",
"name": "val",
"resource_val_path": "valueQuantity.value"
},
{
"resource": "Observation",
"name": "lrl",
"resource_val_path": "referenceRange.0.low.value"
},
{
"resource": "Observation",
"name": "url",
"resource_val_path": "referenceRange.0.high.value"
},
{
"resource": "Observation",
"name": "date",
"resource_val_path": "effectiveDateTime"
},
{
"resource": "Observation",
"name": "method",
"resource_val_path": "method.text"
}
]
}
response = requests.post("http://localhost:5000/filterTasks?execution_type=sync", json=query_spec)
task_id = response.json()["task_id"]
respTable = requests.get("http://localhost:5000/aggregationTasks/" + task_id).text
print(respTable)