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,99 @@
1
+ {
2
+ "title": "validate",
3
+ "description": "TBD",
4
+ "fhirVersion": ["5.0.0", "4.0.1", "3.0.2"],
5
+ "resources": [
6
+ {
7
+ "resourceType": "Patient",
8
+ "name": [
9
+ {
10
+ "family": "F1.1"
11
+ }
12
+ ],
13
+ "id": "pt1"
14
+ },
15
+ {
16
+ "resourceType": "Patient",
17
+ "id": "pt2"
18
+ }
19
+ ],
20
+ "tests": [
21
+ {
22
+ "title": "empty",
23
+ "tags": ["shareable"],
24
+ "view": {},
25
+ "expectError": true
26
+ },
27
+ {
28
+ "title": "missing resource",
29
+ "tags": ["shareable"],
30
+ "view": {
31
+ "select": [
32
+ {
33
+ "column": [
34
+ {
35
+ "name": "id",
36
+ "path": "id",
37
+ "type": "id"
38
+ }
39
+ ]
40
+ }
41
+ ]
42
+ },
43
+ "expectError": true
44
+ },
45
+ {
46
+ "title": "wrong fhirpath",
47
+ "tags": ["shareable"],
48
+ "view": {
49
+ "resource": "Patient",
50
+ "status": "active",
51
+ "select": [
52
+ {
53
+ "forEach": "@@"
54
+ }
55
+ ]
56
+ },
57
+ "expectError": true
58
+ },
59
+ {
60
+ "title": "wrong type in forEach",
61
+ "tags": ["shareable"],
62
+ "view": {
63
+ "resource": "Patient",
64
+ "status": "active",
65
+ "select": [
66
+ {
67
+ "forEach": 1
68
+ }
69
+ ]
70
+ },
71
+ "expectError": true
72
+ },
73
+ {
74
+ "title": "where with path resolving to not boolean",
75
+ "tags": ["shareable"],
76
+ "view": {
77
+ "resource": "Patient",
78
+ "status": "active",
79
+ "select": [
80
+ {
81
+ "column": [
82
+ {
83
+ "name": "id",
84
+ "path": "id",
85
+ "type": "id"
86
+ }
87
+ ]
88
+ }
89
+ ],
90
+ "where": [
91
+ {
92
+ "path": "name.family"
93
+ }
94
+ ]
95
+ },
96
+ "expectError": true
97
+ }
98
+ ]
99
+ }
@@ -0,0 +1,95 @@
1
+ {
2
+ "title": "view_resource",
3
+ "description": "TBD",
4
+ "fhirVersion": ["5.0.0", "4.0.1", "3.0.2"],
5
+ "resources": [
6
+ {
7
+ "id": "pt1",
8
+ "resourceType": "Patient"
9
+ },
10
+ {
11
+ "id": "pt2",
12
+ "resourceType": "Patient"
13
+ },
14
+ {
15
+ "id": "ob1",
16
+ "resourceType": "Observation",
17
+ "code": {
18
+ "text": "code"
19
+ },
20
+ "status": "final"
21
+ }
22
+ ],
23
+ "tests": [
24
+ {
25
+ "title": "only pts",
26
+ "tags": ["shareable"],
27
+ "view": {
28
+ "resource": "Patient",
29
+ "status": "active",
30
+ "select": [
31
+ {
32
+ "column": [
33
+ {
34
+ "path": "id",
35
+ "name": "id",
36
+ "type": "id"
37
+ }
38
+ ]
39
+ }
40
+ ]
41
+ },
42
+ "expect": [
43
+ {
44
+ "id": "pt1"
45
+ },
46
+ {
47
+ "id": "pt2"
48
+ }
49
+ ]
50
+ },
51
+ {
52
+ "title": "only obs",
53
+ "tags": ["shareable"],
54
+ "view": {
55
+ "resource": "Observation",
56
+ "status": "active",
57
+ "select": [
58
+ {
59
+ "column": [
60
+ {
61
+ "path": "id",
62
+ "name": "id",
63
+ "type": "id"
64
+ }
65
+ ]
66
+ }
67
+ ]
68
+ },
69
+ "expect": [
70
+ {
71
+ "id": "ob1"
72
+ }
73
+ ]
74
+ },
75
+ {
76
+ "title": "resource not specified",
77
+ "tags": ["shareable"],
78
+ "view": {
79
+ "status": "active",
80
+ "select": [
81
+ {
82
+ "column": [
83
+ {
84
+ "path": "id",
85
+ "name": "id",
86
+ "type": "id"
87
+ }
88
+ ]
89
+ }
90
+ ]
91
+ },
92
+ "expectError": true
93
+ }
94
+ ]
95
+ }
@@ -0,0 +1,279 @@
1
+ {
2
+ "title": "where",
3
+ "description": "FHIRPath `where` function.",
4
+ "fhirVersion": ["5.0.0", "4.0.1"],
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
+ "name": [
20
+ {
21
+ "use": "nickname",
22
+ "family": "f2"
23
+ }
24
+ ]
25
+ },
26
+ {
27
+ "resourceType": "Patient",
28
+ "id": "p3",
29
+ "name": [
30
+ {
31
+ "use": "nickname",
32
+ "given": ["g3"],
33
+ "family": "f3"
34
+ }
35
+ ]
36
+ },
37
+ {
38
+ "resourceType": "Observation",
39
+ "id": "o1",
40
+ "valueInteger": 12
41
+ },
42
+ {
43
+ "resourceType": "Observation",
44
+ "id": "o2",
45
+ "valueInteger": 10
46
+ }
47
+ ],
48
+ "tests": [
49
+ {
50
+ "title": "simple where path with result",
51
+ "tags": ["shareable"],
52
+ "view": {
53
+ "resource": "Patient",
54
+ "select": [
55
+ {
56
+ "column": [
57
+ {
58
+ "path": "id",
59
+ "name": "id",
60
+ "type": "id"
61
+ }
62
+ ]
63
+ }
64
+ ],
65
+ "where": [
66
+ {
67
+ "path": "name.where(use = 'official').exists()"
68
+ }
69
+ ]
70
+ },
71
+ "expect": [
72
+ {
73
+ "id": "p1"
74
+ }
75
+ ]
76
+ },
77
+ {
78
+ "title": "where path with no results",
79
+ "tags": ["shareable"],
80
+ "view": {
81
+ "resource": "Patient",
82
+ "select": [
83
+ {
84
+ "column": [
85
+ {
86
+ "path": "id",
87
+ "name": "id",
88
+ "type": "id"
89
+ }
90
+ ]
91
+ }
92
+ ],
93
+ "where": [
94
+ {
95
+ "path": "name.where(use = 'maiden').exists()"
96
+ }
97
+ ]
98
+ },
99
+ "expect": []
100
+ },
101
+ {
102
+ "title": "where path with greater than inequality",
103
+ "tags": ["shareable"],
104
+ "view": {
105
+ "resource": "Observation",
106
+ "select": [
107
+ {
108
+ "column": [
109
+ {
110
+ "path": "id",
111
+ "name": "id",
112
+ "type": "id"
113
+ }
114
+ ]
115
+ }
116
+ ],
117
+ "where": [
118
+ {
119
+ "path": "where(value.ofType(integer) > 11).exists()"
120
+ }
121
+ ]
122
+ },
123
+ "expect": [
124
+ {
125
+ "id": "o1"
126
+ }
127
+ ]
128
+ },
129
+ {
130
+ "title": "where path with less than inequality",
131
+ "tags": ["shareable"],
132
+ "view": {
133
+ "resource": "Observation",
134
+ "select": [
135
+ {
136
+ "column": [
137
+ {
138
+ "path": "id",
139
+ "name": "id",
140
+ "type": "id"
141
+ }
142
+ ]
143
+ }
144
+ ],
145
+ "where": [
146
+ {
147
+ "path": "where(value.ofType(integer) < 11).exists()"
148
+ }
149
+ ]
150
+ },
151
+ "expect": [
152
+ {
153
+ "id": "o2"
154
+ }
155
+ ]
156
+ },
157
+ {
158
+ "title": "multiple where paths",
159
+ "tags": ["shareable"],
160
+ "view": {
161
+ "resource": "Patient",
162
+ "select": [
163
+ {
164
+ "column": [
165
+ {
166
+ "path": "id",
167
+ "name": "id",
168
+ "type": "id"
169
+ }
170
+ ]
171
+ }
172
+ ],
173
+ "where": [
174
+ {
175
+ "path": "name.where(use = 'official').exists()"
176
+ },
177
+ {
178
+ "path": "name.where(family = 'f1').exists()"
179
+ }
180
+ ]
181
+ },
182
+ "expect": [
183
+ {
184
+ "id": "p1"
185
+ }
186
+ ]
187
+ },
188
+ {
189
+ "title": "where path with an 'and' connector",
190
+ "tags": ["shareable"],
191
+ "view": {
192
+ "resource": "Patient",
193
+ "select": [
194
+ {
195
+ "column": [
196
+ {
197
+ "path": "id",
198
+ "name": "id",
199
+ "type": "id"
200
+ }
201
+ ]
202
+ }
203
+ ],
204
+ "where": [
205
+ {
206
+ "path": "name.where(use = 'official' and family = 'f1').exists()"
207
+ }
208
+ ]
209
+ },
210
+ "expect": [
211
+ {
212
+ "id": "p1"
213
+ }
214
+ ]
215
+ },
216
+ {
217
+ "title": "where path with an 'or' connector",
218
+ "tags": ["shareable"],
219
+ "view": {
220
+ "resource": "Patient",
221
+ "select": [
222
+ {
223
+ "column": [
224
+ {
225
+ "path": "id",
226
+ "name": "id",
227
+ "type": "id"
228
+ }
229
+ ]
230
+ }
231
+ ],
232
+ "where": [
233
+ {
234
+ "path": "name.where(use = 'official' or family = 'f2').exists()"
235
+ }
236
+ ]
237
+ },
238
+ "expect": [
239
+ {
240
+ "id": "p1"
241
+ },
242
+ {
243
+ "id": "p2"
244
+ }
245
+ ]
246
+ },
247
+ {
248
+ "title": "where path that evaluates to true when empty",
249
+ "tags": ["shareable"],
250
+ "view": {
251
+ "resource": "Patient",
252
+ "select": [
253
+ {
254
+ "column": [
255
+ {
256
+ "path": "id",
257
+ "name": "id",
258
+ "type": "id"
259
+ }
260
+ ]
261
+ }
262
+ ],
263
+ "where": [
264
+ {
265
+ "path": "name.where(family = 'f2').empty()"
266
+ }
267
+ ]
268
+ },
269
+ "expect": [
270
+ {
271
+ "id": "p1"
272
+ },
273
+ {
274
+ "id": "p3"
275
+ }
276
+ ]
277
+ }
278
+ ]
279
+ }