org.sql-on-fhir.ig 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,362 @@
1
+ {
2
+ "title": "fn_boundary",
3
+ "description": "TBD",
4
+ "fhirVersion": ["5.0.0", "4.0.1"],
5
+ "resources": [
6
+ {
7
+ "resourceType": "Observation",
8
+ "id": "o1",
9
+ "code": {
10
+ "text": "code"
11
+ },
12
+ "status": "final",
13
+ "valueQuantity": {
14
+ "value": 1.0
15
+ }
16
+ },
17
+ {
18
+ "resourceType": "Observation",
19
+ "id": "o2",
20
+ "code": {
21
+ "text": "code"
22
+ },
23
+ "status": "final",
24
+ "valueDateTime": "2010-10-10"
25
+ },
26
+ {
27
+ "resourceType": "Observation",
28
+ "id": "o3",
29
+ "code": {
30
+ "text": "code"
31
+ },
32
+ "status": "final"
33
+ },
34
+ {
35
+ "resourceType": "Observation",
36
+ "id": "o4",
37
+ "code": {
38
+ "text": "code"
39
+ },
40
+ "valueTime": "12:34"
41
+ },
42
+ {
43
+ "resourceType": "Patient",
44
+ "id": "p1",
45
+ "birthDate": "1970-06"
46
+ }
47
+ ],
48
+ "tests": [
49
+ {
50
+ "title": "decimal lowBoundary",
51
+ "tags": ["experimental"],
52
+ "view": {
53
+ "resource": "Observation",
54
+ "status": "active",
55
+ "select": [
56
+ {
57
+ "column": [
58
+ {
59
+ "name": "id",
60
+ "path": "id",
61
+ "type": "id"
62
+ },
63
+ {
64
+ "name": "decimal",
65
+ "path": "value.ofType(Quantity).value.lowBoundary()",
66
+ "type": "decimal"
67
+ }
68
+ ]
69
+ }
70
+ ]
71
+ },
72
+ "expect": [
73
+ {
74
+ "id": "o1",
75
+ "decimal": 0.95
76
+ },
77
+ {
78
+ "id": "o2",
79
+ "decimal": null
80
+ },
81
+ {
82
+ "id": "o3",
83
+ "decimal": null
84
+ },
85
+ {
86
+ "id": "o4",
87
+ "decimal": null
88
+ }
89
+ ]
90
+ },
91
+ {
92
+ "title": "decimal highBoundary",
93
+ "tags": ["experimental"],
94
+ "view": {
95
+ "resource": "Observation",
96
+ "status": "active",
97
+ "select": [
98
+ {
99
+ "column": [
100
+ {
101
+ "name": "id",
102
+ "path": "id",
103
+ "type": "id"
104
+ },
105
+ {
106
+ "name": "decimal",
107
+ "path": "value.ofType(Quantity).value.highBoundary()",
108
+ "type": "decimal"
109
+ }
110
+ ]
111
+ }
112
+ ]
113
+ },
114
+ "expect": [
115
+ {
116
+ "id": "o1",
117
+ "decimal": 1.05
118
+ },
119
+ {
120
+ "id": "o2",
121
+ "decimal": null
122
+ },
123
+ {
124
+ "id": "o3",
125
+ "decimal": null
126
+ },
127
+ {
128
+ "id": "o4",
129
+ "decimal": null
130
+ }
131
+ ]
132
+ },
133
+ {
134
+ "title": "datetime lowBoundary",
135
+ "tags": ["experimental"],
136
+ "view": {
137
+ "resource": "Observation",
138
+ "status": "active",
139
+ "select": [
140
+ {
141
+ "column": [
142
+ {
143
+ "name": "id",
144
+ "path": "id",
145
+ "type": "id"
146
+ },
147
+ {
148
+ "name": "datetime",
149
+ "path": "value.ofType(dateTime).lowBoundary()",
150
+ "type": "dateTime"
151
+ }
152
+ ]
153
+ }
154
+ ]
155
+ },
156
+ "expect": [
157
+ {
158
+ "id": "o1",
159
+ "datetime": null
160
+ },
161
+ {
162
+ "id": "o2",
163
+ "datetime": "2010-10-10T00:00:00.000+14:00"
164
+ },
165
+ {
166
+ "id": "o3",
167
+ "datetime": null
168
+ },
169
+ {
170
+ "id": "o4",
171
+ "datetime": null
172
+ }
173
+ ]
174
+ },
175
+ {
176
+ "title": "datetime highBoundary",
177
+ "tags": ["experimental"],
178
+ "view": {
179
+ "resource": "Observation",
180
+ "status": "active",
181
+ "select": [
182
+ {
183
+ "column": [
184
+ {
185
+ "name": "id",
186
+ "path": "id",
187
+ "type": "id"
188
+ },
189
+ {
190
+ "name": "datetime",
191
+ "path": "value.ofType(dateTime).highBoundary()",
192
+ "type": "dateTime"
193
+ }
194
+ ]
195
+ }
196
+ ]
197
+ },
198
+ "expect": [
199
+ {
200
+ "id": "o1",
201
+ "datetime": null
202
+ },
203
+ {
204
+ "id": "o2",
205
+ "datetime": "2010-10-10T23:59:59.999-12:00"
206
+ },
207
+ {
208
+ "id": "o3",
209
+ "datetime": null
210
+ },
211
+ {
212
+ "id": "o4",
213
+ "datetime": null
214
+ }
215
+ ]
216
+ },
217
+ {
218
+ "title": "date lowBoundary",
219
+ "tags": ["experimental"],
220
+ "view": {
221
+ "resource": "Patient",
222
+ "status": "active",
223
+ "select": [
224
+ {
225
+ "column": [
226
+ {
227
+ "name": "id",
228
+ "path": "id",
229
+ "type": "id"
230
+ },
231
+ {
232
+ "name": "date",
233
+ "path": "birthDate.lowBoundary()",
234
+ "type": "date"
235
+ }
236
+ ]
237
+ }
238
+ ]
239
+ },
240
+ "expect": [
241
+ {
242
+ "id": "p1",
243
+ "date": "1970-06-01"
244
+ }
245
+ ]
246
+ },
247
+ {
248
+ "title": "date highBoundary",
249
+ "tags": ["experimental"],
250
+ "view": {
251
+ "resource": "Patient",
252
+ "status": "active",
253
+ "select": [
254
+ {
255
+ "column": [
256
+ {
257
+ "name": "id",
258
+ "path": "id",
259
+ "type": "id"
260
+ },
261
+ {
262
+ "name": "date",
263
+ "path": "birthDate.highBoundary()",
264
+ "type": "date"
265
+ }
266
+ ]
267
+ }
268
+ ]
269
+ },
270
+ "expect": [
271
+ {
272
+ "id": "p1",
273
+ "date": "1970-06-30"
274
+ }
275
+ ]
276
+ },
277
+ {
278
+ "title": "time lowBoundary",
279
+ "tags": ["experimental"],
280
+ "view": {
281
+ "resource": "Observation",
282
+ "status": "active",
283
+ "select": [
284
+ {
285
+ "column": [
286
+ {
287
+ "name": "id",
288
+ "path": "id",
289
+ "type": "id"
290
+ },
291
+ {
292
+ "name": "time",
293
+ "path": "value.ofType(time).lowBoundary()",
294
+ "type": "time"
295
+ }
296
+ ]
297
+ }
298
+ ]
299
+ },
300
+ "expect": [
301
+ {
302
+ "id": "o1",
303
+ "time": null
304
+ },
305
+ {
306
+ "id": "o2",
307
+ "time": null
308
+ },
309
+ {
310
+ "id": "o3",
311
+ "time": null
312
+ },
313
+ {
314
+ "id": "o4",
315
+ "time": "12:34:00.000"
316
+ }
317
+ ]
318
+ },
319
+ {
320
+ "title": "time highBoundary",
321
+ "tags": ["experimental"],
322
+ "view": {
323
+ "resource": "Observation",
324
+ "status": "active",
325
+ "select": [
326
+ {
327
+ "column": [
328
+ {
329
+ "name": "id",
330
+ "path": "id",
331
+ "type": "id"
332
+ },
333
+ {
334
+ "name": "time",
335
+ "path": "value.ofType(time).highBoundary()",
336
+ "type": "time"
337
+ }
338
+ ]
339
+ }
340
+ ]
341
+ },
342
+ "expect": [
343
+ {
344
+ "id": "o1",
345
+ "time": null
346
+ },
347
+ {
348
+ "id": "o2",
349
+ "time": null
350
+ },
351
+ {
352
+ "id": "o3",
353
+ "time": null
354
+ },
355
+ {
356
+ "id": "o4",
357
+ "time": "12:34:59.999"
358
+ }
359
+ ]
360
+ }
361
+ ]
362
+ }
@@ -0,0 +1,57 @@
1
+ {
2
+ "title": "fn_empty",
3
+ "description": "TBD",
4
+ "fhirVersion": ["5.0.0", "4.0.1", "3.0.2"],
5
+ "resources": [
6
+ {
7
+ "resourceType": "Patient",
8
+ "id": "p1",
9
+ "name": [
10
+ {
11
+ "use": "official",
12
+ "family": "f1"
13
+ }
14
+ ]
15
+ },
16
+ {
17
+ "resourceType": "Patient",
18
+ "id": "p2"
19
+ }
20
+ ],
21
+ "tests": [
22
+ {
23
+ "title": "empty names",
24
+ "tags": ["shareable"],
25
+ "view": {
26
+ "resource": "Patient",
27
+ "status": "active",
28
+ "select": [
29
+ {
30
+ "column": [
31
+ {
32
+ "name": "id",
33
+ "path": "id",
34
+ "type": "id"
35
+ },
36
+ {
37
+ "name": "name_empty",
38
+ "path": "name.empty()",
39
+ "type": "boolean"
40
+ }
41
+ ]
42
+ }
43
+ ]
44
+ },
45
+ "expect": [
46
+ {
47
+ "id": "p1",
48
+ "name_empty": false
49
+ },
50
+ {
51
+ "id": "p2",
52
+ "name_empty": true
53
+ }
54
+ ]
55
+ }
56
+ ]
57
+ }
@@ -0,0 +1,173 @@
1
+ {
2
+ "title": "fn_extension",
3
+ "description": "TBD",
4
+ "fhirVersion": ["5.0.0", "4.0.1"],
5
+ "resources": [
6
+ {
7
+ "resourceType": "Patient",
8
+ "id": "pt1",
9
+ "meta": {
10
+ "profile": [
11
+ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"
12
+ ]
13
+ },
14
+ "extension": [
15
+ {
16
+ "id": "birthsex",
17
+ "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex",
18
+ "valueCode": "F"
19
+ },
20
+ {
21
+ "id": "race",
22
+ "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race",
23
+ "extension": [
24
+ {
25
+ "url": "ombCategory",
26
+ "valueCoding": {
27
+ "system": "urn:oid:2.16.840.1.113883.6.238",
28
+ "code": "2106-3",
29
+ "display": "White"
30
+ }
31
+ },
32
+ {
33
+ "url": "text",
34
+ "valueString": "Mixed"
35
+ }
36
+ ]
37
+ },
38
+ {
39
+ "id": "sex",
40
+ "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-sex",
41
+ "valueCode": "248152002"
42
+ }
43
+ ]
44
+ },
45
+ {
46
+ "resourceType": "Patient",
47
+ "id": "pt2",
48
+ "meta": {
49
+ "profile": [
50
+ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"
51
+ ]
52
+ },
53
+ "extension": [
54
+ {
55
+ "id": "birthsex",
56
+ "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex",
57
+ "valueCode": "M"
58
+ },
59
+ {
60
+ "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race",
61
+ "id": "race",
62
+ "extension": [
63
+ {
64
+ "url": "ombCategory",
65
+ "valueCoding": {
66
+ "system": "urn:oid:2.16.840.1.113883.6.238",
67
+ "code": "2135-2",
68
+ "display": "Hispanic or Latino"
69
+ }
70
+ },
71
+ {
72
+ "url": "text",
73
+ "valueString": "Mixed"
74
+ }
75
+ ]
76
+ },
77
+ {
78
+ "id": "sex",
79
+ "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-sex",
80
+ "valueCode": "248152002"
81
+ }
82
+ ]
83
+ },
84
+ {
85
+ "resourceType": "Patient",
86
+ "id": "pt3",
87
+ "meta": {
88
+ "profile": [
89
+ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"
90
+ ]
91
+ },
92
+ "extension": []
93
+ }
94
+ ],
95
+ "tests": [
96
+ {
97
+ "title": "simple extension",
98
+ "tags": ["shareable"],
99
+ "description": "flatten simple extension",
100
+ "view": {
101
+ "resource": "Patient",
102
+ "select": [
103
+ {
104
+ "column": [
105
+ {
106
+ "path": "id",
107
+ "name": "id",
108
+ "type": "id"
109
+ },
110
+ {
111
+ "name": "birthsex",
112
+ "path": "extension('http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex').value.ofType(code).first()",
113
+ "type": "code"
114
+ }
115
+ ]
116
+ }
117
+ ]
118
+ },
119
+ "expect": [
120
+ {
121
+ "id": "pt1",
122
+ "birthsex": "F"
123
+ },
124
+ {
125
+ "id": "pt2",
126
+ "birthsex": "M"
127
+ },
128
+ {
129
+ "id": "pt3",
130
+ "birthsex": null
131
+ }
132
+ ]
133
+ },
134
+ {
135
+ "title": "nested extension",
136
+ "tags": ["shareable"],
137
+ "description": "flatten simple extension",
138
+ "view": {
139
+ "resource": "Patient",
140
+ "select": [
141
+ {
142
+ "column": [
143
+ {
144
+ "path": "id",
145
+ "name": "id",
146
+ "type": "id"
147
+ },
148
+ {
149
+ "name": "race_code",
150
+ "path": "extension('http://hl7.org/fhir/us/core/StructureDefinition/us-core-race').extension('ombCategory').value.ofType(Coding).code.first()",
151
+ "type": "code"
152
+ }
153
+ ]
154
+ }
155
+ ]
156
+ },
157
+ "expect": [
158
+ {
159
+ "id": "pt1",
160
+ "race_code": "2106-3"
161
+ },
162
+ {
163
+ "id": "pt2",
164
+ "race_code": "2135-2"
165
+ },
166
+ {
167
+ "id": "pt3",
168
+ "race_code": null
169
+ }
170
+ ]
171
+ }
172
+ ]
173
+ }
@@ -0,0 +1,77 @@
1
+ {
2
+ "title": "fn_first",
3
+ "description": "FHIRPath `first` function.",
4
+ "fhirVersion": ["5.0.0", "4.0.1", "3.0.2"],
5
+ "resources": [
6
+ {
7
+ "resourceType": "Patient",
8
+ "name": [
9
+ {
10
+ "use": "official",
11
+ "family": "f1",
12
+ "given": ["g1.1", "g1.2"]
13
+ },
14
+ {
15
+ "use": "usual",
16
+ "given": ["g2.1"]
17
+ },
18
+ {
19
+ "use": "maiden",
20
+ "family": "f3",
21
+ "given": ["g3.1", "g3.2"],
22
+ "period": {
23
+ "end": "2002"
24
+ }
25
+ }
26
+ ]
27
+ }
28
+ ],
29
+ "tests": [
30
+ {
31
+ "title": "table level first()",
32
+ "tags": ["shareable"],
33
+ "view": {
34
+ "resource": "Patient",
35
+ "select": [
36
+ {
37
+ "column": [
38
+ {
39
+ "path": "name.first().use",
40
+ "name": "use",
41
+ "type": "code"
42
+ }
43
+ ]
44
+ }
45
+ ]
46
+ },
47
+ "expect": [
48
+ {
49
+ "use": "official"
50
+ }
51
+ ]
52
+ },
53
+ {
54
+ "title": "table and field level first()",
55
+ "tags": ["shareable"],
56
+ "view": {
57
+ "resource": "Patient",
58
+ "select": [
59
+ {
60
+ "column": [
61
+ {
62
+ "path": "name.first().given.first()",
63
+ "name": "given",
64
+ "type": "string"
65
+ }
66
+ ]
67
+ }
68
+ ]
69
+ },
70
+ "expect": [
71
+ {
72
+ "given": "g1.1"
73
+ }
74
+ ]
75
+ }
76
+ ]
77
+ }