#NodeOnFHIR#
This is a Node server with tweaks to read and write FHIR data structures. It is based on this fork, which is based on this.
##Installation##
Note that all cd
commands assume you are not already in that directory, and may be skipped if so.
###Basic Configuration###
-
Install server dependencies:
$ cd [HEPCAT install directory]/server $ npm install
-
Verify authentication/authorization is enabled:
$ vi config/config.js
- Change
exports.authenticate=false
toexports.authenticate=true
if not already set - Change
exports.authorize=false
toexports.authorize=true
if not already set
- Start the server by following the Running > Start the Node Server section below
###Import Data### NodeOnFHIR uses the NDC drug database to drive its list of medications. It is included as a submodule. Follow the following steps to download the raw data files, parse them into JSON dumps, and import them. NOTE that due to its size, the NDC database could not be included with the repo and must be downloaded manually.
Import Data### HEPCAT uses the NDC drug database to drive its list of medications. It is included as a submodule of the Node server (a submodule itself).
Execute the following steps to download the raw data files, parse them into JSON dumps, and import them into the FHIR database.
-
Create
data
directory:$ cd [HEPCAT install directory]/server/import/medications $ mkdir data $ cd data
-
Download and unzip NDC database:
$ curl -O http://www.fda.gov/downloads/Drugs/DevelopmentApprovalProcess/UCM070838.zip $ unzip UCM070838.zip -d ndc
-
Run the parse script:
$ cd [HEPCAT install directory]/server/import/medications/ $ python parse.py
- Troubleshooting
locale.Error: unsupported locale setting
- run
locale -a
to get locales supported by your system - edit the
locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
line inparse.py
to match one of the supported locales
- run
-
Start the node server (if not already running) by following the Running section below
-
Import the data (
medications
,organizations
andsubstances
)$ cd [HEPCAT install directory]/server/import $ bash load.sh
##Running##
Start the server:
$ cd [NodeOnFHIR install directory]
$ node server
Verify that the data was imported correctly by executing the following GET request: