module-builder
module-builder copied to clipboard
Attribute-based Distributions
Distributions can be based off attribute values (the wiki was wrong):
For example:
"distribution": { "attribute" : "probability_of_fall_injury", "default" : 0.06 },
See https://github.com/synthetichealth/synthea/issues/289
https://github.com/synthetichealth/synthea/wiki/Generic-Module-Framework%3A-Transitions#named-probabilities
Interesting, this is a powerful feature and enables some pretty cool system-dynamics type modeling.
@jawalonoski it looks like this already exists. When looking at a distributed transition, click on 'Change to named transition', and you get a view like this (on the second transition):

It appears to show up in the JSON correctly too. Am I missing something?
I should change 'Weight' to 'Default Weight', and remove hte 'not adding up to 100%' warning, as that value is expected to change over time though.
And I guess if any of the transitions are named, we should allow any number, instead of constraining to 0-1, right?
Correct, if any transitions are named, you could say something like "Weights might not add up to 100% when using named transitions." Otherwise, you can use the current warning language.
Changed Weight to Default Weight in #181
Will leave open to handle the 'not add up to 100' case, but will set to 'low priority enhancement' as it doesn't prevent usage.