This repository is intended to lay some development foundations as an example to start an ETL process in which GNU-Health is used as data source and Dhis2 as destination.
- This repo is based in
Sierra LeoneImage ofGNU-Health- If you aren't using this Image please change all
Sierra LeonerootOrgUnit vars for the instance that you are using.
- If you aren't using this Image please change all
- This script has implemented a change log method used to keep a record of all methods used and their responses the logs can be found in the directory "logs/log[date].txt.
This project was made with following tech-stack.
- Proteus 6.8.0
- Python 3.10.6
- Dhis2 2.37.1.2
- GNU-Health
For the proper use of this repo you should had installed the following pip libraries and have a instance of GNU-Health and Dhis2 in docker.
- proteus
pip install proteus
- statistics
pip install statistics
You should change the following conection info if you arent usining a sample data.
- GNU-Health connection data
"""
Server conf
"""
user = 'exampleuser'
password = "examplepassword"
dbname = "exampledbname"
hostname = 'localhost'
port = '8000'
health_server = 'http://'+user+':'+password+'@'+hostname+':'+port+'/dbname+'/'
conf = config.set_xmlrpc(health_server)- Dhis2 connection data
def login():
session = requests.Session()
session.auth = ('username', 'password')
return sessionThe best use for this script is to extract information from gnu-health to perform some process with it and integrate it in dhis dimensions, however this example is based on the gnu-health labs model and as a working sample it works well to show how everything moves behind.
To extend the following example using the lab module, I recommend changing the analyte to see the results shown by the script, or venture to change the model and query other gnu-health modules.
Note: The module has to be externalized in client side of gnu-health, that can be made following this easy steps.
- In the visual client of GNU-Health go to /Federation/Federation Object
- Add a new entrace putting the name exactly of the model that you want to externalice (now that model is accessible from the API)
- To find the name of the model in the client go to any part of the client that you want to take access externaly and access to "view logs" menu
- To upload all the data obtained in GNU-Health just remember, the admin user of Dhis2 doesn't have the proper authorities to upload data, to change that you need go to User section and select role management then find the superuser role and asing the following authorities
- In section Other authorities find Available system authorities and select All (Full authotity) and Save Changes.
Github - @yassirH9
Useful documentation used in this project.




