<aside> 💡 This guide is intended for software developers who are working on electronic data retrieval from DHIS2 based EWARS and integrate the information in other systems such as information portals and dashboards. This guide is based on the DHIS2 version 2.30 (currently adopted for EWARS). This document is work-in-progress and being continuously updated for improved usefulness, conciseness and completeness.

</aside>


Basic concept

Before you start getting data from any DHIS2 instance, define the following basic elements clearly:

  1. What - what information to extract (Data variables or Indicators)
  2. When - Time period (Fixed - particular day, month, year etc., or Relative - Last month, last year, last fiscal year etc.)
  3. Where - Organization Unit/Administrative hierarchy (National, Province, District, Municipality, Health Facility etc.)

Each basic elements described above will have associated unique identifier in DHIS2 system. For example each data variables, indicators and organization units will have 11 digit alphanumeric unique identifier. For relevant metadata information click here (or contact EDCD).


DHIS2 Analytics Resource for Events

EWARS is based on event reporting system of DHIS2. To access analytical, aggregated event data in DHIS2 you can work with the analytics resource. The analytics resource is powerful as it lets you query and retrieve event data aggregated along all available data dimensions. It allows retrieve the aggregated data for a combination of any number of dimensions based on data elements, periods and organisation units.

API Endpoint pattern:

GET *[BASE_URL]/api/analytics/events/aggregate/[programUID].[dataType]?[queryParameters]&stage=[programStageUID]&displayProperty=NAME&outputType=EVENT&outputIdScheme=NAME*

API Endpoint Description:

BASE_URL**:** http://ewars.edcd.gov.np/ewarsdemo (Demo server URL, contact EDCD for live server URL)

programUID: uoCswKjfyiM (This is UID for EWARS)

dataType: json | csv | xml

programStageUID: ****uTJBFFVYXqA (This UID is for EWARS)

queryParameters: The analytics resource lets you specify a range of query parameters (most useful mentioned below):