Synchronizing ODK data with DHIS2

I am interested in tools and documentation about connecting ODK with DHIS2.

Background: in my work (distributing bednets against malaria), DHIS2 is commonly used for storing and analysing data. We use it both for summary data (e.g., number of nets distributed per day in a given place) and individual-level data (e.g., GPS coordinates of a household that has received nets). People value the dashboards and analysis features of DHIS2. In addition, there are also political reasons for using it.

For data collection, however, ODK is the better solution. It has simpler and more intuitive forms, better data validation, and requires fewer resources on the phones/tablets.

Existing information

Request for more information

Do you know other tools? Do you have success stories to share, or lessons learned?

2 Likes

Hi,

I have been engaged with couple of big projects involving DX2 and ODK. I also tried to find some direct link, but could not find a proper one. The only workaround is to have a middleware dashboard which could pull the data from ODK via API, summarize into aggregated counts via programming (this is very important for DX2 counters, and difficult to do if you connect ODK directly to DX2 somehow), and push the data into DX2 via its API. I am into design phase of having this whole setup, and will be completing in the coming months.

If you are interested, I will keep you updated.

Regards,
Saad

1 Like

Here's my summary of solutions, after a week has passed and I was able to do a bit more research.

  • Using OpenFn:

    • Well engineered, with lots of thoughts going into reliability and security (for example, syncs are idempotent and can be replayed. Credentials are stored safely. Security certification done).
    • Several success stories for connecting Kobo/ODK and DHIS2.
    • Basic principle: On submission, the Kobo servers send an HTTP POST request to OpenFn. OpenFn stores the message. It triggers a job that formats the data and inserts/updates it in DHIS2 using the DHIS2 API. Built-in connectors facilitate the task of parsing the Kobo message and formatting data for DHIS2.
    • I believe the process is a bit different for ODK (not 100% sure what it uses there, probably OData).
    • Costs: Users pay OpenFn for hosting and support (https://www.openfn.org/pricing).
    • Looks like the best solution overall for projects that can afford it.
  • Bao Systems' KoboToolbox connector for DHIS2

    • Basic principle: This is JavaScript code that runs within DHIS2. It talks to Kobo's API to fetch the form definition and data. The code then creates a matching DHIS2 configuration and inserts the data.
    • Limitations:
      • Does not support custom or existing data layouts in DHIS2
      • Requires Kobo's API, does not support ODK or related systems.
      • Limited support for forms (e.g., no repeat groups)
      • Requires tweaks to DHIS2's server setup to work around the browser's same-origin policy.
      • No automated/real-time sync, since it runs in the user's browser.
    • Would not recommend except for very simple integrations
  • Custom solutions:

    • Anecdotally, it seems common for people to build custom systems that connect to the OData feed from Kobo/ODK, process the data, and upload it to DHIS2's API.
    • Examples are @Saad's answer above, and other forum posts.
    • Benefits are that it's potentially cheaper, does not rely on third parties.
    • Disadvantages: it's hard to make this reliable, idempotent, secure...
    • Building blocks that could be used: Maybe OpenFn's open-source tools, RuODK.

Another update of my thoughts: The DHIS2 Capture app is becoming better and has closed some of the gaps it had compared to Kobo/ODK. For example, adding a new tracked entity requires fewer clicks than it used to, and forms can be structured more intuitively. This means that the benefits of using a combination of Kobo/ODK and DHIS2 are smaller nowadays... the simplest solution might be to use DHIS2 Capture for those cases where the data needs to end up in DHIS2.

3 Likes