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

Fixes rare issue with weight management regression #1050

Merged
merged 1 commit into from
May 5, 2022

Conversation

eedrummer
Copy link
Collaborator

This fix addresses an issue where weight could be calculated as not a number
due to a divide by zero error.

This happened when a person had successful weight management, starting at age
13 and then regressing back to their original weight trajectory. The issue
would happen when attempting to determine what percentage of the "adult"
(after age 20) part of regression had elapsed. Since the adult regression
period was less than one year, it was setting the denominator of the
equation to zero.

The fix now sets this denominator to 1, making the calculation of percentage
elapsed the fraction over age 20 that the person is at the time of the weight
measurement.

Addresses issue #1038

There are checkstyle issues currently in the master branch that this PR does not address. Those issues are fixed in PR #1047

This fix addresses an issue where weight could be calculated as not a number
due to a divide by zero error.

This happened when a person had successful weight management, starting at age
13 and then regressing back to their original weight trajectory. The issue
would happen when attempting to determine what percentage of the "adult"
(after age 20) part of regression had elapsed. Since the adult regression
period was less than one year, it was setting the denominator of the
equation to zero.

The fix now sets this denominator to 1, making the calculation of percentage
elapsed the fraction over age 20 that the person is at the time of the weight
measurement.
@codecov
Copy link

codecov bot commented Apr 15, 2022

Codecov Report

Merging #1050 (d331e71) into master (7876535) will increase coverage by 1%.
The diff coverage is 100%.

@@            Coverage Diff            @@
##             master   #1050    +/-   ##
=========================================
+ Coverage        79%     80%    +1%     
- Complexity     3165    3222    +57     
=========================================
  Files           119     119            
  Lines         21704   21707     +3     
  Branches       2949    2950     +1     
=========================================
+ Hits          17168   17494   +326     
+ Misses         3617    3315   -302     
+ Partials        919     898    -21     
Impacted Files Coverage Δ
...va/org/mitre/synthea/modules/WeightLossModule.java 99% <100%> (+<1%) ⬆️
.../world/agents/behaviors/ProviderFinderNearest.java 90% <0%> (-5%) ⬇️
...g/mitre/synthea/modules/HealthInsuranceModule.java 89% <0%> (-4%) ⬇️
...ain/java/org/mitre/synthea/world/agents/Payer.java 75% <0%> (-2%) ⬇️
.../main/java/org/mitre/synthea/engine/Generator.java 76% <0%> (-1%) ⬇️
...in/java/org/mitre/synthea/world/agents/Person.java 84% <0%> (-1%) ⬇️
...ava/org/mitre/synthea/modules/LifecycleModule.java 91% <0%> (-1%) ⬇️
src/main/java/org/mitre/synthea/engine/State.java 86% <0%> (+<1%) ⬆️
...c/main/java/org/mitre/synthea/export/Exporter.java 64% <0%> (+<1%) ⬆️
.../java/org/mitre/synthea/export/BB2RIFExporter.java 54% <0%> (+<1%) ⬆️
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7876535...d331e71. Read the comment docs.

@jawalonoski jawalonoski merged commit 4be5dd4 into master May 5, 2022
@jawalonoski jawalonoski deleted the fix-transition-regression branch May 5, 2022 17:24
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.

2 participants