Closed antvaset closed 3 weeks ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 63.71%. Comparing base (
179c762
) to head (7efaada
). Report is 34 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This branch contains proposed changes to CQL's grammar (and therefore spec) to make operator precedence work the same way it does in FHIRPath.
...some background on this issue
The following is a valid FHIRPath expression:
which evaluates to true (you can use this https://hl7.github.io/fhirpath.js/ to confirm). But in CQL it currently throws an error because
=
takes precedence over|
, so it's trying to parse((0 | 1 | 2).take(2) = 0) | 1
and not(0 | 1 | 2).take(2) = (0 | 1)
. The pipe operator is defined to be equivalent tounion
, andunion
is currently explicitly below=
in CQL's operator precedence table (https://cql.hl7.org/03-developersguide.html#operator-precedence). In FHIRPath however, the pipe has higher precedence than=
(https://build.fhir.org/ig/HL7/FHIRPath/#operator-precedence).