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

cql-to-elm translator validation issue #825

Open adongare opened 1 year ago

adongare commented 1 year ago

This was noticed while testing CMS190V11 in bonnie. CQL:

 define "No Mechanical VTE Prophylaxis Due to Medical Reason on Day of or Day After Procedure":
  from
    "Encounter with ICU Location" QualifyingEncounterICU,
    ["Procedure, Performed": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,
    "No Mechanical VTE Prophylaxis Performed or Ordered" NoMechanicalProphylaxis
    where NoMechanicalProphylaxis.negationRationale in "Medical Reason" NoMechanicalProphylaxis
      and Global."NormalizeInterval" ( AnesthesiaProcedure.relevantDatetime, AnesthesiaProcedure.relevantPeriod ) ends 1 day after day of VTE."StartOfFirstICU" ( QualifyingEncounterICU )
      and NoMechanicalProphylaxis.authorDatetime during day of TJC."CalendarDayOfOrDayAfter" ( 
      end of Global."NormalizeInterval" ( AnesthesiaProcedure.relevantDatetime, AnesthesiaProcedure.relevantPeriod ) )
    return QualifyingEncounterICU

especially the line where NoMechanicalProphylaxis.negationRationale in "Medical Reason" NoMechanicalProphylaxis. The alias NoMechanicalProphylaxis in the above line seems to be unnecessary, however, the translator did not catch it. After talking to @JSRankins, we think that this could be a potential bug in the translator. Although we used translator v1.5.3 for this, this issue could be in the latest version of the translator as well.

brynrhodes commented 1 year ago

@adongare , can you post the full library (or even better, a pared down version that includes all the dependencies so this is a standalone repro?)

ddieppois commented 10 months ago

I've downloaded the ECM at https://ecqi.healthit.gov/ecqm/eh/2023/cms0190v11#quicktabs-tab-tabs_measure-2 and opened it using the plugin in visual code. I believe the definition has changed since then

define "No Mechanical VTE Prophylaxis Due to Medical Reason on Day of or Day After Procedure":
  from
    "Encounter with ICU Location" QualifyingEncounterICU,
    ["Procedure, Performed": "General or Neuraxial Anesthesia"] AnesthesiaProcedure,
    "No Mechanical VTE Prophylaxis Performed or Ordered" NoVTEDevice
    where NoVTEDevice.negationRationale in "Medical Reason"
      and Global."NormalizeInterval" ( AnesthesiaProcedure.relevantDatetime, AnesthesiaProcedure.relevantPeriod ) ends 1 day after day of VTE."StartOfFirstICU" ( QualifyingEncounterICU )
      and NoVTEDevice.authorDatetime during day of TJC."CalendarDayOfOrDayAfter" ( 
      end of Global."NormalizeInterval" ( AnesthesiaProcedure.relevantDatetime, AnesthesiaProcedure.relevantPeriod ) )
    return QualifyingEncounterICU
adongare commented 9 months ago

@brynrhodes, @ddieppois- we advised measure dev to remove the alias. Here is the cql file: CMS190v11.txt and measure CMS190-v11-1-001-QDM-5-6 (1).zip. thank you!