Giter Site home page Giter Site logo

hospitalrun-server's Introduction

HosptialRun Server

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:

  1. Use Google OAuth for user authentication.
  2. Provide a proxy for CouchDB.
  3. Integrate with ElasticSearch for better search capability.
  4. The capabilty to define CouchDB database listeners that react to changes in the database. At present, there are 3 database listeners, located in the dblisteners directory:
  • file-upload - Uploads patient images to the server
  • lookup-import - Utility to import lookup lists from the frontend.
  • merge-conflicts - Checks for couchdb conflicts and resolves using a strategy of accepting the last change at a field level.

##Installation

  1. The HospitalRun server expects that the HospitalRun frontend is available in server/public and has been compiled using the command:
ember build --environment production --output-path ../server/public

This assumes that you have frontend and server in the same parent directory. You could specify another directory as the output path in frontend and then use a symbolic link in server/public to point to your production build.

  1. Run npm install to install the HospitalRun dependencies
  2. In the server directory copy config-example.js to config.js and configure db passwords etc in config.js
  3. 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
  4. Search on the HospitalRun Server uses elasticsearch. You will also need the CouchDB River Plugin for Elasticsearch and the JavaScript language Plugin for elasticsearch. If you are installing on a debian server you can use the following steps to setup elasticsearch and java (if needed):
wget -qO - https://packages.elasticsearch.org/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb http://packages.elastic.co/elasticsearch/1.4/debian stable main" | sudo tee -a /etc/apt/sources.list
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer elasticsearch
sudo update-rc.d elasticsearch defaults 95 10
cd /usr/share/elasticsearch/
sudo bin/plugin install elasticsearch/elasticsearch-river-couchdb/2.4.2
sudo bin/plugin -install elasticsearch/elasticsearch-lang-javascript/2.4.1
  1. Add the following line to /etc/elasticsearch/elasticsearch.yml (or wherever your elasticsearch configuration is located):
script.disable_dynamic: false
  1. Start elasticsearch. On debian/ubuntu: service elasticsearch start
  2. Run the setup script for linking couchdb to elasticsearch. You will need to specify the username and password for the hosptialrun admin account you created with initcouch.sh in HospitalRun/frontend:
/server/utils/elasticsearch.sh hradmin password

hospitalrun-server's People

Contributors

jkleinsc avatar

Watchers

James Cloos avatar Dave Kerr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.