Code Monkey home page Code Monkey logo

dhis2-integration's Introduction

Implementation Guide

Install and configure DHIS2 integration app

Assuming you have Bahmni installer latest version installed and running successfully.
  1. Run the following command to install DHIS2 integration app.
    
    wget https://media.githubusercontent.com/media/Possiblehealth/possible-artifacts/master/dhis-integration-1.0-1.noarch.rpm
    rpm –ivh dhis-integration-1.0-1.noarch.rpm
  2. Update the properties file for DHIS2 integration app, located at
    '/etc/dhis-integration/dhis-integration.yml',
    with right configuration.
    KeyDescriptionExample
    openmrs.root.urlUrl to access Openmrs servicehttp://localhost:8050/openmrs/ws/rest/v1
    bahmni.login.urlWhen user isn't logged in, then user is redirected to this url. https://ehr.possible.org/bahmni/home/#/login?showLoginMessage
    reports.urlBahmni reports url. Used for downloading reports.https://ehr.possible.org/bahmnireports/report
    reports.jsonThis file contains configurations of DHIS2 reports./var/www/bahmni_config/openmrs/apps/reports/reports.json
    dhis.config.directoryThis folder contains DHIS2 integration configurations program wise./var/www/bahmni_config/dhis2/
    dhis.urlThe DHIS2 government server instance url.Ex. 1: http://100.100.100.100:8080/
    Ex. 2: http://200.100.20.30:8888/hmistest/ Note that the url could be at domain or ip address level (ex1) or could be at a specific path(ex2)
    dhis.userThe username to access DHIS2 instance.username
    dhis.password The password for the DHIS2 user. password
    openmrs.db.urlMysql connection url to access "openmrs" database. Set valid user and password in the url.jdbc:mysql://localhost/openmrs?user=openmrs-user&password=password
    submission.audit.folderAll DHIS2 submissions are stored in this directory. Ensure the directory exists and "bahmni" user has access to it, or configure a different directory./dhis-integration-data
    server.portServer config. Port for server to listen to.8040
    server.context-pathServer config. Mapping incoming requests./dhis-integration/
    log4j.config.fileServer config. Properties file for logger of dhis-integration server.log4j.properties
  3. Download and place the ssl.conf file.
    
    cd /etc/httpd/conf.d/ 
    wget https://raw.githubusercontent.com/Possiblehealth/possible-config/89662e8e823fac3dbcaf111aa72713a63139bb03/playbooks/roles/possible-dhis-integration/templates/dhis_integration_ssl.conf
  4. Ensure Bahmni reports service is installed and running successfully.
    
      service bahmni-reports status ##should be running
     
  5. Configure Bahmni landing page to show DHIS2 integration app.
    Insert the following in
    "/var/www/bahmni_config/openmrs/apps/home/extension.json" file
      
    "possible_dhis_2_integration": {
        "id": "possible.dhis2Integration",
        "extensionPointId": "org.bahmni.home.dashboard",
        "type": "link",
       "label": "DHIS2 integration",
       "url": "/dhis-integration/index.html",
       "icon": "fa-book",
       "order": 11,
       "requiredPrivilege": "app:reports"
    }
     
  6. Ensure Bahmni reports service is installed and running successfully.
    service bahmni-reports status ##should be running
    
  7. Restart ssl and dhis-integration services.
  8. 
    service httpd restart
    service dhis-integration restart
Now the DHIS2 integration app is available on landing screen, given that the user has reporting privileges.
Once you open the app you land on DHIS integration app page, where you select the month and year for given program, type a comment and submit report.

Configure New Program

  1. Configure the concatenated reports for the program
  2. Put the following configuration in the concatenated report to make it DHIS2 program.
    "DHISProgram": true,Example: Safe motherhood program
  3. Create a DHIS configuration file for the program with the name of program under '/var/www/bahmni_config/dhis2/' folder.
  4. To use different folder change 'dhis.config.directory' configuration at '/etc/dhis-integration/dhis-integration.yml'.

DHIS configuration file should have the following structure. DHIS Config


{
  "orgUnit": "",
  "reports": {
    "": {
      "dataValues": [
        {
          "categoryOptionCombo": "",
          "dataElement": "",
          "row": ,
          "column": 
        },
        {
          "categoryOptionCombo": "",
          "dataElement": "",
          "row": ,
          "column": 
        },
        ............more data element mappings............
      ]
    },
    "": {
    "dataValues": [......]
    },
    "": {
    "dataValues": [......]
    },
    ............more sub report mappings............
  }
}
An example configuration for Safe Motherhood program will look like the following Example: Safe motherhood program
KeyDescription
orgUnitThis is the organisation unit ID from DHIS
reports <>This is list of reports which are the inner reports of concatenated report of the program. Each report name is a unique key in this object.

'Antenatal Checkup' is one of the inner reports configured in concatenated report, for example.

dataValuesThis is list of data element mappings. Each mapping maps a cell in SQL output to a dataElement in DHIS.
categoryOptionComboThis is the 'category option combination id' of the dataElement in DHIS.
dataElementThis is the 'data element id' of the dataElement in DHIS.
row and columnThis 'row and column' numbers refers to a particular cell in the output of configured SQL.

Notes: To find out the orgUnit Id, dataElement Id, category option combo Id do the following:

  1. Access the DHIS2 government server in your browser.
  2. Open data entry apps and select appropriate organisation and location.
  3. Once the data entry forms are visible, click on the input boxes where you enter the data.
  4. Right click on the input box and select "Inspect" from the options.
  5. Copy the Id of the html element from window (See image), it would look like the following string: "kSnqP4GPOsQ-kdsirVNKdhm-val".
  6. This string is in the format of "dataElementId - categoryOptionComboId - ...."
  7. These dataElementId and categoryOptionComboId need to be used in DHIS2 configuration file. Refer the below image.

dhis2-integration's People

Contributors

dipakthapaofficial avatar laxmanm7 avatar sidtharthanan avatar suruchee avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.