Skip to content

An Instant OpenHIE Template Package from which to build custom packages. This template will also demonstrate a few component config import scenarios.

License

Notifications You must be signed in to change notification settings

jembi/instant-openhie-template-package

Repository files navigation

instant-openhie-template-package

An Instant OpenHIE Template Package from which to build custom packages.

Prerequisites

Before using this template, we suggest you read through this guide on creating packages to understand the structure and content of Instant OpenHIE packages.

We also recommend you have the following available to follow along:

  • Fast uncapped internet connection
  • Linux operating system
  • Docker & Docker Compose installed
  • Kubernetes installed

Template purpose

This template package aims to demonstrate two Instant OpenHIE Package config methods, namely config file and API.

API config

To demonstrate a scripted API configuration, we'll be configuring a new channel in the OpenHIM. This config is done using our importer docker container. This container does a check to see whether the service is running before running a config NodeJS script which handles the API interactions. In the case of the OpenHIM, the container checks the OpenHIM Core heartbeat is successful before running the config. The NodeJS script reads the openhim-import.json file and POSTs the data to the OpenHIM /metadata endpoint. You can confirm the import was successful by logging into the OpenHIM Console and inspecting the Channels page.

File config

To demonstrate adding new file config, we will be starting up a simple node http server listening on port 9090. This server will respond with a message when it receives a request. The message returned depends on the state of the server's config file. When the server starts up, it will have no config file and will return the default message "Default server config" when triggered. After 30 seconds pause (to allow for a quick user inspection), the script will add the config file to the shared volume and restart the container.

During the 30 second script pause, run the following command to see the default server message.

curl http://localhost:5001/template -H "Authorization: Custom test"

Then run the curl command again after the script completes to see the configured server response.

Setup

  1. Clone the template package git repo.

  2. Download the deploy script and move it into an easily accessible place (preferably in the parent directory of the template package directory).

  3. Open up a terminal and navigate to the directory containing the deploy.sh script.

  4. Change the file permissions of deploy.sh to allow it to be executed

    chmod 700 deploy.sh
  5. Get the relative path from your working directory to this template package.

  6. Run the command below to initialise Instant OpenHIE with our custom package template.

    Docker:

    ./deploy.sh init -t docker template -c="<file/path>"

    Kubernetes:

    ./deploy.sh init -t k8s template -c="<file/path>"

    Substitute in your file path into the -c flag

About

An Instant OpenHIE Template Package from which to build custom packages. This template will also demonstrate a few component config import scenarios.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published