Closed lmd59 closed 1 year ago
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 |
424 tests passing in 31 suites.
Report generated by 🧪jest coverage report action from 1ad9591e320ce9bc91fdf40cd34d993dfd354eb3
… 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
CompositeReportBuilder.ts
sums weightsCompositeReportBuilder.test.ts
has updated denominator and score as expected for thecompositeExecutionResults
andsimpleCompositeMeasureWeightedScoring
used in the testtest/integration/composite-weighted
Testing guidance
npm run check
npm run test:integration
Initially, the weights are 3 and 1 (resulting in a 62.5% overall score), but you can change around weights and run the following:
npm run cli -- reports -m test/integration/composite-weighted/composite-weighted-bundle.json --patients-directory test/integration/composite-weighted/patients -s 2023-01-01 -e 2023-12-31 --report-type "summary"
Component results for the patients are:
Play with different weights to check for a weighted average between these two scores.