projecttacoma / fqm-execution

fqm-execution is a library that allows users to calculate FHIR-based electronic Clinical Quality Measures (eCQMs) and retrieve the results in a variety of formats
https://projecttacoma.github.io/fqm-execution/
Apache License 2.0
18 stars 6 forks source link

Missing results for measure observations in some scenarios #144

Closed nmorasb closed 1 year ago

nmorasb commented 1 year ago

Expected behavior:

Actual behavior:

Only non-boolean Continuous Variable measure includes observation results

populationResults results field only includes a boolean result for observations, and we always expect a numeric value for observation results. So far, we have only seen a numeric observation result in episodeResults, which is only populated for episode based measures.

For all instances of Ratio, we have not seen any observation results in the episodeResults. The observations field of the measure-observation populationType is always undefined.

observation-resources.zip

mgramigna commented 1 year ago

Thanks for the issue! And thanks for providing examples as well.

In our initial investigation/exploration with supporting Ratio measures, we did not really have any examples to go off of, so this helps a lot.

For the CV Boolean measure, it looks like the measure scoring is defined using the cqfm-scoring extension on the Measure.group. I believe fqm-execution only looks at the root Measure.scoring attribute defined in base FHIR to determine the scoring. We will update this, and I believe this will help us fix the issue about observation results not being included in the return result. The raw results from the engine (before they get passed through all of fqm-executions eCQM-specific logic), do include a numerical value on the measure observation function:

"obs_func_fun_boolDenom": {
  "episode": true,
  "observation": 1
}

So we just need to make sure this gets handled properly when putting it on the detailed results JSON.


For the ratio measures, I think they key for us was seeing your use of cqfm-criteriaReference in the measure population for the observation(s) of the ratio measure. With the one example we had, we had to bake some assumptions into fqm-execution, as the example did not use this extension to actually identify which observation was a numerator or a denominator observation. I think this is contributing to the observations field not being properly reported. Our plan is to update fqm-execution to use this extension when determining what the observation function is in order to properly report the observation results.


Hopefully this helps

nmorasb commented 1 year ago

Sounds good, thank you! If any additional examples or info would help with building in support for this then please just let me know!

mgramigna commented 1 year ago

@nmorasb I believe #152 resolves these issues, see the PR description for more

mgramigna commented 1 year ago

Released in https://github.com/projecttacoma/fqm-execution/releases/tag/v1.0.0-beta.6

mgramigna commented 1 year ago

@nmorasb By the way, @natjoe4, who helped test some of these measures, noticed that the CV measure you provided is not using a proper value[x] for the cqfm-aggregateMethod. The extension indicates that the type is a FHIR code, and it also provides the list of codes and displays. A proper use of this extension would be:

[
  {
    "url": "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-aggregateMethod",
    "valueCode": "count"
  }
]

This doesn't affect fqm-execution the way you are using it, as the aggregateMethod is not factored in until creating a MeasureReport, but we wanted to make sure you were aware of this issue to hopefully avoid future problems with aggregating during CV measure calculation.