DHIS2 Module > Support multiple versions of DHIS2 (2.19 and prior then 2.20)
Description
The DHIS2 module works with versions 2.16 to 2.18. However, DHIS2 made changes to their web API in version 2.19, 2.20 and 2.21 that cause the DHIS2 module to cause errors when parsing the DHIS2 application schema. We would like to allow users to configure the version of DHIS2 in the settings, assuming that DHIS2 implementations are generally government owned and most often do not run the current version.
The Web API updates for version 2.20 can be found here The Web API updates for version 2.2.1 can be found here
DHIS2 has an exposed API that allows authenticated users to determine the version of the server. We would like to use this API to identify the server version and modify the payload accordingly.
When you hit <<serverURL>>/api/system/info.json the following JSON is returned in the payload. Note the "version":"2.18" This indicator should be used to modify the payload to the specified version.
Checked. MOTECH DHIS2 Module is working with DHIS2 application in versions 2.19, 2.20 and 2.21.
Sebastian Brudziński
April 1, 2016 at 4:40 PM
@Nikodem Graczewski Could you please investigate the error reported by Piotr and upload the fix?
Piotr Zurawski
March 31, 2016 at 8:13 AM
I have DHIS2 (version 2.19) application and attached demo database from version 2.19. When i want to Sync by MOTECH i get this error:
Piotr Zurawski
March 29, 2016 at 2:11 PM
@Sebastian Brudziński here's the file with Errors and DEBUG logs:
Sebastian Brudziński
March 29, 2016 at 1:53 PM
@Piotr Zurawski I tried reproducing this but the sync worked fine for me. Could you enable "DEBUG" level logging for "org.motechproject.dhis2.rest" and then click sync on version 2.21? Please attach the logs then.
The DHIS2 module works with versions 2.16 to 2.18. However, DHIS2 made changes to their web API in version 2.19, 2.20 and 2.21 that cause the DHIS2 module to cause errors when parsing the DHIS2 application schema. We would like to allow users to configure the version of DHIS2 in the settings, assuming that DHIS2 implementations are generally government owned and most often do not run the current version.
The Web API updates for version 2.20 can be found here
The Web API updates for version 2.2.1 can be found here
DHIS2 has an exposed API that allows authenticated users to determine the version of the server. We would like to use this API to identify the server version and modify the payload accordingly.
When you hit <<serverURL>>/api/system/info.json the following JSON is returned in the payload. Note the "version":"2.18" This indicator should be used to modify the payload to the specified version.