29.3 Export data and meta-data

DHIS2 makes it possible to export various types of data in multiple data formats. You can export your data, also referred to as measures or facts; and your meta-data, which refers to the information describing your data. Data can be exported both in raw, non-aggregated format and in aggregated format. It is also possible to export a combination of data and meta-data in case you have special requirements. This chapter covers mainly how to export data and meta-data through the user interface of the import-export DHIS2 module. Data can also be exported programmatically through the DHIS2 Web API, and it is useful to be aware of the various options available:

Data can be exported on various formats, including DXF 2 (the DHIS2 meta-data and data exchange format based on XML), CSV, PDF, MS Excel and the DHIS2 1.4 XML format.

Another aspect of data export is the type of DHIS2 deployment. In the case of online deployment, all data is saved into a single database only. In an offline deployment, each instance will store data in a separate database in their local system. In an offline deployment, after the data entry is finished, data will have to be manually sent to the next level in the organizational hierarchy. In an on-line application this is not required, as all data is captured over an Internet connection and stored in a central location.

29.3.1 Metadata export

Meta-data is “data about data”. In the context of DHIS2, meta-data consists of definitions of data elements, indicators, the structure and names contained in the organizational hierarchy, and other options. Click on the “Meta-data export” link from the main “Data export” screen in order to access this. Just select the features, format, and the compression that you want and click “Export”. This metadata file can then be transmitted just like a data file, except it will contain information on the definitions of the various features, as opposed to the values of the data themselves.

Simply choose the objects which you would like to export, and click “Export”.

29.3.2 Metadata export with dependencies

Metadata export with dependencies lets you create canned exports for metadata objects. This type of export will include the metadata objects and the metadata object’s related objects, that is the metadata which belong together with the main object.

Object types and their dependencies

Object type

Dependencies included in export

DHIS2_SECTION_ID:docs-internal-guid-4a3662ce-63b9-1efd-e640-8ba874d1bcde:Data set

Data elements

Sections

Indicators

Indicator types

Attributes

Data entry forms

Legend sets

Legends

Category combinations

Categories

Category options

Category option combinations

Option sets

Program

Data entry form

Tracked entity

Program stages

Program attributes

Program indicators

Program rules

Program rule actions

Program rule variables

Program attributes

Data elements

Category combinations

Categories

Category options

Category option combinations

Option sets

Category combination

Category combinations

Categories

Category options

Category option combinations

Attributes

Dashboard

Dashboard items

Charts

Event charts

Pivot tables

Event reports

Maps

Reports

Resources

Data element group

Data elements

Category combinations

Categories

Category options

Category option combinations

Option sets

Attributes

Legend sets

Legends

  1. Open the Import-Export app.

  2. Click Metadata dependency export .

  3. Select an Object type : Data set , Program , category combo , Dashboard or Data element group .

  4. Select an Object .

  5. Select a Format .

  6. Select a format: XML or JSON .

  7. Select Compression : Zip , Gzip or Uncompressed .

  8. Click Export . The export file is downloaded to your local computer.

29.3.3 Data export

To export raw data from DHIS2, choose “Import-export->Data export”. Select the organisation unit(s), the start and end date, and dataset or data sets for which data export should be selected. You can also select which types of identifiers which will be exported by pressing “More options” and then selecting either UID, Code, or Name for data elements, organisation units and category options. Once you have specified all options as required, press “Export as…” along with the format which you would like to export the data as (XML, JSON or CSV).

A pop-up save option will appear on the displayed screen (see picture below) prompting the saving of the exported data. You may save the export folder on your desktop or any other folder by selecting the ‘Save to Disk’ option from the pop-up prompt.

29.3.4 Event data export

You can export event or tracker data in XML , JSON or CSV formats.

  1. Open the Import-Export app.

  2. Click Event Export .

  3. Select an organisation unit.

  4. Select a program and a program stage (if applicable).

  5. Select the ID scheme to use for export: UID (default) or CODE .

    If you select CODE but the object’s attribute does not have code, it will not be included in the return payload.

  6. Select Start date and End date .

  7. Select the Inclusion :

    • Selected organisation unit : Export event data only for the selected organisation unit

    • Include children of organisation unit : Export event data for the children of the organisation unit as well as the selected organisation unit itself.

    • Include descendants of organisation unit : Export event data for the descendants of the organisation unit as well as the selected organisation unit itself.

  8. Select a format: XML , JSON or CSV .

  9. Select Compression : Zip , Gzip or Uncompressed .

  10. Click Export . The export file is downloaded to your local computer.

29.3.5 Export data to other systems

29.3.5.1 DHIS2 1.4 Meta-data export

The DHIS2 1.4 Meta-data export functionality provides the same functionality as the standard DHIS2 meta-data export, except that the resulting file can be used to transmit meta-data information to DHIS2 1.4 systems.

29.3.5.2 DHIS2 1.4 Detailed Metadata Export

The DHIS2 1.4 Metadata export functionality provides the same functionality as the detailed DHIS2 metadata export, except that the resulting file can be used to transmit meta-data information to DHIS2 1.4 systems. Simply select the data elements and indicators that you want and click “Export” to begin the export process.

29.3.5.3 DHIS2 1.4 Data export

This service allows you to export data to a format which can easily be imported into a compatible DHIS2 1.4 database.

29.3.5.4 XLS metadata export

Meta-data can be exported directly to the XLS format with this function. Simply click all of the available object which you wish to export and click “Export”.