smartonfhir/hapi-5
A HAPI FHIR server configured to run with several FHIR versions and sample datatsets.
100K+
To run a HAPI server use the following command:
docker run -it -p {PORT}:8080 smartonfhir/hapi-5:{TAG}
Replace the {PORT} with the port that you want the server to accessible at and {TAG} with the image that you want to use. The available tags are:
r2-empty - DSTU2 FHIR server with an empty database
r2-smart - STU3 FHIR server with 65 generated patients
r2-synthea - STU3 FHIR server with 1461 Synthea-generated patients
r2-full - STU3 FHIR server with r2-smart and r2-synthea data combined
r3-empty - STU3 FHIR server with an empty database
r3-smart - STU3 FHIR server with 67 generated patients
r3-pro - STU3 FHIR server with some questionnaires and responses from 100 de-identified patients
r3-synthea - STU3 FHIR server with 1461 Synthea patients
r3-full - STU3 FHIR server with r3-smart, r3-pro and r3-synthea data combined
r4-empty - R4 FHIR server with an empty database
r4-synthea - R4 FHIR server with 629 Synthea patients
r5-empty - R5 FHIR server with an empty database
The HAPI images are perfect for experimenting in development but if you want to modify the data or insert new patients, those changes will not be preserved after the container is shut down. To preserve the database across restarts, a Docker volume can be used. Example:
# Run this once to create a named volume
docker volume create db
# Then mount the database to it while starting the image
docker run -it -p 8080:8080 -v db:/usr/local/tomcat/target/database smartonfhir/hapi-5:r3-full
Every image comes with a standard HAPI configuration file in which only the desired FHIR version is modified. In some cases, users may need to change other setting as well. For example, if you want to use SSL you would have to set up a domain, generate a certificate and use a proxy server like NginX or Apache that will pass requests to the upstream HAPI server. To make that work, you would have to "tell" HAPI what its base URL is so that it generates proper links in FHIR responses. To do so, you get a copy of the configuration file (hapi.properties) included in this repo for convenience. Then make sure you set fhir_version (replace $FHIR_VERSION) to what you need (DSTU2, DSTU3, R4 or R5) and set server_address to the desired value. Once your config file is ready, put it in a folder and bind-mount it to /config:
docker run -it -p 8080:8080 -v /path/to/config-folder/:/config smartonfhir/hapi-5:r3-full
For more information, see the project GitHub page
docker pull smartonfhir/hapi-5