Skip to content

The Open Health Information Mediator core component. OpenHIM Support: Post your query on OpenHIE Discourse using the #openhim tag https://discourse.ohie.org/

License

Notifications You must be signed in to change notification settings

jembi/openhim-core-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Dependency Status devDependency Status

OpenHIM Core Component

The OpenHIM core component is responsible for providing a single entry-point into an HIE as well as providing the following key features:

  • Point of service client authentication and authorization
  • Persistence and audit logging of all messages that flow through the OpenHIM
  • Routing of messages to the correct service provider (be it an HIM orchestrator for further orchestration or the actual intended service provider)

⚠️ The OpenHIM core is currently in early active development and is not yet ready for production use.

Quickstart Guide

  1. Install Node.js 0.11.9 or greater
  2. Clone the https://github.com/jembi/openhim-core-js.git repository or download the code to the desired location
  3. Install and start MongoDB
  4. Install the dependencies by running npm install
  5. Start the server by running node --harmony lib/server.js

Installation and Development

Clone the https://github.com/jembi/openhim-core-js.git repository or download the code.

Prerequisites

The OpenHIM core makes use of the Koa framework, which requires node version 0.11.9 or greater. Node also has to be run with the --harmony flag for this allocation to work.

The easiest way to use the latest version of node is to install nvm. On Ubuntu, you can install using the install script but you have to add [[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh # This loads NVM to the end of your ~/.bashrc file as well.

Once nvm is installed, run the following:

nvm install 0.11

nvm alias default 0.11

The latest version of node 0.11 should now be installed and set as default. The next step is to get all the required dependencies using npm. Navigate to the directory where the openhim-core-js source is located and run the following:

npm install

In order to run the OpenHIM core server, MongoDB must be installed and running.

Installing MongoDB

Skip this section if you have already installed MongoDB

For further information see the MongoDB installation documentation.

Starting MongoDB

For more information see the MongoDB getting started guide.

Testing

This step is optional but recommended to ensure that the system is running as expected. To run the tests see the Testing section below.

Running the server

Once all the prerequisites have been installed, configured and started, run the OpenHIM core server by executing the following:

node --harmony lib/server.js

The server will by default start in development mode using the mongodb database 'openhim-development'. To start the serve in production mode use the following:

NODE_ENV=production node --harmony lib/server.js

This starts the server with production defaults, including the use of the production mongodb database called 'openhim'.

Testing

This project uses mocha as a unit testing framework with should.js for assertions and sinon.js for spies and mocks. The tests can be run using either npm or cake.

To run the tests using npm execute npm test.

The project is build and tested using cake, if you want to run cake directly, you will need CoffeeScript. Install CoffeeScript by executing the following:

npm install -g coffee-script (omit the -g if you don't wish to install globally)

See the CoffeScript website for more further information.

You can have the CoffeeScript files in src/ auto compile as you save them by running:

cake watch

Design

To see some design docs refer to the OpenHIE wiki pages:

About

The Open Health Information Mediator core component. OpenHIM Support: Post your query on OpenHIE Discourse using the #openhim tag https://discourse.ohie.org/

Resources

License

Stars

Watchers

Forks

Packages

No packages published