Your organization is collecting immunization data in a custom HIS built on PostgreSQL.
Your government partner wants you to start sending weekly, aggregate reports to DHIS2 on immunization key indicator results. To do this, you need to automatically calculate indicator values based on the individual data collected in the HIS.
You’ve been asked to design a workflow to:
- extract data from your HIS (you've been given direct DB access)
- automatically calculate indicator results & map the data elements to the DHIS2 data model, and
- create
dataValue
records in DHIS2 in order to update related indicator reports
- Job 1: Get rows from the DB table
patient
- Job 2: Calculate the
# of OPV doses given
across all patients. Reported on the calculated sumvalue
to DHIS2 as a newdataValueSet
.
See Day 2 mapping spec here and sample output linked below.
Job 1: postgresql
DB
- Configuration: See slide 52 from training
Job 2: DHIS app
- Configuration: See slide 52 from training
See the latest Adaptor docs here: https://docs.openfn.org/adaptors/
See example JSON output from DHIS2 API documentation
FYI - To create dataValueSets, using the latest version of language-dhis2 See job example:
create('dataValueSets', {
dataSet: 'pBOMPrpg1QX',
completeDate: '2014-02-03',
period: '201401',
orgUnit: 'DiszpKrYNg8',
dataValues: [
{
dataElement: 'f7n9E0hX8qk', //dataElement you are reporting on
value: '1', //value to dynamically return based on calculations
}
],
});