Interval "expand" produces invalid results
define "test": expand {Interval[@2020-01-01, @2020-01-08]} per day
The above CQL calculates: [Interval[2020-01-01, 2020-01-01), Interval[2020-01-02, 2020-01-02) [...]
Those intervals are invalid, both including and excluding a particular day. If the "expand" operator uses the "except" operator, this issue may be linked to issue cqframework/clinical_quality_language#952
This same behavior is confirmed for integer intervals. define "test": expand {Interval[4,6]} //results in Interval[4, 4), Interval[5, 5), Interval[6, 6)]
Decimal intervals work better, but the ends should probably be inclusive instead of exclusive define "test_decimal": expand {Interval[4.0,6]} //results in [Interval[4.0, 4.99999999), Interval[5.0, 5.99999999)]
Resolved by cqframework/cql-engine#462
Whoops. Had too many tabs open.