Skip to content

Instantly share code, notes, and snippets.

@kennwhite
Created August 28, 2020 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kennwhite/086cd71220569b2982f6d336eba27996 to your computer and use it in GitHub Desktop.
Save kennwhite/086cd71220569b2982f6d336eba27996 to your computer and use it in GitHub Desktop.
FHIR Connector Demo
# Example FHIR Connector Demo
# Default settings are for local mongodb on 27017. If using Atlas, modify src/config.js or
# set an environment variable: export MONGO_HOSTNAME='mongodb+srv://DBUSER:PASSWORD@example.cluster.mongodb.net'
# If using other mongodb, from shell: export MONGO_HOSTNAME='mongodb://DBUSER:PASSWORD@example.mongodb.net'
git clone https://github.com/kennwhite/node-fhir-server-mongo
cd node-fhir-server-mongo/
# Assumes NPM v 10 > is installed
npm install > log.txt 2>&1 && echo 'Dependencies installed.'
curl -L -o createPatient.json https://git.io/JffR2
# KILL any existing running NPM jobs first!
npm run start &
# Push a record to the FHIR web service
curl -X PUT -H "Content-Type: application/fhir+json" -H "Cache-Control: no-cache" --data @createPatient.json http://localhost:3000/4_0_0/Patient/example
# Query the FHIR web service
curl -sX GET http://localhost:3000/4_0_0/Patient/example | less | jq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment