DHIS 2 integration on bahmni docker

I’ve previously used the documentation from https://bahmni.atlassian.net/wiki/spaces/BAH/pages/116694133/Bahmni+-+DHIS2+Integration to integrate DHIS 2 to bahmni. But i’m currently working on bahmni docker project and i want to ship the integration as service with the rest of the services. Is there a docker specific integration or should i build the installation in a container my self.

Bahmni - DHIS2 integration is a popular requirement and people do want this. The document you referred is a good starting point.

If the integration is architecturally implemented as its own independent service, then its a good idea to create a separate docker container/service, and then include it in docker compose (like other bahmni services).

You can read this documentation as an example on how to create a docker container / publish it on dockerhub: GitHub - Bahmni/default-config: Default configuration setup for bahmni.

Once the container is built/published on docker hub, you can include it in docker compose file and try it out. If all this works well, please publish/share what you did – and Bahmni team can reivew/decide if this should become standard product service/not.

cc: @mohant @angshuonline @binduak – thoughts?

Yes that’s what i’m working on right now. I have used the docker image of dhis2 to and dhi2-db to run along side the bahmni-standard services. But i think the dhis-integration project is supposed to be run on the vagrant setup. Is it best to try to change that project to a docker image or is there a better way i could go about it? I’ll create a repo and share it with u once i get it up and running. Thanks.

The dhis-integration-project seems to be published by PossibleHealth as an rpm, which means it needs to be installed on an rpm based OS (like CentOS/RedHat). You can run it on Vagrant also (but that means a heavy OS outside of Docker network).

You could install this rpm in a vanilla centos docker image:

And in docker-compose, put reference to this new image (and DHIS2 images), so from networking purposes, Bahmni services can access this integration service, and DHIS2 docker services.

As per DHIS2 integration wiki pages, the other changes like report changes (bahmni_config container) or httpd changes (apache web container), etc will need to be made.

I hope this helps.

Thanks.

  1. I did that and i couldn’t access the integration from http://localhost:8040/dhis-integration/ which is where /dhis-integration url will be directed to.
  2. On which container volume should i put dhis-integration.yml and dhis_integration_ssl.conf (bahmni-web?) files

*edit: I think the dhis-integration expects bahmni vagrant to be up and running before its installed. But i want to run it stand-alone since im using the docker project for the other services. Is there a way to specifically just the server from bahmni and install dhis-integration. And ill do the proxy from the bahmni-web service

Thinking about build https://github.dev/Possiblehealth/dhis2-integration as a jar file and use https://spring.io/guides/topicals/spring-boot-docker/ to spring boot it. Is that a good way to go about it?

*edit: @gsluthra This worked for me. Ill create a repo and build a docker image which you can include to bahmni-docker as dhis2-integration. I’ll share it to u once i’ve pushed it to dockerhub.

If you can make the dhis2 integration run locally with java/Spring, then yes, instead of rpm based packaging and centos, you can just use plain java docker container and load the dhis2-integration code there. Will be more lightweight than the centos/rpm option. See this:

Amazon provided jdk images:

  1. Getting Started with Amazon Corretto 11 on Docker Images - Amazon Corretto
  2. AmazonCorretto

Thanks. Thats what i’m currently using. I have built the docker from openjdk image. I think it’s light weight enough. And it works locally but i’m testing it.

I’ve unset the solved checkbox due to one addition issue I’m facing. All the container are running and are accessible. The problem is i’ve put a proxy pass on proxy apache2 config and its pointing to dhis-integration. like:

ProxyPass /dhis-integration/ http://host.docker.internal:8041/dhis-integration/
ProxyPassReverse /dhis-integration/ http://host.docker.internal:8041/dhis-integration/

Im able to access dhis-integration page just before it redirects to the login page. Did further digging and the proxy is actually feeding dhis-integration the wrong cookie jsessionid. It removes the correct session id and just provides reporting_session as JSESSIONID which the integration uses to make requests to openmrs rest and get 401 unauthorized. Any reason this might be happening

The reporting_session is a copy of OpenMRS sessionid, which is used by other systems like reports to authenticate with openmrs. Can you please check in the requests tab on what is key of the cookie set by dhis2-integration?

I’ve decided to move on from my first approach and I experimented with a custom implementation which looks like this

Which works beautifully with Bahmni Docker and DHIS2 instance. Let me know if this meets Bahmni standards.

1 Like

@yohannes.suraphel Looks interesting. It would be better if you can showcase / demo this at a high level during one of the PAT call to understand more on the architecture and the approach you have taken. If possible please demo in it tomorrow’s PAT call happening at 6.30PM IST.

cc. @angshuonline @gsluthra @akhilmalhotra

Thanks

@mohant, Thanks for you interest. We are doing this for an organization whose approval we need. I will reply to this thread when that is granted. Hopefully I will be able to demo it for you next week.

Hi @yohannes.suraphel - Can you share a short video recording for the community to understand / appreciate what you achieved with Bahmni-DHIS2 integration? Alternatively, please consider attending one of the upcoming PAT calls to showcase this. Thanks! :slight_smile: