HSPC Sandbox container in Mac and Windows

Install Docker from https://www.docker.com/products/docker#mac

If you are not familiar with Docker, read and study https://docs.docker.com/engine/getstarted/ - This goes through the "getting started" support of Docker, with Kitematic, the new GUI interface engine.

The first instructions below are for Kitematic (for Mac, Windows is similar), but they are incomplete...  If you are already comfortable with the command-line version of Docker, then you can probably use the Linux instructions on the separate page at HSPC Sandbox container.

1. If you want to use the new Kitematic GUI interface, then this what you will see in the Mac Applications Folder : 

  

Click on the Kitematic button, and you will get this:

    

Any Docker containers that are already installed are listed on the left-hand side.  You can start a container that is already installed by selecting it, and clicking the start button that appears.  There is also another button that will appear when you click in the left-hand side of the window for adding a new Docker image from the official Docker repository.

2. The rest of these instructions are for the use of the command-line tool started by clicking the "Docker Quickstart Terminal" button shown above.

 

Start Docker from the Mac applications folder, and select the Docker Quickstart Terminal icon:

  1. Determine a <parent directory> where you want to have the <hspc-docker local> installed. 
  2. In a separate terminal, change directories to the <parent directory>. 
  3. Copy the archive file furnished by Salvador to the <parent directory>, and expand it. 
  4. Switch back to the Docker terminal, and change directories to the expanded <hspc-docker local> directory:
  5. Build the hspc image in the Docker terminal:
Mac Start Docker Quickstart Terminal
cd <hspc-docker localpath>
docker build -t="opencds/hspc" .

Create volume for hspc mysql data:

Mac Start Docker Quickstart Terminal
docker create -v /var/lib/mysql --name hspc-mysql-data opencds/hspc /bin/true

Create volume for hspc webapps:

Mac Start Docker Quickstart Terminal
docker create -v /usr/local/tomcat/webapps --name hspc-webapps opencds/hspc /bin/true

Create hspc container:

Mac Start Docker Quickstart Terminal
docker run --volumes-from hspc-webapps --volumes-from hspc-mysql-data -d -p 8080:8080 --name hspc opencds/hspc

3. Populate patients:

a. Open a separate command prompt (NOT the Docker Quickstart Prompt), and change to a directory that is not internal to the hspc-webapps location you created above.

b. Using GIT, clone project bitbucket.org/hspconsortium/tools.git (in my case, it is something like this:  git clone https://davidshields@bitbucket.org/hspconsortium/tools.git)

c. Compile the tools (and save this project so that you don't have to re-do it later, because it takes along time to create and load all the data into mysql):

Mac Start Docker Quickstart Terminal
mvn clean install

 

d. Change to the tools/target subdirectory

Mac Start Docker Quickstart Terminal
cd tools/target

 

e. Load data

Mac Start Docker Quickstart Terminal
java -jar hspc-tools.jar org.hspconsortium.DataLoad -url http://localhost:8080/hspc-reference-api/data


f. Load dstu2/usecase/schedule

Mac Start Docker Quickstart Terminal
java -jar hspc-tools.jar org.hspconsortium.DataLoad -url http://localhost:8080/hspc-reference-api/data -in datapack/dstu2/usecase/schedule


g. Load dstu2/starter

Mac Start Docker Quickstart Terminal
java -jar hspc-tools.jar org.hspconsortium.DataLoad -url http://localhost:8080/hspc-reference-api/data -in datapack/dstu2/starter


4. Verify Correct Installation:

Create container:
docker inspect hspc
Import sample patient data:
# The sandbox must be running cd hspc/hsp-tools/tools/target java -jar hsp-tools.jar org.hspconsortium.DataLoad -url http://localhost:8080/hsp-api/data

Test the Installation

  1. Open a browser and go to: http://localhost:8080/hsp-reference-apps
  2. Log in with "demo/demo"
  3. Select a patient 
  4. Select an application

Issue a Test Query Against Your Unsecured RESTful API Server
http://localhost:8080/hsp-api/data/Patient?_format=json - This should result in aJSON FHIR bundle containing all the default patients in the system.