Running Bahmni with ABDM Integration on Docker
Bahmni successfully completed the ABDM integration process and was certified as an ABDM compliant product on 15th Feb 2022.
This document explains the steps for setting up Bahmni with ABDM services using docker-compose.
Pre-Requisites
Latest Stable version of docker > 20.10.3 installed. Verify by running
docker version
Latest Stable version of docker compose v2 installed. Verify by running
docker compose version
Latest Stable version of git installed. Verify by running
git --version
Sandbox registration in ABDM Ecosystem
Visit this link to sign up. Sandbox- Request form
Define HIP and HIU services. https://sandbox.abdm.gov.in/docs/getting_started_with_apis
(Optional) Download and setup Postman Collection. https://sandbox.abdm.gov.in/docs/postman_collections
Training
See this: ABDM and Bahmni (Training)
Setting up the callback URL
ABDM Integration requires a publicly available URL for the Gateway to callback the services and to allow other HIPs to push data to HIU. The URL should have a valid SSL certificate.
Using Ngrok
Callbacks on Ngrok are no longer supported by ABDM for technical reasons. Need to find an alternate solution
If you don’t have a domain registered, but want to try out ABDM features, you can use Ngrok which tunnels requests to your local machine. The SSL termination happens at Ngrok level.
Install Ngrok Download ngrok
Setup Ngrok Auth Quickstart | ngrok documentation
Start ngrok to expose port 443 by running
ngrok http 443
. Keep the terminal window running. Note this exposes your application running on port 443 to the public internet. Be careful of any sensitive data.You will get a URL on the screen. Copy that.
You will get a URL in the format <*>.in.ngrok.io. Add /hiprovider to the URL. The final URL should look like
https://<hash>.in.ngrok.io/hiprovider
.This is your callback URLFollow the steps in this page under
Updating your Health Repository URL
section to define your callback URL.
Using your own domain
If you have a domain already registered and you have a public IP to your instance, you can use the same URL as the callback URL. The important point to note here is you need to have a valid SSL certificate for the domain.
Refer this video on setting up SSL certificate with Bahmni on Docker.
Add /hiprovider to your URL. The final URL should look like
https://<your-domain>/hiprovider
.This is your callback URL.Follow the steps in this page under
Updating your Health Repository URL
section to define your callback URL.
Starting Bahmni Services
1. Clone the repository
The docker-compose for running Bahmni with ABDM services is available in BahmniIndiaDistro/bahmni-india-package
Clone the repo by running the following command
git clone https://github.com/BahmniIndiaDistro/bahmni-india-package.git
cd bahmni-india-package
2. Update the .env file with your ABDM Sandbox details
Update secrets
Open the .env file in a file editor
Find for the key
ABDM_GATEWAY_CLIENT_ID
and set the value with your client IDFind for the key
ABDM_GATEWAY_CLIENT_SECRET
and set the value with your client secret
Update HIP ID and HIU ID
Open the .env file in a file editor
Find for the key
HIP_ID
and set the value with the Facility HIP ID you defined in the pre-requisites stepFind for the key
HIU_ID
and set the value with the Facility HUI ID you defined in the pre-requisites stepFind for the key
HIU_NAME
and set the value with the Facility Name you defined in the pre-requisites step
Update Data Push URL (Need only if you are implementing HIU flows)
Open the .env file in a file editor
Find for the key
HIU_DATA_PUSH_URL
and set the value ashttps://<your-domain>/hiu-api/data/notification
(or)https://<hash>.in.ngrok.io/hiu-api/data/notification
depending on your configuration.
Note: Make sure to update localhost with your-domain HIU_BACKEND_BASE_URL=https://<your-domain>/hiu-api
3. Start Bahmni EMR Services
First it is recommended to start the Bahmni EMR components and then start the ADBM services. You can start the emr services alone by running the following command. This should be run from the bahmni-india-package
directory.
docker compose up -d
After 5-10 minutes you should see be able to access Bahmni EMR on https://localhost
4. Start ABDM Services
Now once you have the EMR up and running, you can start the ABDM services.
a. Open the .env file in file editor.
b. Update the COMPOSE_PROFILES key with abdm. It should look like COMPOSE_PROFILES=emr,abdm
c. Save the file
Now from the bahmni-india-package directory run the following command.
docker compose up -d
You can check the status of the services by running docker compose ps
.
ABDM Role: Ensure to assign ABDM
role to the user to view the ABDM features
First Time Error: Note for the first time some services would exit with an error. If you see some containers in exit state you can start them again by running docker compose up -d
.
The Bahmni documentation is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)