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

Proportion episode-based measure highlighting fix #212

Closed elsaperelli closed 1 year ago

elsaperelli commented 1 year ago

Summary

Fixes #211

New behavior

Before, buildPopulationRelevanceForAllEpisodes() was being called in scenarios where episodeResults is defined, but is an empty array. This caused the highlighting to be incorrect because buildPopulationRelevanceForAllEpisodes had no episode array to work with and therefore returned a masterRelevanceResults array where every entry had a result of false. Now, in ClauseResultsBuilder.ts, we check if results.episodeResults is defined AND has a length greater than 0. As a result, the correct highlighting is shown because it is treated as a normal patient based measure when calculating relevance. We set the precedent of using patient-level logic for this in DetailedResultsBuilder.ts (line 43) so I thought this fix was okay.

Code changes

Testing guidance

github-actions[bot] commented 1 year ago

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟒 Statements 85.26% 2001/2347
🟑 Branches
73.92% (-0.06% πŸ”»)
1774/2400
🟒 Functions 87.38% 353/404
🟒 Lines 85.56% 1931/2257
Show files with reduced coverage πŸ”»
|
St.:grey_question:
| File | Statements | Branches | Functions | Lines | | :----------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------- | :--------- | :------------------------------------------------------------- | :-------- | :---- | | 🟑 |
`...` / ClauseResultsBuilder.ts
| 72.84% |
60.59% (-0.45% πŸ”»)
| 86.49% | 72.4% |

Test suite run success

371 tests passing in 28 suites.

Report generated by πŸ§ͺjest coverage report action from b4564795b28f1a16374d4b01420a0adadb07a63e