This is the collection of tools that i use in day to day activities interacting with dhis.
Heads up! Its the work in progress.
Store db credentials in bin/env.json
with the following format
{
"user": "dhis",
"host": "localhost",
"database": "dhis2",
"password": "dhis",
"port": 5432
}
Prerequsite: install node from v8 since it uses async/wait
and many recent
ES6
features.
npm install
node bin/event-transaction --file pathtothefile.csv
The structure of the pathtothefile.csv
should be like this. It uses id so as
to reduce amount of time it takes to import single event.
storedby,status,executiondate,organisationunitid,programinstanceid,attributeoptioncomboid,programstageid,completedby,completeddate,dataElementid...
node bin/tei-delete --file pathtothefile.csv
The structure of the pathtothefile.csv
should be like this. It uses id so as
to reduce amount of time it takes to delete trackedentityinstance.
trackedentityinstanceid
node bin/updateLocationTei --file pathtothefile.csv
The structure of the pathtothefile.csv
should be like this. It uses id so as
to reduce amount of time it takes to delete trackedentityinstance.
trackedentityinstanceid,organisationunitid
node bin/updatedAttributesValues --file pathtothefile.csv
The structure of the pathtothefile.csv
should be like this. It uses id so as
to reduce amount of time it takes to delete trackedentityinstance.
trackedentityinstanceid,trackedEntityAttributesid1,trackedEntityAttributesid2 ...