Skip to content
No description, website, or topics provided.
JavaScript HTML CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
fhir
importer
static
tests
transforms
.gitignore
FhirStream.js
LICENSE
QueryBuilder.js
README.md
ScopeSet.js
bulk_data_handler.js
config.js
database.backup.db
database.r2.db
database.r3.db
database.r4.db
db.js
env.js
generator.js
import.js
index.js
lib.js
package-lock.json
package.json
registration_handler.js
token_handler.js

README.md

Bulk Data Server

Online Demo

Install

First you have to install NodeJS if you don't already have it from https://nodejs.org/. This app has been developed on Node version 7.9 and also tested on Node 8. In case you have older version you might need to also install a newer one. This is easy to do using the Node Version Manager from https://github.com/creationix/nvm. Then clone the repo, install the dependencies and start it:

git clone https://github.com/smart-on-fhir/bulk-data-server.git
cd bulk-data-server
npm i

Use

Run the following command:

npm start

You should see "Server listening on http://localhost:9443", and can open that URL in your browser to load the server's front end.

The bulk-data server can be accessed by clients like the FHIR Downloader. To connect a client, you will need the server's FHIR endpoint that is displayed in the "FHIR Server URL" field towards the bottom of the page.

The server can also handle authenticated requests using the SMART Backend Services specification. To use it you should have a pair of RS256 private and public keys (the server only require you to input the public key). Alternatively, you can generate the key pair by clicking on the "Generate Keys" button. The other required piece is the "Service URL" which acts as a unique identifier of your client. Once you have the public key and the Service URL, the server will generate a Client ID for you. You can also download the settings a client will need in JSON format by using the "Download as JSON" button. These settings include:

  • private_key - Only included if keys are generated by the server
  • client_id - client_id to send while authorizing
  • fhir_url - where to send your FHIR requests
  • token_url - where to send your authorization requests
  • service_url - client identifier

Note that changing options may also change some of these settings (the fields that change will flash green).

Adding your own data

  1. Use the Synthea Patient Generator to generate STU3 patients.
  2. Import these patients into the server's database:
node import -d /path/to/my/patients/

Configuration

You can customize your settings by editing the file config.js. You can also pass the following environment variables:

  • NODE_ENV - Typically this is production, development or test. Defaults to production.
  • PORT - The port to listen on. Defaults to 9444 for running tests and 9443 otherwise.
  • BASE_URL - The base url for the link generation. Defaults to http://localhost:${PORT}.
  • SECRET - The secret for signing jwt tokens. Defaults to "this-is-our-big-secret". You must set this one.
You can’t perform that action at this time.