Releases: OpenFn/language-dhis2
v2.0.10
v2.0.8
v2.0.7
v2.0.6
e54474e patch version bump
bdde425 package.json fixes'
3ac0c1d Cleaned up logging
04eabaa slight log changes
0d3be9b update package.json for npm'
983f507 Merge pull request #37 from OpenFn/dependabot/npm_and_yarn/lodash-4.17.21
7f4f24e Bump lodash from 4.17.19 to 4.17.21
7ee8a86 abstract demo server versions
Color-free logs
Standard, though less colorful, log output for a better UI in AceEditor
.
Using expandReferences from new common
v2.0.3 update name and version for npm
Better inline docs for new functions
v2.0.1 new version for helper docs
Broader API coverage
Version 2 sunsets the limited and specific operations from v1.4.0
and introduces a much broader selection of operations, prividing both specificity with high-use API endpoints and more generic functions to describe and understand the dhis2 api. Full docs at https://openfn.github.io/language-dhis2/
Upsert tracked entity instances
Currently, DHIS2 doesn't support upserts on tracked entity instances but many organizations need to either add or update TEIs based on an external ID. With this new upserTEI function, @chaiwa-berian wrapped up several different DHIS2 apis to build an upsert: first checking if the entity exists with a unique attribute and a get request, and then either creating or updating the TEI.
N.B., DHIS2 also doesn't support patch
for updates
on tracked entity instances, but we don't want to destroy existing attributes if information from an external system is incomplete, so we've defaulted the behaviour to merge the new data with existing data, unless { replace: true }
is set in the optional options
argument in upsertTEI(uuid, data, options);
upsertTEI using strategy=CREATE_AND_UPDATE
New helper function:
/**
* Create or update one or many new Tracked Entity Instances
* @public
* @example
* upsertTEI(data)
* @constructor
* @param {object} data - Payload data for new/updated tracked entity instance(s)
* @returns {Operation}
*/