Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * A generic helper method for getting data of any kind from DHIS2.
- * - This can be used to get `DataValueSets`,`events`,`trackedEntityInstances`,`etc.`
- * @public
- * @function
- * @param {string} resourceType - The type of resource to get(use its `plural` name). E.g. `dataElements`, `trackedEntityInstances`,`organisationUnits`, etc.
- * @param {object} [params] - Optional `query parameters` e.g. `{ou: 'DiszpKrYNg8'}`. Run `discover` or see {@link https://docs.dhis2.org/2.34/en/dhis2_developer_manual/web-api.html DHIS2 docs} for more details on which params to use for a given type of resource.
- * @param {{apiVersion: number,operationName: string,responseType: string}}[options] - `Optional` options for `getData` operation. Defaults to `{operationName: 'getData', apiVersion: state.configuration.apiVersion, responseType: 'json'}`.
- * @param {requestCallback} [callback] - Optional callback to handle the response
- * @returns {Promise<state>} state
- * @example <caption>Example getting one `trackedEntityInstance` with `Id` 'dNpxRu1mWG5' for a given `orgUnit(DiszpKrYNg8)`</caption>
- * getData('trackedEntityInstances', {
- * fields: '*',
- * ou: 'DiszpKrYNg8',
- * entityType: 'nEenWmSyUEp',
- * trackedEntityInstance: 'dNpxRu1mWG5',
- * })
- *
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement