• Stars
    star
    116
  • Rank 303,894 (Top 6 %)
  • Language Smarty
  • License
    Other
  • Created over 6 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Docker based sandbox for smart apps

SMART Dev Sandbox

The SMART Dev Sandbox is an open source, Docker based version of the SMART Sandbox that can be installed locally on your machine to facilitate offline development and the use of custom data sets. Please note that it is not designed for clinical use and should not be used to store or access patient medical data.

This tool supplements the free online sandbox at https://launch.smarthealthit.org and packages together the SMART launcher front end, DSTU2, STU3, R4 and R5 FHIR servers based on the excellent http://hapifhir.io project, sample patient data, an integrated web based interface to browse these sample patients, and a web based FHIR data explorer. Additionally, these components can be set up individually from the SMART docker images repository at https://hub.docker.com/u/smartonfhir/ (for example, to run a local FHIR server you can type docker run -it -p 8080:8080 smartonfhir/hapi-5:r3-full).

Check it out and please open issues on Github if you have suggestions or run into any problems!

SMART Dev-Sandbox

System requirements

The hardware requirements are mostly depending on the number and kind of HAPI servers that you want to run. We support 3 different servers for each FHIR version, each of which may require gigabytes of memory and multiple CPU cores. These are configurable in the .env file. You should disable servers that you don't need and give as much resources as you can to the remaining server(s).

Configuration

The sandbox behavior is determined on startup using environment variables. These variables are defined in the configuration file called .env. Once you make changes, you will need to restart the sandbox using docker-compose down and docker-compose up. If you change the used databases (by selecting different HAPI images) you may also have to delete previous containers and volumes as described below.

Start the Dev Sandbox

  1. If you don't already have Docker on your system, download and install it from https://store.docker.com/search?type=edition&offering=community
  2. If you don't already have Git on your system, download and install it from https://git-scm.com/downloads
  3. Clone this project
    git clone https://github.com/smart-on-fhir/smart-dev-sandbox.git
  4. Change to the new directory
    cd smart-dev-sandbox
  5. Start the Docker containers
    docker-compose up
  6. It might take some time to download all the images on the first run. After that, it probably takes a minute to start all the services.
  7. Open http://localhost:4000 in your browser to access the sandbox.

Stop the Dev Sandbox

To stop a running sandbox press Ctrl+C. Eventually, you should see something like (depends on what services you have enabled):

Stopping launcher        ... done
Stopping hapi-r4         ... done
Stopping hapi-r3         ... done
Stopping hapi-r2         ... done
Stopping patient-browser ... done
Stopping home-page       ... done
Stopping fhir-viewer     ... done

If you don't see this output, then you will have to stop the services manually. To do so, run docker-compose down.

FHIR Data

The HAPI FHIR servers are pre-populated with a set of sample patients and store data in Docker volumes. You can change the configuration to start the sandbox without any existing data.

Choosing a dataset

By default the servers will start with their "full database" that includes various generated datasets. To reduce the number of pre-inserted patients (or to start with an empty database) you need to change a configuration variable in the .env file. The name of that variable is:

  • For DSTU2 - R2_IMAGE
  • For STU3 - R3_IMAGE
  • For r4 - R4_IMAGE

Please read the comments above that variable declaration to find out more about its possible values.

WARNING

The databases are stored in Docker volumes. Once you start a server (as part of the sandbox), a volume will be created and persisted across further restarts. If you then decide to use a different database and change the RX_IMAGE (where X is the numeric FHIR version) variable the sandbox may continue to use the already existing database which leads to unpredictable behavior. To avoid that you need to remove the volume and the container that created it first. For example for STU3 run:

docker container rm hapi-r3
docker volume rm smart-dev-sandbox_r3-database

Then start the sandbox as usual using docker-compose up. Note that the same can also be used to reset a server to its initial state and quickly discard any changes that you have made to the data.

Configuring the Patient Browser

The patient browser can filter the sample data in many ways, including by medical condition. To update the browser's autocomplete functionality after inserting or modifying patients, install NodeJS and run the following commands:

cd ./patient-browser

# run this the first time
npm i

# then, while the sandbox is running, to update conditions run:

# for STU2
node sync-conditions -s 2

# for STU3
node sync-conditions -s 3

# for R4
node sync-conditions -s 4

# When done restart the sandbox
cd ..
docker-compose down
docker-compose up

Hosting the Sandbox

By default everything runs on localhost but you can change that by updating the HOST variable. There could be multiple reasons for wanting to do that. For example:

  1. You want the sandbox to be available on specific domain, say sandbox.dev. In this case add an entry to your hosts file to map sandbox.dev to 127.0.0.1 and set HOST in .env to sandbox.dev.
  2. You want the sandbox to be accessible from every machine in your local network. Fond your LAN IP, set it as HOST in your .env file and restart the sandbox.
  3. You want to put everything behind a proxy (perhaps to also enable SSL connections):
    1. Set up a proxy server (typically NginX or Apache) and configure it to pass requests up to localhost:port for each service that you enable.
    2. Set HOST in your .env file to the domain that your proxy server is listening to.
    3. (Re)start the sandbox.

Using Standalone Docker Images

This project composes multiple Docker images together. It is also possible to use a subset of the images by setting the XX_ENABLED variable to 0 where XX is the name of the service that you want to exclude.

Since the images are available on the Docker hub at https://hub.docker.com/u/smartonfhir/ you can also use them directly. For example, to start just a local STU3 HAPI FHIR server, simply run:

docker run -it -p 8080:8080 smartonfhir/hapi-5:r3-full

Running the Dev Sandbox with TLS

In docker-compose.yml:

  • Change the values for LAUNCHER_BASE_URL and BASE_URL to https

  • Add a line in the smart-launcher section below STU4_ENABLED:

    SSL_PORT : ${LAUNCHER_PORT}

  • change the ports line below that to:

    - $LAUNCHER_PORT:$LAUNCHER_PORT

In www/template.html:

  • Search and replace http://$HOST:$LAUNCHER_PORT to https://$HOST:$LAUNCHER_PORT

And then docker compose up normally. Your launcher and fhir proxy will now be running with a self-signed certificate (that you'll have to approve of course).

More Repositories

1

client-py

Python SMART on FHIR client
Python
588
star
2

health-cards

Health Cards Framework: implementation guide and supporting material
TypeScript
259
star
3

Swift-FHIR

These are Swift classes for data models of FHIR elements and resources
Swift
159
star
4

fhir-parser

A Python FHIR specification parser and class generator
Python
149
star
5

Swift-SMART

Swift SMART on FHIR framework for iOS and OS X
Swift
125
star
6

api-server

Open-source FHIR Server to support patient- and clinician-facing apps
Groovy
104
star
7

patient-browser

JavaScript
83
star
8

smart-on-fhir.github.io

SMART on FHIR Docs
Jupyter Notebook
77
star
9

fhir-bulk-data-docs

Documentation and issue tracking for the emerging FHIR bulk data implementation guide
Jupyter Notebook
74
star
10

health-cards-dev-tools

Developer tools for validating SMART Health Cards
TypeScript
71
star
11

growth-chart-app

JavaScript
66
star
12

sample-apps-stu3

Collection of simple sample apps
JavaScript
46
star
13

fred

FRED - FHIR Resource Editor
JavaScript
44
star
14

health-cards-tests

Demo for health wallet with Verifiable Credentials and Decentralized Identifiers
TypeScript
43
star
15

bulk-data-server

JavaScript
42
star
16

fhir-server-dashboard

Presents a human-readable representation of the data in a FHIR server.
JavaScript
41
star
17

fhir-viewer

In-browser viewer for FHIR resources
JavaScript
39
star
18

installer

Shell
39
star
19

hapi

HAPI FHIR Server With Sample Patients
Dockerfile
37
star
20

SoF-Demo

Simple SMART on FHIR / Argonaut iOS sample app that fetches a couple of resources
Swift
36
star
21

smart-launcher

Launcher for SMART apps
JavaScript
33
star
22

smart-scheduling-links

Clinical Appointment Slot Discovery
TypeScript
28
star
23

sample-apps

HTML
25
star
24

cardiac-risk-app

JavaScript
25
star
25

generated-sample-data

Contains all the bundles that are loaded into the FHIR server
24
star
26

bulk-data-tools

HTML
23
star
27

smart-examples

Collection of public apps
JavaScript
14
star
28

client-node

SMART client for NodeJS
HTML
13
star
29

bulk-import

12
star
30

bulk-data-implementations

listing of bulk FHIR client implementations
12
star
31

bulk-data-client

JavaScript
11
star
32

tag-uploader

Adds tags to FHIR bundles and resources and uploads them to specified servers
JavaScript
9
star
33

sample-patients-stu3

Python
9
star
34

client-ts

FHIR Client Library
HTML
9
star
35

bp-centiles-app

JavaScript
8
star
36

cumulus-etl

Extract FHIR data, Transform with NLP and DEID tools, and then Load FHIR data into a SQL Database for analysis
Python
8
star
37

diabetes-monograph-app

JavaScript
7
star
38

fhir-starter

HTML
7
star
39

smart-launcher-v2

SMART Launcher
TypeScript
6
star
40

smart-local-sandbox

Docker based sandbox for smart apps
JavaScript
6
star
41

health-cards-designs

5
star
42

smart-hapi-stack

Experimental HAPI stack to support SMART on FHIR
Java
5
star
43

sample-bulk-fhir-datasets

Sample bulk export results of various sizes, for testing tools and workflows
Shell
5
star
44

bdt

Bulk Data Test Suite and Test Runner
TypeScript
5
star
45

sample-patients-prom

Provisional Quarterly Patient Reported Outcome Measures (PROMs) in England - April 2015 to March 2016, November 2016 release
JavaScript
5
star
46

smart-stub

Node / Express server to stub SMART Auth
JavaScript
4
star
47

mpr-monitor-app

JavaScript
4
star
48

dstu2-examples

Copy of official FHIR examples with an index page
HTML
4
star
49

synthea

Static build of Synthea with http interface
JavaScript
4
star
50

hca-fhir-importer

Import synthetic breast cancer sample data, courtesy of HCA/Bill Gregg
Python
4
star
51

fhir-demo-app

ApacheConf
3
star
52

smart-health-card-decoder

Sample code for a SMART Health Card validator
JavaScript
3
star
53

smart-health-links

Static documentation site for SMART Health Links
JavaScript
3
star
54

ehi-app

EHI Export API Client Reference Implementation
TypeScript
3
star
55

ehi-server

An EHI export server reference implementation of Argonaut's EHI Export API IG
TypeScript
3
star
56

bulk-import-client

CLI Client app for Bulk Data Import
JavaScript
2
star
57

confidential-client-example

JavaScript
2
star
58

fiery-sublime

Sublime Text 3 Plugin for FHIR data models
Python
2
star
59

disease-monograph-app

JavaScript
2
star
60

fhir-crawler

Utility to download resources from a FHIR server
TypeScript
1
star
61

fhir-server-tasks

Maintenance web-hooks for FHIR servers
JavaScript
1
star
62

timeshift

Shift dates in FHIR datasets
JavaScript
1
star
63

client-js-examples

Contains examples of how to use the client-js library
HTML
1
star
64

registry

Registry of FHIR Profiles for SMART Platforms
HTML
1
star
65

bulk-import-consumer

Bulk Data Import Server (Data Consumer)
JavaScript
1
star
66

reachnet

JavaScript
1
star
67

cumulus-library-hypertension

Hypertension case definition to support CDC chronic disease management and CMS measures
Python
1
star