|
1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | 2 | <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" |
3 | 3 | name="CqlAggregateFunctionsTest" reference="https://cql.hl7.org/09-b-cqlreference.html#aggregate-functions" version="1.5"> |
| 4 | + <capability code="aggregate-functions"/> |
4 | 5 | <group name="AllTrue" version="1.5"> |
| 6 | + <capability code="aggregate-functions"/> |
5 | 7 | <test name="AllTrueAllTrue" version="1.5"> |
| 8 | + <capability code="aggregate-functions"/> |
6 | 9 | <expression>AllTrue({true,true})</expression> |
7 | 10 | <output>true</output> |
8 | 11 | </test> |
9 | 12 | <test name="AllTrueTrueFirst" version="1.5"> |
| 13 | + <capability code="aggregate-functions"/> |
10 | 14 | <expression>AllTrue({true,false})</expression> |
11 | 15 | <output>false</output> |
12 | 16 | </test> |
13 | 17 | <test name="AllTrueFalseFirst" version="1.5"> |
| 18 | + <capability code="aggregate-functions"/> |
14 | 19 | <expression>AllTrue({false,true})</expression> |
15 | 20 | <output>false</output> |
16 | 21 | </test> |
17 | 22 | <test name="AllTrueAllTrueFalseTrue" version="1.5"> |
| 23 | + <capability code="aggregate-functions"/> |
18 | 24 | <expression>AllTrue({true,false,true})</expression> |
19 | 25 | <output>false</output> |
20 | 26 | </test> |
21 | 27 | <test name="AllTrueAllFalseTrueFalse" version="1.5"> |
| 28 | + <capability code="aggregate-functions"/> |
22 | 29 | <expression>AllTrue({false,true,false})</expression> |
23 | 30 | <output>false</output> |
24 | 31 | </test> |
25 | 32 | <test name="AllTrueNullFirst" version="1.5"> |
| 33 | + <capability code="aggregate-functions"/> |
26 | 34 | <expression>AllTrue({null,true,true})</expression> |
27 | 35 | <output>true</output> |
28 | 36 | </test> |
29 | 37 | <test name="AllTrueEmptyList" version="1.5"> |
| 38 | + <capability code="aggregate-functions"/> |
30 | 39 | <expression>AllTrue({})</expression> |
31 | 40 | <output>true</output> |
32 | 41 | </test> |
33 | 42 | <test name="AllTrueIsTrueWhenNull" version="1.5"> |
| 43 | + <capability code="aggregate-functions"/> |
34 | 44 | <expression>AllTrue(null)</expression> |
35 | 45 | <output>true</output> |
36 | 46 | </test> |
37 | 47 | </group> |
38 | 48 | <group name="AnyTrue" version="1.5"> |
| 49 | + <capability code="aggregate-functions"/> |
39 | 50 | <test name="AnyTrueAllTrue" version="1.5"> |
| 51 | + <capability code="aggregate-functions"/> |
40 | 52 | <expression>AnyTrue({true,true})</expression> |
41 | 53 | <output>true</output> |
42 | 54 | </test> |
43 | 55 | <test name="AnyTrueAllFalse" version="1.5"> |
| 56 | + <capability code="aggregate-functions"/> |
44 | 57 | <expression>AnyTrue({false,false})</expression> |
45 | 58 | <output>false</output> |
46 | 59 | </test> |
47 | 60 | <test name="AnyTrueAllTrueFalseTrue" version="1.5"> |
| 61 | + <capability code="aggregate-functions"/> |
48 | 62 | <expression>AnyTrue({true,false,true})</expression> |
49 | 63 | <output>true</output> |
50 | 64 | </test> |
51 | 65 | <test name="AnyTrueAllFalseTrueFalse" version="1.5"> |
| 66 | + <capability code="aggregate-functions"/> |
52 | 67 | <expression>AnyTrue({false,true,false})</expression> |
53 | 68 | <output>true</output> |
54 | 69 | </test> |
55 | 70 | <test name="AnyTrueTrueFirst" version="1.5"> |
| 71 | + <capability code="aggregate-functions"/> |
56 | 72 | <expression>AnyTrue({true,false})</expression> |
57 | 73 | <output>true</output> |
58 | 74 | </test> |
59 | 75 | <test name="AnyTrueFalseFirst" version="1.5"> |
| 76 | + <capability code="aggregate-functions"/> |
60 | 77 | <expression>AnyTrue({false,true})</expression> |
61 | 78 | <output>true</output> |
62 | 79 | </test> |
63 | 80 | <test name="AnyTrueNullFirstThenTrue" version="1.5"> |
| 81 | + <capability code="aggregate-functions"/> |
64 | 82 | <expression>AnyTrue({null,true})</expression> |
65 | 83 | <output>true</output> |
66 | 84 | </test> |
67 | 85 | <test name="AnyTrueNullFirstThenFalse" version="1.5"> |
| 86 | + <capability code="aggregate-functions"/> |
68 | 87 | <expression>AnyTrue({null,false})</expression> |
69 | 88 | <output>false</output> |
70 | 89 | </test> |
71 | 90 | <test name="AnyTrueEmptyList" version="1.5"> |
| 91 | + <capability code="aggregate-functions"/> |
72 | 92 | <expression>AnyTrue({})</expression> |
73 | 93 | <output>false</output> |
74 | 94 | </test> |
75 | 95 | <test name="AnyTrueIsFalseWhenNull" version="1.5"> |
| 96 | + <capability code="aggregate-functions"/> |
76 | 97 | <expression>AnyTrue(null)</expression> |
77 | 98 | <output>false</output> |
78 | 99 | </test> |
79 | 100 | </group> |
80 | 101 | <group name="Avg" version="1.5"> |
| 102 | + <capability code="aggregate-functions"/> |
81 | 103 | <test name="AvgTest1" version="1.5"> |
| 104 | + <capability code="aggregate-functions"/> |
82 | 105 | <expression>Avg({ 1.0, 2.0, 3.0, 6.0 })</expression> |
83 | 106 | <output>3.0</output> |
84 | 107 | </test> |
85 | 108 | </group> |
86 | 109 | <group name="Product" version="1.5"> |
| 110 | + <capability code="aggregate-functions"/> |
87 | 111 | <test name="ProductLong" version="1.5"> |
| 112 | + <capability code="aggregate-functions"/> |
| 113 | + <capability code="system.long"/> |
88 | 114 | <expression>Product({5L, 4L, 5L})</expression> |
89 | 115 | <output>100L</output> |
90 | 116 | </test> |
91 | 117 | </group> |
92 | 118 | <group name="Count" version="1.5"> |
| 119 | + <capability code="aggregate-functions"/> |
93 | 120 | <test name="CountTest1" version="1.5"> |
| 121 | + <capability code="aggregate-functions"/> |
94 | 122 | <expression>Count({ 15, 5, 99, null, 1 })</expression> |
95 | 123 | <output>4</output> |
96 | 124 | </test> |
97 | 125 | <test name="CountTestDateTime" version="1.5"> |
| 126 | + <capability code="aggregate-functions"/> |
| 127 | + <capability code="date-and-time-operators"/> |
98 | 128 | <expression>Count({ DateTime(2014), DateTime(2001), DateTime(2010) })</expression> |
99 | 129 | <output>3</output> |
100 | 130 | </test> |
101 | 131 | <test name="CountTestTime" version="1.5"> |
| 132 | + <capability code="aggregate-functions"/> |
| 133 | + <capability code="date-and-time-operators"/> |
102 | 134 | <expression>Count({ @T15:59:59.999, @T05:59:59.999, @T20:59:59.999 })</expression> |
103 | 135 | <output>3</output> |
104 | 136 | </test> |
105 | 137 | <test name="CountTestNull" version="1.5"> |
| 138 | + <capability code="aggregate-functions"/> |
106 | 139 | <expression>Count({})</expression> |
107 | 140 | <output>0</output> |
108 | 141 | </test> |
109 | 142 | </group> |
110 | 143 | <group name="Max" version="1.5"> |
| 144 | + <capability code="aggregate-functions"/> |
111 | 145 | <test name="MaxTestInteger" version="1.5"> |
| 146 | + <capability code="aggregate-functions"/> |
112 | 147 | <expression>Max({ 5, 12, 1, 15, 0, 4, 90, 44 })</expression> |
113 | 148 | <output>90</output> |
114 | 149 | </test> |
115 | 150 | <test name="MaxTestLong" version="1.5"> |
| 151 | + <capability code="aggregate-functions"/> |
| 152 | + <capability code="system.long"/> |
116 | 153 | <expression>Max({ 5L, 12L, 1L, 15L, 0L, 4L, 90L, 44L })</expression> |
117 | 154 | <output>90L</output> |
118 | 155 | </test> |
119 | 156 | <test name="MaxTestString" version="1.5"> |
| 157 | + <capability code="aggregate-functions"/> |
120 | 158 | <expression>Max({ 'hi', 'bye', 'zebra' })</expression> |
121 | 159 | <output>'zebra'</output> |
122 | 160 | </test> |
123 | 161 | <test name="MaxTestDateTime" version="1.5"> |
| 162 | + <capability code="aggregate-functions"/> |
| 163 | + <capability code="date-and-time-operators"/> |
124 | 164 | <expression>Max({ DateTime(2012, 10, 5), DateTime(2012, 9, 5), DateTime(2012, 10, 6) })</expression> |
125 | 165 | <output>@2012-10-06T</output> |
126 | 166 | </test> |
127 | 167 | <test name="MaxTestTime" version="1.5"> |
| 168 | + <capability code="aggregate-functions"/> |
| 169 | + <capability code="date-and-time-operators"/> |
128 | 170 | <expression>Max({ @T15:59:59.999, @T05:59:59.999, @T20:59:59.999 })</expression> |
129 | 171 | <output>@T20:59:59.999</output> |
130 | 172 | </test> |
131 | 173 | </group> |
132 | 174 | <group name="Median" version="1.5"> |
| 175 | + <capability code="aggregate-functions"/> |
133 | 176 | <test name="MedianTestDecimal" version="1.5"> |
| 177 | + <capability code="aggregate-functions"/> |
134 | 178 | <expression>Median({6.0, 5.0, 4.0, 3.0, 2.0, 1.0})</expression> |
135 | 179 | <output>3.5</output> |
136 | 180 | </test> |
137 | 181 | </group> |
138 | 182 | <group name="Min" version="1.5"> |
| 183 | + <capability code="aggregate-functions"/> |
139 | 184 | <test name="MinTestInteger" version="1.5"> |
| 185 | + <capability code="aggregate-functions"/> |
140 | 186 | <expression>Min({5, 12, 1, 15, 0, 4, 90, 44})</expression> |
141 | 187 | <output>0</output> |
142 | 188 | </test> |
143 | 189 | <test name="MinTestLong" version="1.5"> |
| 190 | + <capability code="aggregate-functions"/> |
| 191 | + <capability code="system.long"/> |
144 | 192 | <expression>Min({5L, 12L, 1L, 15L, 0L, 4L, 90L, 44L})</expression> |
145 | 193 | <output>0L</output> |
146 | 194 | </test> |
147 | 195 | <test name="MinTestString" version="1.5"> |
| 196 | + <capability code="aggregate-functions"/> |
148 | 197 | <expression>Min({'hi', 'bye', 'zebra'})</expression> |
149 | 198 | <output>'bye'</output> |
150 | 199 | </test> |
151 | 200 | <test name="MinTestDateTime" version="1.5"> |
| 201 | + <capability code="aggregate-functions"/> |
| 202 | + <capability code="date-and-time-operators"/> |
152 | 203 | <expression>Min({ DateTime(2012, 10, 5), DateTime(2012, 9, 5), DateTime(2012, 10, 6) })</expression> |
153 | 204 | <output>@2012-09-05T</output> |
154 | 205 | </test> |
155 | 206 | <test name="MinTestTime" version="1.5"> |
| 207 | + <capability code="aggregate-functions"/> |
| 208 | + <capability code="date-and-time-operators"/> |
156 | 209 | <expression>Min({ @T15:59:59.999, @T05:59:59.999, @T20:59:59.999 })</expression> |
157 | 210 | <output>@T05:59:59.999</output> |
158 | 211 | </test> |
159 | 212 | </group> |
160 | 213 | <group name="Mode" version="1.5"> |
| 214 | + <capability code="aggregate-functions"/> |
161 | 215 | <test name="ModeTestInteger" version="1.5"> |
| 216 | + <capability code="aggregate-functions"/> |
162 | 217 | <expression>Mode({ 2, 1, 8, 2, 9, 1, 9, 9 })</expression> |
163 | 218 | <output>9</output> |
164 | 219 | </test> |
165 | 220 | <test name="ModeTestDateTime" version="1.5"> |
| 221 | + <capability code="aggregate-functions"/> |
| 222 | + <capability code="date-and-time-operators"/> |
166 | 223 | <expression>Mode({ DateTime(2012, 10, 5), DateTime(2012, 9, 5), DateTime(2012, 10, 6), DateTime(2012, 9, 5) })</expression> |
167 | 224 | <output>@2012-09-05T</output> |
168 | 225 | </test> |
169 | 226 | <test name="ModeTestDateTime2" version="1.5"> |
| 227 | + <capability code="aggregate-functions"/> |
| 228 | + <capability code="date-and-time-operators"/> |
170 | 229 | <expression>Mode({ DateTime(2012, 10, 5), DateTime(2012, 10, 5), DateTime(2012, 10, 6), DateTime(2012, 9, 5) })</expression> |
171 | 230 | <output>@2012-10-05T</output> |
172 | 231 | </test> |
173 | 232 | <test name="ModeTestTime" version="1.5"> |
| 233 | + <capability code="aggregate-functions"/> |
| 234 | + <capability code="date-and-time-operators"/> |
174 | 235 | <expression>Mode({ @T15:59:59.999, @T05:59:59.999, @T20:59:59.999, @T05:59:59.999 })</expression> |
175 | 236 | <output>@T05:59:59.999</output> |
176 | 237 | </test> |
177 | 238 | </group> |
178 | 239 | <group name="PopulationStdDev" version="1.5"> |
| 240 | + <capability code="aggregate-functions"/> |
179 | 241 | <test name="PopStdDevTest1" version="1.5"> |
| 242 | + <capability code="aggregate-functions"/> |
180 | 243 | <expression>PopulationStdDev({ 1.0, 2.0, 3.0, 4.0, 5.0 })</expression> |
181 | 244 | <output>1.41421356</output> |
182 | 245 | <!-- 23730951454746218587388284504413604736328125 --> |
183 | 246 | </test> |
184 | 247 | <test name="PopulationStdDevIsNull" version="1.5"> |
| 248 | + <capability code="aggregate-functions"/> |
185 | 249 | <expression>PopulationStdDev({ null as Quantity, null as Quantity, null as Quantity })</expression> |
186 | 250 | <output>null</output> |
187 | 251 | </test> |
188 | 252 | </group> |
189 | 253 | <group name="PopulationVariance" version="1.5"> |
| 254 | + <capability code="aggregate-functions"/> |
190 | 255 | <test name="PopVarianceTest1" version="1.5"> |
| 256 | + <capability code="aggregate-functions"/> |
191 | 257 | <expression>PopulationVariance({ 1.0, 2.0, 3.0, 4.0, 5.0 })</expression> |
192 | 258 | <output>2.0</output> |
193 | 259 | </test> |
194 | 260 | <test name="PopVarianceIsNull" version="1.5"> |
| 261 | + <capability code="aggregate-functions"/> |
195 | 262 | <expression>PopulationVariance({ null as Quantity, null as Quantity, null as Quantity })</expression> |
196 | 263 | <output>null</output> |
197 | 264 | </test> |
198 | 265 | </group> |
199 | 266 | <group name="StdDev" version="1.5"> |
| 267 | + <capability code="aggregate-functions"/> |
200 | 268 | <test name="StdDevTest1" version="1.5"> |
| 269 | + <capability code="aggregate-functions"/> |
201 | 270 | <expression>StdDev({ 1.0, 2.0, 3.0, 4.0, 5.0 })</expression> |
202 | 271 | <output>1.58113883</output> |
203 | 272 | <!-- 00841897613935316257993690669536590576171875 --> |
204 | 273 | </test> |
205 | 274 | <test name="StdDevIsNull" version="1.5"> |
| 275 | + <capability code="aggregate-functions"/> |
206 | 276 | <expression>StdDev({ null as Quantity, null as Quantity, null as Quantity })</expression> |
207 | 277 | <output>null</output> |
208 | 278 | </test> |
209 | 279 | </group> |
210 | 280 | <group name="Sum" version="1.5"> |
| 281 | + <capability code="aggregate-functions"/> |
211 | 282 | <test name="SumTest1" version="1.5"> |
| 283 | + <capability code="aggregate-functions"/> |
212 | 284 | <expression>Sum({ 6.0, 2.0, 3.0, 4.0, 5.0 })</expression> |
213 | 285 | <output>20.0</output> |
214 | 286 | </test> |
215 | 287 | <test name="SumTestLong" version="1.5"> |
| 288 | + <capability code="aggregate-functions"/> |
| 289 | + <capability code="system.long"/> |
216 | 290 | <expression>Sum({ 6L, 2L, 3L, 4L, 5L })</expression> |
217 | 291 | <output>20L</output> |
218 | 292 | </test> |
219 | 293 | <test name="SumTestQuantity" version="1.5"> |
| 294 | + <capability code="aggregate-functions"/> |
| 295 | + <capability code="unit-conversion-support"/> |
220 | 296 | <expression>Sum({1 'ml',2 'ml',3 'ml',4 'ml',5 'ml'})</expression> |
221 | 297 | <output>15 'ml'</output> |
222 | 298 | </test> |
223 | 299 | <test name="SumTestNull" version="1.5"> |
| 300 | + <capability code="aggregate-functions"/> |
224 | 301 | <expression>Sum({ null, 1, null })</expression> |
225 | 302 | <output>1</output> |
226 | 303 | </test> |
227 | 304 | </group> |
228 | 305 | <group name="Variance" version="1.5"> |
| 306 | + <capability code="aggregate-functions"/> |
229 | 307 | <test name="VarianceTest1" version="1.5"> |
| 308 | + <capability code="aggregate-functions"/> |
230 | 309 | <expression>Variance({ 1.0, 2.0, 3.0, 4.0, 5.0 })</expression> |
231 | 310 | <output>2.5</output> |
232 | 311 | </test> |
|
0 commit comments