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,832 @@
1
+ {
2
+ "title": "foreach",
3
+ "description": "TBD",
4
+ "fhirVersion": ["5.0.0", "4.0.1", "3.0.2"],
5
+ "resources": [
6
+ {
7
+ "resourceType": "Patient",
8
+ "id": "pt1",
9
+ "name": [
10
+ {
11
+ "family": "F1.1"
12
+ },
13
+ {
14
+ "family": "F1.2"
15
+ }
16
+ ],
17
+ "contact": [
18
+ {
19
+ "telecom": [
20
+ {
21
+ "system": "phone"
22
+ }
23
+ ],
24
+ "name": {
25
+ "family": "FC1.1",
26
+ "given": ["N1", "N1`"]
27
+ }
28
+ },
29
+ {
30
+ "telecom": [
31
+ {
32
+ "system": "email"
33
+ }
34
+ ],
35
+ "gender": "unknown",
36
+ "name": {
37
+ "family": "FC1.2",
38
+ "given": ["N2"]
39
+ }
40
+ }
41
+ ]
42
+ },
43
+ {
44
+ "resourceType": "Patient",
45
+ "id": "pt2",
46
+ "name": [
47
+ {
48
+ "family": "F2.1"
49
+ },
50
+ {
51
+ "family": "F2.2"
52
+ }
53
+ ]
54
+ },
55
+ {
56
+ "resourceType": "Patient",
57
+ "id": "pt3"
58
+ }
59
+ ],
60
+ "tests": [
61
+ {
62
+ "title": "forEach: normal",
63
+ "tags": ["shareable"],
64
+ "view": {
65
+ "resource": "Patient",
66
+ "status": "active",
67
+ "select": [
68
+ {
69
+ "column": [
70
+ {
71
+ "name": "id",
72
+ "path": "id",
73
+ "type": "id"
74
+ }
75
+ ]
76
+ },
77
+ {
78
+ "forEach": "name",
79
+ "column": [
80
+ {
81
+ "name": "family",
82
+ "path": "family",
83
+ "type": "string"
84
+ }
85
+ ]
86
+ }
87
+ ]
88
+ },
89
+ "expect": [
90
+ {
91
+ "id": "pt1",
92
+ "family": "F1.1"
93
+ },
94
+ {
95
+ "id": "pt1",
96
+ "family": "F1.2"
97
+ },
98
+ {
99
+ "id": "pt2",
100
+ "family": "F2.1"
101
+ },
102
+ {
103
+ "id": "pt2",
104
+ "family": "F2.2"
105
+ }
106
+ ]
107
+ },
108
+ {
109
+ "title": "forEachOrNull: basic",
110
+ "tags": ["shareable"],
111
+ "view": {
112
+ "resource": "Patient",
113
+ "status": "active",
114
+ "select": [
115
+ {
116
+ "column": [
117
+ {
118
+ "name": "id",
119
+ "path": "id",
120
+ "type": "id"
121
+ }
122
+ ]
123
+ },
124
+ {
125
+ "forEachOrNull": "name",
126
+ "column": [
127
+ {
128
+ "name": "family",
129
+ "path": "family",
130
+ "type": "string"
131
+ }
132
+ ]
133
+ }
134
+ ]
135
+ },
136
+ "expect": [
137
+ {
138
+ "id": "pt1",
139
+ "family": "F1.1"
140
+ },
141
+ {
142
+ "id": "pt1",
143
+ "family": "F1.2"
144
+ },
145
+ {
146
+ "id": "pt2",
147
+ "family": "F2.1"
148
+ },
149
+ {
150
+ "id": "pt2",
151
+ "family": "F2.2"
152
+ },
153
+ {
154
+ "id": "pt3",
155
+ "family": null
156
+ }
157
+ ]
158
+ },
159
+ {
160
+ "title": "forEach: empty",
161
+ "tags": ["shareable"],
162
+ "view": {
163
+ "resource": "Patient",
164
+ "status": "active",
165
+ "select": [
166
+ {
167
+ "column": [
168
+ {
169
+ "name": "id",
170
+ "path": "id",
171
+ "type": "id"
172
+ }
173
+ ]
174
+ },
175
+ {
176
+ "forEach": "identifier",
177
+ "column": [
178
+ {
179
+ "name": "value",
180
+ "path": "value",
181
+ "type": "string"
182
+ }
183
+ ]
184
+ }
185
+ ]
186
+ },
187
+ "expect": []
188
+ },
189
+ {
190
+ "title": "forEach: two on the same level",
191
+ "tags": ["shareable"],
192
+ "view": {
193
+ "resource": "Patient",
194
+ "status": "active",
195
+ "select": [
196
+ {
197
+ "forEach": "contact",
198
+ "column": [
199
+ {
200
+ "name": "cont_family",
201
+ "path": "name.family",
202
+ "type": "string"
203
+ }
204
+ ]
205
+ },
206
+ {
207
+ "forEach": "name",
208
+ "column": [
209
+ {
210
+ "name": "pat_family",
211
+ "path": "family",
212
+ "type": "string"
213
+ }
214
+ ]
215
+ }
216
+ ]
217
+ },
218
+ "expect": [
219
+ {
220
+ "pat_family": "F1.1",
221
+ "cont_family": "FC1.1"
222
+ },
223
+ {
224
+ "pat_family": "F1.1",
225
+ "cont_family": "FC1.2"
226
+ },
227
+ {
228
+ "pat_family": "F1.2",
229
+ "cont_family": "FC1.1"
230
+ },
231
+ {
232
+ "pat_family": "F1.2",
233
+ "cont_family": "FC1.2"
234
+ }
235
+ ]
236
+ },
237
+ {
238
+ "title": "forEach: two on the same level (empty result)",
239
+ "tags": ["shareable"],
240
+ "view": {
241
+ "resource": "Patient",
242
+ "status": "active",
243
+ "select": [
244
+ {
245
+ "column": [
246
+ {
247
+ "name": "id",
248
+ "path": "id",
249
+ "type": "id"
250
+ }
251
+ ]
252
+ },
253
+ {
254
+ "forEach": "identifier",
255
+ "column": [
256
+ {
257
+ "name": "value",
258
+ "path": "value",
259
+ "type": "string"
260
+ }
261
+ ]
262
+ },
263
+ {
264
+ "forEach": "name",
265
+ "column": [
266
+ {
267
+ "name": "family",
268
+ "path": "family",
269
+ "type": "string"
270
+ }
271
+ ]
272
+ }
273
+ ]
274
+ },
275
+ "expect": []
276
+ },
277
+ {
278
+ "title": "forEachOrNull: null case",
279
+ "tags": ["shareable"],
280
+ "view": {
281
+ "resource": "Patient",
282
+ "status": "active",
283
+ "select": [
284
+ {
285
+ "column": [
286
+ {
287
+ "name": "id",
288
+ "path": "id",
289
+ "type": "id"
290
+ }
291
+ ]
292
+ },
293
+ {
294
+ "forEachOrNull": "identifier",
295
+ "column": [
296
+ {
297
+ "name": "value",
298
+ "path": "value",
299
+ "type": "string"
300
+ }
301
+ ]
302
+ }
303
+ ]
304
+ },
305
+ "expect": [
306
+ {
307
+ "id": "pt1",
308
+ "value": null
309
+ },
310
+ {
311
+ "id": "pt2",
312
+ "value": null
313
+ },
314
+ {
315
+ "id": "pt3",
316
+ "value": null
317
+ }
318
+ ]
319
+ },
320
+ {
321
+ "title": "forEach and forEachOrNull on the same level",
322
+ "tags": ["shareable"],
323
+ "view": {
324
+ "resource": "Patient",
325
+ "status": "active",
326
+ "select": [
327
+ {
328
+ "column": [
329
+ {
330
+ "name": "id",
331
+ "path": "id",
332
+ "type": "id"
333
+ }
334
+ ]
335
+ },
336
+ {
337
+ "forEachOrNull": "identifier",
338
+ "column": [
339
+ {
340
+ "name": "value",
341
+ "path": "value",
342
+ "type": "string"
343
+ }
344
+ ]
345
+ },
346
+ {
347
+ "forEach": "name",
348
+ "column": [
349
+ {
350
+ "name": "family",
351
+ "path": "family",
352
+ "type": "string"
353
+ }
354
+ ]
355
+ }
356
+ ]
357
+ },
358
+ "expect": [
359
+ {
360
+ "id": "pt1",
361
+ "family": "F1.1",
362
+ "value": null
363
+ },
364
+ {
365
+ "id": "pt1",
366
+ "family": "F1.2",
367
+ "value": null
368
+ },
369
+ {
370
+ "id": "pt2",
371
+ "family": "F2.1",
372
+ "value": null
373
+ },
374
+ {
375
+ "id": "pt2",
376
+ "family": "F2.2",
377
+ "value": null
378
+ }
379
+ ]
380
+ },
381
+ {
382
+ "title": "nested forEach",
383
+ "tags": ["shareable"],
384
+ "view": {
385
+ "resource": "Patient",
386
+ "status": "active",
387
+ "select": [
388
+ {
389
+ "column": [
390
+ {
391
+ "name": "id",
392
+ "path": "id",
393
+ "type": "id"
394
+ }
395
+ ]
396
+ },
397
+ {
398
+ "forEach": "contact",
399
+ "select": [
400
+ {
401
+ "column": [
402
+ {
403
+ "name": "contact_type",
404
+ "path": "telecom.system",
405
+ "type": "code"
406
+ }
407
+ ]
408
+ },
409
+ {
410
+ "forEach": "name.given",
411
+ "column": [
412
+ {
413
+ "name": "name",
414
+ "path": "$this",
415
+ "type": "string"
416
+ }
417
+ ]
418
+ }
419
+ ]
420
+ }
421
+ ]
422
+ },
423
+ "expect": [
424
+ {
425
+ "contact_type": "phone",
426
+ "name": "N1",
427
+ "id": "pt1"
428
+ },
429
+ {
430
+ "contact_type": "phone",
431
+ "name": "N1`",
432
+ "id": "pt1"
433
+ },
434
+ {
435
+ "contact_type": "email",
436
+ "name": "N2",
437
+ "id": "pt1"
438
+ }
439
+ ]
440
+ },
441
+ {
442
+ "title": "nested forEach: select & column",
443
+ "tags": ["shareable"],
444
+ "view": {
445
+ "resource": "Patient",
446
+ "status": "active",
447
+ "select": [
448
+ {
449
+ "column": [
450
+ {
451
+ "name": "id",
452
+ "path": "id",
453
+ "type": "id"
454
+ }
455
+ ]
456
+ },
457
+ {
458
+ "forEach": "contact",
459
+ "column": [
460
+ {
461
+ "name": "contact_type",
462
+ "path": "telecom.system",
463
+ "type": "code"
464
+ }
465
+ ],
466
+ "select": [
467
+ {
468
+ "forEach": "name.given",
469
+ "column": [
470
+ {
471
+ "name": "name",
472
+ "path": "$this",
473
+ "type": "string"
474
+ }
475
+ ]
476
+ }
477
+ ]
478
+ }
479
+ ]
480
+ },
481
+ "expect": [
482
+ {
483
+ "contact_type": "phone",
484
+ "name": "N1",
485
+ "id": "pt1"
486
+ },
487
+ {
488
+ "contact_type": "phone",
489
+ "name": "N1`",
490
+ "id": "pt1"
491
+ },
492
+ {
493
+ "contact_type": "email",
494
+ "name": "N2",
495
+ "id": "pt1"
496
+ }
497
+ ]
498
+ },
499
+ {
500
+ "title": "forEachOrNull & unionAll on the same level",
501
+ "tags": ["shareable"],
502
+ "view": {
503
+ "resource": "Patient",
504
+ "select": [
505
+ {
506
+ "column": [
507
+ {
508
+ "path": "id",
509
+ "name": "id",
510
+ "type": "id"
511
+ }
512
+ ]
513
+ },
514
+ {
515
+ "forEachOrNull": "contact",
516
+ "unionAll": [
517
+ {
518
+ "column": [
519
+ {
520
+ "path": "name.family",
521
+ "name": "name",
522
+ "type": "string"
523
+ }
524
+ ]
525
+ },
526
+ {
527
+ "forEach": "name.given",
528
+ "column": [
529
+ {
530
+ "path": "$this",
531
+ "name": "name",
532
+ "type": "string"
533
+ }
534
+ ]
535
+ }
536
+ ]
537
+ }
538
+ ]
539
+ },
540
+ "expect": [
541
+ {
542
+ "id": "pt1",
543
+ "name": "FC1.1"
544
+ },
545
+ {
546
+ "id": "pt1",
547
+ "name": "N1"
548
+ },
549
+ {
550
+ "id": "pt1",
551
+ "name": "N1`"
552
+ },
553
+ {
554
+ "id": "pt1",
555
+ "name": "FC1.2"
556
+ },
557
+ {
558
+ "id": "pt1",
559
+ "name": "N2"
560
+ },
561
+ {
562
+ "id": "pt2",
563
+ "name": null
564
+ },
565
+ {
566
+ "id": "pt3",
567
+ "name": null
568
+ }
569
+ ]
570
+ },
571
+ {
572
+ "title": "forEach & unionAll on the same level",
573
+ "tags": ["shareable"],
574
+ "view": {
575
+ "resource": "Patient",
576
+ "select": [
577
+ {
578
+ "column": [
579
+ {
580
+ "path": "id",
581
+ "name": "id",
582
+ "type": "id"
583
+ }
584
+ ]
585
+ },
586
+ {
587
+ "forEach": "contact",
588
+ "unionAll": [
589
+ {
590
+ "column": [
591
+ {
592
+ "path": "name.family",
593
+ "name": "name",
594
+ "type": "string"
595
+ }
596
+ ]
597
+ },
598
+ {
599
+ "forEach": "name.given",
600
+ "column": [
601
+ {
602
+ "path": "$this",
603
+ "name": "name",
604
+ "type": "string"
605
+ }
606
+ ]
607
+ }
608
+ ]
609
+ }
610
+ ]
611
+ },
612
+ "expect": [
613
+ {
614
+ "id": "pt1",
615
+ "name": "FC1.1"
616
+ },
617
+ {
618
+ "id": "pt1",
619
+ "name": "N1"
620
+ },
621
+ {
622
+ "id": "pt1",
623
+ "name": "N1`"
624
+ },
625
+ {
626
+ "id": "pt1",
627
+ "name": "FC1.2"
628
+ },
629
+ {
630
+ "id": "pt1",
631
+ "name": "N2"
632
+ }
633
+ ]
634
+ },
635
+ {
636
+ "title": "forEach & unionAll & column & select on the same level",
637
+ "tags": ["shareable"],
638
+ "view": {
639
+ "resource": "Patient",
640
+ "select": [
641
+ {
642
+ "column": [
643
+ {
644
+ "path": "id",
645
+ "name": "id",
646
+ "type": "id"
647
+ }
648
+ ]
649
+ },
650
+ {
651
+ "forEach": "contact",
652
+ "column": [
653
+ {
654
+ "path": "telecom.system",
655
+ "name": "tel_system",
656
+ "type": "code"
657
+ }
658
+ ],
659
+ "select": [
660
+ {
661
+ "column": [
662
+ {
663
+ "path": "gender",
664
+ "name": "gender",
665
+ "type": "code"
666
+ }
667
+ ]
668
+ }
669
+ ],
670
+ "unionAll": [
671
+ {
672
+ "column": [
673
+ {
674
+ "path": "name.family",
675
+ "name": "name",
676
+ "type": "string"
677
+ }
678
+ ]
679
+ },
680
+ {
681
+ "forEach": "name.given",
682
+ "column": [
683
+ {
684
+ "path": "$this",
685
+ "name": "name",
686
+ "type": "string"
687
+ }
688
+ ]
689
+ }
690
+ ]
691
+ }
692
+ ]
693
+ },
694
+ "expect": [
695
+ {
696
+ "id": "pt1",
697
+ "name": "FC1.1",
698
+ "tel_system": "phone",
699
+ "gender": null
700
+ },
701
+ {
702
+ "id": "pt1",
703
+ "name": "N1",
704
+ "tel_system": "phone",
705
+ "gender": null
706
+ },
707
+ {
708
+ "id": "pt1",
709
+ "name": "N1`",
710
+ "tel_system": "phone",
711
+ "gender": null
712
+ },
713
+ {
714
+ "id": "pt1",
715
+ "name": "FC1.2",
716
+ "tel_system": "email",
717
+ "gender": "unknown"
718
+ },
719
+ {
720
+ "id": "pt1",
721
+ "name": "N2",
722
+ "tel_system": "email",
723
+ "gender": "unknown"
724
+ }
725
+ ]
726
+ },
727
+ {
728
+ "title": "forEachOrNull & unionAll & column & select on the same level",
729
+ "tags": ["shareable"],
730
+ "view": {
731
+ "resource": "Patient",
732
+ "select": [
733
+ {
734
+ "column": [
735
+ {
736
+ "path": "id",
737
+ "name": "id",
738
+ "type": "id"
739
+ }
740
+ ]
741
+ },
742
+ {
743
+ "forEachOrNull": "contact",
744
+ "column": [
745
+ {
746
+ "path": "telecom.system",
747
+ "name": "tel_system",
748
+ "type": "code"
749
+ }
750
+ ],
751
+ "select": [
752
+ {
753
+ "column": [
754
+ {
755
+ "path": "gender",
756
+ "name": "gender",
757
+ "type": "code"
758
+ }
759
+ ]
760
+ }
761
+ ],
762
+ "unionAll": [
763
+ {
764
+ "column": [
765
+ {
766
+ "path": "name.family",
767
+ "name": "name",
768
+ "type": "string"
769
+ }
770
+ ]
771
+ },
772
+ {
773
+ "forEach": "name.given",
774
+ "column": [
775
+ {
776
+ "path": "$this",
777
+ "name": "name",
778
+ "type": "string"
779
+ }
780
+ ]
781
+ }
782
+ ]
783
+ }
784
+ ]
785
+ },
786
+ "expect": [
787
+ {
788
+ "id": "pt1",
789
+ "name": "FC1.1",
790
+ "tel_system": "phone",
791
+ "gender": null
792
+ },
793
+ {
794
+ "id": "pt1",
795
+ "name": "N1",
796
+ "tel_system": "phone",
797
+ "gender": null
798
+ },
799
+ {
800
+ "id": "pt1",
801
+ "name": "N1`",
802
+ "tel_system": "phone",
803
+ "gender": null
804
+ },
805
+ {
806
+ "id": "pt1",
807
+ "name": "FC1.2",
808
+ "tel_system": "email",
809
+ "gender": "unknown"
810
+ },
811
+ {
812
+ "id": "pt1",
813
+ "name": "N2",
814
+ "tel_system": "email",
815
+ "gender": "unknown"
816
+ },
817
+ {
818
+ "id": "pt2",
819
+ "name": null,
820
+ "tel_system": null,
821
+ "gender": null
822
+ },
823
+ {
824
+ "id": "pt3",
825
+ "name": null,
826
+ "tel_system": null,
827
+ "gender": null
828
+ }
829
+ ]
830
+ }
831
+ ]
832
+ }