Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: updated ocl mediator install instructions

...

 

Role within DATIM

Mediator

Scripts

API Endpoints

DATIM-OCL Sync

Process shell scripts to perform synchronization requests between DATIM DHIS2 and OCL

openhim-mediator-shell-script

A generic mediator developed by Jembi that can execute shell scripts.

  • datim-sync-mer

  • datim-sync-sims

  • datim-sync-mechanisms

 

DATIM-OCL Export

Used when a person or a computer hits a specific link.  It generates exports for IMAP exports and MER landing page on OHIE Metadata Clearinghouse

openhim-mediator-landing-page

Extension of the openhim-mediator-shell-script that adds support for including URL parameters in the request that are passed on to the scripts.

  • datim-imap-export

  • show-mechanisms

  • show-mer

  • show-sims

  • show-tieredsupport

 

DATIM-OCL IMAP Import

Process IMAP (indicator map) import and status requests.

openhim-mediator-imap-import



  • datim-imap-import

  • datim-imap-status

 

Results Transformation Service

Used by transformation service to map incoming data files from MOH to Datim indicators

openhim-mediator-ocl



??

 

A. Installation

A.1. Installing Mediators

A.1.1. Installing Shell Script Mediator

 

Code Block
languagebash
sudo git clone https://github.com/jembi/openhim-mediator-shell-script.git /usr/share/openhim-mediator-shell-script
sudo vim /usr/share/openhim-mediator-shell-script/config/default.json # Add openhim username, password and url
cd /usr/share/openhim-mediator-shell-script/
sudo  npm install
sudo mkdir /etc/openhim
sudo wget https://raw.githubusercontent.com/jembi/openhim-mediator-shell-script/master/config/default.json
sudo mv default.json /etc/openhim/mediator-shell-script.json
sudo vim /etc/systemd/system/openhim-mediator-shell-script.service
Code Block
languagetext
[Unit]
Description=OpenHIM shell-script mediator
[Service]
WorkingDirectory=/usr/share/openhim-mediator-shell-script
ExecStart=/usr/bin/npm start
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=shell-script-mediator
Environment=NODE_ENV=production
[Install]
Code Block
languagebash
sudo systemctl start openhim-mediator-shell-script
sudo mkdir /opt/openhim-shell-scripts
cd /opt/
sudo git clone https://github.com/OpenConceptLab/ocl_datim.git
sudo chown -R centos:centos /opt/ocl_datim/
sudo chown -R centos:centos /opt/openhim-shell-scripts/
sudo su centos
vim /opt/openhim-shell-scripts/datim-sync-mer.sh
	#!/bin/sh
	python /opt/ocl_datim/syncmer.py true
vim /opt/openhim-shell-scripts/datim-sync-sims.sh
	#!/bin/sh
	python /opt/ocl_datim/syncsims.py true
vim /opt/openhim-shell-scripts/datim-sync-mechanisms.sh
	#!/bin/sh
	python /opt/ocl_datim/syncmechanisms.py true
exit
sudo chmod ug+x datim-sync-mer.sh
sudo chmod ug+x datim-sync-sims.sh
sudo chmod ug+x datim-sync-mechanisms.sh
sudo yum -y install python-pip
cd /opt/ocl_datim/
sudo pip install -r requirements.txt


A.1.2. Installing Landing page mediator


Code Block
languagebash
sudo git clone https://github.com/maurya/openhim-mediator-landing-page.git /usr/share/openhim-mediator-landing-page
sudo vim /usr/share/openhim-mediator-landing-page/config/default.json #Add openhim username, password and url
cd /usr/share/openhim-mediator-landing-page/
sudo  npm install
sudo vim /etc/systemd/system/openhim-mediator-landing-page.service 
Code Block
languagetext
[Unit]
Description=OpenHIM landing page mediator
[Service]
WorkingDirectory=/usr/share/openhim-mediator-landing-page
ExecStart=/usr/bin/npm start
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=landing-page-mediator
Environment=NODE_ENV=production
[Install]
Code Block
languagebash
sudo systemctl start openhim-mediator-landing-page
sudo chown -R centos:centos /usr/share/openhim-mediator-landing-page/
sudo chmod ug+x /opt/ocl_datim/show-imap.sh
sudo chmod ug+x /opt/ocl_datim/show-mechanisms.sh
sudo chmod ug+x /opt/ocl_datim/show-merindicators.sh
sudo chmod ug+x /opt/ocl_datim/show-sims.sh
sudo chmod ug+x /opt/ocl_datim/show-tieredsupport.sh


A.1.3. Installing IMAP IMPORT mediator


 

Code Block
languagebash
sudo git clone https://github.com/maurya/openhim-mediator-imap-import.git /usr/share/openhim-mediator-imap-import
sudo vim /usr/share/openhim-mediator-imap-import/config/default.json # Add openhim username, password and url
cd /usr/share/openhim-mediator-imap-import/
sudo  npm install
sudo vim /etc/systemd/system/openhim-mediator-imap-import.service
Code Block
languagetext
[Unit]
Description=OpenHIM IMAP Import mediator
[Service]
WorkingDirectory=/usr/share/openhim-mediator-imap-import
ExecStart=/usr/bin/npm start
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=imap-import-mediator
Environment=NODE_ENV=production
[Install]

 

 

Code Block
languagebash
sudo systemctl start openhim-mediator-imap-import



 

A.1.4. Installing openhim-mediator-ocl mediator

  • Description: Mediator for MOH to PEPFAR conversion with OCL

  • `sudo git clone Copy the folder `https://github.com/pepfar-datim/DATIM-OCL/tree/master/src/openhim-mediator-oclocl` to `/usr/share/openhim-mediator-ocl`

     

 
Code Block
languagebash
sudo vim /usr/share/openhim-mediator-ocl/config/config.json
-
 # Add openhim username, password
and urlsudo vim
 and urlsudo vim /usr/share/openhim-mediator-ocl/config/mediator.json

- Put in proper information under config section at the bottom of the file.

cd
 #Put in proper information under config section at the bottom of the file.cd /usr/share/openhim-mediator-ocl/
sudo
 npm install
  • npm start

  • sudo vim
     npm installnpm startsudo vim /etc/systemd/system/openhim-mediator-ocl.service
    Code Block
    languagetext
    [Unit]
    
    Description=OpenHIM OCL mediator
    
    [Service]
    
    WorkingDirectory=/usr/share/openhim-mediator-ocl
    
    ExecStart=/usr/bin/npm start
    
    Restart=always
    
    StandardOutput=syslog
    
    StandardError=syslog
    
    SyslogIdentifier=ocl-mediator
    
    Environment=NODE_ENV=production
    
    [Install]
    Code Block
    languagebash
    sudo systemctl start openhim-mediator-ocl

     

    B. Management Operations

    B.1. Restart the mediators-




    B.2. Check logs

    • tail -fn 1000 openhim-mediator-shell-script.log



    B.3. Updating scripts