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

Update weighted composite measure calculation to divide by sum of all… #253

Closed lmd59 closed 1 year ago

lmd59 commented 1 year ago

… weights

Summary

Weighted composite measure calculation does a weighted average by setting the final denominator to be the some of all weights.

Example calculation:

composite score = ((weight A)(score A) + (weight B)(score B))/(weight A + weight B) = ((2)(.6)+(.5)(.8))/(2+.5) = 1.6/2.5 = .64 (i.e. 64%)

New behavior

Final denominator is the sum of weights, final score is a weighted average. This should not affect component-level linear combination scoring.

Code changes

Testing guidance

Initially, the weights are 3 and 1 (resulting in a 62.5% overall score), but you can change around weights and run the following:

Component results for the patients are:

Play with different weights to check for a weighted average between these two scores.

github-actions[bot] commented 1 year ago

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟢 Statements 86.25% 2258/2618
🟡 Branches 75.4% 2087/2768
🟢 Functions 89.41% 422/472
🟢 Lines 86.57% 2178/2516

Test suite run success

424 tests passing in 31 suites.

Report generated by 🧪jest coverage report action from 1ad9591e320ce9bc91fdf40cd34d993dfd354eb3