Skip to content
New issue

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

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

Already on GitHub? # to your account

Module overrides #566

Merged
merged 5 commits into from
Feb 14, 2020
Merged

Module overrides #566

merged 5 commits into from
Feb 14, 2020

Conversation

dehall
Copy link
Contributor

@dehall dehall commented Sep 6, 2019

Starting point for "module overrides". The idea here is that we can provide a module override file at runtime that defines parameters that override parts of the generic modules. There are a number of possible use cases for this, for example pre-defining alternative populations (think "internationalization", such as "run with this override file to produce a population matching all condition prevalence rates in Germany"). Also includes a task that can generate a base set of override files with some configurability.

The format of the overrides file is a java properties file, with format:

(module file path)::(jsonpath to value) = (new value)

example:

congestive_heart_failure.json\:\:$['states']['Age_70-79-Chance\ of\ CHF']['distributed_transition'][0]['distribution'] = 0.024
congestive_heart_failure.json\:\:$['states']['Age_80-Chance\ of\ CHF']['distributed_transition'][0]['distribution'] = 0.045
atopy.json\:\:$['states']['Initial']['complex_transition'][0]['distributions'][0]['distribution'] = 0.917
atopy.json\:\:$['states']['Initial']['complex_transition'][1]['distributions'][0]['distribution'] = 0.033

The way that this feature is used is by setting a config property:

run_synthea --module_override=path_to_properties_file

Note that I also extracted the common "for each module" logic into a new utility method since the exact same boilerplate was used in 5+ places. Apologies for the extra diffs but if you view it in "ignore whitespace mode" it's more obvious what the actual change to those files was.

@codecov
Copy link

codecov bot commented Sep 6, 2019

Codecov Report

Merging #566 into master will increase coverage by <1%.
The diff coverage is 57%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #566    +/-   ##
=========================================
+ Coverage        76%     76%   +<1%     
- Complexity     2202    2246    +44     
=========================================
  Files            85      86     +1     
  Lines         14546   14645    +99     
  Branches       1974    1991    +17     
=========================================
+ Hits          11088   11227   +139     
+ Misses         2887    2855    -32     
+ Partials        571     563     -8
Impacted Files Coverage Δ Complexity Δ
src/main/java/Graphviz.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...main/java/org/mitre/synthea/helpers/Utilities.java 78% <100%> (+1%) 107 <6> (+6) ⬆️
src/main/java/org/mitre/synthea/engine/Module.java 79% <52%> (-9%) 38 <6> (-1)
...ava/org/mitre/synthea/helpers/ModuleOverrides.java 56% <56%> (ø) 20 <20> (?)
.../main/java/org/mitre/synthea/helpers/Concepts.java 84% <75%> (-1%) 16 <1> (-2)
...ain/java/org/mitre/synthea/helpers/Attributes.java 85% <75%> (-1%) 65 <1> (-2)
...in/java/org/mitre/synthea/export/TextExporter.java 92% <0%> (-2%) 79% <0%> (-6%)
...org/mitre/synthea/export/ClinicalNoteExporter.java 79% <0%> (-2%) 14% <0%> (-2%)
...ava/org/mitre/synthea/modules/EncounterModule.java 96% <0%> (-2%) 31% <0%> (-1%)
...ava/org/mitre/synthea/modules/LifecycleModule.java 90% <0%> (-1%) 127% <0%> (ø)
... and 9 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 604ddbe...5c3b586. Read the comment docs.

@dehall
Copy link
Contributor Author

dehall commented Oct 22, 2019

Note to self: once this is eventually complete and merged, update the README on the populations repo: https://github.com/synthetichealth/populations

@dehall dehall marked this pull request as ready for review February 6, 2020 13:31
@dehall dehall changed the title WIP: module overrides Module overrides Feb 6, 2020
@dehall dehall requested a review from jawalonoski February 6, 2020 13:32
@dehall
Copy link
Contributor Author

dehall commented Feb 6, 2020

Once this is merged I'll add a wiki page for it as well

@jawalonoski jawalonoski merged commit 5163e99 into master Feb 14, 2020
@jawalonoski jawalonoski deleted the module_overrides branch February 14, 2020 19:31
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants