Local


Requirements

Installation steps:

sudo apt-get install postgresql-9.4 postgresql-contrib-9.4 curl
# create local user for ident auth
sudo su postgres -c 'createuser -s <you-local-user>'
# create empty database
psql -d postgres -c 'create database test'

Download latest version of fhirbase.sql

Download

# install last version of fhirbase
psql -d test < fhirbase.sql
# generate tables
psql -d test -c 'SELECT fhir.generate_tables()'

psql test
#> \dt

Here is asci cast for the simplest installation - [https://asciinema.org/a/17236].


Vagrant


The simplest and cross-platform installation can be done using Vagrant.

1. Install Vagrant

Install vagrant according to its documentation or check you already have it

vagrant --version
# Vagrant 1.8.1

2. Clone Fhirbase

Clone Fhirbase project and go to the project folder

git clone https://github.com/fhirbase/fhirbase-plv8.git fhirbase
cd fhirbase

3. Launch vagrant

This action could take a time to load fhirbase container

vagrant up

4. Test installation

Test your Fhirbase installation

echo "SET plv8.start_proc = 'plv8_init'; SELECT fhirbase_version();" \
    | psql postgres://fhir:fhirbase@127.0.0.1:2345/fhir

You should see output with version number of the installed Fhirbase.


Docker


  1. You can install FHIRbase using docker. First you have to install docker itself according to provided documentation (see the installation section).

  2. For this installation we are going to use docker-containers - images, which are stored in the Docker Hub repository or can be built manually. Depending on your goals you can get different docker images:

    • Stable versioned tagged build fhirbase-build. Select the desired tag from tags, for example 0.0.9-alpha4, and run the following command:

      sudo docker run --name=fhirbase -p 5433:5432 -d fhirbase/fhirbase-build:0.0.9-alpha4
      
    • The latest automatically deployed on commit development build fhirbase. Here there is no need to specify any tags. Just use the command below:

      sudo docker run --name=fhirbase -p 5433:5432 -d fhirbase/fhirbase
      
    • The third method is to build an image locally from Dockerfile. First you have to clone FHIRbase project. Then go to the project folder, build an image with name ‘fhirbase’ and tag ‘latest’ and run docker.

      git clone https://github.com/fhirbase/fhirbase/
      cd fhirbase
      sudo docker build -t fhirbase:latest .
      sudo docker run --name=fhirbase -p 5433:5432 -d fhirbase/fhirbase
      
  3. Check installation

    The process of image loading can take some time. When it is finished FHIRbase will be accessible on localhost with the following parameters:

    • port: 5433
    • user: fhirbase
    • password: fhirbase

    You can check that your container is running, connect to FHIRbase and list database tables by the next commands:

    sudo docker inspect fhirbase
    # read <Config.NetworkSettings.IPAddress> and <Config.Image> of started container
    sudo docker run --rm -i -t <Config.Image> psql -h <Config.NetworkSettings.IPAddress> -U fhirbase -p 5432
    \dt
    

    or another way to connect to FHIRbase:

    psql -h localhost -p 5433 -U fhirbase
    \dt
    

    You will see tables of FHIR resources.


Heroku


  1. Register on Heroku.
  2. Please ensure that you have Ruby installed.
  3. Run this from your terminal:

    wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
    
  4. Then login and create app

    heroku login
    heroku apps:create <your-app-name>
    
  5. Create PostgreSQL 9.4 database.

    heroku addons:add heroku-postgresql --app your-app-name --version=9.4
    
  6. Find YOUR-DB-NAME at https://postgres.heroku.com/databases. Then restore fhirbase dump and generate tables.

    curl https://raw.githubusercontent.com/fhirbase/fhirbase-build/master/fhirbase.sql \
      | pg:psql --app your-app-name YOUR-DB-NAME
    heroku pg:psql --app your-app-name YOUR-DB-NAME --command 'SELECT fhir.generate_tables()'