This is the Node.js backend for HospitalRun. The intention is that this would be used in HospitalRun production deployments. Having a Node.js backend server allows us to do the following:
This is the preferred and recommended way of running hospitalrun-server.
Full deployment documentation is available here.
git clone https://github.com/HospitalRun/hospitalrun-servernpm install in the newly cloned directory to install the HospitalRun dependencieshttps://github.com/HospitalRun/hospitalrun-frontend/blob/master/script/initcouch.shinitcouch.sh with no arguements. A user hradmin will be created with password: test.initcouch.sh USER PASS. USER and PASS are the CouchDB admin user credentials.config-example.js to config.js in the folder you cloned the HospitalRun repository. If you already had a CouchDB admin user that you passed into the couch script (initcouch.sh USER PASS), then you will need to modify the couchAdminUser and couchAdminPassword values in config.js to reflect those credentials. Additionally the default network name for the CouchDB server is couchdb. If you are runninig CouchDB on the same server as HospitalRun, change line 2 of config.js from:var config = {
couchDbServer: 'couchdb',
to:
var config = {
couchDbServer: 'localhost',
If you are on Linux distribution that uses Upstart, there is an upstart script in utils/hospitalrun.conf. By default this script assumes the server is installed at /var/app/server. This script relies on forever which you will need to install via npm: npm install -g forever
npm start (this is not recommended for production usage).Search on the HospitalRun Server uses Elasticsearch 5.x and Logstash 5.x. If you are installing on a debian server you can use the following steps to setup elasticsearch and java (if needed):
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-5.x.list
sudo apt-get install apt-transport-https
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer elasticsearch logstash
sudo /usr/share/logstash/bin/logstash-plugin update --no-verify logstash-input-couchdb_changes
sudo cp -r logstash/pipeline /usr/share/logstash
sudo cp -r logstash/config /usr/share/logstash
sudo service logstash restart
sudo service elasticsearch restart
There is a utility located under utils/inv-import.js that will allow you to import inventory from a CSV. To use it, run the following command
node utils/inv-import.js file.csv YYYY-MM-DD, for example node utils/inv-import.js file.csv 2015-12-31
The date specified will be used as the date that the purchases were received.
The csv fields that are supported are as follows:
Medication for medicine; other types can be specified, but they should be added in the interface through Admin/Lookup Lists/Inventory TypesMM/DD/YYYYYes if item is gift in kindThe first row of the csv file needs to have the columnName as specified above so that the import tool knows which value is in which column.
There is a utility located under utils/db-to-csv.js that will allow you to dump the database to CSV. To use it, run the following command
node utils/db-dump.js <type> <filename> <dbname>, for example node utils/db-dump.js inventory
The following parameters are supported:
node utils/db-to-csv.js --typesContent type
Image
Digest
Size
105.6 MB
Last updated
over 9 years ago
docker pull anthoor/hospitalrun-server:0.2.0