Skip to content
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

cql-to-elm translator comment newlines being lost in some cases #1109

Closed
nmorasb opened this issue Jan 6, 2023 · 1 comment
Closed

cql-to-elm translator comment newlines being lost in some cases #1109

nmorasb opened this issue Jan 6, 2023 · 1 comment
Labels
bug md impact tracking The issue is impacting measure development
Milestone

Comments

@nmorasb
Copy link

nmorasb commented Jan 6, 2023

We are using the cql-to-elm library and have observed that when combining styles of comments the newline after the last comment is lost, causing issues with downstream consumers of the generated ELM.
CQL:

library ObsTestN1 version '0.0.000'

using FHIR version '4.0.1'


include FHIRHelpers version '4.1.000' called FHIRHelpers

parameter "Measurement Period" Interval<DateTime>

context Patient

/* Multi-line works fine */
// Single-line comment does not work
define "boolIpp":
  exists ["Encounter"] E where E.period.start during "Measurement Period"

Here are some screenshots of the issue as observed after passing the ELM to fqm-execution:
Screen Shot 2023-01-06 at 11 25 59 AM

Screen Shot 2023-01-06 at 11 25 40 AM

The issue is not observed when comment styles are not mixed:
Screen Shot 2023-01-06 at 11 25 09 AM

The issue is also not observed if a multi-line comment comes after the single-line comments:
Screen Shot 2023-01-06 at 11 26 34 AM

These screenshots were all coming from fqm-execution library output, but we can see here the actual cql-to-elm output where the newline character is being lost:
image

versus what appears when we only use single-line comment style:
image

Adding @JSRankins here as well

@brynrhodes brynrhodes added the bug label Mar 28, 2023
@brynrhodes brynrhodes added this to the Maintenance milestone Mar 28, 2023
@jenseeman jenseeman added the md impact tracking The issue is impacting measure development label Jun 16, 2023
brynrhodes added a commit that referenced this issue Jul 10, 2023
JPercival pushed a commit that referenced this issue Jul 11, 2023
* #1156: Added test cases for CMS143 and CMS149 to validate data requirements output

* #1147: Fixed invalid let ref during data requirements inference

* #1146: Added test for MedicationRequest to ensure expected ELM output

* #1109: Fixed newlines being stripped incorrectly in mixed single- and multi-line comments
brynrhodes added a commit that referenced this issue Jul 14, 2023
* #1156: Added test cases for CMS143 and CMS149 to validate data requirements output

* #1147: Fixed invalid let ref during data requirements inference

* #1146: Added test for MedicationRequest to ensure expected ELM output

* #1109: Fixed newlines being stripped incorrectly in mixed single- and multi-line comments
@brynrhodes
Copy link
Member

Included in 2.11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug md impact tracking The issue is impacting measure development
Projects
None yet
Development

No branches or pull requests

3 participants