Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Applies to stratifiers #307

Merged
merged 7 commits into from
Jul 19, 2024
Merged

Applies to stratifiers #307

merged 7 commits into from
Jul 19, 2024

Conversation

elsaperelli
Copy link
Contributor

Summary

This PR does two things: fixes an error that was occurring when running calculateMeasureReports on measure bundles whose group.stratifiers did not have code.text and adds functionality in measure report calculation for stratifiers that have the cqfm-appliesTo extension.

New behavior

Measure report calculation no longer errors out with the measure bundle provided in the most recent fqm-execution issue- stratifiers are now either identified with s.code OR s.id. Additionally, if a stratifier has a cqfm-appliesTo extension, then only that associated population is included on the stratifier.population array in the MeasureReport. If the extension is not present, then the stratifier applies to all populations in the group. This specification is described in the CQFM Computable Measure Profile.

Code changes

  • src/calculation/DetailedResultsBuilder.ts - use strata.id if strata.code.text does not exist
  • src/calculation/MeasureReportBuilder.ts - use id when setting up the population groups in the Measure Report, add cqfm-appliesTo extension functionality
  • test/unit/MeasureReportBuilder.test.ts - unit tests for stratifiers with cqfm-appliesTo
  • test/unit/fixtures/measure/proportion-measure-with-stratifiers.json - test measure with stratifiers that have the cqfm-appliesTo extension

Testing guidance

  • npm run check
  • npm run test:integration & regression testing
  • Run MeasureReports with the measure bundle and patient provided in the fqm-execution issue. There are a couple ways to do this, but I use the cli in the following command: npm run cli -- reports -m <measureBundle> -p <patientBundle> --debug -o -s 2025-01-01 -e 2025-12-31 --trust-meta-profile true

Copy link

github-actions bot commented Jul 17, 2024

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements
85.25% (+0.09% 🔼)
2405/2821
🟡 Branches
72.79% (-0.22% 🔻)
2253/3095
🟢 Functions
87.37% (-0.1% 🔻)
429/491
🟢 Lines
85.56% (+0.09% 🔼)
2323/2715
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / DetailedResultsBuilder.ts
87.74%
80% (-0.1% 🔻)
84.38% 87.98%

Test suite run success

454 tests passing in 31 suites.

Report generated by 🧪jest coverage report action from ccd7cd3

Copy link
Contributor

@hossenlopp hossenlopp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small change for report output.

I feel like this could use a test that adds results for two patients to make sure it properly makes use of the appliesTo (as we understand it now) and keeps with only having results for the single population on the stratifier output.

src/calculation/MeasureReportBuilder.ts Outdated Show resolved Hide resolved
@elsaperelli elsaperelli requested a review from hossenlopp July 18, 2024 17:36
Copy link
Contributor

@lmd59 lmd59 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small comment!

@elsaperelli elsaperelli requested a review from lmd59 July 19, 2024 16:15
@elsaperelli elsaperelli merged commit 0b752a1 into master Jul 19, 2024
6 checks passed
@elsaperelli elsaperelli deleted the appliesTo-stratifiers branch July 19, 2024 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants