Closed cmoesel closed 7 years ago
Here is the eCQM that causes this issue: CMS146_v5_2_Artifacts.zip
The problem is that the result type of the tuple was being incorrectly inferred by the translator. Odd and Even were being incorrectly considered Lists of Integers, which is why no error or list promotion was occurring. I corrected the type inference so that Odd and Even are now correctly integers, and the list promotion is now occurring as expected.
I've tested it and merged it. Thanks!
For those using the CoffeeScript execution engine (@mulcahyk), note that it will still not handle this fix well. This fix uses the CQL-to-ELM promotion feature to promote the single value to a list (containing only the single value). It uses the ToList
operator, which is not yet implemented in the CoffeeScript CQL execution engine. So... that will need to be added.
The
includes
operator is generally defined for lists and intervals. In some cases, a non-list item may be promoted to a list during CQL-to-ELM translation.There is at least one case, however, where this promotion is not occurring, and CQL-to-ELM produces ELM that allows the
includes
operator to be executed on a single item that is not an interval or list (and is not promoted). This happens when using a tuple returned from a multi-source query.Example CQL:
This produces ELM containing this snippet:
In reality, the
Odd
property onOE
is anInteger
, so it is not valid as the first operand inContains
.@mulcahyk has identified at least one eCQM that triggers this bug. As a result of the invalid
Contains
operator in the ELM, that measure cannot be properly executed.