Download DHIS2 Developer Manual

Transcript
Web API
Update strategies
For completing a enrollment for a tracked entity instance you can make a PUT request to the following URL:
/api/enrollments/<enrollment-id>/completed
For deleting a enrollment, you can make a DELETE request to the following URL:
/api/enrollments/<enrollment-id>
1.43.5. Update strategies
Two update strategies for tracked entity instance are supported: enrollment and event creation. This is useful when you
have generated an identifier on the client side and are not sure if it was created or not on the server.
Table 1.60. Available tracker strategies
Parameter
Description
CREATE
Create only, this is the default behavior.
CREATE_AND_UPDATE Try and match the ID, if it exist then update, if not create.
To change the parameter, please use the strategy parameter:
POST /api/trackedEntityInstances?strategy=CREATE_AND_UPDATE
1.44. Enrollment instance query
To query for tracked entity instances you can interact with the /api/enrollments resource.
1.44.1. Request syntax
Table 1.61. Tracked entity instances query parameters
Query
parameter
Description
ou
Organisation unit idenfiers, separated by ";".
ouMode
The mode of selecting organisation units, can be SELECTED | CHILDREN | DESCENDANTS
| ACCESSIBLE | ALL. Default is SELECTED, which refers to the selected organisation units
only. See table below for explanations.
program
Program identifier. Restricts instances to being enrolled in the given program.
programStatus
Status of the instance for the given program. Can be ACTIVE | COMPLETED | CANCELLED.
followUp
Follow up status of the instance for the given program. Can be true | false or omitted.
programStartDate Start date of enrollment in the given program for the tracked entity instance.
programEndDate End date of enrollment in the given program for the tracked entity instance.
trackedEntity
Tracked entity identifer. Restricts instances to the given tracked instance type.
trackedEntityInstsane
Tracked entity instance identifier. Should not be used together with trackedEntity.
page
The page number. Default page is 1.
pageSize
The page size. Default size is 50 rows per page.
totalPages
Indicates whether to include the total number of pages in the paging response (implies higher
response time).
skipPaging
Indicates whether paging should be ignored and all rows should be returned.
The available organisation unit selection modes are explained in the following table.
92