Skip to content

Commit b1a4960

Browse files
authored
Merge pull request #86 from bryantaustin13/capabilitiesAdded
capabilities added to tests, group, and test
2 parents b39ac76 + b3b1318 commit b1a4960

16 files changed

+1741
-1
lines changed

tests/cql/CqlAggregateFunctionsTest.xml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,232 +1,311 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://hl7.org/fhirpath/tests" xsi:schemaLocation="http://hl7.org/fhirpath/tests ../../testSchema/testSchema.xsd"
33
name="CqlAggregateFunctionsTest" reference="https://cql.hl7.org/09-b-cqlreference.html#aggregate-functions" version="1.5">
4+
<capability code="aggregate-functions"/>
45
<group name="AllTrue" version="1.5">
6+
<capability code="aggregate-functions"/>
57
<test name="AllTrueAllTrue" version="1.5">
8+
<capability code="aggregate-functions"/>
69
<expression>AllTrue({true,true})</expression>
710
<output>true</output>
811
</test>
912
<test name="AllTrueTrueFirst" version="1.5">
13+
<capability code="aggregate-functions"/>
1014
<expression>AllTrue({true,false})</expression>
1115
<output>false</output>
1216
</test>
1317
<test name="AllTrueFalseFirst" version="1.5">
18+
<capability code="aggregate-functions"/>
1419
<expression>AllTrue({false,true})</expression>
1520
<output>false</output>
1621
</test>
1722
<test name="AllTrueAllTrueFalseTrue" version="1.5">
23+
<capability code="aggregate-functions"/>
1824
<expression>AllTrue({true,false,true})</expression>
1925
<output>false</output>
2026
</test>
2127
<test name="AllTrueAllFalseTrueFalse" version="1.5">
28+
<capability code="aggregate-functions"/>
2229
<expression>AllTrue({false,true,false})</expression>
2330
<output>false</output>
2431
</test>
2532
<test name="AllTrueNullFirst" version="1.5">
33+
<capability code="aggregate-functions"/>
2634
<expression>AllTrue({null,true,true})</expression>
2735
<output>true</output>
2836
</test>
2937
<test name="AllTrueEmptyList" version="1.5">
38+
<capability code="aggregate-functions"/>
3039
<expression>AllTrue({})</expression>
3140
<output>true</output>
3241
</test>
3342
<test name="AllTrueIsTrueWhenNull" version="1.5">
43+
<capability code="aggregate-functions"/>
3444
<expression>AllTrue(null)</expression>
3545
<output>true</output>
3646
</test>
3747
</group>
3848
<group name="AnyTrue" version="1.5">
49+
<capability code="aggregate-functions"/>
3950
<test name="AnyTrueAllTrue" version="1.5">
51+
<capability code="aggregate-functions"/>
4052
<expression>AnyTrue({true,true})</expression>
4153
<output>true</output>
4254
</test>
4355
<test name="AnyTrueAllFalse" version="1.5">
56+
<capability code="aggregate-functions"/>
4457
<expression>AnyTrue({false,false})</expression>
4558
<output>false</output>
4659
</test>
4760
<test name="AnyTrueAllTrueFalseTrue" version="1.5">
61+
<capability code="aggregate-functions"/>
4862
<expression>AnyTrue({true,false,true})</expression>
4963
<output>true</output>
5064
</test>
5165
<test name="AnyTrueAllFalseTrueFalse" version="1.5">
66+
<capability code="aggregate-functions"/>
5267
<expression>AnyTrue({false,true,false})</expression>
5368
<output>true</output>
5469
</test>
5570
<test name="AnyTrueTrueFirst" version="1.5">
71+
<capability code="aggregate-functions"/>
5672
<expression>AnyTrue({true,false})</expression>
5773
<output>true</output>
5874
</test>
5975
<test name="AnyTrueFalseFirst" version="1.5">
76+
<capability code="aggregate-functions"/>
6077
<expression>AnyTrue({false,true})</expression>
6178
<output>true</output>
6279
</test>
6380
<test name="AnyTrueNullFirstThenTrue" version="1.5">
81+
<capability code="aggregate-functions"/>
6482
<expression>AnyTrue({null,true})</expression>
6583
<output>true</output>
6684
</test>
6785
<test name="AnyTrueNullFirstThenFalse" version="1.5">
86+
<capability code="aggregate-functions"/>
6887
<expression>AnyTrue({null,false})</expression>
6988
<output>false</output>
7089
</test>
7190
<test name="AnyTrueEmptyList" version="1.5">
91+
<capability code="aggregate-functions"/>
7292
<expression>AnyTrue({})</expression>
7393
<output>false</output>
7494
</test>
7595
<test name="AnyTrueIsFalseWhenNull" version="1.5">
96+
<capability code="aggregate-functions"/>
7697
<expression>AnyTrue(null)</expression>
7798
<output>false</output>
7899
</test>
79100
</group>
80101
<group name="Avg" version="1.5">
102+
<capability code="aggregate-functions"/>
81103
<test name="AvgTest1" version="1.5">
104+
<capability code="aggregate-functions"/>
82105
<expression>Avg({ 1.0, 2.0, 3.0, 6.0 })</expression>
83106
<output>3.0</output>
84107
</test>
85108
</group>
86109
<group name="Product" version="1.5">
110+
<capability code="aggregate-functions"/>
87111
<test name="ProductLong" version="1.5">
112+
<capability code="aggregate-functions"/>
113+
<capability code="system.long"/>
88114
<expression>Product({5L, 4L, 5L})</expression>
89115
<output>100L</output>
90116
</test>
91117
</group>
92118
<group name="Count" version="1.5">
119+
<capability code="aggregate-functions"/>
93120
<test name="CountTest1" version="1.5">
121+
<capability code="aggregate-functions"/>
94122
<expression>Count({ 15, 5, 99, null, 1 })</expression>
95123
<output>4</output>
96124
</test>
97125
<test name="CountTestDateTime" version="1.5">
126+
<capability code="aggregate-functions"/>
127+
<capability code="date-and-time-operators"/>
98128
<expression>Count({ DateTime(2014), DateTime(2001), DateTime(2010) })</expression>
99129
<output>3</output>
100130
</test>
101131
<test name="CountTestTime" version="1.5">
132+
<capability code="aggregate-functions"/>
133+
<capability code="date-and-time-operators"/>
102134
<expression>Count({ @T15:59:59.999, @T05:59:59.999, @T20:59:59.999 })</expression>
103135
<output>3</output>
104136
</test>
105137
<test name="CountTestNull" version="1.5">
138+
<capability code="aggregate-functions"/>
106139
<expression>Count({})</expression>
107140
<output>0</output>
108141
</test>
109142
</group>
110143
<group name="Max" version="1.5">
144+
<capability code="aggregate-functions"/>
111145
<test name="MaxTestInteger" version="1.5">
146+
<capability code="aggregate-functions"/>
112147
<expression>Max({ 5, 12, 1, 15, 0, 4, 90, 44 })</expression>
113148
<output>90</output>
114149
</test>
115150
<test name="MaxTestLong" version="1.5">
151+
<capability code="aggregate-functions"/>
152+
<capability code="system.long"/>
116153
<expression>Max({ 5L, 12L, 1L, 15L, 0L, 4L, 90L, 44L })</expression>
117154
<output>90L</output>
118155
</test>
119156
<test name="MaxTestString" version="1.5">
157+
<capability code="aggregate-functions"/>
120158
<expression>Max({ 'hi', 'bye', 'zebra' })</expression>
121159
<output>'zebra'</output>
122160
</test>
123161
<test name="MaxTestDateTime" version="1.5">
162+
<capability code="aggregate-functions"/>
163+
<capability code="date-and-time-operators"/>
124164
<expression>Max({ DateTime(2012, 10, 5), DateTime(2012, 9, 5), DateTime(2012, 10, 6) })</expression>
125165
<output>@2012-10-06T</output>
126166
</test>
127167
<test name="MaxTestTime" version="1.5">
168+
<capability code="aggregate-functions"/>
169+
<capability code="date-and-time-operators"/>
128170
<expression>Max({ @T15:59:59.999, @T05:59:59.999, @T20:59:59.999 })</expression>
129171
<output>@T20:59:59.999</output>
130172
</test>
131173
</group>
132174
<group name="Median" version="1.5">
175+
<capability code="aggregate-functions"/>
133176
<test name="MedianTestDecimal" version="1.5">
177+
<capability code="aggregate-functions"/>
134178
<expression>Median({6.0, 5.0, 4.0, 3.0, 2.0, 1.0})</expression>
135179
<output>3.5</output>
136180
</test>
137181
</group>
138182
<group name="Min" version="1.5">
183+
<capability code="aggregate-functions"/>
139184
<test name="MinTestInteger" version="1.5">
185+
<capability code="aggregate-functions"/>
140186
<expression>Min({5, 12, 1, 15, 0, 4, 90, 44})</expression>
141187
<output>0</output>
142188
</test>
143189
<test name="MinTestLong" version="1.5">
190+
<capability code="aggregate-functions"/>
191+
<capability code="system.long"/>
144192
<expression>Min({5L, 12L, 1L, 15L, 0L, 4L, 90L, 44L})</expression>
145193
<output>0L</output>
146194
</test>
147195
<test name="MinTestString" version="1.5">
196+
<capability code="aggregate-functions"/>
148197
<expression>Min({'hi', 'bye', 'zebra'})</expression>
149198
<output>'bye'</output>
150199
</test>
151200
<test name="MinTestDateTime" version="1.5">
201+
<capability code="aggregate-functions"/>
202+
<capability code="date-and-time-operators"/>
152203
<expression>Min({ DateTime(2012, 10, 5), DateTime(2012, 9, 5), DateTime(2012, 10, 6) })</expression>
153204
<output>@2012-09-05T</output>
154205
</test>
155206
<test name="MinTestTime" version="1.5">
207+
<capability code="aggregate-functions"/>
208+
<capability code="date-and-time-operators"/>
156209
<expression>Min({ @T15:59:59.999, @T05:59:59.999, @T20:59:59.999 })</expression>
157210
<output>@T05:59:59.999</output>
158211
</test>
159212
</group>
160213
<group name="Mode" version="1.5">
214+
<capability code="aggregate-functions"/>
161215
<test name="ModeTestInteger" version="1.5">
216+
<capability code="aggregate-functions"/>
162217
<expression>Mode({ 2, 1, 8, 2, 9, 1, 9, 9 })</expression>
163218
<output>9</output>
164219
</test>
165220
<test name="ModeTestDateTime" version="1.5">
221+
<capability code="aggregate-functions"/>
222+
<capability code="date-and-time-operators"/>
166223
<expression>Mode({ DateTime(2012, 10, 5), DateTime(2012, 9, 5), DateTime(2012, 10, 6), DateTime(2012, 9, 5) })</expression>
167224
<output>@2012-09-05T</output>
168225
</test>
169226
<test name="ModeTestDateTime2" version="1.5">
227+
<capability code="aggregate-functions"/>
228+
<capability code="date-and-time-operators"/>
170229
<expression>Mode({ DateTime(2012, 10, 5), DateTime(2012, 10, 5), DateTime(2012, 10, 6), DateTime(2012, 9, 5) })</expression>
171230
<output>@2012-10-05T</output>
172231
</test>
173232
<test name="ModeTestTime" version="1.5">
233+
<capability code="aggregate-functions"/>
234+
<capability code="date-and-time-operators"/>
174235
<expression>Mode({ @T15:59:59.999, @T05:59:59.999, @T20:59:59.999, @T05:59:59.999 })</expression>
175236
<output>@T05:59:59.999</output>
176237
</test>
177238
</group>
178239
<group name="PopulationStdDev" version="1.5">
240+
<capability code="aggregate-functions"/>
179241
<test name="PopStdDevTest1" version="1.5">
242+
<capability code="aggregate-functions"/>
180243
<expression>PopulationStdDev({ 1.0, 2.0, 3.0, 4.0, 5.0 })</expression>
181244
<output>1.41421356</output>
182245
<!-- 23730951454746218587388284504413604736328125 -->
183246
</test>
184247
<test name="PopulationStdDevIsNull" version="1.5">
248+
<capability code="aggregate-functions"/>
185249
<expression>PopulationStdDev({ null as Quantity, null as Quantity, null as Quantity })</expression>
186250
<output>null</output>
187251
</test>
188252
</group>
189253
<group name="PopulationVariance" version="1.5">
254+
<capability code="aggregate-functions"/>
190255
<test name="PopVarianceTest1" version="1.5">
256+
<capability code="aggregate-functions"/>
191257
<expression>PopulationVariance({ 1.0, 2.0, 3.0, 4.0, 5.0 })</expression>
192258
<output>2.0</output>
193259
</test>
194260
<test name="PopVarianceIsNull" version="1.5">
261+
<capability code="aggregate-functions"/>
195262
<expression>PopulationVariance({ null as Quantity, null as Quantity, null as Quantity })</expression>
196263
<output>null</output>
197264
</test>
198265
</group>
199266
<group name="StdDev" version="1.5">
267+
<capability code="aggregate-functions"/>
200268
<test name="StdDevTest1" version="1.5">
269+
<capability code="aggregate-functions"/>
201270
<expression>StdDev({ 1.0, 2.0, 3.0, 4.0, 5.0 })</expression>
202271
<output>1.58113883</output>
203272
<!-- 00841897613935316257993690669536590576171875 -->
204273
</test>
205274
<test name="StdDevIsNull" version="1.5">
275+
<capability code="aggregate-functions"/>
206276
<expression>StdDev({ null as Quantity, null as Quantity, null as Quantity })</expression>
207277
<output>null</output>
208278
</test>
209279
</group>
210280
<group name="Sum" version="1.5">
281+
<capability code="aggregate-functions"/>
211282
<test name="SumTest1" version="1.5">
283+
<capability code="aggregate-functions"/>
212284
<expression>Sum({ 6.0, 2.0, 3.0, 4.0, 5.0 })</expression>
213285
<output>20.0</output>
214286
</test>
215287
<test name="SumTestLong" version="1.5">
288+
<capability code="aggregate-functions"/>
289+
<capability code="system.long"/>
216290
<expression>Sum({ 6L, 2L, 3L, 4L, 5L })</expression>
217291
<output>20L</output>
218292
</test>
219293
<test name="SumTestQuantity" version="1.5">
294+
<capability code="aggregate-functions"/>
295+
<capability code="unit-conversion-support"/>
220296
<expression>Sum({1 'ml',2 'ml',3 'ml',4 'ml',5 'ml'})</expression>
221297
<output>15 'ml'</output>
222298
</test>
223299
<test name="SumTestNull" version="1.5">
300+
<capability code="aggregate-functions"/>
224301
<expression>Sum({ null, 1, null })</expression>
225302
<output>1</output>
226303
</test>
227304
</group>
228305
<group name="Variance" version="1.5">
306+
<capability code="aggregate-functions"/>
229307
<test name="VarianceTest1" version="1.5">
308+
<capability code="aggregate-functions"/>
230309
<expression>Variance({ 1.0, 2.0, 3.0, 4.0, 5.0 })</expression>
231310
<output>2.5</output>
232311
</test>

tests/cql/CqlAggregateTest.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://hl7.org/fhirpath/tests" xsi:schemaLocation="http://hl7.org/fhirpath/tests ../../testSchema/testSchema.xsd"
33
name="CqlAggregateTest" reference="http://build.fhir.org/ig/HL7/cql/03-developersguide.html#aggregate-queries" version="1.5">
4+
<capability code="aggregate-clause-query"/>
45
<group name="AggregateTests" version="1.5">
6+
<capability code="aggregate-clause-query"/>
57
<test name="FactorialOfFive" version="1.5">
8+
<capability code="single-source-query"/>
9+
<capability code="aggregate-clause-query"/>
610
<expression>({ 1, 2, 3, 4, 5 }) Num aggregate Result starting 1: Result * Num</expression>
711
<output>120</output>
812
</test>
913
<test name="RolledOutIntervals" version="1.5">
14+
<capability code="single-source-query"/>
15+
<capability code="aggregate-clause-query"/>
1016
<expression>
1117
({
1218
Interval[@2012-01-01, @2012-02-28],
@@ -30,6 +36,8 @@
3036
<!-- Execution Error: Invalid precision: 1. -->
3137
</test>
3238
<test name="AggregateSumWithStart" version="1.5">
39+
<capability code="single-source-query"/>
40+
<capability code="aggregate-clause-query"/>
3341
<expression>
3442
({ 1, 2, 3, 4, 5 }) Num
3543
aggregate Result starting 1: Result + Num
@@ -38,6 +46,8 @@
3846
<!-- 15 + 1 (the initial value) -->
3947
</test>
4048
<test name="AggregateSumWithNull" version="1.5">
49+
<capability code="single-source-query"/>
50+
<capability code="aggregate-clause-query"/>
4151
<expression>
4252
({ 1, 2, 3, 4, 5 }) Num
4353
aggregate Result: Coalesce(Result, 0) + Num
@@ -46,6 +56,8 @@
4656
<!-- 15 + 0 (the initial value from null) -->
4757
</test>
4858
<test name="AggregateSumAll" version="1.5">
59+
<capability code="single-source-query"/>
60+
<capability code="aggregate-clause-query"/>
4961
<expression>
5062
({ 1, 1, 2, 2, 2, 3, 4, 4, 5 }) Num
5163
aggregate all Result: Coalesce(Result, 0) + Num
@@ -54,6 +66,8 @@
5466
<!-- 24 + 0 -->
5567
</test>
5668
<test name="AggregateSumDistinct" version="1.5">
69+
<capability code="single-source-query"/>
70+
<capability code="aggregate-clause-query"/>
5771
<expression>
5872
({ 1, 1, 2, 2, 2, 3, 4, 4, 5 }) Num
5973
aggregate distinct Result: Coalesce(Result, 0) + Num
@@ -62,13 +76,17 @@
6276
<!-- 15 + 0 (the initial value) -->
6377
</test>
6478
<test name="Multi" version="1.5">
79+
<capability code="single-source-query"/>
80+
<capability code="aggregate-clause-query"/>
6581
<expression>
6682
from ({1}) X, ({2}) Y, ({3}) Z
6783
aggregate Agg: Coalesce(Agg, 0) + X + Y + Z
6884
</expression>
6985
<output>6</output>
7086
</test>
7187
<test name="MegaMulti" version="1.5">
88+
<capability code="multi-source-query"/>
89+
<capability code="aggregate-clause-query"/>
7290
<expression>
7391
from ({1, 2}) X, ({1, 2}) Y, ({1, 2}) Z
7492
aggregate Agg starting 0: Agg + X + Y + Z
@@ -77,6 +95,8 @@
7795
<!-- (1+1+1)+(1+1+2)+(1+2+1)+(1+2+2)+(2+1+1)+(2+1+2)+(2+2+1)+(2+2+2) -->
7896
</test>
7997
<test name="MegaMultiDistinct" version="1.5">
98+
<capability code="multi-source-query"/>
99+
<capability code="aggregate-clause-query"/>
80100
<expression>
81101
from ({1, 2, 2, 1}) X, ({1, 2, 1, 2}) Y, ({2, 1, 2, 1}) Z
82102
aggregate distinct Agg starting 1: Agg + X + Y + Z

0 commit comments

Comments
 (0)