Closed jackcmeyer closed 7 years ago
@brynrhodes and @c-schuler: Pull Request https://github.com/cqframework/clinical_quality_language/pull/211 was pushed to correct this issue. However, the comment in the pull request is not consistent with what is in CQL if we understand the comment correctly. The comment in the pull request is below.
Comment support is limited (comments within expressions will cause syntax issues - keep comments above or below expressions).
We do not understand what is intended by this comment, but it seems to imply that comments internal to a definition are not supported. If this is the case, then it is not consistent with the CQL standard.
In addition, we have found that the use of a comments provided internally in a definition will sometimes cause an error to return even when the CQL syntax is correct. For example, when the formatter operates on this code...
library Test version '0.0.000'
using QDM version '5.3'
valueset "Dapsone and pyrimethamine": 'urn:oid:2.16.840.1.113883.3.464.1003.196.12.1202' version 'urn:hl7:version:eCQM%20Update%202017-05-05'
valueset "Leucovorin": 'urn:oid:2.16.840.1.113883.3.464.1003.196.12.1205' version 'urn:hl7:version:eCQM%20Update%202017-05-05'
parameter "Measurement Period" Interval<DateTime>
context Patient
define "CD4+ Count With Results and Medications 2":
["Medication, Order": "Leucovorin"] MOL
with ["Medication, Order": "Dapsone and pyrimethamine"] DapsoneOrder
// fdafds this statement
such that DapsoneOrder.authorDatetime occurs 1 days or less after MOL.authorDatetime
with ["Medication, Order": "Dapsone and pyrimethamine"] MODP
such that MODP.authorDatetime occurs 1 day or less after MOL.authorDatetime
where MOL.authorDatetime is not null
...the following output is received:
Encountered syntax errors:
[14:2]: mismatched input 'with' expecting {<EOF>, '<', '>', 'define', 'context', 'in', 'is', 'as', 'properly', 'between', 'and', '<=', '>=', '=', '!=', '~', '!~', 'contains', 'or', 'xor', 'implies', '|', 'union', 'intersect', 'except', 'less than', 'more than', 'on or', 'before', 'after', 'starts', 'ends', 'occurs', 'same', 'includes', 'during', 'included in', 'within', 'meets', 'overlaps', NUMBER}
Input CQL:
null
On the other hand, when the CQL expression is run through the CQL-to-ELM translator, it passes validation.
Addressed in v1.2.12-SNAPSHOT.
When using the CQL Formatter on the following CQL Library:
results in:
Similarly, multi line comments have the same issue.
results in: