Stream: cql
Topic: Syntax for sorting
Georg Fette (Oct 19 2018 at 08:04):
Hello,
I have some erros when parsing CQL statements including the 'sort' statement. I use the parser from the cql2elm project from the cql-github repository. It works to parse the statement from the CQL documentation on page 40:
[Encounter: "Inpatient"] E sort by start of period
However, when parsing statements where the thing to be sorted is referenced by an alias like the statement on page 78:
exists ([DiagnosticOrder: "Pregnancy Test"] O where Last(O.event E where E.status = 'completed' sort by E.date).date during MeasurementPeriod)
I get the error "Could not resolve identifier E in the current library".
It seems that the parser cannot cope with aliases in the sorts.
Am I doing something wrong ?
Greetings
Georg
Georg Fette (Oct 19 2018 at 08:24):
Ah, I used the documentaion R1_STU2_2017JUL. I just saw in in the online documentation on http://cql.hl7.org/02-authorsguide.html#clinical-quality-measure-logic that the example has been changed to not using an alias.
Greetings
Georg
Last updated: Apr 12 2022 at 19:14 UTC