cql-execution icon indicating copy to clipboard operation
cql-execution copied to clipboard

Unable to use Value Set Expansion

Open RohitKandimalla opened this issue 10 months ago • 6 comments

The following image shows a definition "Encounter with Malnutrition Risk Screening DISPLAY ONLY" which is attempting to use valueSet Exapnsions of "Malnutrition Risk Screening" and also trying to analyze if observation.code belongs to that valueSet ( ScreenEval: MalnutritionRiskScreening.code in "Malnutrition Risk Screening",) Note: Also tried ScreenEval: "Malnutrition Risk Screening" contains MalnutritionRiskScreening.code but returned same result.

Expectation is that "contains" or "in" are evaluated as true for the given bundle. Actual: None of those conditions are satisfied.

Image

Image

Additional Debugging:

When reviewing the returned results of StatementResults for 'Encounter with Malnutrition Risk Screening DISPLAY ONLY,' it was found that RiskScreeningExpansion does not return a valid list of expansion codes—instead, it returns an empty list of codes. See the results below.

Contrary when "Encounter Inpatient" is logged, We see the expansion codes accurately.

Image

  1. Attached are the CQL ( Written for Debugging Purpose ) derived from CMS986. TestCQLIT511NutrQ6.txt
  2. Patient Bundle PatientBundle.json
  3. Measure Bundle MeasureBundle.json
  4. ValueSet Expansions ValueSetExpansions.json

RohitKandimalla avatar Mar 12 '25 19:03 RohitKandimalla

Hi @RohitKandimalla,

Thanks for including all the data needed for us to debug this. We will prioritize looking at this in our upcoming sprint.

Best, Chris

hossenlopp avatar Mar 12 '25 21:03 hossenlopp

Hi @RohitKandimalla,

It looks like the MeasureBundle here doesn't contain any FHIR Measure or Library resources and is not a FHIR Bundle.

Could you upload a complete measure bundle to help us with debugging this issue?

-Chris

hossenlopp avatar Mar 13 '25 21:03 hossenlopp

Sorry about that Chris, I mistakenly included wrong content in the measureBundle.json I updated it with measure as well as library resources. MeasureBundle.json

RohitKandimalla avatar Mar 13 '25 21:03 RohitKandimalla

Hi @RohitKandimalla!

The team has been looking into this more, and it appears as though the ValueSet you are missing codes for is perhaps not included in the measure bundle, specifically the relatedArtifacts of the Library resources in the measure bundle. Would you mind looking into that again just to see if you are experiencing this issue when the value set is present? If they aren’t present then they may not be getting loaded in for execution and resulting in this error. Thanks!

elsaperelli avatar Mar 17 '25 20:03 elsaperelli

@elsaperelli Yes you are right, Turns out DataRequirementsProcessor is not gathering appropriate relatedArtifacts. I am working on figuring out why it is happening and hopefully will get an answer to your question about "Is this still an issue with the value set is present"

RohitKandimalla avatar Mar 20 '25 13:03 RohitKandimalla

Hi @RohitKandimalla,

As we were debugging various issues with ValueSets in the past few weeks, this issue made us aware that our internal ValueSet objects are coming through as statement results here. There is a new to CQL 1.5 set of Vocabulary types which includes ValueSet. We plan to implement these new types soon. For the mean time, do not rely on the current ValueSet object output as it does not follow the CQL spec. If you wish to return the expansion of the ValueSet, please use the ExpandValueSet operator.

With regards to your DataRequirements issues, I also saw this problem with the CMS832 and CMS1218 packages in #339. It looks like the ValueSets used in the Retrieves inside functions are not being surfaced to the relatedArtifacts and dataRequirements.

Best, Chris

hossenlopp avatar Apr 03 '25 16:04 hossenlopp

We are closing this ticket as the original issue was not with the cql-execution. For tracking the ValueSet vocabulary type implementation we will use the existing ticket #226.

hossenlopp avatar Jun 11 '25 17:06 hossenlopp