Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Exporters #1354

Merged
merged 3 commits into from
Aug 22, 2023
Merged

Custom Exporters #1354

merged 3 commits into from
Aug 22, 2023

Conversation

dehall
Copy link
Contributor

@dehall dehall commented Aug 17, 2023

This is a proof of concept for supporting drop-in custom exporters.

This approach takes advantage of the Java ServiceLoader to load in JARs containing classes that implement a certain interface. I've defined two interfaces here, PatientExporter and PostCompletionExporter. (The existing exporters weren't modified here but they could easily extend these interfaces as well)

A template for building a custom exporter is here: https://github.com/dehall/custom-exporter-template

And an example Postgres loader which loads Patient basic info and Conditions into simple tables: https://github.com/dehall/example-exporter-postgres

(Documentation is limited on those new repos, apologies)

Note this has not yet been tested with the uberJar, but I believe it should be possible to get it working. I suspect instead of java -jar synthea-with-dependencies.jar though you will have to run something along the lines of java -cp synthea-with-dependencies.jar:new-exporter.jar App

@hadleynet
Copy link
Collaborator

The following command line works for the uberJar:

java -cp lib/custom/my-custom-exporter.jar -jar build/libs/synthea-with-dependencies.jar -p 1

@hadleynet hadleynet merged commit 3c23908 into master Aug 22, 2023
4 checks passed
@hadleynet hadleynet deleted the custom_exporters branch August 22, 2023 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants