Climate Demo (Lao PDR)

Aggregate to DHIS2 JSON

Exports DHIS2 JSON

Description

Aggregate a GeoZarr dataset to DHIS2 org units and save a named, deliverable DHIS2 export

Org-unit aggregation workflow for DHIS2. Loads a published GeoZarr dataset over a time range, spatially aggregates its variable within each GeoJSON feature (a DHIS2 organisation unit) using the chosen method, and saves the result as a DHIS2 dataValueSet through a named export configured in climate-service.yaml.

The named export owns every instance-specific setting: data element and category option combos, period type, the DHIS2 connection, and the optional dataset and org-unit references. The workflow itself stays reusable across instances. As a batch job it writes a versioned delivery manifest, so the saved result can be submitted to POST /exports/{export_id} for DHIS2 delivery.

Each feature's GeoJSON id must be the DHIS2 organisation unit UID. Aggregation is performed at the dataset's native temporal resolution, so the export's period_type must match it. When the export declares aggregation, it must equal method.

For an ad-hoc payload without instance configuration, write the graph directly and call save_result with format DHIS2JSON and the data_element_id, org_unit_field, and period_type options; such a payload is downloadable but not eligible for server-side delivery.

Usage:

{
  "agg": {
    "process_id": "aggregate_to_dhis2_json",
    "arguments": {
      "dataset_id": "era5land_precipitation_monthly",
      "temporal_extent": ["2025-01-01", "2025-12-31"],
      "geometries": { "type": "FeatureCollection", "features": [ ... ] },
      "export": "rainfall-monthly",
      "method": "mean"
    },
    "result": true
  }
}

Parameters

Name Type Description
dataset_id
required
string ID of the published GeoZarr collection to aggregate (as listed under /datasets).
temporal_extent
required
temporal-interval Time range to load as [start, end] ISO-8601 date strings.
geometries
required
geojson GeoJSON FeatureCollection of organisation units. Each feature's id must be its DHIS2 organisation unit UID.
export
required
string ID of a named DHIS2 export declared under exports in the instance configuration. It supplies the data element mapping, period type, and delivery connection.
method
required, default "mean"
mean | min | max | sum | median Spatial aggregation method applied to the pixels within each org unit: mean (default), min, max, sum, or median.

Produces

Exports DHIS2 JSON.

Automation

No automation runs this workflow on this instance.