Closed elsaperelli closed 1 year ago
St.:grey_question: |
Category | Percentage | Covered / Total |
---|---|---|---|
π’ | Statements | 85.01% | 1990/2341 |
π‘ | Branches | 73.68% (+0.02% πΌ) |
1755/2382 |
π’ | Functions | 87.1% | 351/403 |
π’ | Lines | 85.3% (+0.01% πΌ) |
1920/2251 |
364 tests passing in 28 suites.
Report generated by π§ͺjest coverage report action from ce450a83f3fc4b9645e13842aa7c2a9298c955d5
Summary
Fixes #187 This pull request (by @hossenlopp) fixes the bug in #187. Fixes ratio, episode-based measure observation results, for same function, not appearing correctly. Now, we ensure that observations are not nulled out by finding the populationResult whose criteriaExpression matches the desiredPopulation criteriaExpression AND whose populationId matches the desiredPopulation id.
New behavior
Before, in
getObservationResultForPopulation()
inMeasureBundleHelpers.ts
, we found thepopulationResult
of the measure observation that references the desired population in its criteria reference by doing a.find
on populationResults and looking for the result whose criteriaExpression matched the criteriaExpression of the desiredObservation. In cases where populationResults had the same criteriaExpression, this could lead to issues because the.find
would result in returning the first result that had a matching criteriaExpression. In order to fix this, we added a check to the.find
to ensure that the population id of the population result matched the population id of the desired observation. If the populationId does not exist in the population results, thentrue
is returned.Code changes
src/helpers/MeasureBundleHelpers.ts
- where the bug fix occurstest/integration/helpers/testHelpers.ts
- add| undefined
toobservations
and add check forobservations
inassertObservations()
test/integration/ratio-Encounter-reuseObservationFunction/patients
- additional patient bundles for integration testingtest/integration/ratio-Encounter-reuseObservationFunction/ratio-Encounter-reuseObservationFunction.test.ts
- additional integration tests for the new patient bundlesTesting guidance
npm run test:integration
npm run check