cqframework / clinical_quality_language

Clinical Quality Language (CQL) is an HL7 specification for the expression of clinical knowledge that can be used within both the Clinical Decision Support (CDS) and Clinical Quality Measurement (CQM) domains. This repository contains complementary tooling in support of that specification.
https://confluence.hl7.org/display/CDS/Clinical+Quality+Language
Apache License 2.0
258 stars 120 forks source link

Human readable generation issue in cql-to-elm v1.4.6 #524

Closed adongare closed 4 years ago

adongare commented 4 years ago

Hello,

We are using cql-to-elm v1.4.6 in Measure Authoring Tool. We are facing an issue where one of the cql definitions is missing from Human Readable(measure name is Elective Delivery CMS113). Because of some reason cql-to-elm translator thinks that the definition is not being used however the definition is used in denominator. CQL definitions:

define "Denominator":
  "Delivery Encounter Near Term"

define "Delivery Encounter Near Term":
  "Delivery Encounter With Calculated Gestational Age"
    union "Delivery Encounter With Estimated Gestational Age Assessment"

The missing definition from Human Readable isDelivery Encounter With Calculated Gestational Age

To filter out all the used definitions, we use following code:

// prepare cqlFilter
MATCQLFilter cqlFilter = new MATCQLFilter(parentLibraryString, childrenLibraries , parentExpressions, translator, translatedLibraries);
// call filter
cqlFilter.filter();
// get used definitions
cqlFilter.getUsedDefinitions() // "Delivery Encounter With Calculated Gestational Age" not being returned in list

When I change denominator to use this definition directly as:

define "Denominator":
  "Delivery Encounter With Calculated Gestational Age"
    union "Delivery Encounter With Estimated Gestational Age Assessment"

cqlFilter.getUsedDefinitions() returns the definition correctly.

Original ticket that was created by our user is: https://oncprojectracking.healthit.gov/support/browse/BONNIEMAT-646 I can also provide original cql lib if needed.

Thank you!

brynrhodes commented 4 years ago

Hi @adongare , my guess is that something in the MATCqlFilter class is not traversing the ELM tree, is there a way I can see what's happening in that code?

adongare commented 4 years ago

Thank you @brynrhodes! I can walk you through the code. Please let me know when you get some time. I can setup meeting invite.

MAT code that filters out the cql artifacts- line no 710 to 716:

https://github.com/MeasureAuthoringTool/MeasureAuthoringTool/blob/ccaea68b60613fcebf3c77dac12435ecb2f1231d/src/main/java/mat/server/util/CQLUtil.java#L705

adongare commented 4 years ago

Hi @brynrhodes, sorry to bother you again, just followup to our earlier conversation. Please let me know your thoughts on this. Thank you!

yanyanhu2 commented 4 years ago

Hi @adongare @brynrhodes, Just wanted to follow up on this issue. The Joint Commission is going to publish our eCQMs for 2020AU soon, including CMS113 and CMS334. We hope this issue could be resolved by MAT tool completely so that we can have issue-free eCQMs published.  Thank you both!

brynrhodes commented 4 years ago

@adongare , apologies for the delay here, I'll reach out directly to set up a time to chat.

mparenzan commented 4 years ago

Can I get an update on this issue?   We would like to publish this measure next week.  Thank you.

adongare commented 4 years ago

Hi @mparenzan, we met with Bryn and he helped us to figure out the issue. Issue is not in this code. It's in another MAT dependency which uses this code. MAT team is working on it. We'll provide you the status on Jira ticket. Thanks!

mparenzan commented 4 years ago

Do you have an EDC?

adongare commented 4 years ago

@mparenzan we have a MAT release coming up for some HARP related fixes. We are planning to release the fix in that release. Mostly early next week. I'll update you the release date tomorrow once we have QA results for the fix.

mparenzan commented 4 years ago

When do you expect that release to occur?

adongare commented 4 years ago

Early next week

adongare commented 4 years ago

This was an issue in MAT wrapper around CQLtoELM translator and not the original CQLtoELM translator. Thank you so much @brynrhodes for your help on this. I'm closing this issue.