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
262 stars 121 forks source link

Elm Translator: Missing localId for choice type properties #1295

Closed birick1 closed 9 months ago

birick1 commented 10 months ago

This issue arises from ticket https://github.com/projecttacoma/fqm-execution/issues/290 coming from a MADiE user issue.

For this CQL:

define "Has Medical or Patient Reason for Not Ordering Beta Blocker for LVSD":
  exists ( ["MedicationNotRequested"] NoBetaBlockerOrdered
      with AHA."Heart Failure Outpatient Encounter with History of Moderate or Severe LVSD" ModerateOrSevereLVSDHFOutpatientEncounter
        such that NoBetaBlockerOrdered.authoredOn during ModerateOrSevereLVSDHFOutpatientEncounter.period
      where NoBetaBlockerOrdered.medication in "Beta Blocker Therapy for LVSD"
        and ( NoBetaBlockerOrdered.reasonCode in "Medical Reason"
            or NoBetaBlockerOrdered.reasonCode in "Patient Reason"
        )
  )

With the correct set of patients, we should see “NoBetaBlockerOrdered.medication” highlighted. However, it is not highlighted as seen below:

image

The root cause for lack of highlighting is that the ELM is missing the localId for the expression. To see this, the generated ELM for this expression is as follows:

image

With the arrows pointing at the location where a localId should be found.

What’s particularly odd is that a localId for this expression does exist in the annotations:

image

It is likely a bug that the localId exists in the annotation, but not the ELM expression. If the annotation is added to the ELM as expected:

image

Then highlighting works as expected (Note: the localId could also be placed in the “code” clause):

image

JPercival commented 10 months ago

Duplicate of #1279, currently working on this!