Giter Club home page Giter Club logo

dhis2-mediator's Introduction

dhis2-mediator-elmis

Codacy Badge Java CI Badge Coverage Status

An OpenHIM mediator for handling system integrations with DHIS2.

1. Dev Requirements

  1. Java 1.8
  2. IntelliJ or Visual Studio Code
  3. Maven 3.6.3

2. Mediator Configuration

This mediator is designed to work with multiple systems that do not require any message transformations or any data validation to the message payload to DHIS2. The mediator handles processing of DHIS2 response messages, in cases that DHIS2 responds with HTTP status code 200 while some data had failed during processing, before sending the response to HIM.

3 Configuration Parameters

The configuration parameters specific to the mediator and destination system can be found at

src/main/resources/mediator.properties

    mediator.name=eLMIS-to-DHIS2-Mediator
    mediator.host=localhost
    mediator.port=3031
    mediator.timeout=60000
    mediator.heartbeats=true

    core.host=localhost
    core.api.port=8080
    [email protected]
    core.api.password=openhim-password

    destination.host=localhost
    destination.api.port=8080
    destination.api.path=/destination-system-path
    destination.scheme=http

The configuration parameters specific to the mediator and the mediator's metadata can be found at

src/main/resources/mediator-registration-info.json

    {
        "urn": "urn:uuid:c11b99a0-d8af-11eb-badb-9d2a2a013a07",
        "version": "0.1.0",
        "name": "eLMIS - DHIS2 Mediator",
        "description": "An openHIM mediator for handling system integration between eLMIS and DHIS2",
        "endpoints": [
            {
                "name": "eLMIS to DHIS2 Mediator Route",
                "host": "localhost",
                "port": "3031",
                "path": "/dhis2",
                "type": "http"
            }
        ],
        "defaultChannelConfig": [
            {
                "name": "eLMIS to DHIS2 Mediator",
                "urlPattern": "^/dhis2$",
                "type": "http",
                "allow": ["elmis-role"],
                "routes": [
                    {
                        "name": "eLMIS - DHIS2 Mediator Route",
                        "host": "localhost",
                        "port": "3031",
                        "path": "/dhis2",
                        "type": "http",
                        "primary": "true"
                    }
                ]
            }
        ],
        "configDefs": [
            {
                "param": "destinationConnectionProperties",
                "displayName": "Destination Connection Properties",
                "description": "Configuration to set the hostname, port and path for the destination server",
                "type": "struct",
                "template": [
                    {
                        "param": "destinationHost",
                        "displayName": "Destination Host Name",
                        "description": "IP address/hostname of the destination server. e.g 192.168.1.1",
                        "type": "string"
                    },
                    {
                        "param": "destinationPort",
                        "displayName": "Destination Port Number",
                        "description": "The port number of the destination server. e.g 8080",
                        "type": "number"
                    },
                    {
                        "param": "destinationPath",
                        "displayName": "Destination Path",
                        "description": "The destination path",
                        "type": "string"
                    },
                    {
                        "param": "destinationScheme",
                        "displayName": "Destination Scheme",
                        "description": "Whether the destination is using HTTP or HTTPS requests.",
                        "type": "option",
                        "values": [
                            "http",
                            "https"
                        ]
                    },
                    {
                        "param": "destinationUsername",
                        "displayName": "Destination Username",
                        "description": "The destination username for receiving data from the HIM.",
                        "type": "string"
                    },
                    {
                        "param": "destinationPassword",
                        "displayName": "Destination Password",
                        "description": "The destination password for receiving data from the HIM.",
                        "type": "password"
                    }
                ]
            }
        ]
    }

4. Deployment

To build and run the mediator after performing the above configurations, run the following

  mvn clean package -DskipTests=true -e source:jar javadoc:jar
  java -jar target/dhis2-mediator-<version>-jar-with-dependencies.jar

dhis2-mediator's People

Contributors

cozej4 avatar danfordnchembi avatar codacy-badger avatar

Watchers

James Cloos avatar  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.