Package: dhis2
dhis2-python: integration client for dhis2Requirements: Python 3.8+QuickstartInstall usingpip:$pipinstalldhis2This will install thedhis2command in your local environment (installing into a virtual environment recommended).The tool supports a pluggable architecture, but the core supports:Inspecting dhis2 instancesdhis2 -i inventory.yml inspect host-id/group-idExtracting mCSD and SVCM compatible payload, and pushing those to a FHIR compliant serverdhis2 -i inventory.yml facility-list mcsd mcsd-config.ymldhis2 -i inventory.yml code-list svcm svcm-config.ymlExtract ICD 11 (MMS)LinearizationEntitiesas DHIS2 Option Setsdhis2 -i inventory.yml code-list icd11 <icd11-host> --root-id <X>Extract ICD 10ICD10Entitiesas DHIS2 Option Setsdhis2 -i inventory.yml code-list icd10 <icd10-host> --root-id <X>Please be aware that the icd11 docker image doesnotinclude the icd10 code lists, so you have to use the public instance which requires API keysExtract Individual Case Safety Reports E2B (R2) XML from DHIS2 instances that have installed the WHO AEFI package(see description of formats below)As of now, we do not support sending data to dhis2, only extraction is supported.FormatsInventoryThe inventory is where you will store all your services, and various groupings you might find useful (most commands will only work on single sources/targets though, with the exception of theinspectcommand currently)The basic format is as followshosts:playdev:type:dhis2baseUrl:https://play.dhis2.org/devusername:adminpassword:districtplaydemo:type:dhis2baseUrl:https://play.dhis2.org/demoauth:default:type:http-basicusername:adminpassword:districtfhirdemo:type:fhirbaseUrl:http://localhost:8080/baseR4icd11local:type:icd11baseUrl:http://localhost:8888icd11official:type:icd11baseUrl:https://id.who.intheaders:Authorization:Bearer YOUR_TOKENicd10official:type:icd10baseUrl:https://id.who.intheaders:Authorization:Bearer YOUR_TOKENgroups:dhis2:-playdev-playdemoThe keys of thehostsandgroupsblock will be used to identifiy targets when using thedhis2commands.Please note that:Currently onlyhttp-basicis supported for dhis2For fhir no authentication is supported (coming soon)mCSD / SVCM configurationBoth mCSD and SVCM currently has the exact same format so we will describe them together. You will need a source host, target host (or some other target) and a set of filters if desired.Basic formatsource:id:playdevtarget:id:fhirdemoThis configuration would simply take all org unit or option sets inside of dhis2 and push them to a fhir instance.If you would want to store the result instead, you can use thelog://targetsource:id:playdevtarget:id:log://(this is also the default if no target is given)Individual Case Safety Reports E2B (R2) configurationExtract of E2B R2 compatible XML is now supported in the tool. To use it, you will need a connection to a dhis2 instance with the DHIS2 WHO AEFI program,
and for now only individual tracked entities can be extracted (more flexible query mechanism is coming)Basic dhis2 confighosts:
  d2aefi:
    type: dhis2
    baseUrl: https://dhis2-instance.com
    username: username
    password: passwordExample command for extracting E2B XMLdhis2 -i inventory.yml e2b d2aefi --tracked-entity some-te-uid