JSON Export - synthetichealth/synthea GitHub Wiki
JSON Export
The JSON Export is somewhat close to a Synthea "object dump". It uses the Gson library to serialize instances of the Person class into JSON. Each Person is written into a single JSON file in a directory called json, where ever Synthea is configured to output records.
Export Properties
Each JSON file will contain a single object with the following properties:
attributes- theMapof properties associated with thePerson. There is a lot of information in this property. Some information is removed prior to export. See below for details.coverage- thePerson'sCoverageRecordlastUpdated- time in the simulation that thePersonwas last updatedseed- random seed used in generationrecordorrecords- APerson'sHealthRecord. If thePersonhas a singleHealthRecord, then the property will be calledrecord. If there are multiple, the property will be calledrecords
What is not exported
- Any java fields marked as
static,transientorvolatile. These fields are often references to look up data structures. Person.attributeswith key names starting with "ehr_", containing "lookup" or containing "UUID".- The "ehr_" attributes are generated by the
ClinicalNoteExporterand contain references to objects in theHealthRecord, so nothing is really lost by dropping it. - "lookup" attributes are dropped because they contain look up tables.
- "UUID" attributes are dropped because they contain UUID generators, not UUIDs themselves. UUID generators in Synthea are problematic for JSON export, as they often contain a reference to the
Personas a source of randomness. This creates a circular reference.
- The "ehr_" attributes are generated by the
Payerexport is limited to name and UUID. This eliminates many circular references and references to information held elsewhere.- Any instance of
Moduleor anything that subclasses it gets skipped in the export.
Export of State and Module History
Synthea stores the path an individual takes through each module in Person.attributes. Each module history is stored in a key that is the name of the module. By default, module history is removed before export into JSON. It can be enabled through configuration.
If module history export is enabled, it will be available under the attributes property. Each module will have history under a property that is its name. The history is a JSON Array. The objects in the array, each representing a state, have the following properties:
state_nameentered(optional)exited(optional)
Configuration
exporter.json.export set to true to enable JSON Export. The default is false.
exporter.json.include_module_history set to true to enable export of module history in Person.attributes. The default is false.