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,331 @@
1
+ {
2
+ "title": "constant",
3
+ "description": "constant substitution",
4
+ "fhirVersion": ["5.0.0", "4.0.1"],
5
+ "resources": [
6
+ {
7
+ "resourceType": "Patient",
8
+ "id": "pt1",
9
+ "name": [
10
+ {
11
+ "family": "Block",
12
+ "use": "usual"
13
+ },
14
+ {
15
+ "family": "Smith",
16
+ "use": "official"
17
+ }
18
+ ]
19
+ },
20
+ {
21
+ "resourceType": "Patient",
22
+ "id": "pt2",
23
+ "deceasedBoolean": true,
24
+ "name": [
25
+ {
26
+ "family": "Johnson",
27
+ "use": "usual"
28
+ },
29
+ {
30
+ "family": "Menendez",
31
+ "use": "old"
32
+ }
33
+ ]
34
+ }
35
+ ],
36
+ "tests": [
37
+ {
38
+ "title": "constant in path",
39
+ "tags": ["shareable"],
40
+ "view": {
41
+ "resource": "Patient",
42
+ "status": "active",
43
+ "constant": [
44
+ {
45
+ "name": "name_use",
46
+ "valueString": "official"
47
+ }
48
+ ],
49
+ "select": [
50
+ {
51
+ "column": [
52
+ {
53
+ "name": "id",
54
+ "path": "id",
55
+ "type": "id"
56
+ },
57
+ {
58
+ "name": "official_name",
59
+ "path": "name.where(use = %name_use).family",
60
+ "type": "string"
61
+ }
62
+ ]
63
+ }
64
+ ]
65
+ },
66
+ "expect": [
67
+ {
68
+ "id": "pt1",
69
+ "official_name": "Smith"
70
+ },
71
+ {
72
+ "id": "pt2",
73
+ "official_name": null
74
+ }
75
+ ]
76
+ },
77
+ {
78
+ "title": "constant in forEach",
79
+ "tags": ["shareable"],
80
+ "view": {
81
+ "resource": "Patient",
82
+ "status": "active",
83
+ "constant": [
84
+ {
85
+ "name": "name_use",
86
+ "valueString": "official"
87
+ }
88
+ ],
89
+ "select": [
90
+ {
91
+ "forEach": "name.where(use = %name_use)",
92
+ "column": [
93
+ {
94
+ "name": "official_name",
95
+ "path": "family",
96
+ "type": "string"
97
+ }
98
+ ]
99
+ }
100
+ ]
101
+ },
102
+ "expect": [
103
+ {
104
+ "official_name": "Smith"
105
+ }
106
+ ]
107
+ },
108
+ {
109
+ "title": "constant in where element",
110
+ "tags": ["shareable"],
111
+ "view": {
112
+ "resource": "Patient",
113
+ "status": "active",
114
+ "constant": [
115
+ {
116
+ "name": "name_use",
117
+ "valueString": "official"
118
+ }
119
+ ],
120
+ "select": [
121
+ {
122
+ "column": [
123
+ {
124
+ "name": "id",
125
+ "path": "id",
126
+ "type": "id"
127
+ }
128
+ ]
129
+ }
130
+ ],
131
+ "where": [
132
+ {
133
+ "path": "name.where(use = %name_use).exists()"
134
+ }
135
+ ]
136
+ },
137
+ "expect": [
138
+ {
139
+ "id": "pt1"
140
+ }
141
+ ]
142
+ },
143
+ {
144
+ "title": "constant in unionAll",
145
+ "tags": ["shareable"],
146
+ "view": {
147
+ "resource": "Patient",
148
+ "status": "active",
149
+ "constant": [
150
+ {
151
+ "name": "use1",
152
+ "valueString": "official"
153
+ },
154
+ {
155
+ "name": "use2",
156
+ "valueString": "usual"
157
+ }
158
+ ],
159
+ "select": [
160
+ {
161
+ "unionAll": [
162
+ {
163
+ "forEach": "name.where(use = %use1)",
164
+ "column": [
165
+ {
166
+ "name": "name",
167
+ "path": "family",
168
+ "type": "string"
169
+ }
170
+ ]
171
+ },
172
+ {
173
+ "forEach": "name.where(use = %use2)",
174
+ "column": [
175
+ {
176
+ "name": "name",
177
+ "path": "family",
178
+ "type": "string"
179
+ }
180
+ ]
181
+ }
182
+ ]
183
+ }
184
+ ]
185
+ },
186
+ "expect": [
187
+ {
188
+ "name": "Smith"
189
+ },
190
+ {
191
+ "name": "Block"
192
+ },
193
+ {
194
+ "name": "Johnson"
195
+ }
196
+ ]
197
+ },
198
+ {
199
+ "title": "integer constant",
200
+ "tags": ["shareable"],
201
+ "view": {
202
+ "resource": "Patient",
203
+ "status": "active",
204
+ "constant": [
205
+ {
206
+ "name": "name_index",
207
+ "valueInteger": 1
208
+ }
209
+ ],
210
+ "select": [
211
+ {
212
+ "column": [
213
+ {
214
+ "name": "id",
215
+ "path": "id",
216
+ "type": "id"
217
+ },
218
+ {
219
+ "name": "official_name",
220
+ "path": "name[%name_index].family",
221
+ "type": "string"
222
+ }
223
+ ]
224
+ }
225
+ ]
226
+ },
227
+ "expect": [
228
+ {
229
+ "id": "pt1",
230
+ "official_name": "Smith"
231
+ },
232
+ {
233
+ "id": "pt2",
234
+ "official_name": "Menendez"
235
+ }
236
+ ]
237
+ },
238
+ {
239
+ "title": "boolean constant",
240
+ "tags": ["shareable"],
241
+ "view": {
242
+ "resource": "Patient",
243
+ "status": "active",
244
+ "constant": [
245
+ {
246
+ "name": "is_deceased",
247
+ "valueBoolean": true
248
+ }
249
+ ],
250
+ "select": [
251
+ {
252
+ "column": [
253
+ {
254
+ "name": "id",
255
+ "path": "id",
256
+ "type": "id"
257
+ }
258
+ ]
259
+ }
260
+ ],
261
+ "where": [
262
+ {
263
+ "path": "deceased.ofType(boolean).exists() and deceased.ofType(boolean) = %is_deceased"
264
+ }
265
+ ]
266
+ },
267
+ "expect": [
268
+ {
269
+ "id": "pt2"
270
+ }
271
+ ]
272
+ },
273
+ {
274
+ "title": "accessing an undefined constant",
275
+ "tags": ["shareable"],
276
+ "view": {
277
+ "resource": "Patient",
278
+ "status": "active",
279
+ "constant": [
280
+ {
281
+ "name": "name_use",
282
+ "valueString": "official"
283
+ }
284
+ ],
285
+ "select": [
286
+ {
287
+ "forEach": "name.where(use = %wrong_name)",
288
+ "column": [
289
+ {
290
+ "name": "official_name",
291
+ "path": "family",
292
+ "type": "string"
293
+ }
294
+ ]
295
+ }
296
+ ]
297
+ },
298
+ "expectError": true
299
+ },
300
+ {
301
+ "title": "incorrect constant definition",
302
+ "tags": ["shareable"],
303
+ "view": {
304
+ "resource": "Patient",
305
+ "status": "active",
306
+ "constant": [
307
+ {
308
+ "name": "name_use"
309
+ }
310
+ ],
311
+ "select": [
312
+ {
313
+ "column": [
314
+ {
315
+ "name": "id",
316
+ "path": "id",
317
+ "type": "id"
318
+ },
319
+ {
320
+ "name": "official_name",
321
+ "path": "name.where(use = %name_use).family",
322
+ "type": "string"
323
+ }
324
+ ]
325
+ }
326
+ ]
327
+ },
328
+ "expectError": true
329
+ }
330
+ ]
331
+ }