-
Notifications
You must be signed in to change notification settings - Fork 657
Generic Module Framework
Synthea contains a framework for defining modules using JSON. These JSON modules describe a progression of states and the transitions between them. On each Synthea generation time-step, the generic framework processes states one at a time to trigger conditions, encounters, medications, and other clinical events.
This simplified example of childhood ear infections shows the flow of a generic module. In this instance, children get ear infections at different rates based on their age, are then diagnosed at an encounter, and then are prescribed either an antibiotic or a painkiller.
The Module Builder is a web interface for clinicians and other healthcare professionals to design Synthea modules with no programming experience required. A short video introduction to the Module Builder is available on YouTube (linked below), and a Tutorial is available on this Wiki.
Details and examples for the core generic module concepts are available on the following pages:
Within the synthea repository, the following files and paths are relevant to the generic module framework:
-
src/main/resources/modules/
: the path containing the JSON module files that Synthea should process -
src/main/java/org/mitre/synthea/engine/Module.java
: theModule
class definition; responsible for maintaining a module's state definition. TheModule
class also processes states and transitions. -
src/main/java/org/mitre/synthea/engine/Logic.java
: theLogic
class implements the methods corresponding to the supported logical condition types -
src/main/java/org/mitre/synthea/engine/State.java
: theState
class implements the supported state types -
src/test/resources/generic/*.json
: the test fixtures for all of the generic module framework unit tests -
src/test/java/org/mitre/synthea/engine/*Test.java
: the unit tests for the generic module framework's context, logic, and state implementations