Hey Community
We are excited to announce the release of version 6.0.0 of the DHIS2 adaptor, introducing significant enhancements to align with the latest DHIS2 version.This update migrates the adaptor to the new Tracker API (v36+) for resources such as trackedEntities
, enrollments
, events
, and relationships
. Notably, the trackedEntityInstances
resource is now deprecated.
The create
, update
, upsert
, and destroy
functions have been updated to automatically map affected resources to the new Tracker API endpoints. However, existing workflows utilizing these functions with the aforementioned resources may require adjustments to ensure compatibility with the new API structure.We recommend reviewing your code in accordance with the DHIS2 Tracker Migration Guide to understand the necessary changes.
For instance, previous implementations using:
create('trackedEntityInstances', {
/*...*/
});
should be updated to:
create('trackedEntities', {
/*...*/
});
Similarly, payload structures have evolved. For example, an event creation that previously looked like:
create('events', {
trackedEntityInstance: 'eBAyeGv0exc',
eventDate: '2024-01-01',
/* ... */
});
should now be modified to:
create('events', {
trackedEntity: 'eBAyeGv0exc',
occurredAt: '2024-01-01',
/* ... */
});
Please note that the HTTP APIs get()
, patch()
, and post()
will continue to call the specified URLs with the provided data without automatic mapping to the new Tracker API.This allows for direct interaction with any DHIS2 API endpoint.
We encourage all users to update to version 6.0.0 to take advantage of these improvements and to ensure seamless integration with DHIS2. As always, we appreciate your feedback and are here to assist with any questions during this transition.