Dockerized OpenHIM Mediators

Hello All,

We are trying to include OpenHIM in an environment where they preferably use Docker. After talking with a few folks from Jembi we were able to locate a docker compose file for the basic OpenHIM install with
openhim-core and openhim-console.

But we need to include a couple mediators as well in the install. I am pretty new to docker and have only conceptual knowledge. After discussing with people working with Docker and giving a brief idea of how
a mediator and openhim core work their suggestion was to use Volumes in docker compose to copy mediator files (usually stored in /usr/share/ and available in github) and a separate volume for implementation specific scripts or resources like shell scripts
(one of the mediator we are using is the Shell script mediator).

I am reaching out to see if anyone in the community have experience with dockerizing mediators or have an idea/best practice examples for this architecture(OpenHIM/Mediators) or how a similar example in docker
would be.

— Thanks and Regards,

**Sri Maurya Kummamuru |Systems Engineer

Tel 317-640-2458 | Skype srimaurya23

image001.png

1101 West Tenth Street

Indianapolis, IN 46202

Web and email addresses, and phone numbers will remain the same.

Tel 317-274-9234 | Fax 317-274-9303

Twitter: @Regenstrief | Facebook.com/regenstriefinstitute

www.regenstrief.org

Confidentiality Notice: The contents of this message and any files transmitted with it may contain confidential and/or privileged information and are intended solely
for the use of the named addressee(s). Additionally, the information contained herein may have been disclosed to you from medical records with confidentiality protected by federal and state laws. Federal regulations and State laws prohibit you from making
further disclosure of such information without the specific written consent of the person to whom the information pertains or as otherwise permitted by such regulations. A general authorization for the release of medical or other information is not sufficient
for this purpose.

If you have received this message in error, please notify the sender by return e-mail and delete the original message. Any retention, disclosure, copying, distribution
or use of this information by anyone other than the intended recipient is strictly prohibited.

Hello @maurya , At openmrs with PLIR andHAPI fHIR we are trying to implement such kind of work, Am also facing this scenario setting up docker environments for openhim mediators,Did you finally succeed with this, is there any documentation that you can share please thanks

1 Like

Hi, We ended up going another route of implementing openhim and its mediators using Ansible roles. There isn’t any documentation and the code is in private repos but this is an example ansible role of how you can deploy the mediators. You need to tweak them to work for your environment or use case. Also, this can be used as a reference of what you need to do to implement in docker -

  - name: download file-queue mediator
get_url:
  url: https://github.com/jembi/openhim-mediator-file-queue/archive/{{ file_queue_mediator_branch_or_tag }}.tar.gz
  dest: /tmp/file-queue-mediator.tar.gz
  timeout: 60
tags: file-queue-mediator

  - name: creates file-queue mediator directory
file: path=/usr/share/openhim-mediator-file-queue state=directory
tags: openhim

  - name: unarchive file-queue mediator
unarchive:
  src: /tmp/file-queue-mediator.tar.gz
  dest: /usr/share/openhim-mediator-file-queue
  extra_opts: --strip-components=1
  remote_src: yes
tags: file-queue-mediator

  - name: add file-queue mediator config
template: src=config.json.j2 dest=/usr/share/openhim-mediator-file-queue/config/config.json
tags: file-queue-mediator

  - name: install git for use in npm install
yum: name=git state=present
tags: file-queue-mediator

  - name: install file-queue mediator dependencies
command: npm install chdir=/usr/share/openhim-mediator-file-queue
tags: file-queue-mediator

  - name: add file-queue mediator service
template: src=openhim-mediator-file-queue.service.j2 dest=/etc/systemd/system/openhim-mediator-file-queue.service
tags: file-queue-mediator

     - name: read new service
command: systemctl daemon-reload
tags: file-queue-mediator

 - name: run file-queue mediator
service: name=openhim-mediator-file-queue state=started enabled=yes
tags: file-queue-mediator

and the service file template used to register the mediator with OpenHIM core and restart it is

[Unit]
Description=File Queue OpenHIM Mediator

[Service]
WorkingDirectory=/usr/share/openhim-mediator-file-queue
ExecStart=/usr/bin/npm start
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=file-queue-mediator
Environment=NODE_ENV=production {{ 'NODE_TLS_REJECT_UNAUTHORIZED=0 ' if (allow_self_signed == 'true') else '' }}

[Install]
WantedBy=multi-user.target

@ryan or @daniel.futerman might have more experience working with docker implementations of OpenHIM and its mediators.

2 Likes

@maurya and @sharfspace

We have released a new tutorial video on YouTube on setting up the Mapping Mediator within a Docker environment. Perhaps this will help you?

Regards,
Matt

3 Likes

Thanks @mattdickie for sharing that :slight_smile:
@sharfspace We’ve started Dockerizing new mediators that we develop, with the Mapping Mediator an example of the approach taken. The Mapping Mediator has been developed as a generic mediator that supports data validation, mapping, and orchestration, and is intended to be adapted based on specific use cases. More details are available here:


3 Likes

Thanks so much @mattdickie , for your response , will surely follow the vedio however it seems its specifically using node js for creating mediator mappings we are looking at a use case of creating a java mediator use scenarios thanks will keep you up to date of findings

2 Likes

Thanks so much @daniel.futerman, will surely deep dive into these links , will update you of my progress about mediator use case

2 Likes