-
Notifications
You must be signed in to change notification settings - Fork 663
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.
Future plans for the generic module framework include a web interface to allow clinicians or other healthcare professionals to design Synthea modules with no programming experience required.
Details and examples for these concepts are available on the following pages:
Within the synthea repository, the following files and paths are relevant to the generic module framework:
-
lib/generic/modules/
: the path containing the JSON module files that Synthea should process -
lib/generic/context.rb
: theContext
class definition; responsible for maintaining a module's state definition, state history, and current state for each patient. TheContext
class also processes states and transitions. -
lib/generic/logic.rb
: theLogic
module implements the methods corresponding to the supported logical condition types -
lib/generic/states.rb
: theStates
module implements the supported state types -
modules/generic.rb
: theGeneric
module defines the Synthearule
that is executed on every time-step. It loops through the modules inlib/generic/modules/
, setting up and running the context for each module. -
test/fixtures/generic/*.json
: the test fixtures for all of the generic module framework unit tests -
test/generic_*_test.rb
: the unit tests for the generic module framework's context, logic, and state implementations