webAPI Handler for DHIS2

Hi Devs

Can anyone elaborate on the tools or systems used to present DHIS2 data through the webAPI? I’m trying to understand how DHIS2’s database interacts with the webAPI to present output data. Is there a plugin/converter installed alongside DHIS2 that runs in the background or is that built into the java core that DHIS2 is built upon?

Thanks,

Greg

···

Business Intelligence Planner

Health Information Systems Programme

**- - - - - - - ****- - - - - - - ****- - - - - - - ****- - - - - - - ****- - - - - **

Mobile : 073 246 2992
Landline: 021 554 3130
Fax: 086 733 8432
Skype: gregory_rowles

Hi Greg,

The DHIS2 Web API uses built-in functions from Spring MVC, which converts Java objects to various formats such as XML, JSON etc. Spring lets you deploy exisiting converters or allow you to write your own if you want some special format. Each of the API endpoints are Spring MVC controllers that handle the various REST-calls.

You can see these controllers in http://bazaar.launchpad.net/~dhis2-devs-core/dhis2/trunk/files/head:/dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/

he slides from lectures 2, 3 and 4 of the INF5750 course (http://www.uio.no/studier/emner/matnat/ifi/INF5750/h14/lecture-presentations/ ) gives you some background on how this is done. However, some of the calls in the API are a bit magical, which makes it a bit difficult to read, going beyond ‘plain Spring MVC’.

The API implementation is a module within DHIS2, so while it’s modular, it’s closely linked to the internal APIs and data models.

Best regards,

Lars

Best regards,

Lars

···

2014-12-05 11:35 GMT+01:00 Greg Rowles greg.rowles@gmail.com:

Hi Devs

Can anyone elaborate on the tools or systems used to present DHIS2 data through the webAPI? I’m trying to understand how DHIS2’s database interacts with the webAPI to present output data. Is there a plugin/converter installed alongside DHIS2 that runs in the background or is that built into the java core that DHIS2 is built upon?

Thanks,

Business Intelligence Planner

Health Information Systems Programme

**- - - - - - - ****- - - - - - - ****- - - - - - - ****- - - - - - - ****- - - - - **

Mobile : 073 246 2992
Landline: 021 554 3130
Fax: 086 733 8432
Skype: gregory_rowles

Greg


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Lars Kristian Roland

Research Fellow, Department of Informatics, University of Oslo

Email: lars@roland.bz - roland@ifi.uio.no

Phone: +47 90733036

Thank you Lars! Looks like the Oslo course work is the way to go. I assume MongoDB is not part of any DHIS2 architecture currently in use?

···

On Fri, Dec 5, 2014 at 12:57 PM, Lars Kristian Roland lars@roland.bz wrote:

Hi Greg,

The DHIS2 Web API uses built-in functions from Spring MVC, which converts Java objects to various formats such as XML, JSON etc. Spring lets you deploy exisiting converters or allow you to write your own if you want some special format. Each of the API endpoints are Spring MVC controllers that handle the various REST-calls.

You can see these controllers in http://bazaar.launchpad.net/~dhis2-devs-core/dhis2/trunk/files/head:/dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/

he slides from lectures 2, 3 and 4 of the INF5750 course (http://www.uio.no/studier/emner/matnat/ifi/INF5750/h14/lecture-presentations/ ) gives you some background on how this is done. However, some of the calls in the API are a bit magical, which makes it a bit difficult to read, going beyond ‘plain Spring MVC’.

The API implementation is a module within DHIS2, so while it’s modular, it’s closely linked to the internal APIs and data models.

Best regards,

Lars

Best regards,

Lars

2014-12-05 11:35 GMT+01:00 Greg Rowles greg.rowles@gmail.com:

Hi Devs

Can anyone elaborate on the tools or systems used to present DHIS2 data through the webAPI? I’m trying to understand how DHIS2’s database interacts with the webAPI to present output data. Is there a plugin/converter installed alongside DHIS2 that runs in the background or is that built into the java core that DHIS2 is built upon?

Thanks,

Business Intelligence Planner

Health Information Systems Programme

**- - - - - - - ****- - - - - - - ****- - - - - - - ****- - - - - - - ****- - - - - **

Mobile : 073 246 2992
Landline: 021 554 3130
Fax: 086 733 8432
Skype: gregory_rowles

Greg


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Lars Kristian Roland

Research Fellow, Department of Informatics, University of Oslo

Email: lars@roland.bz - roland@ifi.uio.no

Phone: +47 90733036

Business Intelligence Planner

Health Information Systems Programme

**- - - - - - - ****- - - - - - - ****- - - - - - - ****- - - - - - - ****- - - - - **

Mobile : 073 246 2992
Landline: 021 554 3130
Fax: 086 733 8432
Skype: gregory_rowles

It is not, but another similar Json based database api is being considered. This could use the postgres Json support, which would limit the database choice. That would probably be for other app specific data, rather than dhis core data. At least at first. But the postgres Json support also allows you to link Json and sql/relational stuff.

Hence it would probably provide similar functions to Mongodb, but be linkable to the dhis data model.

For now, the system and user settings are the only ways to store raw Json, but it’s quite limited…

MobiLars

  1. Des. 2014 13:11 skrev “Greg Rowles” greg.rowles@gmail.com følgende:
···

On Fri, Dec 5, 2014 at 12:57 PM, Lars Kristian Roland lars@roland.bz wrote:

Hi Greg,

The DHIS2 Web API uses built-in functions from Spring MVC, which converts Java objects to various formats such as XML, JSON etc. Spring lets you deploy exisiting converters or allow you to write your own if you want some special format. Each of the API endpoints are Spring MVC controllers that handle the various REST-calls.

You can see these controllers in http://bazaar.launchpad.net/~dhis2-devs-core/dhis2/trunk/files/head:/dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/

he slides from lectures 2, 3 and 4 of the INF5750 course (http://www.uio.no/studier/emner/matnat/ifi/INF5750/h14/lecture-presentations/ ) gives you some background on how this is done. However, some of the calls in the API are a bit magical, which makes it a bit difficult to read, going beyond ‘plain Spring MVC’.

The API implementation is a module within DHIS2, so while it’s modular, it’s closely linked to the internal APIs and data models.

Best regards,

Lars

Best regards,

Lars

Business Intelligence Planner

Health Information Systems Programme

**- - - - - - - ****- - - - - - - ****- - - - - - - ****- - - - - - - ****- - - - - **

Mobile : 073 246 2992
Landline: 021 554 3130
Fax: 086 733 8432
Skype: gregory_rowles

2014-12-05 11:35 GMT+01:00 Greg Rowles greg.rowles@gmail.com:

Hi Devs

Can anyone elaborate on the tools or systems used to present DHIS2 data through the webAPI? I’m trying to understand how DHIS2’s database interacts with the webAPI to present output data. Is there a plugin/converter installed alongside DHIS2 that runs in the background or is that built into the java core that DHIS2 is built upon?

Thanks,

Business Intelligence Planner

Health Information Systems Programme

**- - - - - - - ****- - - - - - - ****- - - - - - - ****- - - - - - - ****- - - - - **

Mobile : 073 246 2992
Landline: 021 554 3130
Fax: 086 733 8432
Skype: gregory_rowles

Greg


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Lars Kristian Roland

Research Fellow, Department of Informatics, University of Oslo

Email: lars@roland.bz - roland@ifi.uio.no

Phone: +47 90733036