cqframework / clinical_quality_language

Clinical Quality Language (CQL) is an HL7 specification for the expression of clinical knowledge that can be used within both the Clinical Decision Support (CDS) and Clinical Quality Measurement (CQM) domains. This repository contains complementary tooling in support of that specification.
https://confluence.hl7.org/display/CDS/Clinical+Quality+Language
Apache License 2.0
251 stars 121 forks source link

Aggregate function errors #1347

Closed brynrhodes closed 4 days ago

brynrhodes commented 3 months ago

The following functions return incorrect results:

define "AllTrueIsTrueWhenNull": AllTrue(null) // Should be true, returns null
define "AnyTrueIsFalseWhenNull": AnyTrue(null) // Should be false, returns null
define "StdDevIsNull": StdDev({ null as Quantity, null as Quantity, null as Quantity }) // Gives NullPointerException, should be null
define "PopulationStdDevIsNull": PopulationStdDev({ null as Quantity, null as Quantity, null as Quantity }) // Gives NullPointerException, should be null

Note that these are directly from the spec, and are likely in the cql-tests, so the fix here should be coordinated with a passing test in the tests suite.