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

UnexpectedProperty: Stratum strata-2 in group #311

Open JSRankins opened 2 weeks ago

JSRankins commented 2 weeks ago

Summary

In using the global CLI (v 1.5.0), ran into an issue with the associated measure and patient bundles for the reports method using something similar to following command:

fqm-execution reports -m "path\to\measures\EpisodeMeasure.json" -p "path\to\patients\Episode_Patient.json" -o "path\to\output\Individal_Report.json" --report-type individual --vs-api-key {apiKey}

The following error was received:

UnexpectedProperty: Stratum strata-2 in group 66dfc5b649447a49beca9124 not found in measure reports
    at C:\Users\user\AppData\Roaming\npm\node_modules\fqm-execution\build\calculation\MeasureReportBuilder.js:205:43
    at Array.forEach (<anonymous>)
    at C:\Users\user\AppData\Roaming\npm\node_modules\fqm-execution\build\calculation\MeasureReportBuilder.js:186:93
    at Array.forEach (<anonymous>)
    at C:\Users\user\AppData\Roaming\npm\node_modules\fqm-execution\build\calculation\MeasureReportBuilder.js:173:45
    at Array.forEach (<anonymous>)
    at MeasureReportBuilder.addPatientResults (C:\Users\user\AppData\Roaming\npm\node_modules\fqm-execution\build\calculation\MeasureReportBuilder.js:148:32)
    at C:\Users\user\AppData\Roaming\npm\node_modules\fqm-execution\build\calculation\MeasureReportBuilder.js:586:21
    at Array.forEach (<anonymous>)
    at MeasureReportBuilder.buildMeasureReports (C:\Users\user\AppData\Roaming\npm\node_modules\fqm-execution\build\calculation\MeasureReportBuilder.js:583:26) {
  debugOutput: undefined
}

The details method appears to work for the measure and patient bundles (response attached: Episode_Details.json): fqm-execution details -m "path\to\measures\EpisodeMeasure.json" -p "path\to\patients\Episode_Patient.json" -o "path\to\output\Episode_Details.json" --vs-api-key {apiKey}

Expected Behavior

Calculation and generation of individual report with the relevant results

Version or Commit

1.5.0

Inputs (e.g. Measure Bundle, Patient Bundle, CQL Library)

Measure Bundle: EpisodeMeasure.json

Patient Bundle: Episode_Patient.json

Relevant Calculation Options (e.g. Measurement Period, meta.profile Validation)

Used measurement period in Measure resource

cql-to-elm Version Used for Measure Logic Translation (if known)

3.3.2

hossenlopp commented 1 week ago

Hi @JSRankins,

Good catch! This does look like a small bug in our creation of MeasureReports when we made it able to handle stratifiers identified by code OR id. We will plan to resolve this soon.

Your example measure here does bring up another concern. We did not assume that there would be multiple cqfm-appliesTo extensions on a single stratification. We only handle the first one found right now. What should results look like when there are multiple cqfm-appliesTo entries on a single strata and what does it actually mean to do so?

JSRankins commented 1 week ago

Hi @hossenlopp. QM IG STU 4 CQFM Computable Measure Profile changed cardinality of appliesTo extension from 1..1 (which is what it was In STU 3) to 0..*. The description of the extension:

Indicates the population that this stratifier should apply to.

Based on CQI discussions, this extension is really just a way to say whether all populations or a subset of populations in the group should be stratified and provided back in a report or if all of the populations in the group should be stratified and reported back. Per the IG,

If none is specified, the stratification applies to all populations in the group.

Does that help?