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