-
Notifications
You must be signed in to change notification settings - Fork 6
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
Support for multiple initial populations #160
Conversation
Coverage report
Show files with reduced coverage 🔻
Test suite run success320 tests passing in 28 suites. Report generated by 🧪jest coverage report action from a206b7f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Just some small changes and questions. My only overall suggestion is to maybe add some unit tests for DetailedResultsBuilder.ts since there were some changes there that are not covered? Unsure how necessary that is though with all the external tests you made.
I Added some more tests for the branch of logic that I changed in Ideally we can expand the tests more in the future. This led to a net increase in test coverage for that file, so I think that's good |
817564f
to
f0d106f
Compare
f0d106f
to
d5d8767
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm! Thank you for adding the detailed comments! Those will be helpful. As well as the additional tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a quick pass, the approach is sound. 👍
I didn't see anything relevant to making sure the distinct IPPs are getting results in the MeasureReportBuilder. Maybe it already is inherently doing it right.
Yeah, I think we will have the same problem as we do with ratio measures with multiple observations: need to differentiate them in the MeasureReport. We're avoiding this for now. If this ticket gets in, we can probably use this to differentiate the populations. For now, I wonder if (as a separate PR) we should update the MeasureReportBuilder to either throw an error or a warning or something when we encounter one of these edge cases, just so users don't expect it to work (and we can recommend using the low-level detailed results API or something) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested thoroughly and works well! Took a good look at the code diff and only have a couple tiny comments. Nice work!
Requested changes are non-issues
Summary
Fixes #149
This PR enables the results processing logic of
fqm-execution
to handle the case of multiple Initial Populations defined in a measure. Note that this is only applicable for Ratio Measures.For context, in the case of a ratio measure when there are two IPs, the numerator and the denominator are treated independently when they depend on different IPs.
New behavior
criteriaReference
extension in the numer/denom populationcqfm-populationBasis
extension being present at the individual population level (as opposed to Measure or Measure.group)Code changes
criteriaExpression
when provided to resolve ambiguity between multiple populations of the same typeTesting guidance
Verify the differences with the new output and what was there on master before. You should see that
ipp2
is now properly being reported astrue
fqm-execution
. These are test cases I created and bundled that further test this logic, specifically testing the "independentness" of numer and denom in these multiple IPP cases. Instructions are inMULTIPLE-IP-INSTRUCTIONS.md
, but it's a two parter:Part 2A: Test cases
Run the
./run-multiple-ip-test-cases.sh
file to generate 3 JSON outputs for each of the CQL libraries present in themultiple-ipp-test-cases
directory. Please cross-reference the results with the CQL files.false-denom-output.json
- Of note in this is thatipp
anddenom
both have no results, butipp2
andnumer
have one episode result. you should see that the results foripp2
andnumer
are reported as true independent ofipp
anddenom
. This would not happen on master. In addition,denom
is not relevant, as its corresponding ipp is falsy.numerator
is relevant though, since its corresponding ipp is truthyfalse-numer-output.json
- Of note in this one is that the numerator population is not relevant since its ipp is false, but denom/ipp are both relevant and truthyboth-true-output.json
- Everything is true and relevant, and we get results for 2 episodesPart 2B: Regression Tests
Given that a lot of the results processing has changed in this PR, I wrote some scripts that ensure that previous calculation behavior for measures without two IPPs is unchanged.
git clone https://github.com/DBCG/connectathon.git
./run-regression.sh
PASS
means that there are 0 diffs in the detailed results for that measure/test case between master and this branch. This is expected, as none of the measures in connectathon have two IPPs, so calculation results should be unchanged.