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

Physiology Models (Borked) #1254

Closed
wants to merge 180 commits into from
Closed

Physiology Models (Borked) #1254

wants to merge 180 commits into from

Conversation

awatson1978
Copy link
Collaborator

@awatson1978 awatson1978 commented Feb 20, 2023

Synthea Physiology Simulations

The simulation configuration files in this directory can be used to execute a single run of a Synthea physiology model via the gradle command line interface. The configuration allows manipulation of the differential equation solver, step size, sim duration, and configuration for output charts if desired. Output files will be in the output/physiology directory.

Note that these are only utilized for the physiology gradle command and are not part of the normal Synthea execution procedure.

Configuration

You will need to set the following two fields to true in the src/main/resources/synthea.properties file.

# Use physiology simulations to generate some VitalSigns
physiology.generators.enabled = true

# Allow physiology module states to be executed
# If false, all Physiology state objects will immediately redirect to the state defined in
# the alt_direct_transition field
physiology.state.enabled = true

Usage

./gradlew physiology --args="config/simulations/[config name].yml"

Examples

  ./gradlew physiology --args="config/simulations/circadian_clock.yml"
  ./gradlew physiology --args="config/simulations/ecg.yml"
  ./gradlew physiology --args="config/simulations/insulin_signalling_diabetic.yml"
  ./gradlew physiology --args="config/simulations/insulin_signalling_normal.yml"
  ./gradlew physiology --args="config/simulations/liver_metabolism.yml"
  ./gradlew physiology --args="config/simulations/mammalian_circadian_rhythm_non_24hr.yml"
  ./gradlew physiology --args="config/simulations/menstrual_cycle.yml"
  ./gradlew physiology --args="config/simulations/o2_transport_metabolism.yml"
  ./gradlew physiology --args="config/simulations/plasma_melatonin.yml"  
  ./gradlew physiology --args="config/simulations/pulmonary_fluid_dynamics.yml"
  ./gradlew physiology --args="config/simulations/pulmonary_oxygen_intake.yml"
  ./gradlew physiology --args="config/simulations/telomere_associated_dna_damage.yml"
  ./gradlew physiology --args="config/simulations/weight_change.yml"

Output

Graphs and raw data in CVS files will be found in output/physiology folder.

You may also wish to create a large population of 10,000 or more individuals, and search for gallblader patients (which are currently the only patients that have ECG physiology data attached to them.)

# generate the sample patients
run_synthea -p 10000

# then search for gallbladder conditions with any of the following terms:
  - Media
  - 29303009 
  - Electrocardiogram
  - valueSampledData

References

@awatson1978 awatson1978 marked this pull request as draft February 20, 2023 17:21
@codecov
Copy link

codecov bot commented Feb 20, 2023

Codecov Report

Merging #1254 (ab9c85c) into master (7a5348f) will increase coverage by 0%.
Report is 155 commits behind head on master.
The diff coverage is n/a.

❗ Current head ab9c85c differs from pull request most recent head 2e115c6. Consider uploading reports for the commit 2e115c6 to get more accurate results

@@            Coverage Diff             @@
##             master   #1254     +/-   ##
==========================================
  Coverage        78%     79%             
- Complexity     3635    3874    +239     
==========================================
  Files           167     167             
  Lines         23659   24941   +1282     
  Branches       3220    3566    +346     
==========================================
+ Hits          18643   19756   +1113     
- Misses         3996    4160    +164     
- Partials       1020    1025      +5     

see 27 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

jawalonoski and others added 3 commits July 14, 2023 11:02
Co-authored-by: sonatype-lift[bot] <37194012+sonatype-lift[bot]@users.noreply.github.com>
@jawalonoski
Copy link
Member

After a quick glance, here are a few quick thoughts:

  • You probably want to remove all of the .idea/ files and add .idea/** to .gitignore.
  • You also made some non-functional whitespace changes (some with trailing whitespace that our style guidelines will issue warnings about) that you probably should revert.
  • You have *.bkup copies of files that you probably did not intend to commit that should probably be removed.

@jawalonoski
Copy link
Member

Many of the wearable submodule files start with gallstones_* not sure if this is copy & paste or if you tied this to gallstones or what, but ideally these should be independent of gallstones. Let's discuss.

BigDecimal income = BigDecimal.valueOf((Integer) this.attributes.get(Person.INCOME));
BigDecimal yearlyCost = plan.getYearlyCost();
return income.multiply(BigDecimal.valueOf(incomePercentage)).compareTo(yearlyCost) == 1;
int income = (int) this.attributes.get(Person.INCOME);
Copy link
Contributor

Choose a reason for hiding this comment

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

7% of developers fix this issue

NULLPTR_DEREFERENCE: null (last assigned on line 776) is dereferenced.

❗❗ 2 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
src/main/java/org/mitre/synthea/export/rif/CarrierExporter.java 69
src/main/java/org/mitre/synthea/export/rif/BeneficiaryExporter.java 487

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


double incomePercentage = Config.getAsDouble("generate.payers.insurance_plans.income_premium_ratio");
int income = 0;
income = (int) this.attributes.get(Person.INCOME);
Copy link
Contributor

Choose a reason for hiding this comment

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

7% of developers fix this issue

NULLPTR_DEREFERENCE: null (last assigned on line 777) is dereferenced.


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.

@sonatype-lift
Copy link
Contributor

sonatype-lift bot commented Aug 3, 2023

🛠 Lift Auto-fix

Some of the Lift findings in this PR can be automatically fixed. You can download and apply these changes in your local project directory of your branch to review the suggestions before committing.1

# Download the patch
curl https://lift.sonatype.com/api/patch/github.com/synthetichealth/synthea/1254.diff -o lift-autofixes.diff

# Apply the patch with git
git apply lift-autofixes.diff

# Review the changes
git diff

Want it all in a single command? Open a terminal in your project's directory and copy and paste the following command:

curl https://lift.sonatype.com/api/patch/github.com/synthetichealth/synthea/1254.diff | git apply

Once you're satisfied, commit and push your changes in your project.

Footnotes

  1. You can preview the patch by opening the patch URL in the browser.

@awatson1978 awatson1978 mentioned this pull request Aug 3, 2023
@awatson1978
Copy link
Collaborator Author

Replaced by #1347

@awatson1978 awatson1978 closed this Aug 3, 2023
@awatson1978 awatson1978 changed the title Physiology Models Physiology Models (Borked) Aug 3, 2023
@awatson1978 awatson1978 deleted the wearables branch August 8, 2023 19:23
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.

6 participants