I’m newbie on DHIS2. I implemented an instance that work for my organisation and I need to Interoperate with MOH instance to retrieve data each month for some health facilities.
I need guidance on how to set up interoperability by using web API and how to create a cronjob that will fetch data from MOH instance to my instance each month.
Could you please help me to find ressources (course, tutorials, step by step code, etc.) and advises on how to implement?
The nature of a Web API is its openness to be used by any software.
As a start, I would start in trying to understand how such an API
works, which is based on “HTTP REST” principles.
REST in layman's terms: REST basics (IBM developers):
Specification for DHIS2:
As an example, the programming language Python can be used, which is
installable on any system and is on Ubuntu by default. DHIS2
supports the transportation format JSON. There’s a new library on
github (, but have not tried it
yet) or you can write your own.
So a basic procedure would be:
myscript.py
load a configuration of both APIs (username, url, passwords)
make a GET request to a specific endpoint of MoH API
validate, transform,… the received data
make a POST request to another specific endpoint of your other
instance’s API
and then install a cronjob which calls this script with “* * * * *
python myscript.py”
Further extensions could be logging to a file and a mail
notification if something goes wrong.
I hope this can help a bit.
Best regards
David
The nature of a Web API is its openness to be used by any software. As a start, I would start in trying to understand how such an API works, which is based on "HTTP REST" principles.
REST in layman's terms: [http://www.looah.com/source/view/2284](http://www.looah.com/source/view/2284)
REST basics (IBM developers): [https://www.ibm.com/developerworks/library/ws-restful/index.html](https://www.ibm.com/developerworks/library/ws-restful/index.html)
Specification for DHIS2: [https://dhis2.github.io/dhis2-docs/master/en/developer/html/dhis2_developer_manual_full.html](https://dhis2.github.io/dhis2-docs/master/en/developer/html/dhis2_developer_manual_full.html)
As an example, the programming language Python can be used, which is installable on any system and is on Ubuntu by default. DHIS2 supports the transportation format JSON. There's a new library on github ([https://github.com/dhis2/dhis2-python](https://github.com/dhis2/dhis2-python) , but have not tried it yet) or you can write your own.
So a basic procedure would be:
myscript.py
1. load a configuration of both APIs (username, url, passwords)
2. make a GET request to a specific endpoint of MoH API
3. validate, transform,... the received data
4. make a POST request to another specific endpoint of your other instance's API
and then install a cronjob which calls this script with "* * * * * python myscript.py"
Further extensions could be logging to a file and a mail notification if something goes wrong.
I hope this can help a bit.
Best regards
David
On 03.04.2016 08:34, vunda limbe wrote:
Hi All,
I'm newbie on DHIS2. I implemented an instance that work for my organisation and I need to Interoperate with MOH instance to retrieve data each month for some health facilities.
I need guidance on how to set up interoperability by using web API and how to create a cronjob that will fetch data from MOH instance to my instance each month.
Could you please help me to find ressources (course, tutorials, step by step code, etc.) and advises on how to implement?
Thank you all for your help.
_______________________________________________ Mailing list: [https://launchpad.net/~dhis2-users](https://launchpad.net/~dhis2-users)
Post to : dhis2-users@lists.launchpad.net
Unsubscribe : [https://launchpad.net/~dhis2-users](https://launchpad.net/~dhis2-users)
More help : [https://help.launchpad.net/ListHelp](https://help.launchpad.net/ListHelp)
The nature of a Web API is its openness to be used by any software. As a start, I would start in trying to understand how such an API works, which is based on "HTTP REST" principles.
REST in layman's terms: [http://www.looah.com/source/view/2284](http://www.looah.com/source/view/2284)
REST basics (IBM developers): [https://www.ibm.com/developerworks/library/ws-restful/index.html](https://www.ibm.com/developerworks/library/ws-restful/index.html)
Specification for DHIS2: [https://dhis2.github.io/dhis2-docs/master/en/developer/html/dhis2_developer_manual_full.html](https://dhis2.github.io/dhis2-docs/master/en/developer/html/dhis2_developer_manual_full.html)
As an example, the programming language Python can be used, which is installable on any system and is on Ubuntu by default. DHIS2 supports the transportation format JSON. There's a new library on github ([https://github.com/dhis2/dhis2-python](https://github.com/dhis2/dhis2-python) , but have not tried it yet) or you can write your own.
So a basic procedure would be:
myscript.py
1. load a configuration of both APIs (username, url, passwords)
2. make a GET request to a specific endpoint of MoH API
3. validate, transform,... the received data
4. make a POST request to another specific endpoint of your other instance's API
and then install a cronjob which calls this script with "* * * * * python myscript.py"
Further extensions could be logging to a file and a mail notification if something goes wrong.
I hope this can help a bit.
Best regards
David
On 03.04.2016 08:34, vunda limbe wrote:
Hi All,
I'm newbie on DHIS2. I implemented an instance that work for my organisation and I need to Interoperate with MOH instance to retrieve data each month for some health facilities.
I need guidance on how to set up interoperability by using web API and how to create a cronjob that will fetch data from MOH instance to my instance each month.
Could you please help me to find ressources (course, tutorials, step by step code, etc.) and advises on how to implement?
Thank you all for your help.
_______________________________________________ Mailing list: [https://launchpad.net/~dhis2-users](https://launchpad.net/~dhis2-users)
Post to : dhis2-users@lists.launchpad.net
Unsubscribe : [https://launchpad.net/~dhis2-users](https://launchpad.net/~dhis2-users)
More help : [https://help.launchpad.net/ListHelp](https://help.launchpad.net/ListHelp)
The nature of a Web API is its openness to be used by any software. As a start, I would start in trying to understand how such an API works, which is based on "HTTP REST" principles.
REST in layman's terms: [http://www.looah.com/source/view/2284](http://www.looah.com/source/view/2284)
REST basics (IBM developers): [https://www.ibm.com/developerworks/library/ws-restful/index.html](https://www.ibm.com/developerworks/library/ws-restful/index.html)
Specification for DHIS2: [https://dhis2.github.io/dhis2-docs/master/en/developer/html/dhis2_developer_manual_full.html](https://dhis2.github.io/dhis2-docs/master/en/developer/html/dhis2_developer_manual_full.html)
As an example, the programming language Python can be used, which is installable on any system and is on Ubuntu by default. DHIS2 supports the transportation format JSON. There's a new library on github ([https://github.com/dhis2/dhis2-python](https://github.com/dhis2/dhis2-python) , but have not tried it yet) or you can write your own.
So a basic procedure would be:
myscript.py
1. load a configuration of both APIs (username, url, passwords)
2. make a GET request to a specific endpoint of MoH API
3. validate, transform,... the received data
4. make a POST request to another specific endpoint of your other instance's API
and then install a cronjob which calls this script with "* * * * * python myscript.py"
Further extensions could be logging to a file and a mail notification if something goes wrong.
I hope this can help a bit.
Best regards
David
On 03.04.2016 08:34, vunda limbe wrote:
Hi All,
I'm newbie on DHIS2. I implemented an instance that work for my organisation and I need to Interoperate with MOH instance to retrieve data each month for some health facilities.
I need guidance on how to set up interoperability by using web API and how to create a cronjob that will fetch data from MOH instance to my instance each month.
Could you please help me to find ressources (course, tutorials, step by step code, etc.) and advises on how to implement?
Thank you all for your help.
_______________________________________________ Mailing list: [https://launchpad.net/~dhis2-users](https://launchpad.net/~dhis2-users)
Post to : dhis2-users@lists.launchpad.net
Unsubscribe : [https://launchpad.net/~dhis2-users](https://launchpad.net/~dhis2-users)
More help : [https://help.launchpad.net/ListHelp](https://help.launchpad.net/ListHelp)