Closed sarahmcdougall closed 1 year ago
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 |
424 tests passing in 31 suites.
Report generated by π§ͺjest coverage report action from 0245869c641f9710201f62a82d16a3b150ebb428
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
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
MeasureBundleHelpers
- helper functions that extract the group IdvalueString
from the defined CQFM Group Id extension and filter the component results according to the defined group Ids on the extensionCompositeReportBuilder
- calls helper functions fromMeasureBundleHelpers
to extract the group Ids and filter the component results before looping through them for measure score calculationTesting 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:
.zip
. The.zip
contains a directory of patients and two different measure bundles:composite-mb-no-extension.json
- does not define the group Id extension. Component 1 has two defined groups. Should throw an error since a specific group is not specified with the extension.composite-mb-with-groupId.json
- defines the group Id extension for Component 1. Component 1 has two defined groups. Should successfully build a composite measure report using the defined group.composite-mb-with-groupId.json
to specify a non-existent group. This should throw an error.compositeScoring.coding.code
on the composite measure in the measure bundle. At a minimum, test one of the scoring types that is checked inaddPatientResults
(all or nothing, opportunity, or linear) and test theweighted
scoring type since that gets calculated inaddWeightedResults
.composite.zip