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'
# install last version of fhirbase
curl https://raw.githubusercontent.com/fhirbase/fhirbase-build/master/fhirbase.sql | psql -d test
# 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 according to its documentation or check you already have it.
vagrant -v
# Vagrant 1.7.2
  1. Clone FHIRbase project and go to the project folder.
git clone https://github.com/fhirbase/fhirbase.git
cd fhirbase
  1. Launch vagrant.
sudo vagrant up
# this action could take a time to load fhirbase container
  1. Check your ssh-config settings and remember your ip.
vagrant ssh-config
# HostName 172.17.0.15 <<- vm <ip>
#  User vagrant
#  Port 22
  1. Use your in the next command to connect to the database.
psql -h <ip> -p 5432 -U fhirbase
# password: fhirbase

(6). If you like GU interfaces use pgadmin with connection * host: * database: fhirbase * user: fhirbase * password: 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:

  sudo docker run --name=fhirbase -p 5433:5432 -d fhirbase/fhirbase-build:0.0.9-alpha4
  sudo docker run --name=fhirbase -p 5433:5432 -d fhirbase/fhirbase
  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
  1. 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
  1. Then login and create app
heroku login
heroku apps:create <your-app-name>
  1. Create PostgreSQL 9.4 database.
heroku addons:add heroku-postgresql --app your-app-name --version=9.4
  1. 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()'