-
Notifications
You must be signed in to change notification settings - Fork 791
Flexporter
The Synthea Flexible Exporter a.k.a. "Flexporter" is a utility designed to make it easy to add new fields, values, and resource types to Synthea-generated FHIR, without having to modify the Synthea engine. Primary users of this feature are expected to be Implementation Guide authors and users, electronic clinical quality measure developers and testers, and anyone who needs just a slight tweak to the data exported by Synthea.
As of 2022-07-28, this feature is only available on the flexporter branch: https://github.com/synthetichealth/synthea/tree/flexporter
The basic idea of the Flexporter is that users will define a series of transformations to apply to Synthea data. A predefined set of transformations, such as "set field X to value Y" or "create a new resource" is intended to cover the majority of use cases while still remaining easy to use.
The Flexporter can also run standalone to post-process FHIR Bundles.
./run_flexporter -m mapping_file -s source_fhir [-ig ig_folder]
( https://github.com/synthetichealth/synthea/blob/flexporter/src/main/java/RunFlexporter.java )
The format of the mapping file is as follows:
At the core of the flexporter is the CustomFHIRPathResourceGeneratorR4 class - this is based on a community contribution within HAPI which we've added some additional functionality to. It does some magic using HAPI's internal reflection (on top of Java reflection), so it can be a bear to wrap your head around. Debugging and stepping through examples makes it easier. https://github.com/synthetichealth/synthea/blob/flexporter/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java