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

Add support for CQFM Group Id extension (composite measure report building) #243

Closed sarahmcdougall closed 1 year ago

sarahmcdougall commented 1 year ago

Summary

For composite measure report building, filters the component results to those corresponding to groups defined by the CQFM Group Id extension (if applicable).

New behavior

Resources:

From the Multiple Populations section of the spec: "Component measures used in a composite SHOULD contain a single population group. For component measures that contain multiple population groups, the composite measure SHALL specify the specific group to be used in the composite using the cqfm-groupId extension."

Behavior does not change for calculating detailed results. Behavior does change for composite measure report building. When calculating the measure score, the component results will first be filtered so that the population results used for calculating the measure score are those that correspond to the specified groups. In other words, rather than considering all the component results across all the defined groups for measure score calculation, only one component result for a single group will be considered for measure score calculation. The logic can be broken down as follows:

Code changes

Testing guidance

Since no (known) composite measures exist in the wild, the best way to test functionality will be to run unit tests and integration tests. That being said, testing guidance is as follows:

composite.zip

github-actions[bot] commented 1 year ago

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟒 Statements
86.25% (-0.19% πŸ”»)
2258/2618
🟑 Branches
75.4% (+0.15% πŸ”Ό)
2087/2768
🟒 Functions
89.41% (+0.08% πŸ”Ό)
422/472
🟒 Lines
86.57% (-0.21% πŸ”»)
2178/2516
Show files with reduced coverage πŸ”»
|
St.:grey_question:
| File | Statements | Branches | Functions | Lines | | :----------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------- | :------------------------------------------------------------- | :---------------------------------------------------------- | :----------------------------------------------------------- | :------------------------------------------------------------- | | 🟒 |
`...` / CompositeReportBuilder.ts
|
88.62% (-9.42% πŸ”»)
|
75% (-5.86% πŸ”»)
|
96.43% (-3.57% πŸ”»)
|
88.62% (-9.42% πŸ”»)
|

Test suite run success

424 tests passing in 31 suites.

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

sarahmcdougall commented 1 year ago

I was trying some different test cases for this with @mgramigna and found an issue with the test case where there are two related artifacts of the same component (resource is the same) but the extensions of them are different groups. An example of this can be found at the bottom of the composite measures IG:

Ah, great catch. This example falls under part 2(c) here: "Multiple groups within the same measure may be referenced as different components of the same composite." I forgot this was possible because I keep thinking of measure and component as being synonymous, which isn't always the case since a measure can be referenced within multiple components. I'll update the storage method for mapping components to group Id