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

DataRequirementsProcessor returning unwanted dataRequirement entries #1311

Closed nmorasb closed 8 months ago

nmorasb commented 9 months ago

We are requesting an update to the DataRequirementProcessor to stop adding additional, unnecessary data requirements to the output. This is when calling DataRequirementsProcessor.gatherDataRequirements() in elm-fhir. It seems like, while composing the dateRequirement entries, the processor sometimes loses the call stack context and returns an unfiltered dataRequirement entry. Take the below for example.
 If we have a Cohort measure where the IP is this:

define "Initial Population":
  exists [Condition: "Pregnancy or Other Related Diagnoses"] Dx
    where Dx.isActive ( )

The following is returned for dataRequirement:

"dataRequirement": [
  {
    "type": "Condition",
    "profile": [
      "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition"
    ],
    "mustSupport": [
      "clinicalStatus"
    ]
  },
  {
    "type": "Condition",
    "profile": [
      "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition"
    ],
    "mustSupport": [
      "code"
    ],
    "codeFilter": [
      {
        "path": "code",
        "valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1.1623"
      }
    ]
  }
]

It seems like the condition context has been lost inside the isActive() call, resulting in two Condition dataRequirement entries - one with the valueset, and one without. What we would really like is for just this to be returned:

"dataRequirement": [
  {
    "type": "Condition",
    "profile": [
      "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition"
    ],
    "mustSupport": [
      "code"
    ],
    "codeFilter": [
      {
        "path": "code",
        "valueSet": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1.1623"
      }
    ]
  }
]

If needed, we'd be ok with this being added behind a configuration option.

JPercival commented 9 months ago

Hi @nmorasb. What's the code for the Dx.isActive() function? Most likely that is looking at clinicalStatus property, which is why it's showing up the data requirements.

JPercival commented 8 months ago

Closing due to inactivity. Please reopen if needed.