This project is no longer maintained, but there is a list of other open source FHIR servers here.
Open-source FHIR Server to support patient- and clinician-facing apps.
Still highly experimental, but has limited support for:
- GET, POST, and PUT resources
transaction
(POST a bundle of resources)- Search resources based on FHIR's defined search params
- Install Postgres 9.1+ (locally or use a remote service)
- Oracle Java 7 JDK (not JRE -- and not Java 8)
$ git clone https://github.com/smart-on-fhir/api-server
$ cd api-server
Ensure that /etc/postgresql/9.1/main/pg_hba.conf
contains a line like:
local all all md5
(If you have local all all peer
, for example, peer
with md5
.)
$ sudo -u postgres -i
postgres@$ createuser -R -P -S -D fhir
[at password prompt: fhir]
postgres@$ createdb -O fhir fhir
postgres@$ logout
$ ./grailsw run-app
Key settings files are:
- Turn authentication on or off with
fhir.oauth.enabled
:true | false
- Configure authentication with
fhir.oauth
- Configure your Postgres
dataSource
Add new data to the server via HTTP PUT or POST. For example, with default authentication settings and a server running at http://localhost:8080, you can add a new Diagnostic Order via:
curl 'http://localhost:8080/DiagnosticOrder/example' \
-X PUT \
-H 'Authorization: Basic Y2xpZW50OnNlY3JldA=='\
-H 'Content-Type: text/xml' \
--data @grails-app/conf/examples/diagnosticorder.xml
And then you can retrieve a feed of diagnostic orders via:
curl 'http://localhost:8080/DiagnosticOrder' \
-H 'Authorization: Basic Y2xpZW50OnNlY3JldA=='
or fetch a single resource as JSON via:
curl 'http://localhost:8080/DiagnosticOrder/example' \
-H 'Authorization: Basic Y2xpZW50OnNlY3JldA==' \
-H 'Accept: application/json'
You can load sample data from SMART's Sample Patients:
$ git clone --recursive https://github.com/smart-on-fhir/sample-patients
$ cd sample-patients/bin
$ pip install -r requirements.txt
$ python generate.py --write-fhir ../generated-data
$ ls ../generated-data # a bunch of XML files
cd ../generated-data
for i in *.xml; do
curl 'http://localhost:8080/?' \
-H 'Content-Type: text/xml' \
--data-binary @$i;
done