-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ToList is not implemented according to the spec #1133
Comments
IMO, the implementation makes sense -- if a list is passed to |
I can see it either way. I don't mind whether this is an implementation change or a spec change. We could tack this into the ELM spec:
|
According to the ELM spec,
https://cql.hl7.org/04-logicalspecification.html#tolist
However:
https://github.com/cqframework/clinical_quality_language/blob/d10c4ef801a8e160510b2a868c044dea5bdb85c1/Src/java/engine/src/main/java/org/opencds/cqf/cql/engine/elm/execution/ToListEvaluator.java
When operand is already a list, the ruler simply returns the operand. That logic is on line 12.
This is important as the cql-to-elm translator assumes this behavior. Consider this CQL:
The translator is generating this ELM for the codes property of the Retrieve:
Because the ruler ignores the ToList for expressions that are already lists, it codes would end up being expressed as a
List<Code>
.If you were to follow the letter of the ELM spec, codes ends up expressed as a
List<List<Code>>
.This confounds engines that expect the terminology element of the retrieve statement to be a
List<Code
> (or a value set, which is implicitly convertible to aList<Code>
).The text was updated successfully, but these errors were encountered: