A Java/Apache Camel service for transforming medical forms into structured FHIR data. Apache Camel allows integration of multiple sources including:
- Emails with PDF attachments
- Message Queues
- Restful POST operations
- See full list of potential Camel Components
Although the possibilities are endless, the service's initial implementation includes the ability for end-users to email PDF documents to a given email address. The PDF documents will be stored in AWS S3, analyzed using AWS Textract, and ultimately persisted as FHIR data.
Specifically, this service aims to automate the collection of Covid-19 Case Reports in the United States using CDC's Person Under Investigation (PUI) Form. The PUI Form is the standard required by the CDC and adopted by most State Health Departments.
The service requires a designated email address where PDF documents can be received. A test Gmail account can be configured for the service:
- Navigate to
Gmail Settings
->Forwarding and POP/IMAP
->IMAP access
, then selectEnable IMAP
- Navigate to
Google Account Settings
->Security
->Less secure app access
, then toggle to allow less secure apps to connect to the account.
It goes without saying the service and email account will require some additional security configurations to meet HIPAA compliance standards.
- Clone the repo. git clone https://github.com/hapifhir/covid-response-app.git
- Once you're in the root of cloned repo, change the directory to
formtofhirservice
- Using gradle wrapper command, build an executable using
./gradlew clean build
- Finally, run the service:
java -jar build/libs/formtofhirservice-0.0.1-SNAPSHOT.jar [email protected] --email.password=YOURPASSWORD --email.hostname=imap.gmail.com
Data from PUI Form is converted into the following FHIR Resources
- Split attachments into individual messages
- Write each attachment to S3
- For each S3 document asynchronously kickoff Textract, see https://docs.aws.amazon.com/textract/latest/dg/api-async.html
- Configure another Consumer endpoint for SNS/SQS,where Textract completion notification are posted
- Create Camel Processor for transforming Textract data to FHIR Questionaire/QuestionaireResponse
- Use Camel FHIR Component to persist, see https://camel.apache.org/components/latest/fhir-component.html