跳转至
For the complete DHIS2 documentation index, see llms.txt.

用户界面定制

要自定义 DHIS2 应用项目的 UI,您可以插入自定义 JavaScript 和 CSS 样式通过 files 资源。

```

POST删除后/ api / 33 / files / script POST GET DELETE / api / 33 / files / style

通过此资源插入的 JavaScript 和 CSS 内容将由
DHIS2 网络应用项目。这在某些情况下特别有用:

### 跟踪实体{ #tracked-entities } 

登录页面或主页。

| 指标组 | Parameter name | 检索和删除项目通知模板 | 是的 | Potential duplicate status | 描述 |
|---|---|---|---|---|---|
| storeCopy | 要创建自定义模板,建议从现有模板开始(这些模板可在登录应用项目的扩展 dhis-web-login/#download 中下载)。 | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | 价值 | The value of the tracked entity attribute. |
| `{"organisationUnit": "a3kGcGDCuk7"}` | Tracker { #webapi_tracker } | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | 价值 | The value of the tracked entity attribute. |
| 类型 | Property | Program notification template | Program notification template | Immutable | 类型 |
| 身份证 | trackedEntity | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Immutable | 类型 |
| String:Uid | trackedEntityType | Program notification template | Program notification template | Immutable | 类型 |
| DateTime | createdAt | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Immutable | 类型 |
| `{"type":"ABSOLUTE","startDate":"2020-03-01","endDate":"2022-12-30"}` | createdAtClient | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | 价值 | The value of the tracked entity attribute. |
| YYYY-MM-DDThh:mm:ss | updatedAt | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | *userDataStore* 由用户、命名空间、键和关联的
值。用户、命名空间和密钥的组合是唯一的。 | Date:ISO 8601 |
| ID | updatedAtClient | Program notification template | Program notification template | *userDataStore* 由用户、命名空间、键和关联的
值。用户、命名空间和密钥的组合是唯一的。 | Date:ISO 8601 |
| 串 | orgUnit | Program notification template | Program notification template | *userDataStore* 由用户、命名空间、键和关联的
值。用户、命名空间和密钥的组合是唯一的。 | String:Uid |
| In the case of CSV, the `fields` request parameter has no effect, and the response will always
contain the following fields: | inactive | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | 是的 | String:any |
| 日期时间 | deleted | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | 不 | Boolean |
|     GET /api/metadata/proposals/ | createdAt | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Sharing of data store keys follows the same principle as for other metadata sharing (see
[Sharing](sharing.md#webapi_sharing)). | String:Any |
| Latitude of a `Point` type of Geometry | updatedAt | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Sharing of data store keys follows the same principle as for other metadata sharing (see
[Sharing](sharing.md#webapi_sharing)). | String:Any |
| {<br>"type": "POINT",<br>"coordinates": [123.0, 123.0]<br>} | storedBy | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | 是的 | String:Uid |
| Duration | createdBy | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | 是的 | 用户 |
| {<br>"uid": "ABCDEF12345",<br>"username": "username",<br>"firstName": "John",<br>"surname": "Doe"<br>} | updatedBy | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | 不 | String:Uid |
| {<br>"uid": "ABCDEF12345",<br>"username": "username",<br>"firstName": "John",<br>"surname": "Doe"<br>} | 属性 | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | 是的 | List of TrackedEntityAttributeValue |

See Attribute

### 注册{ #enrollments } 

A list of enrollments owned by the tracked entity.

| 指标组 | Parameter name | 检索和删除项目通知模板 | 是的 | Potential duplicate status | 描述 |
|---|---|---|---|---|---|
| 文本 | 是的 | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | 价值 | The value of the tracked entity attribute. |
| `{ "periodFrom": -15, "periodTo": 15}` | 是的 | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Program notification template | 价值 | The value of the tracked entity attribute. |
| storeCopy | Property | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | 价值 | The value of the tracked entity attribute. |
| 用户友好型消息,说明操作是否成功。 | enrollment | Program notification template | Program notification template | DateTime | String:Uid |
| `{"type":"ABSOLUTE","startDate":"2020-03-01","endDate":"2022-12-30"}` | 项目 | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Program notification template | 价值 | The value of the tracked entity attribute. |
| 类型 | trackedEntity | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Immutable | 类型 |
| 身份证 | status | Program notification template | Program notification template | Immutable | 类型 |
| String:Uid | orgUnit | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Immutable | 类型 |
| DateTime | createdAt | Program notification template | Program notification template | Immutable | 类型 |
| 例 | createdAtClient | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Immutable | 类型 |
| To retrieve an event with a specific ID: | updatedAt | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Immutable | 类型 |
| WKT, can be omitted it in case of a `Point` type and with `latitude` and `longitude` provided | updatedAtClient | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Immutable | 类型 |
| 日期时间 | enrolledAt | Program notification template | Program notification template | 是的 | Boolean |
| Table: Program Stage Query Criteria | occurredAt | Program notification template | Program notification template | *userDataStore* 由用户、命名空间、键和关联的
值。用户、命名空间和密钥的组合是唯一的。 | Date:ISO 8601 |
| ID | completedAt | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | *userDataStore* 由用户、命名空间、键和关联的
值。用户、命名空间和密钥的组合是唯一的。 | Date:ISO 8601 |
| In the case of CSV, the `fields` request parameter has no effect, and the response will always
contain the following fields: | completedBy | Program notification template | Program notification template | 是的 | String:any |
| 日期时间 | 跟进 | Program notification template | Program notification template | 不 | Boolean |
|     GET /api/metadata/proposals/ | createdAt | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Sharing of data store keys follows the same principle as for other metadata sharing (see
[Sharing](sharing.md#webapi_sharing)). | String:Any |
| Latitude of a `Point` type of Geometry | updatedAt | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Sharing of data store keys follows the same principle as for other metadata sharing (see
[Sharing](sharing.md#webapi_sharing)). | String:Any |
| {<br>"type": "POINT",<br>"coordinates": [123.0, 123.0]<br>} | storedBy | Program notification template | Program notification template | 是的 | String:Uid |
| 用于项目阶段引用的 IdScheme。默认为 `idScheme` 参数。 | createdBy | Program notification template | Program notification template | 是的 | 用户 |
| {<br>"uid": "ABCDEF12345",<br>"username": "username",<br>"firstName": "John",<br>"surname": "Doe"<br>} | updatedBy | Program notification template | Program notification template | 不 | String:Uid |
| ABCDEF12345 | 属性 | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | 不 | 用户 |
| > **注**
>
> 以下属性可能使用了外部系统的引用,因此被特意排除在合并之外。如果这些字段出现问题,可能需要更新。 
>
> 指标: aggregateExportCategoryOptionCombo & aggregateExportAttributeOptionCombo
>
> 项目指标: aggregateExportCategoryOptionCombo & aggregateExportAttributeOptionCombo | 报名的属性选项组合。如果没有提供,则使用程序类别组合定义的默认值。 | Program notification template | Program notification template | 价值 | The value of the tracked entity attribute.

See Attribute

### events

A list of events owned by the enrollment.

不

| 指标组 | Parameter name | 检索和删除项目通知模板 | 是的 | Potential duplicate status | 描述 |
|---|---|---|---|---|---|
| The message text. | List of Relationship | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | 价值 | The value of the tracked entity attribute. |
| See an example payload below. | List of Note | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Program notification template | 价值 | The value of the tracked entity attribute. |
| 文本 | Property | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | 价值 | The value of the tracked entity attribute. |
| `{ "periodFrom": -15, "periodTo": 15}` | 仅用于读取数据。拥有该事件的注册项目类型。 | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | 价值 | The value of the tracked entity attribute. |
| storeCopy | 项目阶段 | Program notification template | Program notification template | 价值 | The value of the tracked entity attribute. |
| 用户友好型消息,说明操作是否成功。 | enrollment | Program notification template | Program notification template | DateTime | String:Uid |
| `{"type":"ABSOLUTE","startDate":"2020-03-01","endDate":"2022-12-30"}` | 项目 | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Program notification template | 价值 | The value of the tracked entity attribute. |
| 类型 | trackedEntity | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Immutable | 类型 |
| 身份证 | status | Program notification template | Program notification template | Immutable | 类型 |
| String:Uid | orgUnit | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Immutable | 类型 |
| DateTime | createdAt | Program notification template | Program notification template | Immutable | 类型 |
| If not otherwise specified, JSON is the default response for the `GET` method. The API also 
supports CSV export for single and collection endpoints. Furthermore, it supports compressed 
JSON and CSV for the collection endpoint. | createdAtClient | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Immutable | 类型 |
| To retrieve an event with a specific ID: | updatedAt | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Immutable | 类型 |
| WKT, can be omitted it in case of a `Point` type and with `latitude` and `longitude` provided | updatedAtClient | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Immutable | 类型 |
| 日期时间 | scheduledAt | Program notification template | Program notification template | 是的 | Boolean |
| Table: Program Stage Query Criteria | occurredAt | Program notification template | Program notification template | *userDataStore* 由用户、命名空间、键和关联的
值。用户、命名空间和密钥的组合是唯一的。 | Date:ISO 8601 |
| ID | completedAt | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | *userDataStore* 由用户、命名空间、键和关联的
值。用户、命名空间和密钥的组合是唯一的。 | Date:ISO 8601 |
| In the case of CSV, the `fields` request parameter has no effect, and the response will always
contain the following fields: | completedBy | Program notification template | Program notification template | 是的 | String:any |
| 日期时间 | 跟进 | Program notification template | Program notification template | 不 | Boolean |
|     GET /api/metadata/proposals/ | createdAt | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Sharing of data store keys follows the same principle as for other metadata sharing (see
[Sharing](sharing.md#webapi_sharing)). | String:Any |
| Latitude of a `Point` type of Geometry | updatedAt | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Sharing of data store keys follows the same principle as for other metadata sharing (see
[Sharing](sharing.md#webapi_sharing)). | String:Any |
| > **注**
>
> 以下属性可能使用了外部系统的引用,因此被特意排除在合并之外。如果这些字段出现问题,可能需要更新。 
>
> 指标: aggregateExportCategoryOptionCombo & aggregateExportAttributeOptionCombo
>
> 项目指标: aggregateExportCategoryOptionCombo & aggregateExportAttributeOptionCombo | 事件的属性选项组合。如果没有提供,则使用程序类别组合定义的默认值。 | Program notification template | Program notification template | 价值 | The value of the tracked entity attribute.
| boolean | 事件的属性类别选项。如果没有提供,则使用由程序类别组合定义的默认值 | Program notification template | Program notification template | 价值 | The value of the tracked entity attribute.
| 布尔 | updatedBy | Program notification template | Program notification template | Sharing of data store keys follows the same principle as for other metadata sharing (see
[Sharing](sharing.md#webapi_sharing)). | String:Any |
| {<br>"uid": "ABCDEF12345",<br>"username": "username",<br>"firstName": "John",<br>"surname": "Doe"<br>} | attributeOptionCombo | Program notification template | Program notification template | 是的 | String:Uid |
| {<br>"uid": "ABCDEF12345",<br>"username": "username",<br>"firstName": "John",<br>"surname": "Doe"<br>} | attributeCategoryOptions | Program notification template | Program notification template | 不 | String:Uid |
| ABCDEF12345 | assignedUser | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | 不 | 用户 |

### 人际关系 { #relationships } 

dataValues

| 指标组 | Parameter name | 检索和删除项目通知模板 | 是的 | Potential duplicate status | 描述 |
|---|---|---|---|---|---|
| A list of relationships connected to the event. | 不 | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | 价值 | The value of the tracked entity attribute. |
| Notes connected to the event. It can only be created. | 不 | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | 价值 | The value of the tracked entity attribute. |
| `Relationships` are objects that link together two other tracker objects. The constraints each side
of the relationship must conform to are based on the `Relationship Type` of the `Relationship`. | Property | Program notification template | Program notification template | 不 | 类型 |
| 类型 | relationship | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Immutable | 类型 |
| String:Uid | relationshipType | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Immutable | 类型 |
| 身份证 | relationshipName | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Immutable | 类型 |
| Sibling | createdAt | Program notification template | Program notification template | *userDataStore* 由用户、命名空间、键和关联的
值。用户、命名空间和密钥的组合是唯一的。 | Date:ISO 8601 |
| YYYY-MM-DDThh:mm:ss | updatedAt | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | 是的 | Date:ISO 8601 |

YYYY-MM-DDThh:mm:ss

### 属性 { #attributes } 

Timestamp when the user created the relationship on the client.

| 指标组 | Parameter name | 检索和删除项目通知模板 | 是的 | Potential duplicate status | 描述 |
|---|---|---|---|---|---|
| 不 | 不 | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | 价值 | The value of the tracked entity attribute. |
| 是的 | 是的 | Program notification template | Program notification template | 不 | 属性 |
| 属性是描述被跟踪实体的值。属性可以通过
通过被跟踪实体类型或项目关联。这意味着属性既可以是被追踪实体的一部分,也可以是注册的一部分。
跟踪实体和注册的一部分。重要的是,一个属性只能有一个值,即使一个
一个属性只能有一个值,即使一个被跟踪实体有多个注册表来定义该属性。这是因为
实体最终拥有属性值。 | Property | Program notification template | Program notification template | 不 | 类型 |
| 类型 | attribute | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Immutable | 类型 |
| String:Uid | 码 | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Immutable | 类型 |
| 日期时间 | displayName | Program notification template | Program notification template | 不 | Boolean |
| 名称 | createdAt | Program notification template | Program notification template | DateTime | Date:ISO 8601 |
| 日期时间 | updatedAt | Program notification template | Program notification template | 不 | Boolean |

YYYY-MM-DDThh:mm:ss

### storedBy

Client reference for who stored/created the value.

| 指标组 | Parameter name | 检索和删除项目通知模板 | 是的 | Potential duplicate status | 描述 |
|---|---|---|---|---|---|
| 最小最大数据元素 | 不 | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | 价值 | The value of the tracked entity attribute. |
| 日期时间 | 不 | Program notification template | Program notification template | 不 | 123 |
| 日期时间 | While attributes describe a tracked entity, data values describe an event. | Program notification template | Program notification template | *userDataStore* 由用户、命名空间、键和关联的
值。用户、命名空间和密钥的组合是唯一的。 | Immutable |
| 类型 | 例 | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Immutable | 类型 |
| String:Uid | 码 | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Immutable | 类型 |
| 日期时间 | displayName | Program notification template | Program notification template | 不 | Boolean |
|     GET /api/metadata/proposals/ | createdAt | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Sharing of data store keys follows the same principle as for other metadata sharing (see
[Sharing](sharing.md#webapi_sharing)). | String:Any |
| Latitude of a `Point` type of Geometry | updatedAt | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Sharing of data store keys follows the same principle as for other metadata sharing (see
[Sharing](sharing.md#webapi_sharing)). | String:Any |

YYYY-MM-DDThh:mm:ss

### 笔记 { #notes } 

在需要记录有关具体问题的补充信息或说明的情况下,可以使用注释来记录。
可以使用注释来记录。

不

不

String:Any

John Doe

| 指标组 | Parameter name | 检索和删除项目通知模板 | 是的 | Potential duplicate status | 描述 |
|---|---|---|---|---|---|
| updatedBy | Only for reading data. User that last updated the object. Set on the server. | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | 价值 | The value of the tracked entity attribute. |
| 日期时间 | 笔记 | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | 不 | Notes do not have a dedicated endpoint; they are exchanged as part of the parent event and/or
enrollment payload. A sample payload is found below. |
| ```json
{
  "trackedEntity": "oi3PMIGYJH8",
  "enrollments": [
    {
      "enrollment": "EbRsJr8LSSO",
      "notes": [
        {
          "note": "vxmCvYcPdaW",
          "value": "Enrollment note 1"
        },
        {
          "value": "Enrollment note 2."
        }
      ],
      "events": [
        {
          "event": "zfzS9WeO0uM",
          "notes": [
            {
              "note": "MAQFb7fAggS",
              "value": "Event Note 1."
            },
            {
              "value": "Event Note 2."
            }
          ]
        }
      ]
    }
  ]
}
``` | Property | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Immutable | 类型 |
| 日期时间 | note | Program notification template | Program notification template | 不 | Boolean |
|     GET /api/metadata/proposals/ | createdAt | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | Sharing of data store keys follows the same principle as for other metadata sharing (see
[Sharing](sharing.md#webapi_sharing)). | String:Any |

### 用户数 { #users } 

| 指标组 | Parameter name | 检索和删除项目通知模板 | 是的 | Potential duplicate status | 描述 |
|---|---|---|---|---|---|
| storedByDataValue | Client reference for who stored/created the note. | 不 | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | 价值 | The value of the tracked entity attribute. |
| createdBy | Only for reading data. User that created the object. Set on the server. | 不 | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | 不 | 123 |
| {<br>"uid": "ABCDEF12345",<br>"username": "username",<br>"firstName": "John",<br>"surname": "Doe"<br>} | Users | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | 不 | Immutable |
| 类型 | 例 | Program notification template | ```json
{
    "name": "Case notification",
    "notificationTrigger": "ENROLLMENT",
    "subjectTemplate": "Case notification V{org_unit_name}",
    "displaySubjectTemplate": "Case notification V{org_unit_name}",
    "notifyUsersInHierarchyOnly": false,
    "sendRepeatable": false,
    "notificationRecipient": "ORGANISATION_UNIT_CONTACT",
    "notifyParentOrganisationUnitOnly": false,
    "displayMessageTemplate": "Case notification A{h5FuguPFF2j}",
    "messageTemplate": "Case notification A{h5FuguPFF2j}",
    "deliveryChannels": [
        "EMAIL"
    ]
}
``` | 不 | 是的 |

String:Uid

## ID 计划{ #id-schemes } 

用户名

Username used by the user.

* Yes*
* 是的
* String:Any

firstName

Only for reading data. First name of the user.

* 不
* 是的

String:Any

导入希望元数据标识符只使用所选的 `idScheme`。同样,元数据
只能使用所选的 `idScheme` 导出。如果元数据缺少所选 `idScheme` 的标识符、
就会收到如下错误。

surname

Only for reading data. Last name of the user.

* 不
* 是的

## String:Any

Doe

> **Note**
>
> Either `uid` or `username` must be provided. If both are provided, only username is
> considered.

* Side Effects
* 类型
* 支持的
* `GET /api/tracker/events/{uid}/changeLogs`
* [tracked entity export](tracker.md#webapi_tracker_export_tracked_entities)

### [event export](tracker.md#webapi_tracker_export_events)

See each section for request parameters.

| 允许值 | Parameter name | Potential duplicate status | `order` | The import expects metadata identifiers to only use the chosen `idScheme`. Similarly, metadata is 
exported only using the chosen `idScheme`. If metadata lacks identifiers for the chosen `idScheme`, 
you'll receive an error like the below. |
|---|---|---|---|---|
| 异步导入时,会立即返回一个 *Location* 标头,指向 *importReport* 的位置。有效载荷还包含一个已创建任务的 json 对象。 | To resolve this, either: | *userDataStore* 由用户、命名空间、键和关联的
值。用户、命名空间和密钥的组合是唯一的。 | 跟踪器或事件项目的标识符。该参数为必填参数。 | Tracker import { #webapi_tracker_import } |
| ```
GET /tracker/jobs/{uid}
``` | The endpoint `POST /api/tracker` is also called the tracker importer. This endpoint allows clients
to import i.e. create, update and delete | DateTime | Enrollments | 大事记 |
| 设置整体导入模式,决定是否仅 `VALIDATE` 或也 `COMMIT` 元数据,这与我们旧的 dryRun 标志具有相似的功能。 | Objects embedded in other [tracker objects](tracker.md#webapi_tracker_objects) | DateTime | 跟踪器导入项目支持以下参数: | Parameter name |
| 描述 | 类型 | DateTime | Enum | Narrows response to tracked entities matching given filters. More on filters [here](tracker.md#tracked_entity_attribute_filtering) |
| DateTime | enrollmentEnrolledBefore | DateTime | Enum | importMode |
| programStageIdScheme  | [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) | DateTime | Enum |importMode |
| Can either be `VALIDATE` which will report errors in the payload without making changes to the database or `COMMIT` (default) which will validate the payload and make changes to the database.  | 方案 | DateTime | Enum | importMode |
| IdScheme used for all metadata references unless overridden by a metadata specific parameter. Default is `UID`.  | `UID`, `CODE`, `NAME`, `ATTRIBUTE:{uid}` | DateTime | Enum | importMode |
| programIdScheme  | `UID`, `CODE`, `NAME`, `ATTRIBUTE:{uid}` | DateTime | Enum | importMode |
| `UID`, `CODE`, `NAME`, `ATTRIBUTE:{uid}`  | `UID`, `CODE`, `NAME`, `ATTRIBUTE:{uid}` | DateTime | Enum | importMode |
| Sets import strategy, `CREATE_AND_UPDATE` will try and match on identifier, if it doesn't exist, it will create the object. | Enum | DateTime | `idScheme` parameter | 项目阶段标识方案 |
| 设置原子模式,在旧的导入器中,我们总是进行*best effort*导入,这意味着即使某些引用不存在,我们仍然会导入(即数据元素组导入时缺少数据元素)。新进口商的默认设置是不允许这样做,并且类似地拒绝任何验证错误。设置 `NONE` 模式模拟了旧的行为. | Enum | DateTime | `idScheme` parameter | categoryOptionComboIdScheme |
| 设置刷新模式,控制何时刷新内部缓存。*强烈*建议将其保留为`AUTO`(这是默认设置)。仅将 `OBJECT` 用于调试目的,您会看到休眠异常并想查明堆栈发生的确切位置(休眠只会在刷新时抛出,因此很难知道哪个对象有问题)。 | Enum | DateTime | `idScheme` parameter | categoryOptionIdScheme |
| IdScheme used for category option references. Defaults to the `idScheme` parameter. | Enum | DateTime | `idScheme` parameter | importStrategy |
| Indicates the effect the import should have. Can either be `CREATE`, `UPDATE`, `CREATE_AND_UPDATE` and `DELETE`, which respectively only allows importing new data, importing changes to existing data, importing any new or updates to existing data, and finally deleting data. | Enum | *userDataStore* 由用户、命名空间、键和关联的
值。用户、命名空间和密钥的组合是唯一的。 | 跟踪器或事件项目的标识符。该参数为必填参数。 | flushMode |
| Indicates how the import responds to validation errors. If `ALL`, all data imported must be valid for any data to be committed. For `OBJECT`, only the data committed needs to be valid, while other data can be invalid. | Enum | *userDataStore* 由用户、命名空间、键和关联的
值。用户、命名空间和密钥的组合是唯一的。 | 跟踪器或事件项目的标识符。该参数为必填参数。 | flushMode |
| Indicates the frequency of flushing. This is related to how often data is pushed into the database during the import. Primarily used for debugging reasons, and should not be changed in a production setting | Enum | *userDataStore* 由用户、命名空间、键和关联的
值。用户、命名空间和密钥的组合是唯一的。 | 跟踪器或事件项目的标识符。该参数为必填参数。 | flushMode |

#### 同步和异步{ #sync-and-async } 

对用户来说,同步导入和异步导入的主要区别在于 API 响应的时间。
API 响应的时间。同步导入会在导入完成后立即提供 [导入摘要](tracker.md#webapi_tracker_import_summary)
导入完成后,会立即提供 [导入摘要](#webapi_tracker_import_summary)。相反,异步导入会立即返回导入任务的引用。
的引用。可以使用此 `response.location`来跟踪导入任务的进度。异步导入响应的示例
异步导入响应的示例如下。

`FULL`, `FAIL_FAST`, `SKIP`

`FULL`

### 有效载荷{ #payload } 

If true, it will skip validating the pattern of generated attributes.

#### 扁平有效载荷{ #flat-payload } 

`true`, `false`

``json
{
  "trackedEntities":[
    {
      "orgUnit":"y77LiPqLMoq"、
      "trackedEntity":"Kj6vYde4LHh"、
      "trackedEntityType":"nEenWmSyUEp" }.
    },
    {
      "orgUnit":"y77LiPqLMoq"、
      "trackedEntity":"Gjaiu3ea38E"、
      "trackedEntityType":"nEenWmSyUEp" }
    }
  ],
  "注册":[
    {
      "enrolledAt":"2019-08-19T00:00:00.000",
      "注册":"MNWZ6hnuhSw"、
      "occurredAt":"2019-08-19T00:00:00.000",
      "orgUnit":"y77LiPqLMoq"、
      "程序": "IpHINAT79U"IpHINAT79UW"、
      "状态":"ACTIVE"、
      "trackedEntity":"Kj6vYde4LHh"、
      "trackedEntityType":"nEenWmSyUEp"、
      "attributeOptionCombo":"HllvX50cXC0"、
    }
  ],
  "事件":[
    {
      "attributeCategoryOptions":"xYerKDKCefk"、
      "attributeOptionCombo":"HllvX50cXC0"、
      "dataValues":[
        {
          "dataElement":"bx6fsa0t90x"、
          "值":"true
        },
        {
          "dataElement":"UXz7xuGCEhU"、
          "值":"5.7"
        }
      ],
      "注册":"MNWZ6hnuhSw"、
      "enrollmentStatus"(注册状态):"ACTIVE"、
      "事件": "ZwwuwNp6gVd":"ZwwuwNp6gVd"、
      "occurredAt":"2019-08-01T00:00:00.000",
      "orgUnit":"y77LiPqLMoq"、
      "程序": "IpHINAT79U"IpHINAT79UW"、
      "programStage":"A03MvHHogjR"、
      "scheduledAt":"2019-08-19T13:59:13.688",
      状态"ACTIVE"、
      "trackedEntity":"Kj6vYde4LHh"
    },
    {
      "attributeCategoryOptions":"xYerKDKCefk"、
      "attributeOptionCombo":"HllvX50cXC0"、
      "注册": "MNWZ6hnn"MNWZ6hnuhSw"、
      "enrollmentStatus"(注册状态):"ACTIVE"、
      "事件": "XwwuwNp6"XwwuwNp6gVE"、
      "occurredAt":"2019-08-01T00:00:00.000",
      "orgUnit":"y77LiPqLMoq"、
      "程序": "IpHINAT79U"IpHINAT79UW"、
      "programStage":"ZzYYXq4fJie"、
      "scheduledAt":"2019-08-19T13:59:13.688",
      "status":"ACTIVE"、
      "trackedEntity":"Kj6vYde4LHh"
    }
  ],
  "关系":[
    {
      "来自":{
        "trackedEntity":{
          "trackedEntity":"Kj6vYde4LHh"
        }
      },
      "relationshipType":"dDrh5UyCyvQ"、
      "到":{
        "trackedEntity":{
          "trackedEntity":"Gjaiu3ea38E"
        }
      }
    }
  ]
}

嵌套有效载荷{ #nested-payload }

If true, it will skip running any side effects for the import

虽然嵌套的有效载荷更便于客户管理,但有效载荷总是会在导入前被扁平化 在导入之前。对于大型导入,使用扁平结构有效载荷可提供更多控制,并 > 减少导入过程中的开销。 减少导入过程中的开销。但是,不能嵌套新的跟踪实体、 关系中的 > 注册或事件。

true, false

创建{ #create }

skipRuleEngine

更新{ #update }

Boolean

有效负载必须包括要更新对象的所有字段,即使这些字段没有被修改。 修改。唯一的例外是集合。集合中不应更改的项目可以省略。 省略,如 update attribute values 和 [update data 值](#update-data-values)中所示。

已删除的跟踪器对象和关系无法更新。

更新属性值{ #update-attribute-values }

The main difference for the user between synchronous and asynchronous imports is the timing of the API response. Synchronous imports provide an immediate import summary once the import is finished. In contrast, asynchronous imports return a reference to the import job right away. The progress of the import job can be tracked using this response.location. An example of an asynchronous import response is found below.

{
  "httpStatus": "OK",
  "httpStatusCode": 200,
  "status": "OK",
  "message": "Tracker job added",
  "response": {
    "id": "cHh2OCTJvRw",
    "location": "https://play.im.dhis2.org/dev/api/tracker/jobs/cHh2OCTJvRw"
  }
}

For large imports, opting for asynchronous import can be advantageous, as it prevents long waiting times for a response.

Payload

删除属性值{ #delete-attribute-values }

Flat payload

{
  "httpStatus": "OK",
  "httpStatusCode": 200,
  "status": "OK",
  "message": "Tracker job added",
  "response": {
    "id": "cHh2OCTJvRw",
    "location": "https://play.im.dhis2.org/dev/api/tracker/jobs/cHh2OCTJvRw"
  }
}
{
  "trackedEntities": [
    {
      "orgUnit": "y77LiPqLMoq",
      "trackedEntity": "Kj6vYde4LHh",
      "trackedEntityType": "nEenWmSyUEp"
    },
    {
      "orgUnit": "y77LiPqLMoq",
      "trackedEntity": "Gjaiu3ea38E",
      "trackedEntityType": "nEenWmSyUEp"
    }
  ],
  "enrollments": [
    {
      "enrolledAt": "2019-08-19T00:00:00.000",
      "enrollment": "MNWZ6hnuhSw",
      "occurredAt": "2019-08-19T00:00:00.000",
      "orgUnit": "y77LiPqLMoq",
      "program": "IpHINAT79UW",
      "status": "ACTIVE",
      "trackedEntity": "Kj6vYde4LHh",
      "trackedEntityType": "nEenWmSyUEp"
    }
  ],
  "events": [
    {
      "attributeCategoryOptions": "xYerKDKCefk",
      "attributeOptionCombo": "HllvX50cXC0",
      "dataValues": [
        {
          "dataElement": "bx6fsa0t90x",
          "value": "true"
        },
        {
          "dataElement": "UXz7xuGCEhU",
          "value": "5.7"
        }
      ],
      "enrollment": "MNWZ6hnuhSw",
      "enrollmentStatus": "ACTIVE",
      "event": "ZwwuwNp6gVd",
      "occurredAt": "2019-08-01T00:00:00.000",
      "orgUnit": "y77LiPqLMoq",
      "program": "IpHINAT79UW",
      "programStage": "A03MvHHogjR",
      "scheduledAt": "2019-08-19T13:59:13.688",
      "status": "ACTIVE",
      "trackedEntity": "Kj6vYde4LHh"
    },
    {
      "attributeCategoryOptions": "xYerKDKCefk",
      "attributeOptionCombo": "HllvX50cXC0",
      "enrollment": "MNWZ6hnuhSw",
      "enrollmentStatus": "ACTIVE",
      "event": "XwwuwNp6gVE",
      "occurredAt": "2019-08-01T00:00:00.000",
      "orgUnit": "y77LiPqLMoq",
      "program": "IpHINAT79UW",
      "programStage": "ZzYYXq4fJie",
      "scheduledAt": "2019-08-19T13:59:13.688",
      "status": "ACTIVE",
      "trackedEntity": "Kj6vYde4LHh"
    }
  ],
  "relationships": [
    {
      "from": {
        "trackedEntity": {
          "trackedEntity": "Kj6vYde4LHh"
        }
      },
      "relationshipType": "dDrh5UyCyvQ",
      "to": {
        "trackedEntity": {
          "trackedEntity": "Gjaiu3ea38E"
        }
      }
    }
  ]
}

更新数据值{ #update-data-values }

Nested payloads are the most commonly used structure, where tracker objects are embedded within their parent objects, such as an enrollment within a tracked entity. The advantage of this structure is that the client does not need to provide UIDs for these references, as this is handled automatically.

{
  "httpStatus": "OK",
  "httpStatusCode": 200,
  "status": "OK",
  "message": "Tracker job added",
  "response": {
    "id": "cHh2OCTJvRw",
    "location": "https://play.im.dhis2.org/dev/api/tracker/jobs/cHh2OCTJvRw"
  }
}
{
  "trackedEntities": [
    {
      "enrollments": [
        {
          "attributes": [
            {
              "attribute": "zDhUuAYrxNC",
              "displayName": "Last name",
              "value": "Kelly"
            },
            {
              "attribute": "w75KJ2mc4zz",
              "displayName": "First name",
              "value": "John"
            }
          ],
          "enrolledAt": "2019-08-19T00:00:00.000",
          "events": [
            {
              "attributeCategoryOptions": "xYerKDKCefk",
              "attributeOptionCombo": "HllvX50cXC0",
              "dataValues": [
                {
                  "dataElement": "bx6fsa0t90x",
                  "value": "true"
                },
                {
                  "dataElement": "UXz7xuGCEhU",
                  "value": "5.7"
                }
              ],
              "enrollmentStatus": "ACTIVE",
              "notes": [
                {
                  "value": "need to follow up"
                }
              ],
              "occurredAt": "2019-08-01T00:00:00.000",
              "orgUnit": "y77LiPqLMoq",
              "program": "IpHINAT79UW",
              "programStage": "A03MvHHogjR",
              "scheduledAt": "2019-08-19T13:59:13.688",
              "status": "ACTIVE"
            }
          ],
          "occurredAt": "2019-08-19T00:00:00.000",
          "orgUnit": "y77LiPqLMoq",
          "program": "IpHINAT79UW",
          "status": "ACTIVE",
          "trackedEntityType": "nEenWmSyUEp"
        }
      ],
      "orgUnit": "y77LiPqLMoq",
      "trackedEntityType": "nEenWmSyUEp"
    }
  ]
}

删除数据值{ #delete-data-values }

Make a POST request to /api/tracker with the importStrategy set to CREATE or CREATE_AND_UPDATE and a payload as described here.

{
  "httpStatus": "OK",
  "httpStatusCode": 200,
  "status": "OK",
  "message": "Tracker job added",
  "response": {
    "id": "cHh2OCTJvRw",
    "location": "https://play.im.dhis2.org/dev/api/tracker/jobs/cHh2OCTJvRw"
  }
}

Make a POST request to /api/tracker with the importStrategy set to UPDATE or CREATE_AND_UPDATE and a payload as described here.

删除{ #delete }

Note

Deleted tracker objects and rselationships cannot be updated.

Update attribute values

Note that it is not necessary to specify the tracked entity's enrollments. However, you must specify the non-collection fields of the tracked entity, even if you are not changing them.

POST /api/tracker?async=false
{
  "trackedEntities": [
    {
      "trackedEntity": "PQfMcpmXeFE",
      "trackedEntityType": "nEenWmSyUEp",
      "orgUnit": "DiszpKrYNg8",
      "attributes": [
        {
          "attribute": "w75KJ2mc4zz",
          "code": "MMD_PER_NAM",
          "displayName": "First name",
          "createdAt": "2016-08-03T23:49:43.308",
          "updatedAt": "2016-08-03T23:49:43.308",
          "valueType": "TEXT",
          "value": "Johnny"
        }
      ]
    }
  ]
}

Note that it is not necessary to specify the tracked entity's enrollments. However, you must specify the non-collection fields of the tracked entity, even if you are not changing them.

Delete attribute values

The following deletes one of the attribute values of a tracked entity:

CSV 导入{ #csv-import }

{
  "trackedEntities": [
    {
      "trackedEntity": "PQfMcpmXeFE",
      "trackedEntityType": "nEenWmSyUEp",
      "orgUnit": "DiszpKrYNg8",
      "attributes": [
        {
          "attribute": "w75KJ2mc4zz",
          "value": null
        }
      ]
    }
  ]
}

大事记

The following updates one of the data values of an event:

CSV 有效载荷示例{ #csv-payload-example }
{
  "events": [
    {
      "event": "ZwwuwNp6gVd",
      "dataValues": [
        {
          "dataElement": "bx6fsa0t90x",
          "value": "true"
        }
      ],
      "attributeOptionCombo": "HllvX50cXC0",
      "attributeCategoryOptions": "xYerKDKCefk",
      "enrollment": "MNWZ6hnuhSw",
      "enrollmentStatus": "ACTIVE",
      "occurredAt": "2019-08-01T00:00:00.000",
      "orgUnit": "y77LiPqLMoq",
      "program": "IpHINAT79UW",
      "programStage": "A03MvHHogjR",
      "scheduledAt": "2019-08-19T13:59:13.688",
      "status": "ACTIVE",
      "trackedEntity": "Kj6vYde4LHh"
    }
  ]
}

Delete data values

The following deletes one of the data values of an event:

```

POST /api/tracker?async=false

```json
{
  "events": [
    {
      "event": "ZwwuwNp6gVd",
      "dataValues": [
        {
          "dataElement": "bx6fsa0t90x",
          "value": null
        }
      ],
      "attributeOptionCombo": "HllvX50cXC0",
      "attributeCategoryOptions": "xYerKDKCefk",
      "enrollment": "MNWZ6hnuhSw",
      "enrollmentStatus": "ACTIVE",
      "occurredAt": "2019-08-01T00:00:00.000",
      "orgUnit": "y77LiPqLMoq",
      "program": "IpHINAT79UW",
      "programStage": "A03MvHHogjR",
      "scheduledAt": "2019-08-19T13:59:13.688",
      "status": "ACTIVE",
      "trackedEntity": "Kj6vYde4LHh"
    }
  ]
}

删除

Make a POST to /api/tracker with importStrategy set to DELETE. The payload should include only the UIDs of the trackedEntities, enrollments, events or relationships you wish to delete.

The following deletes the events created with this payload:

允许值 Parameter name 描述
storedByDataValue ```json
{
"trackedEntities": [
{
"trackedEntity": "Kj6vYde4LHh",
},
{
"trackedEntity": "Gjaiu3ea38E",
}
]
}
``` All the children of a tracker object will be deleted if the user making the request has the
authorities F_TEI_CASCADE_DELETE and F_ENROLLMENT_CASCADE_DELETE.
Relationships linked to an entity are always deleted, without the need of any authority.

请求示例{ #request-example }

To import events using CSV make a POST request with CSV body file and the Content-Type set to application/csv or text/csv.

回复示例{ #response-example }

Every row of the CSV payload represents an event and a data value. So, for events with multiple data values, the CSV file will have x rows per event, where x is the number of data values in that event.

CSV payload example

Your CSV file can look like:

允许值 Parameter name 描述
fields >
>
> 这些端点依赖于应用项目内存中存储的信息。这意味着信息
> 在某些情况下,如应用项目重启或大量
> 导入请求。 The value of the tracked entity attribute.
```
GET /tracker/jobs/{uid}
``` Parameter Enrollments

请求示例{ #request-example }

uid

回复示例{ #response-example }

eAjkbUGBcZ5

Request example

导入摘要回复{ #import-summary-response }

Response example

[
  {
    "uid": "PQK63sMwjQp",
    "level": "INFO",
    "category": "TRACKER_IMPORT_JOB",
    "time": "2024-03-19T13:18:16.370",
    "message": "Import complete with status OK, 0 created, 0 updated, 0 deleted, 0 ignored",
    "completed": true,
    "id": "PQK63sMwjQp"
  },
  {
    "uid": "XIfTJ1UUNcd",
    "level": "INFO",
    "category": "TRACKER_IMPORT_JOB",
    "time": "2024-03-19T13:18:16.369",
    "message": "PostCommit",
    "completed": false,
    "id": "XIfTJ1UUNcd"
  },
  {
    "uid": "uCG4FNJLLBJ",
    "level": "INFO",
    "category": "TRACKER_IMPORT_JOB",
    "time": "2024-03-19T13:18:16.364",
    "message": "Commit Transaction",
    "completed": false,
    "id": "uCG4FNJLLBJ"
  },
  {
    "uid": "xfOUv2Lk2MC",
    "level": "INFO",
    "category": "TRACKER_IMPORT_JOB",
    "time": "2024-03-19T13:18:16.361",
    "message": "Running Rule Engine Validation",
    "completed": false,
    "id": "xfOUv2Lk2MC"
  },
  {
    "uid": "cSPfA776obb",
    "level": "INFO",
    "category": "TRACKER_IMPORT_JOB",
    "time": "2024-03-19T13:18:16.325",
    "message": "Running Rule Engine",
    "completed": false,
    "id": "cSPfA776obb"
  },
  {
    "uid": "t9gOjotekQt",
    "level": "INFO",
    "category": "TRACKER_IMPORT_JOB",
    "time": "2024-03-19T13:18:15.837",
    "message": "Tracker import started",
    "completed": false,
    "dataType": "PARAMETERS",
    "data": {
      "userId": "xE7jOejl9FI",
      "importMode": "VALIDATE",
      "idSchemes": {
        "dataElementIdScheme": {
          "idScheme": "UID",
          "attributeUid": null
        },
        "orgUnitIdScheme": {
          "idScheme": "UID",
          "attributeUid": null
        },
        "programIdScheme": {
          "idScheme": "UID",
          "attributeUid": null
        },
        "programStageIdScheme": {
          "idScheme": "UID",
          "attributeUid": null
        },
        "idScheme": {
          "idScheme": "UID",
          "attributeUid": null
        },
        "categoryOptionComboIdScheme": {
          "idScheme": "UID",
          "attributeUid": null
        },
        "categoryOptionIdScheme": {
          "idScheme": "UID",
          "attributeUid": null
        }
      },
      "importStrategy": "CREATE_AND_UPDATE",
      "atomicMode": "ALL",
      "flushMode": "AUTO",
      "validationMode": "FULL",
      "skipPatternValidation": false,
      "skipSideEffects": false,
      "skipRuleEngine": false,
      "filename": null,
      "reportMode": "ERRORS"
    },
    "id": "t9gOjotekQt"
  }
]

状态{ #status }

GET /tracker/jobs/{uid}/report

Parameter

描述

验证报告{ #validation-report }

path /{uid}

ID of an existing tracker import job.

ABCDEF12345

报告包含一条信息和一个描述实际错误的代码(有关错误信息,请参阅 错误代码 部分。 章节)。此外,报告还包括 trackerTypeuid 。 和 uid,旨在描述在数据的哪个位置发现了错误。在本例中,有一个 TRACKED_ENTITY",uid 为 "Kj6vYde4LHh",其中有一个对被跟踪实体类型的引用,但未找到。 未找到。

Level of detail for the report.

统计{ #statistics }

Request example

Indicates whether the value of the given key should be encrypted

Response example

The response payload is the same as the one returned after a sync import request.

Note

Both endpoints are used primarily for async import; however, GET /tracker/jobs/{uid} would also work for sync requests as it eventually uses the same import process and logging as async requests.

Import summary response

Import summaries have the following overall structure, depending on the requested reportMode:

捆绑报告{ #bundle-report }

状态

The property, status, of the import summary indicates the overall status of the import. If no errors or warnings were raised during the import, the status is reported as OK. The presence of any error or warnings in the import will result in a status of type ERROR or WARNING.

status is based on the presence of the most significant validationReport. ERROR has the highest significance, followed by WARNING and finally OK. This implies that ERROR is reported as long as a single error was found during the import, regardless of how many warnings occurred.

每种类型的跟踪器对象都将被报告,每种对象都有自己的统计信息和 objectReports.这些 对象报告 "将提供有关每个导入对象的详细信息,如其类型、uid 以及任何 错误或警告报告(如适用)。

信息{ #message }

The validationReport might include errorReports and warningReports if any errors or warnings were present during the import. When present, they provide a detailed list of any errors or warnings encountered.

导入汇总报告级{ #import-summary-report-level }

可在 GET /tracker/jobs/{uid}/report 请求中使用特定的 reportMode 参数检索导入摘要报告。 请求中使用特定的默认情况下,端点将返回一个 reportMode``ERRORimportSummary

| json { "object": { "publicAccess": "rw------", "externalAccess": false, "user": {}, "userAccesses": [], "userGroupAccesses": [ { "id": "hj0nnsVsPLU", "access": "rw------" }, { "id": "qMjBflJMOfB", "access": "r-------" } ] } } | Parameter name | | --- | --- | | Statistics | The stats object provides an overview of the import operation. After an import is completed, these will be the actual counts displaying how many objects were created, updated, deleted and ignored. | | 响应示例: | json { "stats": { "created": 2, "updated": 2, "deleted": 1, "ignored": 5, "total": 10 } } | | The created field refers to how many new objects were created. In general, objects without an existing uid in the payload will be treated as new objects. | The updated field refers to the number of objects updated. If an object has a uid set in the payload, it will be treated as an update as long as that same uid exists in the database. |

The deleted field refers to the number of objects deleted during the import. Deletion only happens when the import is configured to delete data and only then when the objects in the payload have existing uids set.

The ignored field refers to objects that were not persisted. Objects can be ignored for several reasons, for

example trying to create something that already exists. Ignores should always be safe, so if something was ignored, it was not necessary, or it was due to the configuration of the import.

不同的错误场景有不同的错误代码。下表列出了 下表列出了 Tracker API 抛出的错误代码,以及错误信息和一些附加说明。 说明。错误信息中的占位符({0}{1}{2}...)通常是 uids,除非另有说明。 另有说明。

When the import is completed, the bundleReport contains all the tracker objects imported. An example for TRACKED_ENTITY: Parameter name
Each type of tracker object will be reported, and each has its own stats and objectReports. These
objectReports will provide details about each imported object, like their type, their uid, and any
error or warning reports is applicable. 信息 If the import ended abruptly, the message would contain further information in relation to what
happened.
Import summary report level A import summary report can be retrieved using a specific reportMode parameter in a GET /tracker/jobs/{uid}/report
request. By default the endpoint will return an importSummary with reportMode ERROR. Parameter
描述 FULL Returns everything from WARNINGS, plus timingsStats
WARNINGS Returns everything from ERRORS, plus warningReports in validationReports
ERRORS (default) Returns only errorReports in validationReports In addition, all reportModes will return status, stats, bundleReport and message when
applicable.
Error codes { #webapi_tracker_error_codes } There are various error codes for different error scenarios. The following table has the list of
error codes thrown from the new Tracker API, along with the error messages and some additional
descriptions. The placeholders in the error messages ({0},{1},{2}..) are usually uids unless
otherwise specified. Error Code
Error Message 描述 E1000
User: {0}, has no write access to OrganisationUnit: {1}. This typically means that the OrganisationUnit {1} is not in the capture scope of the user {0} for the write operation to be authorized.
E1001 User: {0}, has no data write access to TrackedEntityType: {1}. The error occurs when the user is not authorized to create or modify data of the TrackedEntityType {1}
E1002 TrackedEntity: {0}, already exists. This error is thrown when trying to create a new TrackedEntity with an already existing uid. Make sure a new uid is used when adding a new TrackedEntity.
E1003 User: {0}, has no write access to TrackedEntity: {1}. E1005
Could not find TrackedEntityType: {0}. Error thrown when trying to fetch a non existing TrackedEntityType with uid {0} . This might also mean that the user does not have read access to the TrackedEntityType. E1006
Attribute: {0}, does not exist. Error thrown when the system was not able to find a matching TrackedEntityAttribute with uid {0}. This might also mean that the user does not have access to the TrackedEntityAttribute. E1007
Error validating attribute value type: {0}; Error: {1}. Mismatch between value type of a TrackedEntityAttribute and its provided attribute value. The actual validation error will be displayed in {1}. E1008
项目阶段 {0} 没有引用项目。检查项目阶段配置 E1009 File resource: {0}, has already been assigned to a different object.
The File resource uid {0} is already assigned to another object in the system. E1010 Could not find Program: {0}, linked to Event.
系统无法找到在事件有效负载中指定了 uid {0} 的项目。这也可能意味着登录用户无法访问特定项目。 E1011 Could not find OrganisationUnit: {0}, linked to Event.
The system was unable to find a OrganisationUnit with uid {0} specified inside the Event payload. E1012 Geometry does not conform to FeatureType: {0}.
FeatureType provided is either NONE or an incompatible one for the provided geometry value. E1013 Could not find ProgramStage: {0}, linked to Event.
The system was unable to find a ProgramStage with uid {0} specified inside the Event payload. This might also mean that the ProgramStage is not accessible to the logged in user. E1014 Provided Program: {0}, is a Program without registration. An Enrollment cannot be created into Program without registration.
Enrollments can only be created for Programs with registration. E1015 TrackedEntity: {0}, already has an active Enrollment in Program {1}.
Cannot enroll into a Program if another active enrollment already exists for the Program. The active enrollment will have to be completed first at least. E1016 TrackedEntity: {0}, already has an active enrollment in Program: {1}, and this program only allows enrolling one time.
根据项目 {1} 配置,一个 TrackedEntity 只能注册该项目一次。看起来 TrackedEntity {0} 已经在该项目中注册过一次。因此不能再添加另一个注册。 E1018 Attribute: {0}, is mandatory in program {1} but not declared in enrollment {2}.
有效负载中缺少被定义为项目强制属性的属性值。确保在有效负载中提供强制属性的属性值。 E1019 Only Program attributes is allowed for enrollment; Non valid attribute: {0}.
注册有效负载中指定的属性 uid {0} 与项目无关。 E1020 Enrollment date: {0}, cannot be a future date.
Cannot enroll into a future date unless the Program allows for it in its configuration. E1021 OccurredAt 属性为空或有效负载中的日期格式无效。
事件发生日期不能是未来日期,除非项目在配置中允许这样做。 E1022
TrackedEntity: {0}, must have same TrackedEntityType as Program {1}. 项目被配置为接受与注册有效负载中提供的不同的 TrackedEntityType uid。
E1023 DisplayIncidentDate is true but property occurredAt is null. 项目已配置 DisplayIncidentDate,但在有效负载中为空。
E1025 Property enrolledAt is null. EnrolledAt Date is mandatory for an Enrollment. Make sure it is not null.
E1029 Event OrganisationUnit: {0}, and Program: {1}, don't match. 事件有效载荷使用项目 {1},该项目未配置为可被组织单位 {0} 访问。
E1030 Event: {0}, already exists. This error is thrown when trying to add a new Event with an already existing uid. Make sure a new uid is used when adding a new Event.
E1031 Event occurredAt date is missing. OccurredAt property is either null or has an invalidate date format in the payload.
E1032 Event: {0}, do not exist. E1033
Event: {0}, Enrollment value is NULL. E1039 ProgramStage: {0}, is not repeatable and an event already exists.
特定注册的 ProgramStage 已存在一个事件。由于项目阶段被配置为不可重复,因此无法为同一项目阶段添加另一个事件。 E1041 Enrollment OrganisationUnit: {0}, and Program: {1}, don't match.
注册有效载荷包含一个项目 {1},该项目未配置为可被组织单位 {0} 访问。 E1043 Event: {0}, completeness date has expired. Not possible to make changes to this event.
没有 "F_EDIT_EXPIRED "权限的用户无法更新已过期的事件,因为该事件已在其项目中配置。 E1046
Event: {0}, needs to have at least one (event or schedule) date. Either of occurredAt or scheduledAt property should be present in the Event payload. E1047
Event: {0}, date belongs to an expired period. It is not possible to create such event. Event occurredAt or scheduledAt has a value that is earlier than the PeriodType start date. E1049
Could not find OrganisationUnit: {0}, linked to Tracked Entity. The system could not find an OrganisationUnit with uid {0}. E1050
Event ScheduledAt date is missing. ScheduledAt property in the Event payload is either missing or an invalid date format. E1051
Event: {0}, completedAt must be null when status is {1}. Event completedAt can only be passed in the payload if status is COMPLETED E1052
Enrollment: {0}, completedAt must be null when status is {1}. Enrollment completedAt can only be passed in the payload if status is COMPLETED E1054
AttributeOptionCombo {0} 不在事件项目类别组合 {1} 中。 E1055 由于项目具有非默认的 CategoryCombo,因此不允许使用默认的 AttributeOptionCombo。
项目被配置为包含非默认 CategoryCombo,但请求使用了默认 AttributeOptionCombo。 E1056 Event date: {0}, is before start date: {1}, for AttributeOption: {2}.
The CategoryOption has a start date configured , the Event date in the payload cannot be earlier than this start date. E1057
Event date: {0}, is after end date: {1}, for AttributeOption; {2}. The CategoryOption has an end date configured, the Event date in the payload cannot be later than this end date.
E1063 TrackedEntity: {0}, does not exist.
Error thrown when trying to fetch a non existing TrackedEntity with uid {0} . This might also mean that the user does not have read access to the TrackedEntity. E1064
Non-unique attribute value {0} for attribute {1} The attribute value has to be unique within the defined scope. The error indicates that the attribute value already exists for another TrackedEntity.
E1068 Could not find TrackedEntity: {0}, linked to Enrollment. 当尝试使用已存在的 uid 创建新注册表时,会出现此错误。请确保在添加新注册表时使用新的 uid。
E1069 Could not find Program: {0}, linked to Enrollment. 系统无法找到注册有效负载中指定的项目。这也可能意味着用户没有项目的读取权限。
E1070 Could not find OrganisationUnit: {0}, linked to Enrollment. The system could not find the OrganisationUnit specified in the Enrollment payload.
E1074 FeatureType is missing. E1075
Attribute: {0}, is missing uid. E1076 {0} {1} is mandatory and can't be null
E1077 Attribute: {0}, text value exceed the maximum allowed length: {0}. E1079
Event: {0}, program: {1} is different from program defined in enrollment {2}. E1080 Enrollment: {0}, already exists.
This error is thrown when trying to create a new Enrollmentt with an already existing uid. Make sure a new uid is used when adding a new Enrollment. E1081 Enrollment: {0}, do not exist.
Error thrown when trying to fetch a non existing Enrollment with uid {0} . This might also mean that the user does not have read access to the Enrollment. E1082 Event: {0}, is already deleted and can't be modified.
If the event is soft deleted, no modifications on it are allowed. E1083 User: {0}, is not authorized to modify completed events.
Only a super user or a user with the authority "F_UNCOMPLETE_EVENT" can modify completed events. Completed Events are those Events with status as COMPLETED. E1089 Event: {0}, references a Program Stage {1} that does not belong to Program {2}.
The ProgramStage uid and Program uid in the Event payload is incompatible. E1090 Attribute: {0}, is mandatory in tracked entity type {1} but not declared in tracked entity {2}.
The payload has missing values for mandatory TrackedEntityTypeAttributes. E1091 User: {0}, has no data write access to Program: {1}.
在项目共享配置中,用户没有该项目的写入权限。 E1095 User: {0}, has no data write access to ProgramStage: {1}.
在项目阶段共享配置中,用户没有写入该项目阶段的权限。 E1096 User: {0}, has no data read access to Program: {1}.
在项目共享配置中,用户没有该项目的读取权限。 E1099 User: {0}, has no write access to CategoryOption: {1}.
The CategoryOption sharing configuration is such that, the user does not have write access for this CategoryOption E1100 User: {0}, is lacking 'F_TEI_CASCADE_DELETE' authority to delete TrackedEntity: {1}.
There exists undeleted Enrollments for this TrackedEntity. If the user does not have 'F_TEI_CASCADE_DELETE' authority, then these Enrollments has to be deleted first explicitly to be able to delete the TrackedEntity. E1102
用户: {0}, 没有访问被跟踪实体的权限:{1}, 项目:{2}, 组合。 当用户的组织单位不拥有该特定项目的 TrackedEntity 的所有权时,就会抛出此错误。拥有 TrackedEntity-Program 组合的组织单位应属于用户的捕获范围(有时是搜索范围)。 E1103
User: {0}, is lacking 'F_ENROLLMENT_CASCADE_DELETE' authority to delete Enrollment : {1}. There exists undeleted Events for this Enrollment. If the user does not have 'F_ENROLLMENT_CASCADE_DELETE' authority, then these Events has to be deleted first explicitly to be able to delete the Enrollment.
E1104 User: {0}, has no data read access to program: {1}, TrackedEntityType: {2}.
与项目相关联的 TrackedEntityType 的共享配置规定,用户没有数据读取权限。 E1112
Attribute value: {0}, is set to confidential but system is not properly configured to encrypt data. Either JCE files is missing or the configuration property encryption.password might be missing in dhis.conf. E1113
Enrollment: {0}, is already deleted and can't be modified. If the Enrollment is soft deleted, no modifications on it are allowed.
E1114 TrackedEntity: {0}, is already deleted and can't be modified.
If the TrackedEntity is soft deleted, no modifications on it are allowed. E1115
Could not find CategoryOptionCombo: {0}. E1116
Could not find CategoryOption: {0}. This might also mean the CategoryOption is not accessible to the user.
E1117 CategoryOptionCombo does not exist for given category combo and category options: {0}.
E1118 Assigned user {0} is not a valid uid.
E1119 A Tracker Note with uid {0} already exists.
E1120 项目阶段 {0} 不允许用户赋值
事件有效载荷具有 assignedUserId,但项目阶段未配置为允许用户分配。 E1121
Missing required tracked entity property: {0}. E1122
Missing required enrollment property: {0}. E1123
Missing required event property: {0}. E1124
Missing required relationship property: {0}. E1125
Value {0} is not a valid option code in option set {1} E1126
Not allowed to update Tracked Entity property: {0}. E1127
Not allowed to update Enrollment property: {0}. E1128
Not allowed to update Event property: {0}. E1300
由项目规则生成 ({0}) - {1} E1301
由项目规则生成 ({0}) - 不存在强制性数据元素 {1} E1302 DataElement {0} is not valid: {1}
E1303 Mandatory DataElement {0} is not present
E1304 DataElement {0} is not a valid data element
E1305 数据元素 {0} 不是 {1} 项目阶段的一部分
E1306 由项目规则 ({0}) 生成 - 不存在强制属性 {1}
E1307 由项目规则生成 ({0}) - 无法为数据元素 {1} 赋值。提供的值必须为空或与计算值 {2} 匹配。
E1308 由项目规则 ({0}) 生成 - 数据元素 {1} 被事件 {2} 替换
E1309 由项目规则 ({0}) 生成 - 无法为属性 {1} 赋值。提供的值必须为空或与计算值 {2} 匹配。
E1310 由项目规则 ({0}) 生成 - 属性 {1} 被替换为 {2}
E1313 Event {0} of an enrollment does not point to an existing tracked entity. The data in your system might be corrupted
Indicates an anomaly in the existing data whereby enrollments might not reference a tracked entity E1314
由项目规则 ({0}) 生成 - 数据元素 {1} 是必填项,不能删除。 E1315
Status {0} does not allow defining data values. Statuses that do allow defining data values are: {1} E1316
No event can transition from status {0} to status {1}. E1317
由项目规则 ({0}) 生成 - 属性 {1} 是强制性的,不能删除。 E4000
Relationship: {0} cannot link to itself E4001
Relationship Item {0} for Relationship {1} is invalid: an Item can link only one Tracker entity. E4006 Could not find relationship Type: {0}.
E4010 Relationship Type {0} constraint requires a {1} but a {2} was found. E4012

Could not find {0}: {1}, linked to Relationship.

E4014

所需属性{ #required-properties }

E4015

Relationship: {0}, already exists.

  1. E4016
  2. Relationship: {0}, do not exist.
  3. E4017

Relationship: {0}, is already deleted and cannot be modified.

格式{ #formats }

Relationship: {0}, linking {1}: {2} to {3}: {4} already exists.

  • E4020
  • User: {0}, has no write access to relationship: {1}.
  • E5000

用户访问{ #user-access }

导入项目无法持久化跟踪器对象,因为引用无法持久化。

E9999

不适用

Undefined error message.

属性和数据值{ #attributes-and-data-values }

使用跟踪器导入项目导入数据时,会执行一系列验证,以确保数据的有效性。 数据的有效性。本节将介绍执行的一些不同类型的验证 以便更好地了解导入验证是否失败。

Required properties

Each of the tracker objects has a few required properties that need to be present when importing data. For an exhaustive list of required properties, have a look at the tracker objects section.

When validating required properties, we are usually talking about references to other data or metadata. In these cases, there are three main criteria:

组态

The reference points to the correct type of data and exists in the database

  • The user has access to see the reference
  • If the first condition fails, the import will fail with a message about a missing reference. However, suppose the reference points to something that doesn't exist or which the user cannot access. In that case, both cases will result in a message about the reference not being found.
  • Formats
  • Some of the properties of tracker objects require a specific format. When importing data, each of these properties is validated against the expected format and will return different errors depending on which property has a wrong format. Some examples of properties that are validated this way:

UIDs (These cover all references to other data or metadata in DHIS2.)

Dates

Geometry (The coordinates must match the format as specified by its type)

所需数值{ #required-values }

All data imported will be validated based on the metadata (sharing) and the organisation units (scopes) referenced in the data. You can find more information about sharing and organisation unit scopes in the following sections.

Sharing is validated at the same time as references are looked up in the database. Metadata outside of the user access scope will be treated as if it does not exist. The import will validate any metadata referenced in the data.

GET /api/trackedEntityAttributes/Gs1ICEQTPlG/requiredValues

Users with the ALL authority will ignore the limits of sharing and organisation unit scopes when they import data. However, they can not import enrollments in organisation units that do not have access to the enrollment program.

Attributes and data values

属性和数据值分别是被跟踪实体和事件的一部分。但是 属性可以通过类型(TrackedEntityType)或项目(Program)链接到被跟踪实体。 项目(Program)。此外,属性也可以是唯一的。

The initial validation done in the import is to make sure the value provided for an attribute or data element conforms to the type of value expected. For example, suppose you import a value for a data element with a numeric type. In that case, the value is expected to be numeric. Any errors related to a mismatch between a type and a value will result in the same error code but with a specific message related to the type of violation.

GET /api/trackedEntityAttributes/Gs1ICEQTPlG/generate?ORG_UNIT_CODE=OSLO

The import will validate unique attributes at the time of import. That means as long as the provided value is unique for the attribute in the whole system, it will pass. However, if the unique value is found to be used by any other tracked entity other than the one being imported, it will fail.

组态

The last part of validations in the importer are validations based on the user's configuration of relevant metadata. For more information about each configuration, check out the relevant sections. Some examples of configurable validations:

Feature type (geometry)

GET /api/trackedEntityAttributes/Gs1ICEQTPlG/generateAndReserve?numberToReserve=3&ORG_UNIT_CODE=OSLO

Allow future dates

保留值

These configurations will further change how validation is performed during import.

Generated tracked entity attributes { #webapi_generate_te_attributes }

指标组 Parameter name
A TextPattern may include variables that change based on different factors. Some of these factors are unknown to the server;
thus, the values for these variables must be supplied when generating and reserving values. This endpoint returns a map of required and optional values that the server will inject into the TextPattern when generating new values.
Required variables must be supplied for generation, whereas optional variables should only be provided if necessary.
```
GET /api/33/trackedEntityAttributes/Gs1ICEQTPlG/requiredValues
|json
{
"REQUIRED": [
"ORG_UNIT_CODE"
],
"OPTIONAL": [
"RANDOM"
]
}
```
产生价值终点 { #webapi_generate_values } 在线网络应用项目和其他客户端可使用该端点生成一个唯一值,以供立即使用。
生成的值在生成时保证是唯一的,并保留 3 天。
如果您的 TextPattern 包含必填值,可以将它们作为参数传递。
日期时间 ```
GET /api/33/trackedEntityAttributes/Gs1ICEQTPlG/generate?ORG_UNIT_CODE=OSLO
```
GET /api/metadata/proposals?filter=status:eq:ACCEPTED 产生并保留价值终点 { #webapi_generate_reserve_values }
Offline clients can use this endpoint to reserve a number of unique IDs for later use when
registering new tracked entities. The number of IDs to generate can be specified with the
numberToReserve parameter (default is 1). To override the default expiration time of 60 days, add ?expiration=<number-of-days> to the request.
GET /api/33/trackedEntityAttributes/Gs1ICEQTPlG/generateAndReserve?numberToReserve=3&ORG_UNIT_CODE=OSLO

```json

[ { "ownerObject": "TRACKEDENTITYATTRIBUTE", "ownerUid": "Gs1ICEQTPlG", "key": "RANDOM(X)-OSL", "value": "B-OSL", "created": "2018-03-02T13:22:35.175", "expiryDate": "2018-05-01T13:22:35.174" }, { "ownerObject": "TRACKEDENTITYATTRIBUTE", "ownerUid": "Gs1ICEQTPlG", "key": "RANDOM(X)-OSL", "value": "Q-OSL", "created": "2018-03-02T13:22:35.175", "expiryDate": "2018-05-01T13:22:35.174" }, { "ownerObject": "TRACKEDENTITYATTRIBUTE", "ownerUid": "Gs1ICEQTPlG", "key": "RANDOM(X)-OSL", "value": "S-OSL", "created": "2018-03-02T13:22:35.175", "expiryDate": "2018-05-01T13:22:35.174" } ]

Reserved values

目前无法通过 api 访问保留值,但是,它们
由`generate` 和`generateAndReserve` 端点返回。这
下表解释了保留值对象的属性:

| Table: Reserved values | Property |
| --- | --- |
| 设置必填字段 | |
| 淋浴器 | |
| 日程消息 | |
| 名称 | |
| 始终有效 | DISPLAYKEYVALUEPAIR |
| 显示选项组 | DISPLAYKEYVALUEPAIR |
| 隐藏选项组 | DISPLAYKEYVALUEPAIR |
| The timestamp when the reservation was made | DISPLAYKEYVALUEPAIR |
| The timestamp when the reservation will no longer be reserved | DISPLAYKEYVALUEPAIR |
| Program rules { #webapi_tracker_program_rules }| |
| 隐藏选项 | DISPLAYKEYVALUEPAIR |
| 参见说明 | DISPLAYKEYVALUEPAIR |
| 2.37 中为 ProgramRuleAction 模型添加了一些验证。主要目的是防止用户创建错误的项目规则,以保持数据库的一致性。这些验证取决于项目规则动作类型。每种操作类型都有各自的验证。  | DISPLAYKEYVALUEPAIR |

HIDEFIELD

* HIDESECTION
* ASSIGN

X

* 程序规则操作可能会导致两种不同的结果:警告或错误。
* X
    * SHOWERROR
    * X
    * WARNINGONCOMPLETION
    * X
    * ERRORONCOMPLETION
    * X

CREATEEVENT

SETMANDATORYFIELD

### X

SENDMESSAGE

X

SCHEDULEMESSAGE

| X | Property | Parameter name |
|--- | --- | --- |
| 项目规则条件必须为真。 | DISPLAYKEYVALUEPAIR | 项目规则操作可能会导致两种不同的结果:警告或错误。 |
| Errors will make the validation fail, while the warnings will be reported as a message in the import summary. | DISPLAYKEYVALUEPAIR | `SHOWERROR`, `ERRORONCOMPLETION`, and `SETMANDATORYFIELD` actions can generate only errors. |

`ASSIGN` action can generate both Warnings and Errors.

### When the action is assigning a value to an empty attribute/data element, a warning is generated.

When the action is assigning a value to an attribute/data element that already has the same value to be assigned, a warning is generated.

When the action is assigning a value to an attribute/data element that already has a value and the value to be assigned is different, an error is generated unless the `RULE_ENGINE_ASSIGN_OVERWRITE` system setting is true.

此外,项目规则也会产生副作用,如发送和计划信息。更多
有关副作用的更多信息,请参阅下一节。

> **注**
>
> 在导入过程中,可以使用 `skipProgramRules` 参数跳过项目规则。

Side effects { #webapi_tracker_side_effects }

After an import has been completed, specific tasks might be triggered as a result of the import.
These tasks are what we refer to as "Side effects". These tasks perform operations that do not
affect the import itself.

## Side effects are tasks running detached from the import but are always triggered by an import. Since
side effects are detached from the import, they can fail even when the import is successful.
Additionally, side effects are only run when the import is successful, so they cannot fail the other
way around.

The following side effects are currently supported:

- Side Effects
- 支持的
- 类型
- `GET /api/tracker/events/{uid}/changeLogs`

X

### 常见请求参数{ #common-request-parameters } 

ProgramRule Notification

- X
- 项目规则可触发通知。请注意,这些通知是通过 DHIS2 规则引擎生成的项目规则效果的一部分。
- > **Note**
>
> Certain configurations can control the execution of side effects. `skipSideEffects` flag can be set during the import to skip side effects entirely. This parameter can be useful if you import something you don't want to trigger notifications for, as an example.
- Assign user to events { #webapi_tracker_user_event_assignment }

#### 类型

|允许值|Potential duplicate status|`order`|Parameter name|
|---|---|---|---|
|定义要返回的页码。|Enrollments|`paging`|追踪实体|
|定义每页返回的元素数量。|Enrollments|`paging`|`Boolean`|
|Common request parameters|*userDataStore* 由用户、命名空间、键和关联的
值。用户、命名空间和密钥的组合是唯一的。|跟踪器或事件项目的标识符。该参数为必填参数。|Events: `GET /api/tracker/events`|
|true|*userDataStore* 由用户、命名空间、键和关联的
值。用户、命名空间和密钥的组合是唯一的。|跟踪器或事件项目的标识符。该参数为必填参数。|Request parameter|
|iasc 和 idesc 是不区分大小写的排序。如果需要对多个属性进行排序,请使用逗号将它们分开。|具有以下要求:||描述|

page

#### 组织单位选择模式{ #organisation-unit-selection-modes } 

Any positive integer

#### Page number to return. Defaults to 1.

pageSize

##### ```
/api/dataElements.csv?fields=id,displayName,dataElementGroups
Any positive integer Parameter name
totalPages Boolean
true, false Indicates whether to return the total number of elements and pages. Defaults to false as getting the totals is an expensive operation.
paging Boolean
true, false Indicates whether paging should be ignored and all rows should be returned. Defaults to true, meaning that by default all requests are paginated, unless paging=false.
order

Comma-separated list of field and sort direction pairs in format field:sortDirection. Example: createdAt:desc

Entities are ordered by newest (internal ID descending) by default. Note: field is case sensitive. Valid sortDirections are asc and desc, where sortDirection is case insensitive, and sortDirection defaults to asc for fields or UIDs without explicit sortDirection.

Note

Be aware that performance is directly related to the amount of data requested. Greater page sizes will take more time to return.

Organisation unit selection modes

  • The available organisation unit selection modes are SELECTED, CHILDREN, DESCENDANTS, ACCESSIBLE, CAPTURE and ALL. Each mode is explained in detail in this section.
  • Field filter responses { #webapi_tracker_field_filter }
  • All export endpoints accept a fields parameter which controls which fields will be returned in the JSON response. fields parameter accepts a comma separated list of field names or patterns. A few possible fields filters are shown below. Refer to Metadata field filter for a more complete guide on how to use fields.
  • 例子

Query parameter example

CSV{ #csv }

  • Returns all fields
  • fields=createdAt,uid
  • Returns fields createdAt and uid
  • fields=enrollments[*,!uid]
  • Returns all fields of enrollments except uid
  • fields=enrollments[uid]
  • Returns enrollments field uid
  • fields=enrollments[uid,enrolledAt]
  • Returns enrollments fields uid and enrolledAt
  • Tracked entities { #webapi_tracker_export_tracked_entities }
  • ``` GET /api/tracker/trackedEntities
        Two endpoints are dedicated to tracked entities:
      - `GET /api/tracker/trackedEntities`
      - retrieves tracked entities matching given criteria
      - `GET /api/tracker/trackedEntities/{id}`
      - retrieves a tracked entity given the provided ID
      - If not otherwise specified, JSON is the default response for the `GET` method.
    The API also supports CSV export for single and collection endpoints. Furthermore, compressed
    CSV types is an option for the collection endpoint.
      - CSV
      - In the case of CSV, the `fields` request parameter has no effect, and the response will always
    contain the following fields:
      - trackedEntity (UID)
      - trackedEntityType (identifier in requested idScheme)
      - createdAt (Datetime)
      - createdAtClient (Datetime)
    
    updatedAt (Datetime)
    
    #### GZIP{ #gzip } 
    
    orgUnit (identifier in requested idScheme)
    
    #### ZIP{ #zip } 
    
    deleted (boolean)
    
    #### 跟踪实体集合{ #tracked-entity-collections } 
    
    > **Note**
    >
    > Be aware that performance is directly related to the amount of data requested. Greater page
    > sizes will take more time to return.
    
    You can omit it in case of a `Point` type and with `latitude` and `longitude` provided)
    
    latitude (Latitude of a `Point` type of Geometry)
    
    |允许值|Potential duplicate status|`order`|Parameter name|
    |---|---|---|---|
    |数据值|具有以下要求:|value (String)|storedBy (String) |
    |createdBy (Username of user)|具有以下要求:|See [Tracked Entities](tracker.md#tracked-entities) and [Attributes](tracker.md#attributes) for more field descriptions.|GZIP|
    |The response is file `trackedEntities.csv.gz` containing the `trackedEntities.csv` file.|具有以下要求:|Narrows response to events matching given filters. A filter is a colon separated property or data element UID with optional operator and value pairs. Example: `filter=fazCI2ygYkq:eq:PASSIVE` with operator starts with `eq` followed by a value. A filter like `filter=fazCI2ygYkq:!null` returns all events where the given data element has a value. Characters such as `:` or `,`, as part of the filter value, need to be escaped by `/`. Likewise, `/` needs to be escaped. Multiple operators for the same data element like `filter=qrur9Dvnyt5:gt:70:lt:80` are allowed. User needs access to the data element to filter on it.|Tracked entity collections|
    |`{ "periodFrom": -15, "periodTo": 15}`|具有以下要求:|The endpoint returns a list of tracked entities that match the request parameters.|Request parameter|
    |See [Events](tracker.md#webapi_tracker_objects_events) and [Data Values](tracker.md#webapi_tracker_data_values) for more
    field descriptions.|JSON格式|The response is file `events.json.gz` or `events.csv.gzip` containing the `events.json`
    or `events.csv` file.|跟进|
    |See an example payload below.|具有以下要求:|Narrows response to tracked entities matching given filters. More on filters [here](tracker.md#tracked_entity_attribute_filtering)|orgUnits|
    |Table: Program Stage Query Criteria|*userDataStore* 由用户、命名空间、键和关联的
    值。用户、命名空间和密钥的组合是唯一的。|跟踪器或事件项目的标识符。该参数为必填参数。|orgUnitMode|
    |串|Events CSV|Filter for events which were updated up until this date. Cannot be used together with `updatedWithin`. | 项目|
    |DateTime|Events CSV|Filter for events which were updated up until this date. Cannot be used together with `updatedWithin`. | programStatus **deprecated for removal in version 43 use `enrollmentStatus`**|
    |DateTime|[ISO-8601](https://en.wikipedia.org/wiki/ISO_8601)|Filter for events which occurred up until this date. | 项目阶段|
    |DateTime|具有以下要求:|The response is file `events.json.gz` or `events.csv.gzip` containing the `events.json`
    or `events.csv` file.|跟进|
    |DateTime|Events CSV|Filter for events which were updated up until this date. Cannot be used together with `updatedWithin`.|updatedAfter|
    |DateTime|Events CSV|Filter for events which were updated up until this date. Cannot be used together with `updatedWithin`.|updatedBefore|
    |DateTime|Events CSV|Filter for events which were updated up until this date. Cannot be used together with `updatedWithin`.|指定项目的注册开始日期|
    |Duration|Events CSV|Filter for events which were updated up until this date. Cannot be used together with `updatedWithin`.|指定项目的注册结束日期|
    |`{"organisationUnit": "a3kGcGDCuk7"}`|具有以下要求:|The status of the tracked entities enrollment in the given program.|enrollmentEnrolledAfter|
    |Absolute end date. Applicable only when `type` is ABSOLUTE|具有以下要求:|Start date and time for enrollment in the given program|enrollmentEnrolledBefore|
    |Enum|具有以下要求:|End date and time for enrollment in the given program|enrollmentOccurredAfter|
    |Property|具有以下要求:|events|enrollmentOccurredBefore|
    |iasc 和 idesc 是不区分大小写的排序。如果需要对多个属性进行排序,请使用逗号将它们分开。|具有以下要求:|描述|trackedEntityType|
    |`"displayOrderColumns": ["enrollmentDate", "program"]`|具有以下要求:|Narrows response to tracked entities matching given filters. Example: `filterAttributes=H9IlTX2X6SL:eq:John`. More on filters [here](tracker.md#tracked_entity_attribute_filtering)|trackedEntities|
    |串|Events CSV|Filter for events which were updated up until this date. Cannot be used together with `updatedWithin`.|assignedUserMode|
    |串|Events CSV|Filter for events which were updated up until this date. Cannot be used together with `updatedWithin`.|assignedUsers|
    |串|*userDataStore* 由用户、命名空间、键和关联的
    值。用户、命名空间和密钥的组合是唯一的。|跟踪器或事件项目的标识符。该参数为必填参数。|order|
    |串|*userDataStore* 由用户、命名空间、键和关联的
    值。用户、命名空间和密钥的组合是唯一的。|跟踪器或事件项目的标识符。该参数为必填参数。| eventStatus |
    |描述|DateTime|Enum|eventOccurredAfter|
    |programStageIdScheme|DateTime|Enum|[ISO-8601](https://en.wikipedia.org/wiki/ISO_8601)|
    
    DateTime
    
    [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601)
    
    | Only one parameter among `trackedEntity`, `enrollment`, `event` can be passed. | Parameter name |
    | --- | --- |
    | Boolean | `true`, `false` |
    | Indicates whether to include soft-deleted elements | potentialDuplicate |
    | Boolean | `true`, `false` |
    | Filter the result based on the fact that a tracked entities is a potential duplicate. `true`: returns tracked entities flagged as potential duplicates. `false`: returns tracked entities NOT flagged as potential duplicates. | 方案 |
    | In summary, DHIS2 has a fine-grained sharing setting that we can use to implement access control
    mechanisms both at the data and metadata level. These sharing settings can be applied directly at
    the user level or user group level. How exactly to apply a sharing setting depends on the use-case
    at hand. | `UID`, `CODE`, `NAME`, `ATTRIBUTE:{uid}` |
    
    IdScheme used for all metadata references unless overridden by a metadata specific parameter. Default is `UID`. Note: only metadata in fields `trackedEntity.trackedEntityType`, `orgUnit` and `attributes` is exported in this idScheme. All other fields will always be exported using UIDs.
    
    - orgUnitIdScheme
      Enum
    - `UID`, `CODE`, `NAME`, `ATTRIBUTE:{uid}`
      IdScheme used for organisation unit references. Defaults to the `idScheme` parameter.
    - The available assigned user modes are explained in the following table.
    - Table: Assigned user modes
    - Mode
    - 描述
      CURRENT
    
    - Includes events assigned to the current logged in user.
    
    ##### 请求示例{ #example-requests } 
    
    Includes events assigned to the user provided in the request.
    
    NONE
    
    Includes unassigned events only.
    
    ANY
    
    Includes all assigned events, regardless of who they are assigned to, as long as they are assigned to someone.
    
    全部
    
    Filter the result down to a limited set of tracked entities with events that are assigned to the given user IDs by using `assignedUser=id1,id2`.This parameter will only be considered if `assignedUserMode` is either `PROVIDED` or `null`. The API will error out, if for example, `assignedUserMode=CURRENT` and `assignedUser=someId`.
    
    查询不区分大小写。以下规则适用于查询
    参数。
    
    At least one organisation unit must be specified using the `orgUnit`
    
    parameter (one or many), or `orgUnitMode=ALL` must be specified.
    
    Only one of the `program` and `trackedEntity` parameters can be
    
    指定(零或一)。
    
    If `programStatus` is specified, then `program` must also be specified.
    
    If `enrollmentStatus` is specified, then `program` must also be specified.
    
    | 所需值 | Parameter name |
    | --- | --- |
    | true | 过滤器项目只能指定一次。 |
    | true | 查询与特定组织单位和跟踪项目相关的所有被跟踪实体的方法如下
    可以这样查询 |
    | true | To query for tracked entities using one attribute with a filter and one attribute without a filter,
    with one organisation unit using the descendant organisation unit query mode: |
    | true | 为过滤器指定了多个操作数和过滤器的查询
    物品: |
    | true | A query filter with a value that needs escaping and will be interpreted as `:,/`: |
    | true | 要将项目注册日期指定为查询的一部分,请执行以下操作: |
    | true | To query on an attribute using multiple values with an *IN* filter and semicolon-separated values: |
    | ```
    GET /api/tracker/trackedEntities?trackedEntityType=nEenWmSyUEp&orgUnits=DiszpKrYNg8&filter=w75KJ2mc4zz:IN:Scott;Jimmy;Santiago
    ``` | All of the following operators are supported regardless of the value type. Values are compared using
    text comparison unless stated otherwise. Integer and decimal value types are treated as PostgreSQL
    integer and numeric data types for the specified operators. |
    | Supported binary operators: | Operator |
    | 描述 | eq |
    | true | ieq |
    | true | ge|
    | greater than or equal to (uses integer/number semantics for integer/decimal value types) | gt |
    | greater than, uses integer/number semantics for integer/decimal value types | le |
    | less than or equal to, uses integer/number semantics for integer/decimal value types | lt |
    | less than (uses integer/number semantics for integer/decimal value types) | ne |
    
    not equal to (uses integer/number semantics for integer/decimal value types)
    
    neq
    
    not equal to (uses integer/number semantics for integer/decimal value types), use `ne` instead*
    
    nieq
    
    | 所需值 | Parameter name |
    | --- | --- |
    | false | like |
    | false | ilike |
    
    ##### like text match, ignoring case (use `like` instead)*
    
    nlike
    
    例如: `filter=H9IlTX2X6SL:sw:A` 运算符以 `sw` 开头,后面跟一个值。
    
    过滤器如 `filter=H9IlTX2X6SL:!null` 会返回给定属性有值的所有条目。
    
    特殊字符(如 `+`)需要按百分比编码,因此应使用 `%2B` 代替 `+`。作为过滤值的一部分,`:` 或 `,` 字符需要用 `/` 转义。同样,`/` 也需要转义。
    
    sw
    
    每个被跟踪实体的属性都可配置为
      - 进行搜索所需的最少字符数(0 表示没有最少字符数)。
      - ends with
    
    *These operators are currently supported but may be removed in the future. We recommend using the operator mentioned in the description, as it provides the same functionality.
    ANY
    For instance, `filter=w75KJ2mc4zz:eq:Scott` would return values of the given attribute that match any variation of "Scott" regardless of case, such as SCOTT, scott, Scott...
    
    ##### 被跟踪实体的回复{ #tracked-entities-response } 
    
    Operator
    
    ##### JSON{ #json } 
    
    null
    
    has no value
    
    !null
    
    ##### CSV{ #csv } 
    
    Tracked entity attribute filtering { #tracked_entity_attribute_filtering }
    
    Filtering by a tracked entity attribute narrows the response to tracked entities matching given filters. A filter is a colon separated property or attribute UID with optional operator and value pairs.
    
    ##### 跟踪实体收集限制{ #tracked-entities-collection-limits } 
    
    A filter like `filter=H9IlTX2X6SL:!null` returns all entries where the given attribute has a value. 
    
    - Special characters like `+` need to be percent-encoded, so `%2B` instead of `+`. Characters such as `:` or `,`, as part of the filter value, need to be escaped by `/`. Likewise, `/` needs to be escaped. 
    Multiple operators for the same attribute like `filter=AuPLng5hLbE:gt:438901703:lt:448901704` are allowed.
    Each tracked entity attribute can be configured with:  
    A minimum number of characters required to perform a search (0 means no minimum)  
    
    - Blocked operators. Only `sw`, `ew`, and `like` can be blocked. All other operators cannot be blocked.
    The following request:
    
    GET /api/tracker/trackedEntities?program=IpHINAT79UW&orgUnits=DiszpKrYNg8&filter=w75KJ2mc4zz:EQ:John
    would fail if the minimum character limit was set to 5 (since "John" has only 4 characters), or if the `EQ` operator was blocked for the specified tracked entity attribute.
     Tracked entities response
    
    - The API supports CSV and JSON response for `GET /api/tracker/trackedEntities`.
    
    JSON格式
    
    - Responses can be filtered on desired fields, see [field filter](tracker.md#webapi_tracker_field_filter) for more information.
    
    - A JSON response looks like the following:
    
    #### 跟踪实体单一对象端点{ #tracked-entities-single-object-endpoint } 
    
    CSV
    
    A CSV response looks like the following:
    
    ##### 请求语法 { #request-syntax } 
    
    Tracked entities collection limits
    
    | 允许值 | Potential duplicate status | `order` | Parameter name |
    | --- | --- | --- | --- |
    | storedByDataValue | 具有以下要求: | ```
    GET /api/tracker/events?orgUnit=DiszpKrYNg8&program=lxAQ7Zs9VYR&filter=DanTR5x0WDK:EQ:/:/,//
    ``` | matches exceed this limit. No limit applies when searching within the capture scope |
    | `{ "periodFrom": -15, "periodTo": 15}` | 具有以下要求: |```
    GET /api/tracker/events?orgUnit=DiszpKrYNg8&program=lxAQ7Zs9VYR&filter=DanTR5x0WDK:EQ:/:/,//
    ``` | For paginated requests with non-zero `KeyTrackedEntityMaxLimit`: |
    | 默认过滤器是`id,displayName` | 具有以下要求: | Tracked entities single object endpoint | ```json
    {
      "pager": {
        "page": 1,
        "pageSize": 1
      },
      "events": [
        {
          "event": "A7rzcnZTe2T",
          "status": "ACTIVE",
          "program": "eBAyeGv0exc",
          "programStage": "Zj7UnCAulEk",
          "enrollment": "RiLEKhWHlxZ",
          "orgUnit": "DwpbWkiqjMy",
          "occurredAt": "2023-02-13T00:00:00.000",
          "scheduledAt": "2023-02-13T00:00:00.000",
          "followUp": false,
          "deleted": false,
          "createdAt": "2017-09-08T21:40:22.000",
          "createdAtClient": "2016-09-08T21:40:22.000",
          "updatedAt": "2017-09-08T21:40:22.000",
          "attributeOptionCombo": "HllvX50cXC0",
          "attributeCategoryOptions": "xYerKDKCefk",
          "geometry": {
            "type": "Point",
            "coordinates": [-11.468912037323042, 7.515913998868316]
          },
          "dataValues": [
            {
              "createdAt": "2016-12-06T18:22:34.438",
              "updatedAt": "2016-12-06T18:22:34.438",
              "storedBy": "bjorn",
              "providedElsewhere": false,
              "dataElement": "F3ogKBuviRA",
              "value": "[-11.4880220438585,7.50978830548003]"
            },
            {
              "createdAt": "2013-12-30T14:23:57.423",
              "updatedAt": "2013-12-30T14:23:57.423",
              "storedBy": "lars",
              "providedElsewhere": false,
              "dataElement": "eMyVanycQSC",
              "value": "2018-02-07"
            },
            {
              "createdAt": "2013-12-30T14:23:57.382",
              "updatedAt": "2013-12-30T14:23:57.382",
              "storedBy": "lars",
              "providedElsewhere": false,
              "dataElement": "oZg33kd9taw",
              "value": "Male"
            }
          ],
          "notes": [],
          "followup": false
        }
      ]
    }
    ``` |
    
    ##### 请求示例{ #example-requests } 
    
    Request syntax
    
    GET /api/tracker/trackedEntities/{uid}?program={programUid}&fields={fields}
    ##### 跟踪实体响应{ #tracked-entity-response } 
    
    类型
    
    ###### JSON{ #json } 
    
    Tracked entity attribute value change logs { #webapi_tracker_attribute_change_logs }
    
    ``json
    {
      "trackedEntity":"PQfMcpmXeFE"、
      "trackedEntityType":"nEenWmSyUEp"、
      "createdAt":"2014-03-06T05:49:28.256",
      "createdAtClient":"2014-03-06T05:49:28.256",
      "updatedAt":"2016-08-03T23:49:43.309",
      "orgUnit":"DiszpKrYNg8"、
      "inactive": false、
      "deleted": false、
      "potentialDuplicate": false、
      "属性": [[
        {
          "属性": ["w75KJ2mc4zz"、
          "代码":"MMD_PER_NAM"、
          "displayName"(显示名称):"名字"、
          "创建时间":"2016-08-03T23:49:43.308",
          "updatedAt":"2016-08-03T23:49:43.308",
          "valueType"(值类型): "TEXT"(文本"TEXT"、
          "值":"约翰"
        },
        {
          "属性":"zDhUuAYrxNC"、
          "显示名":"姓氏"、
          "创建时间":"2016-08-03T23:49:43.309",
          "updatedAt":"2016-08-03T23:49:43.309",
          "valueType"(值类型): "TEXT"(文本"TEXT"、
          "值":"凯莉"
        }
      ],
      "注册":[
        {
          "注册":"JMgRZyeLWOo"、
          "创建时间":"2017-03-06T05:49:28.340",
          "创建于客户端":"2016-03-06T05:49:28.340",
          "updatedAt":"2017-03-06T05:49:28.357",
          "trackedEntity":"PQfMcpmXeFE"、
          "程序": "IpHINAT79U"IpHINAT79UW"、
          "状态":"ACTIVE"、
          "orgUnit":"DiszpKrYNg8"、
          "enrolledAt":"2024-03-06T00:00:00.000",
          "occurredAt":"2024-03-04T00:00:00.000",
          "attributeOptionCombo":"HllvX50cXC0"、
          "followUp": false、
          "deleted": false、
          "事件": [[
            {
              "event":"Zq2dg6pTNoj"、
              "状态":"ACTIVE"、
              "程序":"IpHINAT79UW"、
              "程序阶段": "ZzYYXq4fJie"ZzYYXq4fJie"、
              "注册": "JMgRZyeLWOO":"JMgRZyeLWOo"、
              "跟踪实体": "PQfMcpmX"PQfMcpmXeFE"、
              "关系":[],
              "scheduledAt":"2023-03-10T00:00:00.000",
              "followUp": false、
              "deleted": false、
              "createdAt":"2017-03-06T05:49:28.353",
              "createdAtClient":"2016-03-06T05:49:28.353",
              "updatedAt":"2017-03-06T05:49:28.353",
              "attributeOptionCombo":"HllvX50cXC0"、
              "attributeCategoryOptions":"xYerKDKCefk"、
              "dataValues":[],
              "备注": [[]
            }
          ],
          "关系":[],
          "属性":[
            {
              "属性": ["w75KJ2mc4zz"、
              "代码":"MMD_PER_NAM"、
              "displayName"(显示名称):"名字"、
              "创建时间":"2016-08-03T23:49:43.308",
              "updatedAt":"2016-08-03T23:49:43.308",
              "valueType"(值类型): "TEXT"(文本"TEXT"、
              "值":"约翰"
            },
            {
              "属性":"zDhUuAYrxNC"、
              "显示名":"姓氏"、
              "创建时间":"2016-08-03T23:49:43.309",
              "updatedAt":"2016-08-03T23:49:43.309",
              "valueType"(值类型): "TEXT"(文本"TEXT"、
              "值":"凯莉"
            },
            {
              "属性":"AuPLng5hLbE"、
              "代码":"国家标识符"、
              "displayName"(显示名称):"国家标识符"、
              "createdAt":"2016-08-03T23:49:43.301",
              "updatedAt":"2016-08-03T23:49:43.301",
              "valueType"(值类型): "TEXT"(文本"TEXT"、
              "值":"245435245"
            },
            {
              "属性":"ruQQnf6rswq"、
              "显示名称":"结核病编号"、
              "创建时间":"2016-08-03T23:49:43.308",
              "updatedAt"(更新时间"2016-08-03T23:49:43.308",
              "valueType"(值类型): "TEXT"(文本"TEXT"、
              "值": "1z 1f2 a84"1Z 1F2 A84 59 4464 173 6"
            },
            {
              "属性":"cejWyOfXge6"、
              "显示名称":"性别"、
              "创建时间":"2016-08-03T23:49:43.307",
              "updatedAt":"2016-08-03T23:49:43.307",
              "valueType"(值类型): "TEXT"(文本"TEXT"、
              "值":"男性"
            },
            {
              "属性":"VqEFza8wbwA"、
              "代码":"mmd_per_adr1"、
              "显示名称":"地址"、
              "创建时间":"2016-08-03T23:49:43.307",
              "updatedAt"(更新时间"2016-08-03T23:49:43.307",
              "valueType"(值类型):"TEXT"(文本"TEXT"、
              "值":"主要街道 2"
            }
          ],
          "备注":[]
        }
      ],
      "programOwners":[
        {
          "orgUnit":"DiszpKrYNg8"、
          "trackedEntity":"PQfMcpmXeFE"、
          "程序":"ur1Edk5Oe2n"
        },
        {
          "orgUnit":"DiszpKrYNg8"、
          "trackedEntity":"PQfMcpmXeFE"、
          "程序":"IpHINAT79UW" }
        }
      ]
    }
    
CSV{ #csv }

uid

Return the tracked entity with specified uid

项目

允许值 Potential duplicate status order
fields 具有以下要求: Include specified sub-objects in the response
{ "periodFrom": -15, "periodTo": 15} JSON格式 ```
GET /api/tracker/trackedEntities/PQfMcpmXeFE
```
iasc 和 idesc 是不区分大小写的排序。如果需要对多个属性进行排序,请使用逗号将它们分开。 JSON格式 JSON格式
数据值 具有以下要求: CSV
跟踪实体属性值更改日志{ #tracked-entity-attribute-value-change-logs }

Tracked entity attribute value change logs { #webapi_tracker_attribute_change_logs }

``json { "pager":{ "page":1, "pageSize":10 }, "changeLogs":[ { "createdBy":{ "uid":"AIK2aQOJIbj"、 "username":"tracker"、 "firstName":"Tracker demo"、 "姓":"用户" }, "创建时间":"2024-06-20T14:51:16.433", "类型": "UPDATE"UPDATE"、 "更改":{ "attributeValue":{ "attribute":"w75KJ2mc4zz"、 "previousValue":"John"、 "currentValue":"约翰尼" } } }, { "createdBy":{ "uid":"AIK2aQOJIbj"、 "username":"tracker"、 "firstName":"Tracker demo"、 "姓":"用户" }, "创建时间":"2024-06-20T14:50:32.966", "类型":"CREATE"、 "更改":{ "attributeValue":{ "attribute":"w75KJ2mc4zz"、 "currentValue":"约翰" } } } ] }

This endpoint retrieves change logs for the attributes of a specific tracked entity. It returns a list of all tracked entity attributes that have changed over time for that entity.

Event data value change logs { #webapi_event_data_value_change_logs }

### 注册{ #enrollments } 

Allowed values

path `/{uid}`

- 串
    - Tracked entity `UID`.
- 项目
    - `String`

#### 注册信息收集端点 `GET /api/tracker/enrollments`{ #enrollment-collection-endpoint-get-apitrackerenrollments } 

根据筛选条件返回注册列表。

|允许值|Potential duplicate status|`order`|Parameter name|
|---|---|---|---|
|createdBy (Username of user)|具有以下要求:|See [Tracked Entities](tracker.md#tracked-entities) and [Attributes](tracker.md#attributes) for more field descriptions.|```json
{
  "pager": {
    "page": 1,
    "pageSize": 10
  },
  "changeLogs": [
    {
      "createdBy": {
        "uid": "AIK2aQOJIbj",
        "username": "tracker",
        "firstName": "Tracker demo",
        "surname": "User"
      },
      "createdAt": "2024-06-20T14:51:16.433",
      "type": "UPDATE",
      "change": {
        "dataValue": {
          "dataElement": "bx6fsa0t90x",
          "previousValue": "true",
          "currentValue": "false"
        }
      }
    },
    {
      "createdBy": {
        "uid": "AIK2aQOJIbj",
        "username": "tracker",
        "firstName": "Tracker demo",
        "surname": "User"
      },
      "createdAt": "2024-06-20T14:50:32.966",
      "type": "CREATE",
      "change": {
        "dataValue": {
          "dataElement": "ebaJjqltK5N",
          "currentValue": "0"
        }
      }
    }
  ]
}
```|
|orgUnitMode(见 [orgUnitModes](tracker.md#webapi_tracker_orgunit_scope)|具有以下要求:|Narrows response to events matching given filters. A filter is a colon separated property or data element UID with optional operator and value pairs. Example: `filter=fazCI2ygYkq:eq:PASSIVE` with operator starts with `eq` followed by a value. A filter like `filter=fazCI2ygYkq:!null` returns all events where the given data element has a value. Characters such as `:` or `,`, as part of the filter value, need to be escaped by `/`. Likewise, `/` needs to be escaped. Multiple operators for the same data element like `filter=qrur9Dvnyt5:gt:70:lt:80` are allowed. User needs access to the data element to filter on it.|选择组织单位的模式。默认为 "选择"。|
|`{ "periodFrom": -15, "periodTo": 15}`|具有以下要求:|```
GET /api/tracker/events?orgUnit=DiszpKrYNg8&program=lxAQ7Zs9VYR&filter=DanTR5x0WDK:EQ:/:/,//
```|`GET /api/tracker/enrollments/{id}`|
|retrieves an enrollment given the provided ID|具有以下要求:|The response is file `events.json.gz` or `events.csv.gzip` containing the `events.json`
or `events.csv` file.|Request parameter|
|用户友好型消息,说明操作是否成功。|具有以下要求:|The response is file `events.json.gz` or `events.csv.gzip` containing the `events.json`
or `events.csv` file.|Request parameter|
|Table: Program Stage Query Criteria|项目阶段| 跟踪器或事件项目的标识符。该参数为必填参数。 | orgUnitMode` see [orgUnitModes](tracker.md#webapi_tracker_orgunit_scope)|
|串|Events CSV|Filter for events which were updated up until this date. Cannot be used together with `updatedWithin`. | 项目|
|DateTime|[ISO-8601](https://en.wikipedia.org/wiki/ISO_8601)| Filter for events which were updated up until this date. Cannot be used together with `updatedWithin`.| 项目状态 **已过时,将在第 43 版中移除,使用 `status`** |
|串|Events CSV| Filter for events which were updated up until this date. Cannot be used together with `updatedWithin`.|  status|
|串|Events CSV| Filter for events which were updated up until this date. Cannot be used together with `updatedWithin`.| 跟进|
|storeCopy|具有以下要求:|```
GET /api/tracker/events?orgUnit=DiszpKrYNg8&program=lxAQ7Zs9VYR&filter=DanTR5x0WDK:EQ:/:/,//
```| programStatus **deprecated for removal in version 43 use `enrollmentStatus`**|
|iasc 和 idesc 是不区分大小写的排序。如果需要对多个属性进行排序,请使用逗号将它们分开。|具有以下要求:|描述|updatedWithin|
|Duration|具有以下要求:|Only enrollments updated since given duration|enrolledAfter|
|> **注**
>
> 以下属性可能使用了外部系统的引用,因此被特意排除在合并之外。如果这些字段出现问题,可能需要更新。 
>
> 指标: aggregateExportCategoryOptionCombo & aggregateExportAttributeOptionCombo
>
> 项目指标: aggregateExportCategoryOptionCombo & aggregateExportAttributeOptionCombo|具有以下要求:|```
GET /api/tracker/events?orgUnit=DiszpKrYNg8&program=lxAQ7Zs9VYR&filter=DanTR5x0WDK:EQ:/:/,//
```|根据给定的属性选项组合筛选注册信息。只返回匹配的注册信息。|
|串|*userDataStore* 由用户、命名空间、键和关联的
值。用户、命名空间和密钥的组合是唯一的。| |IdScheme used for category option references. Defaults to the `idScheme` parameter.|

enrolledBefore

##### 请求示例{ #example-requests } 

[ISO-8601](https://en.wikipedia.org/wiki/ISO_8601)

Only enrollments older than this date

trackedEntity

串

At least one organisation unit must be specified using the `orgUnit`

Identifier of tracked entity

order

串

Comma-separated list of property name or attribute or UID and sort direction pairs in format `propName:sortDirection`.

Supported fields: `completedAt, createdAt, createdAtClient, enrolledAt, updatedAt, updatedAtClient`.

##### 输出的最大限制。

串

Comma-separated list of enrollment `UID`s.

#### 注册单一对象端点{ #enrollments-single-object-endpoint } 

includeDeleted

Boolean

##### 请求语法 { #request-syntax } 

查询不区分大小写。唯一的要求是必须提供项目参数。

| 允许值 | Potential duplicate status | `order` | Parameter name |
| --- | --- | --- | --- |
| storedByDataValue | 具有以下要求: | ```
GET /api/tracker/events?orgUnit=DiszpKrYNg8&program=lxAQ7Zs9VYR&filter=DanTR5x0WDK:EQ:/:/,//
``` | To constrain the response to enrollments of a specific tracked entity you can include a tracked
entity query parameter: |
| 默认过滤器是`id,displayName` | 具有以下要求: | ```
GET /api/tracker/enrollments?orgUnitMode=ACCESSIBLE&trackedEntity=tphfdyIiVL6
``` | ```json
{
  "pager": {
    "page": 1,
    "pageSize": 1
  },
  "events": [
    {
      "event": "A7rzcnZTe2T",
      "status": "ACTIVE",
      "program": "eBAyeGv0exc",
      "programStage": "Zj7UnCAulEk",
      "enrollment": "RiLEKhWHlxZ",
      "orgUnit": "DwpbWkiqjMy",
      "occurredAt": "2023-02-13T00:00:00.000",
      "scheduledAt": "2023-02-13T00:00:00.000",
      "followUp": false,
      "deleted": false,
      "createdAt": "2017-09-08T21:40:22.000",
      "createdAtClient": "2016-09-08T21:40:22.000",
      "updatedAt": "2017-09-08T21:40:22.000",
      "attributeOptionCombo": "HllvX50cXC0",
      "attributeCategoryOptions": "xYerKDKCefk",
      "geometry": {
        "type": "Point",
        "coordinates": [-11.468912037323042, 7.515913998868316]
      },
      "dataValues": [
        {
          "createdAt": "2016-12-06T18:22:34.438",
          "updatedAt": "2016-12-06T18:22:34.438",
          "storedBy": "bjorn",
          "providedElsewhere": false,
          "dataElement": "F3ogKBuviRA",
          "value": "[-11.4880220438585,7.50978830548003]"
        },
        {
          "createdAt": "2013-12-30T14:23:57.423",
          "updatedAt": "2013-12-30T14:23:57.423",
          "storedBy": "lars",
          "providedElsewhere": false,
          "dataElement": "eMyVanycQSC",
          "value": "2018-02-07"
        },
        {
          "createdAt": "2013-12-30T14:23:57.382",
          "updatedAt": "2013-12-30T14:23:57.382",
          "storedBy": "lars",
          "providedElsewhere": false,
          "dataElement": "oZg33kd9taw",
          "value": "Male"
        }
      ],
      "notes": [],
      "followup": false
    }
  ]
}
``` |

##### 请求示例{ #example-requests } 

```json
{
  "pager": {
    "page": 1,
    "pageSize": 1
  },
  "enrollments": [
    {
      "enrollment": "TRE0GT7eh7Q",
      "createdAt": "2019-08-21T13:28:00.056",
      "createdAtClient": "2018-11-13T15:06:49.009",
      "updatedAt": "2019-08-21T13:29:44.942",
      "updatedAtClient": "2019-08-21T13:29:44.942",
      "trackedEntity": "s4NfKOuayqG",
      "program": "M3xtLkYBlKI",
      "status": "COMPLETED",
      "orgUnit": "DiszpKrYNg8",
      "enrolledAt": "2023-11-13T00:00:00.000",
      "occurredAt": "2023-11-13T00:00:00.000",
      "followUp": false,
      "deleted": false,
      "storedBy": "healthworker1",
      "notes": []
    }
  ]
}

Enrollments single object endpoint

输出的最大限制。

The purpose of this endpoint is to retrieve an enrollment given its ID.

Request syntax

GET /api/tracker/enrollment/{uid}

Request parameter

类型

GET /api/tracker/events/{id}

如果未另行指定,JSON 将是 GET 方法的默认响应。API 还 还支持单个端点和集合端点的 CSV 导出。此外,它还支持压缩 JSON 和 CSV。

活动 CSV{ #events-csv }

指标组 Potential duplicate status
The message text.
用户友好型消息,说明操作是否成功。 具有以下要求:
{ "periodFrom": -15, "periodTo": 15} Response format
See an example payload below. Response format
文本 Response format
{"type":"ABSOLUTE","startDate":"2020-03-01","endDate":"2022-12-30"} Response format
To retrieve an event with a specific ID: Events CSV
If not otherwise specified, JSON is the default response for the GET method. The API also
supports CSV export for single and collection endpoints. Furthermore, it supports compressed
JSON and CSV for the collection endpoint. Events CSV
In the case of CSV, the fields request parameter has no effect, and the response will always
contain the following fields: Property
类型 event
用户标识 status
Table: Program Stage Query Criteria 项目阶段
ID 项目阶段
类型 Events CSV
身份证 Events CSV
String:Uid Events CSV
DateTime Events CSV
日期时间 updatedAtClient
WKT, can be omitted it in case of a Point type and with latitude and longitude provided Events CSV
Latitude of a Point type of Geometry updatedAtClient
>
>
> 以下属性可能使用了外部系统的引用,因此被特意排除在合并之外。如果这些字段出现问题,可能需要更新。
>
> 指标: aggregateExportCategoryOptionCombo & aggregateExportAttributeOptionCombo
>
> 项目指标: aggregateExportCategoryOptionCombo & aggregateExportAttributeOptionCombo Response format
boolean Response format
布尔 updatedAtClient
最小最大数据元素 Response format
日期时间 具有以下要求:
日期时间 updatedAtClient
日期时间 项目阶段
用户名 具有以下要求:
创建的数据值 Events CSV
用户名 Events CSV

ID

活动 GZIP{ #events-gzip }

响应是文件 events.json.gzevents.csv.gz ,其中包含 events.jsonevents.csv 文件。 或 events.csv 文件。

活动 ZIP{ #events-zip }

响应文件是 events.json.zipevents.csv.zip 文件,其中包含 events.jsonevents.csv 文件。 或 events.csv 文件。

事件收集端点 GET /api/tracker/events

ID

允许值 Potential duplicate status order Parameter name
{ "periodFrom": -15, "periodTo": 15} 具有以下要求: storedByDataValue
See an example payload below. 具有以下要求: storedByDataValue 日期时间
See Events and Data Values for more
field descriptions. 具有以下要求: The response is file events.json.gz or events.csv.gzip containing the events.json
or events.csv file. scheduledBefore
数据值 具有以下要求: Returns a list of events based on the provided filters. Request parameter
类型 具有以下要求: 描述 项目
Table: Program Stage Query Criteria 项目阶段 跟踪器或事件项目的标识符。该参数为必填参数。 项目阶段
storeCopy 具有以下要求: storedByDataValue programStatus deprecated for removal in version 43 use enrollmentStatus
{"type":"ABSOLUTE","startDate":"2020-03-01","endDate":"2022-12-30"} 具有以下要求: storedByDataValue filter
具有以下要求: Narrows response to events matching given filters. A filter is a colon separated property or data element UID with optional operator and value pairs. Example: filter=fazCI2ygYkq:eq:PASSIVE with operator starts with eq followed by a value. A filter like filter=fazCI2ygYkq:!null returns all events where the given data element has a value. Characters such as : or ,, as part of the filter value, need to be escaped by /. Likewise, / needs to be escaped. Multiple operators for the same data element like filter=qrur9Dvnyt5:gt:70:lt:80 are allowed. User needs access to the data element to filter on it. filterAttributes
用户友好型消息,说明操作是否成功。 具有以下要求: Narrows response to tracked entities matching given filters. Example: filterAttributes=H9IlTX2X6SL:eq:John. More on filters here 跟进
boolean Events CSV Filter for events which were updated up until this date. Cannot be used together with updatedWithin. trackedEntity
Events CSV Filter for events which were updated up until this date. Cannot be used together with updatedWithin. orgUnit
Events CSV Filter for events which were updated up until this date. Cannot be used together with updatedWithin. orgUnitMode see orgUnitModes
Events CSV Filter for events which were updated up until this date. Cannot be used together with updatedWithin. status
Events CSV Filter for events which were updated up until this date. Cannot be used together with updatedWithin. occurredAfter
DateTime Events CSV Filter for events which were updated up until this date. Cannot be used together with updatedWithin. occurredBefore
DateTime ISO-8601 Filter for events which occurred up until this date. scheduledAfter
DateTime 具有以下要求: The response is file events.json.gz or events.csv.gzip containing the events.json
or events.csv file. scheduledBefore
DateTime Events CSV Filter for events which were updated up until this date. Cannot be used together with updatedWithin. updatedAfter
DateTime Events CSV Filter for events which were updated up until this date. Cannot be used together with updatedWithin. updatedBefore
DateTime Events CSV Filter for events which were updated up until this date. Cannot be used together with updatedWithin. 指定项目的注册开始日期
Duration Events CSV Filter for events which were updated up until this date. Cannot be used together with updatedWithin. 指定项目的注册结束日期
描述 DateTime Enum enrollmentEnrolledAfter
DateTime DateTime Enum enrollmentEnrolledBefore
programStageIdScheme DateTime Enum ISO-8601
Can either be VALIDATE which will report errors in the payload without making changes to the database or COMMIT (default) which will validate the payload and make changes to the database. DateTime Enum 方案
IdScheme used for all metadata references unless overridden by a metadata specific parameter. Default is UID. DateTime Enum UID, CODE, NAME, ATTRIBUTE:{uid}
programIdScheme DateTime Enum UID, CODE, NAME, ATTRIBUTE:{uid}
UID, CODE, NAME, ATTRIBUTE:{uid} DateTime Enum UID, CODE, NAME, ATTRIBUTE:{uid}
iasc 和 idesc 是不区分大小写的排序。如果需要对多个属性进行排序,请使用逗号将它们分开。 具有以下要求: Enum UID, CODE, NAME, ATTRIBUTE:{uid}
用于项目阶段引用的 IdScheme。默认为 idScheme 参数。 具有以下要求: UID, CODE, NAME, ATTRIBUTE:{uid} categoryOptionComboIdScheme
Enum 具有以下要求: IdScheme used for category option combo references. Defaults to the idScheme parameter.
Enum 具有以下要求: categoryOptionIdScheme
userDataStore 由用户、命名空间、键和关联的
值。用户、命名空间和密钥的组合是唯一的。 IdScheme used for category option references. Defaults to the idScheme parameter.
Enum 具有以下要求: order
Property 具有以下要求: events

如果查询既不包含 attributeCategoryCombo 也不包含 attributeCategoryOptions、 服务器将返回用户具有读取权限的所有属性选项组合的事件。

请求示例{ #example-requests }

attributeCategoryCombo (see note)

Attribute category combo identifier. Must be combined with attributeCategoryOptions.

attributeCategoryOptions (see note)

Comma-separated attribute category option identifiers. Must be combined with attributeCategoryCombo.

includeDeleted

Boolean

When true, soft deleted events will be included in your query result.

assignedUserMode

CURRENT, PROVIDED, NONE, ANY

Assigned user selection mode

assignedUsers

Comma-separated list of user UIDs to filter based on events assigned to the users.

Filter the result down to a limited set of tracked entities with events that are assigned to the given user IDs by using assignedUser=id1,id2.This parameter will only be considered if assignedUserMode is either PROVIDED or null. The API will error out, if for example, assignedUserMode=CURRENT and assignedUser=someId.

Note

If the query contains neither attributeCategoryOptions nor attributeCategoryOptions, the server returns events for all attribute option combos where the user has read access.

事件响应示例{ #events-response-example }

The query for all events with children of a particular organisation unit:

JSON{ #json }

The query for all events with all descendants of a particular organisation unit, implying all organisation units in the sub-hierarchy:

GET /api/tracker/events?orgUnit=O6uvpzGd5pu&orgUnitMode=DESCENDANTS
CSV{ #csv }
GET /api/tracker/events?orgUnit=DiszpKrYNg8&program=eBAyeGv0exc

Query for all events with a certain program and organisation unit, sorting by scheduled date ascending:

```

GET /api/tracker/events?orgUnit=DiszpKrYNg8&program=eBAyeGv0exc&order=scheduledAt

查询某一项目和组织单位中发生日期最新的 10 个事件 - 通过分页和按发生日期降序排序的方法
通过分页和按发生日期降序排序:

##### 请求语法 { #request-syntax } 

Query for all events with a certain program and organisation unit for a specific tracked entity:

|允许值|Potential duplicate status|`order`|Parameter name|
|---|---|---|---|
|```
GET /api/tracker/events?orgUnit=DiszpKrYNg8&program=lxAQ7Zs9VYR&filter=DanTR5x0WDK:EQ:/:/,//
```|JSON格式|```
GET /api/tracker/events?orgUnit=DiszpKrYNg8&program=lxAQ7Zs9VYR&filter=DanTR5x0WDK:EQ:/:/,//
```|Events response example|
|The API supports CSV and JSON response for `GET /api/tracker/events`.|JSON格式| The JSON response can look like the following: |```json
{
  "pager": {
    "page": 1,
    "pageSize": 1
  },
  "events": [
    {
      "event": "A7rzcnZTe2T",
      "status": "ACTIVE",
      "program": "eBAyeGv0exc",
      "programStage": "Zj7UnCAulEk",
      "enrollment": "RiLEKhWHlxZ",
      "orgUnit": "DwpbWkiqjMy",
      "occurredAt": "2023-02-13T00:00:00.000",
      "scheduledAt": "2023-02-13T00:00:00.000",
      "followUp": false,
      "deleted": false,
      "createdAt": "2017-09-08T21:40:22.000",
      "createdAtClient": "2016-09-08T21:40:22.000",
      "updatedAt": "2017-09-08T21:40:22.000",
      "attributeOptionCombo": "HllvX50cXC0",
      "attributeCategoryOptions": "xYerKDKCefk",
      "geometry": {
        "type": "Point",
        "coordinates": [-11.468912037323042, 7.515913998868316]
      },
      "dataValues": [
        {
          "createdAt": "2016-12-06T18:22:34.438",
          "updatedAt": "2016-12-06T18:22:34.438",
          "storedBy": "bjorn",
          "providedElsewhere": false,
          "dataElement": "F3ogKBuviRA",
          "value": "[-11.4880220438585,7.50978830548003]"
        },
        {
          "createdAt": "2013-12-30T14:23:57.423",
          "updatedAt": "2013-12-30T14:23:57.423",
          "storedBy": "lars",
          "providedElsewhere": false,
          "dataElement": "eMyVanycQSC",
          "value": "2018-02-07"
        },
        {
          "createdAt": "2013-12-30T14:23:57.382",
          "updatedAt": "2013-12-30T14:23:57.382",
          "storedBy": "lars",
          "providedElsewhere": false,
          "dataElement": "oZg33kd9taw",
          "value": "Male"
        }
      ],
      "notes": [],
      "followup": false
    }
  ]
}
```|

##### 请求示例{ #example-requests } 

The CSV response can look like the following:

```csv
event,status,program,programStage,enrollment,orgUnit,occurredAt,scheduledAt,geometry,latitude,longitude,followUp,deleted,createdAt,createdAtClient,updatedAt,updatedAtClient,completedBy,completedAt,updatedBy,attributeOptionCombo,attributeCategoryOptions,assignedUser,dataElement,value,storedBy,providedElsewhere,storedByDataValue,updatedAtDataValue,createdAtDataValue
A7rzcnZTe2T,ACTIVE,eBAyeGv0exc,Zj7UnCAulEk,RiLEKhWHlxZ,DwpbWkiqjMy,2023-02-12T23:00:00Z,2023-02-12T23:00:00Z,"POINT (-11.468912037323042 7.515913998868316)",7.515913998868316,-11.468912037323042,false,false,2017-09-08T19:40:22Z,,2017-09-08T19:40:22Z,,,,,HllvX50cXC0,xYerKDKCefk,,F3ogKBuviRA,"[-11.4880220438585,7.50978830548003]",admin,false,,2016-12-06T17:22:34.438Z,2016-12-06T17:22:34.438Z
A7rzcnZTe2T,ACTIVE,eBAyeGv0exc,Zj7UnCAulEk,RiLEKhWHlxZ,DwpbWkiqjMy,2023-02-12T23:00:00Z,2023-02-12T23:00:00Z,"POINT (-11.468912037323042 7.515913998868316)",7.515913998868316,-11.468912037323042,false,false,2017-09-08T19:40:22Z,,2017-09-08T19:40:22Z,,,,,HllvX50cXC0,xYerKDKCefk,,eMyVanycQSC,2018-02-07,admin,false,,2013-12-30T13:23:57.423Z,2013-12-30T13:23:57.423Z
A7rzcnZTe2T,ACTIVE,eBAyeGv0exc,Zj7UnCAulEk,RiLEKhWHlxZ,DwpbWkiqjMy,2023-02-12T23:00:00Z,2023-02-12T23:00:00Z,"POINT (-11.468912037323042 7.515913998868316)",7.515913998868316,-11.468912037323042,false,false,2017-09-08T19:40:22Z,,2017-09-08T19:40:22Z,,,,,HllvX50cXC0,xYerKDKCefk,,msodh3rEMJa,2018-02-13,admin,false,,2013-12-30T13:23:57.467Z,2013-12-30T13:23:57.467Z
事件响应示例{ #event-response-example }

API 支持对 GET /api/tracker/events/{uid} 的 CSV 和 JSON 响应。

JSON{ #json }

GET /api/tracker/events/{uid}?fields={fields}

CSV{ #csv }

类型

Allowed values

描述

uid

允许值 Potential duplicate status order
fields 具有以下要求: Any valid field filter (default *,!relationships)
iasc 和 idesc 是不区分大小写的排序。如果需要对多个属性进行排序,请使用逗号将它们分开。 具有以下要求: A query for an Event:
数据值 具有以下要求: 应用项目接口支持对 GET /api/tracker/trackedEntities 的 CSV 和 JSON 响应
事件数据值更改日志响应示例{ #event-data-value-change-logs-response-example }
{
  "event": "rgWr86qs0sI",
  "status": "ACTIVE",
  "program": "kla3mAPgvCH",
  "programStage": "aNLq9ZYoy9W",
  "enrollment": "Lo3SHzCnMSm",
  "orgUnit": "DiszpKrYNg8",
  "occurredAt": "2024-10-12T00:00:00.000",
  "followUp": false,
  "deleted": false,
  "createdAt": "2018-10-20T12:09:19.492",
  "createdAtClient": "2017-10-20T12:09:19.492",
  "updatedAt": "2018-10-20T12:09:19.492",
  "attributeOptionCombo": "amw2rQP6r6M",
  "attributeCategoryOptions": "RkbOhHwiOgW",
  "dataValues": [
    {
      "createdAt": "2015-10-20T12:09:19.640",
      "updatedAt": "2015-10-20T12:09:19.640",
      "storedBy": "system",
      "providedElsewhere": false,
      "dataElement": "HyJL2Lt37jN",
      "value": "12"
    }
  ],
  "notes": [],
  "followup": false
}

CSV

The response will be the same as the collection endpoint but referring to a single event, although it might have multiple rows for each data element value.

Event data value change logs { #webapi_event_data_value_change_logs }

人际关系

This endpoint retrieves change logs for the data values of a specific event. It returns a list of all event data values and event fields (occurredAt, scheduledAt, and geometry) that have changed over time for the specified event.

Parameter

类型

Allowed values

path /{uid}

请求参数{ #request-parameters }

允许值 Potential duplicate status order Parameter name
storeCopy 具有以下要求: ```
GET /api/tracker/events?orgUnit=DiszpKrYNg8&program=lxAQ7Zs9VYR&filter=DanTR5x0WDK:EQ:/:/,//
``` Event data value change logs response example
文本 具有以下要求: ```
GET /api/tracker/events?orgUnit=DiszpKrYNg8&program=lxAQ7Zs9VYR&filter=DanTR5x0WDK:EQ:/:/,//
``` More on change log configuration here
The message text. 具有以下要求: ```
GET /api/tracker/events?orgUnit=DiszpKrYNg8&program=lxAQ7Zs9VYR&filter=DanTR5x0WDK:EQ:/:/,//
``` The purpose of this endpoint is to retrieve relationships between objects.
默认过滤器是id,displayName 具有以下要求: Request parameters ```json
{
"pager": {
"page": 1,
"pageSize": 1
},
"events": [
{
"event": "A7rzcnZTe2T",
"status": "ACTIVE",
"program": "eBAyeGv0exc",
"programStage": "Zj7UnCAulEk",
"enrollment": "RiLEKhWHlxZ",
"orgUnit": "DwpbWkiqjMy",
"occurredAt": "2023-02-13T00:00:00.000",
"scheduledAt": "2023-02-13T00:00:00.000",
"followUp": false,
"deleted": false,
"createdAt": "2017-09-08T21:40:22.000",
"createdAtClient": "2016-09-08T21:40:22.000",
"updatedAt": "2017-09-08T21:40:22.000",
"attributeOptionCombo": "HllvX50cXC0",
"attributeCategoryOptions": "xYerKDKCefk",
"geometry": {
"type": "Point",
"coordinates": [-11.468912037323042, 7.515913998868316]
},
"dataValues": [
{
"createdAt": "2016-12-06T18:22:34.438",
"updatedAt": "2016-12-06T18:22:34.438",
"storedBy": "bjorn",
"providedElsewhere": false,
"dataElement": "F3ogKBuviRA",
"value": "[-11.4880220438585,7.50978830548003]"
},
{
"createdAt": "2013-12-30T14:23:57.423",
"updatedAt": "2013-12-30T14:23:57.423",
"storedBy": "lars",
"providedElsewhere": false,
"dataElement": "eMyVanycQSC",
"value": "2018-02-07"
},
{
"createdAt": "2013-12-30T14:23:57.382",
"updatedAt": "2013-12-30T14:23:57.382",
"storedBy": "lars",
"providedElsewhere": false,
"dataElement": "oZg33kd9taw",
"value": "Male"
}
],
"notes": [],
"followup": false
}
]
}
```
iasc 和 idesc 是不区分大小写的排序。如果需要对多个属性进行排序,请使用逗号将它们分开。 具有以下要求: 描述 trackedEntity
userDataStore 由用户、命名空间、键和关联的
值。用户、命名空间和密钥的组合是唯一的。 跟踪器或事件项目的标识符。该参数为必填参数。 enrollment

uid

Identifier of an enrollment

回复示例{ #example-response }

uid

Identifier of an event

fields

Any valid field filter (default relationship,relationshipType,createdAtClient,from[trackedEntity[trackedEntity],enrollment[enrollment],event[event]],to[trackedEntity[trackedEntity],enrollment[enrollment],event[event]])

Tracker 数据的一个关键点是需要采用整体方法。例如,用户 只对数据元素有读取权限是无法查看数据元素值的。用户 需要有数据读取权限,才能访问该数据元素所属的父计划阶段和计划。 所属的父计划阶段和计划。这与类别选项组合的工作方式相同。在跟踪系统中,事件和 注册与属性选项组合(AttributeOptionCombo)相关联,属性选项组合由多个类别选项组成。 选项。要读取事件或注册信息,用户必须拥有对所有类别选项及其相应类别的数据读取权限。 及其相应类别的数据读取权限。如果用户 缺少对所需类别选项或类别之一的访问权限,则无法访问整个事件或注册信息。 访问整个事件或注册。

order

Comma-separated list of property name or attribute or UID and sort direction pairs in format propName:sortDirection.

Supported fields: createdAt, createdAtClient.

includeDeleted

Boolean

true, false

whether to include soft-deleted elements in your query result

The following rules apply to the query parameters.

Only one parameter among trackedEntity, enrollment, event can be passed. Parameter name
Example response ```json
{
"pager": {
"page": 1,
"pageSize": 2
},
"relationships": [
{
"relationship": "oGtgtJpp6fG",
"relationshipType": "Mv8R4MPcNcX",
"from": {
"trackedEntity": {
"trackedEntity": "neR4cmMY22o"
}
},
"to": {
"trackedEntity": {
"trackedEntity": "DsSlC54GNXy"
}
}
},
{
"relationship": "SSfIicJKbh5",
"relationshipType": "Mv8R4MPcNcX",
"from": {
"trackedEntity": {
"trackedEntity": "neR4cmMY22o"
}
},
"to": {
"trackedEntity": {
"trackedEntity": "rEYUGH97Ssd"
}
}
}
]
}
```
Tracker access control { #webapi_tracker_access_control } Tracker has a few different concepts in regards to access control, like sharing, organisation unit
scopes, ownership, and access levels. The following sections provide a short introduction to the
different topics.
Metadata sharing { #webapi_tracker_metadata_sharing } Sharing setting is standard DHIS2 functionality that applies to both Tracker and Aggregate
metadata/data as well as dashboards and visualization items. At the core of sharing is the ability
to define who can see/do what. In general, there are five possible sharing configurations – no
access, metadata read, metadata write, data read, and data write. These access configurations can be
granted at user and/or user group level (for more flexibility). With a focus on Tracker, the
following metadata and their sharing setting is of particular importance: Data Element, Category
Option, Program, Program Stage, Tracked Entity Type, Tracked Entity Attribute as well as Tracker
related Dashboards and Dashboard Items.
Sharing settings are enforced during Tracker data import/export. Data read/write access is needed to
read and write respectively. Similarly, if a user is expected to modify metadata, it is essential to
grant metadata write access. One critical point with Tracker data is the need to have a holistic approach. For example, a user
won’t be able to see the Data Element value by having read access to just the Data Element. The user
needs to have data read to access the parent Program Stage and Program where this Data Element
belongs. It is the same with the category option combination. In Tracker, the Event is related to
AttributeOptionCombo, which is made up of a combination of Category Options. Therefore, for a user
to read data of an Event, he/she needs to have data read access to all Category Options and
corresponding Categories that constitute the AttributeOptionCombo of the Event in question. If a
user lacks access to just one Category Option or Category, then the user has no access to the entire
Event.
在访问注册数据时,必须首先访问被跟踪实体。
首先。通过共享设置项目、跟踪实体类型和跟踪实体属性,可以控制对跟踪实体的访问。
类型和跟踪实体属性的共享设置来控制对跟踪实体的访问。一旦访问了注册,就有可能访问事件
数据,这同样取决于项目阶段和数据元素共享设置。 另一个需要考虑的关键点是如何规划对不同项目阶段的访问。
有时,我们可能需要向特定用户组(实验室技术人员)授予访问特定阶段的权限,如
例如 "实验室结果")的访问权限。在这种情况下,我们可以
为 "实验室结果 "阶段提供数据写入访问权限,可能为一个或多个阶段提供数据读取 访问权限,以防我们希望实验室技术人员读取数据。
如果我们希望实验室技术人员读取其他医疗结果,则可以提供数据写入访问权限;如果我们 认为实验室技术人员没有必要查看数据,则可以不提供访问权限。
如果我们认为实验室技术人员没有必要查看实验室相关数据以外的数据,则不提供访问权限。
In summary, DHIS2 has a fine-grained sharing setting that we can use to implement access control
mechanisms both at the data and metadata level. These sharing settings can be applied directly at
the user level or user group level. How exactly to apply a sharing setting depends on the use-case
at hand. Organisation unit scopes { #webapi_tracker_orgunit_scope }

Organisation units are one of the most fundamental objects in DHIS2. They define a universe under which a user is allowed to record and/or read data. There are three types of organisation units that can be assigned to a user. These are data capture, data view (not used in tracker), and tracker search. As the name implies, these organisation units define a scope under which a user is allowed to conduct the respective operations. A user can search for data in their search scope and capture scope organisation units.

However, to further fine-tune the scope, DHIS2 Tracker introduces a concept that we call OrganisationUnitSelectionMode. Such a mode is often used at the time exporting tracker objects. For example, given that a user has a particular tracker search scope, does it mean that we have to use this scope every time a user tries to search for a tracker, Enrollment, or Event object? Or is the user interested in limiting the searching just to the selected org unit, or the entire capture org unit scope, and so on.

Users can do the fine-tuning by passing a specific value of orgUnitMode in their API request:

/api/tracker/trackedEntities?orgUnit=UID&orgUnitMode=specific_organisation_unit_selection_mode

Currently, there are six selection modes available: SELECTED, CHILDREN, DESCENDANTS, CAPTURE, ACCESSIBLE, and ALL.

Mode

描述

DHIS2 2.30 中引入的 "跟踪所有权 "定义了一个组织单位关联,用于 程序组合的组织单位关联。我们称其为计划背景下被跟踪实体的所有者(或拥有者)组织单位。 我们称其为程序上下文中 TrackedEntity 的所有者(或拥有者)组织单元。所有者组织单元 用来决定读写与程序相关的跟踪数据时的访问权限。这一点 访问级别](#webapi_tracker_access_level) 配置一起,决定与程序相关数据(注册)的访问行为。 行为。如果相应的所有者组织--用户--可以访问一个 TrackedEntity 的 如果该 TrackedEntity-Program 组合对应的所有者组织单位(OrganisationUnit 在用户的组织单位范围内(搜索/捕获)。对于配置为 的程序,其所有者组织单位必须在用户的搜索范围内。 范围。对于访问级别为*PROTECTED*或*CLOSED*的程序,所有者组织单位必须在用户搜索范围内。 组织单位必须在用户的捕获范围内,才能访问特定被跟踪实体的相应程序数据。 的程序数据。无论程序访问级别如何,要访问 无论程序访问级别如何,要访问跟踪器对象,所请求的组织单位必须始终在用户的搜索范围或捕获范围内。 范围或捕获范围内。用户不能请求这两个范围之外的对象,除非他们 使用组织单位模式 ALL 并拥有使用该模式的足够权限。

Specified organisation units.

  • CHILDREN Specified organisation unit including immediate children, i.e. organisation units at the immediate level below.
  • DESCENDANTS Specified organisation unit and all organisation units in the sub-hierarchy, i.e. at all organisation unit levels in the sub-hierarchy below the specified organisation units.

CAPTURE

The data capture organisation units associated with the current user and all organisation units in the sub-hierarchy.

ACCESSIBLE

跟踪器会搜索与当前用户相关联的组织单位以及子层次结构中的所有组织单位。这包括用户可见的所有内容,包括搜索范围内的打开和已审核项目,以及用户捕获范围内受保护和已关闭项目中的数据。如果用户缺少搜索组织单元,系统会默认为捕获范围,确保用户始终可以访问至少一个范围。捕获范围是强制性的,是保证用户数据环境的基本要素。

全部

All organisation units in the system. This mode is reserved for authorized users, specifically those with the authority ALL (super users). Users with the authority F_TRACKED_ENTITY_INSTANCE_SEARCH_IN_ALL_ORGUNITS can also search system-wide but need sharing access to the returned program, program stage, and/or tracked entity type. Non-authorized users are not permitted to search using this scope.

The first three modes, SELECTED, CHILDREN and DESCENDANTS, expect an organisation unit to be

supplied in the request, while the last three, CAPTURE, ACCESSIBLE and ALL do not.

The organisation unit mode will be one of the ones listed above when it is explicitly provided in the API request. Since it is not a mandatory paramter, when not specified, the default value will be SELECTED if an organisation unit is present, and ACCESSIBLE if not.

It makes little sense to pass these modes at the time of tracker import operations. Because when writing tracker data, each of the objects needs to have a specific organisation unit attached to them. The system will then ensure if each of the mentioned organisation units falls under the CAPTURE scope. If not, the system will simply reject the write operation.

请注意,与跟踪器对象相关的组织单位关联有四种类型。A

被跟踪实体有一个组织单位,通常称为注册组织单位。 注册有一个与之相关的组织单位。事件也有一个 关联。跟踪项目组合也有一个所有者组织单元。 组合。

When fetching Tracker objects, depending on the context, the organisation unit scope is applied to one of the above four organisation unit associations.

例如,在没有项目上下文的情况下检索 "跟踪实体 "时,组织单位 范围适用于被跟踪实体的注册组织单位。而当 组织单位范围适用于所有者组织单位。 组织单位范围适用于所有者组织单位。

打开{ #open }

A new concept called Tracker Ownership is introduced from 2.30. This introduces a new organisation unit association for a TrackedEntity - Program combination. We call this the Owner (or Owning) Organisation unit of a TrackedEntity in the context of a Program. The Owner organisation unit is used to decide access privileges when reading and writing tracker data related to a program. This, along with the Program's Access Level configuration, decides the access behavior for Program-related data (Enrollments and Events). A user can access a TrackedEntity's Program data if the corresponding Owner OrganisationUnit for that TrackedEntity-Program combination falls under the user's organisation unit scope (Search/Capture). For Programs that are configured with access level OPEN or AUDITED , the Owner OrganisationUnit has to be in the user's search scope. For Programs that are configured with access level PROTECTED or CLOSED , the Owner OrganisationUnit has to be in the user's capture scope to be able to access the corresponding program data for the specific tracked entity. Irrespective of the program access level, to access Tracker objects, the requested organisation unit must always be within either the user's search scope or capture scope. A user cannot request objects outside these two scopes unless they are using the organisation unit mode ALL and have sufficient privileges to use that mode.

经审计的{ #audited }

被跟踪的实体已加入用户可访问数据的至少一个项目,且用户

受保护的{ #protected }

被跟踪的实体没有加入用户有数据访问权的任何项目,但用户有

关闭{ #closed }

Tracker Ownership Override: Break the Glass { #webapi_tracker_ownership_override }

工作清单{ #working-lists }

This act of temporarily gaining access is termed breaking the glass. Currently, temporary access is granted for 3 hours. DHIS2 audit breaking the glass along with the reason specified by the user. This information is also stored in the database, but only if the tracked entity type is configured to allow auditing, which is disabled by default.

无法临时访问已配置为*CLOSED*访问级别的项目。 项目的临时访问权限。

To break the glass for a TrackedEntity-Program combination, the following POST request can be used:

跟踪实体工作清单{ #tracked-entity-working-lists }

Tracker Ownership Transfer { #webapi_tracker_ownership_transfer }

It is possible to transfer the ownership of a TrackedEntity-Program from one organisation unit to another. This will be useful in case of patient referrals or migrations. Only a user who has Ownership access (or temporary access by breaking the glass) can transfer the ownership. To transfer ownership of a TrackedEntity-Program to another organisation unit, the following PUT request can be used:

有效载荷{ #payload }

"assignedUsers":["DXyJmlo9rge"]

指标组 Parameter name 描述
displayColumnOrder periodFrom
dataFilters Protected
这种访问级别的限制稍多一些。受保护项目中的数据只有在所有者组织单位属于用户捕获范围的情况下才能被用户访问。
只有当所有者组织单位属于用户的捕获范围时,用户才能访问受保护项目内的数据。但是,如果用户
用户可以通过 打破玻璃 获得临时所有权。
玻璃](#webapi_tracker_ownership_override)获得临时所有权。用户必须说明为什么要访问手头的数据。
他们为什么要访问手头的数据。然后,系统会将理由和访问审核记录在案,并提供 3 个月的临时访问权限。
访问审计日志,并为用户提供 3 小时的临时访问权限。请注意,打破玻璃时
时,所有者组织单位保持不变,只有打碎玻璃的用户才能获得临时访问权。
获得临时访问权。 Closed
这是最受限制的访问级别。在访问级别为
如果所有者组织单位不在用户的捕获范围内,则无法访问 "关闭 "项目下记录的数据。
范围。在这种配置下,也无法打破玻璃或获得临时所有权。
请注意,仍有可能将所有权转移到另一个组织单位。只有
才能将 TrackedEntity-Program 组合的所有权转移给另一个组织单位。
另一个组织单位。如果所有权被转移,所有者组织单位将被更新。
跟踪实体 Working lists 工作列表允许用户保存筛选器和排序偏好,从而有效地组织工作流程。
首选项。每种类型的工作列表
实体、注册和事件都有专门的应用项目接口进行管理。
{ "periodFrom": -15, "periodTo": 15} Query request parameters Tracked entity working lists
Create, update and delete tracked entity working lists using /api/trackedEntityInstanceFilters Payload
Table: Payload Property 描述

指标组 Parameter name 描述
A description of the working list. sortOrder "attributeValueFilters":[{"attribute":"abcAttributeUid", "le":"20", "ge":"10", "lt":"20", "gt":"10","in":["印度", "挪威"], "like":"abc","sw":"abc","ew":"abc","dateFilter":{"startDate":"2014-05-01","endDate":"2019-03-20","startBuffer":-5,"endBuffer":5, "period":"LAST_WEEK", "type":"RELATIVE"}]
DateTime 被跟踪实体的注册状态。可以是 "无"(任何注册状态)或 "ACTIVE"、"COMPLETED"、"CANCELLED"。
Table: Program Stage Query Criteria 项目
是否在 DHIS2 中存储一份项目信息副本。 { "id" : "uy2gU8kTjF"} entityQueryCriteria
{"type":"RELATIVE","period":"TODAY"} See Entity Query Criteria definition table below. DateFilterPeriod object filtering based on the event scheduled date.
Enum 项目阶段的 uid。 "eventDate": {"startBuffer": -5,"endBuffer": 5, "type": "RELATIVE" }
Property DateFilterPeriod object date filtering based on last updated date.
"enrolledAt": {"type":"RELATIVE","period":"THIS_MONTH"} Property "attributeValueFilters"=[{"attribute": "abcAttributeUid","le": "20","ge": "10","lt": "20","gt": "10","in": ["India", "Norway"],"like": "abc","sw": "abc","ew": "abc","dateFilter": {"startDate": "2014-05-01","endDate": "2019-03-20","startBuffer": -5,"endBuffer": 5,"period": "LAST_WEEK","type": "RELATIVE"}}]
iasc 和 idesc 是不区分大小写的排序。如果需要对多个属性进行排序,请使用逗号将它们分开。 The tracked entities enrollment status. Can be none(any enrollmentstatus) or ACTIVE, COMPLETED, CANCELLED "order": "a3kGcGDCuk6:desc"
See an example payload below. organisationUnit "programStage": "a3kGcGDCuk6"
{"organisationUnit": "a3kGcGDCuk7"} ouMode {"trackedEntityType": "a3kGcGDCuk6"}
Absolute end date. Applicable only when type is ABSOLUTE assignedUserMode "trackedEntities":["a3kGcGDCuk6", "b4jGcGDCuk7"]
"assignedUserMode": "PROVIDED" assignedUsers To specify a list of assigned users for events. To be used along with PROVIDED assignedUserMode above.
"assignedUsers": ["a3kGcGDCuk7", "a3kGcGDCuk8"] displayColumnOrder To specify the output ordering of columns
"displayOrderColumns": ["enrollmentDate", "program"] 名称
"assignedUsers": ["a3kGcGDCuk7", "a3kGcGDCuk8"] 项目阶段 To specify a programStage uid to filter on. tracked entities will be filtered based on presence of enrollment in the specified program stage.
"order"="a3kGcGDCuk6:desc,eventDate:asc" trackedEntityType To specify a trackedEntityType filter tracked entities on.

{"trackedEntityType"="a3kGcGDCuk6"}

指标组 Parameter name 描述
See an example payload below. DateFilterPeriod object date filtering based on enrollment created date. "enrollmentCreatedDate": { "period": "LAST_WEEK", "type": "RELATIVE" }
"displayOrderColumns": ["enrollmentDate", "program"] DateFilterPeriod object date filtering based on enrollment incident date. "enrollmentIncidentDate": { "startDate": "2014-05-01", "endDate": "2019-03-20", "startBuffer": -5, "endBuffer": 5, "period": "LAST_WEEK", "type": "RELATIVE" }
eventStatus The event status. Options are ACTIVE, COMPLETED, VISITED, SCHEDULE, OVERDUE, SKIPPED and VISITED "status":"VISITED"
Enum DateFilterPeriod object date filtering based on event date. "eventDate": {"startBuffer": -5,"endBuffer": 5, "type": "RELATIVE" }
Property DateFilterPeriod object date filtering based on last updated date.
Event filters definition
指标组 Parameter name 描述
项目阶段 被跟踪实体需要返回哪个项目阶段的事件。 -15
"eaDH9089uMp" eventStatus 15

查询请求参数{ #query-request-parameters }

ACTIVE

eventCreatedPeriod Parameter name
{ "periodFrom": -15, "periodTo": 15} assignedUserMode

计划阶段工作清单{ #program-stage-working-lists }

"assignedUserMode": "PROVIDED"

assignedUsers

有效载荷{ #payload }

"assignedUsers":["DXyJmlo9rge"]

Table: Period filter definition Parameter name 描述
displayColumnOrder periodFrom
dataFilters Protected
{ "periodFrom": -15, "periodTo": 15} Query request parameters Table: Tracked entity instance filters query parameters
See an example payload below. 描述 项目
项目标识符。将筛选器限制在给定的项目中。 /api/trackedEntityInstanceFilters Create, update and delete program stage working lists using
/api/programStageWorkingLists
Payload Parameter name 描述
"displayOrderColumns": ["enrollmentDate", "program"] 名称
Name of the working list. Required. 描述 A description of the working list.
项目 eventCreatedAt {"id" : "uy2gU8kTjF"}
项目阶段 包含项目阶段 ID 的对象。必须填写。 {"id" : "uy2gU8kTjF"}
DateTime An object representing various possible filtering values. See Program Stage Query Criteria definition table below.
Table: Program Stage Query Criteria Criteria values 描述
eventStatus The event status. Options are ACTIVE, COMPLETED, VISITED, SCHEDULE, OVERDUE, SKIPPED and VISITED
"status":"VISITED" eventCreatedAt DateFilterPeriod object filtering based on the event creation date.
{"type":"ABSOLUTE","startDate":"2020-03-01","endDate":"2022-12-30"} eventOccurredAt DateFilterPeriod object filtering based on the event occurred date.
{"type":"RELATIVE","period":"TODAY"} eventScheduledAt DateFilterPeriod object filtering based on the event scheduled date.
Enum enrollmentStatus Any valid EnrollmentStatus. Options are ACTIVE, COMPLETED and CANCELLED.
Property 跟进 Indicates whether to filter enrollments marked for follow up or not
iasc 和 idesc 是不区分大小写的排序。如果需要对多个属性进行排序,请使用逗号将它们分开。 enrolledAt DateFilterPeriod object filtering based on the event enrollment date.
"enrolledAt": {"type":"RELATIVE","period":"THIS_MONTH"} enrollmentOccurredAt DateFilterPeriod object filtering based on the event occurred date.
{"type":"RELATIVE","period":"THIS_MONTH"} orgUnit A valid organisation unit UID
A description of the working list. ouMode A valid OU selection mode

"ouMode": "SELECTED"

assignedUserMode

活动工作清单{ #event-working-lists }

"assignedUserMode":"PROVIDED"

assignedUsers

有效载荷{ #payload }

"assignedUsers":["DXyJmlo9rge"]

指标组 Parameter name 描述
displayColumnOrder Output ordering of columns "displayColumnOrder":["w75KJ2mc4zz","zDhUuAYrxNC"]
dataFilters Protected "dataFilters":[{"dataItem": "GXNUsigphqK","ge": "10","le": "20"}]
{ "periodFrom": -15, "periodTo": 15} A list of attribute value filters. This is used to specify filters for attribute values when listing tracked entities "attributeValueFilters":[{"attribute": "ruQQnf6rswq","eq": "15"}]
See an example payload below. ```json
{
"name": "Test WL",
"description": "Test WL definition",
"program": {
"id": "uy2gU8kT1jF"
},
"programStage": {
"id": "oRySG82BKE6"
},
"programStageQueryCriteria": {
"eventStatus": "VISITED",
"eventCreatedAt": {
"type": "ABSOLUTE",
"startDate": "2020-03-01",
"endDate": "2022-12-30"
},
"eventScheduledAt": {
"type": "RELATIVE",
"period": "TODAY"
},
"enrollmentStatus": "COMPLETED",
"followUp": true,
"enrolledAt": {
"type": "RELATIVE",
"period": "THIS_MONTH"
},
"enrollmentOccurredAt": {
"type": "RELATIVE",
"period": "THIS_MONTH"
},
"orgUnit": "Rp268JB6Ne4",
"ouMode": "SELECTED",
"assignedUserMode": "PROVIDED",
"assignedUsers": [
"DXyJmlo9rge"
],
"order": "w75KJ2mc4zz:asc",
"displayColumnOrder": [
"w75KJ2mc4zz",
"zDhUuAYrxNC"
],
"dataFilters": [
{
"dataItem": "GXNUsigphqK",
"ge": "10",
"le": "20"
}
],
"attributeValueFilters": [
{
"attribute": "ruQQnf6rswq",
"eq": "15"
}
]
}
}
``` Event working lists
Create, update and delete event working lists using the following endpoint. ```
/api/eventFilters
``` Payload
Payload
指标组 Parameter name 描述
Table: Program Stage Query Criteria Name of the working list. "name":"My working list"
是否在 DHIS2 中存储一份项目信息副本。 { "id" : "uy2gU8kTjF"} "description":"for listing all events assigned to me".
{"type":"RELATIVE","period":"TODAY"} 项目的 uid。 "项目":"a3kGcGDCuk6"
Enum 项目阶段的 uid。 "项目阶段": "a3kGcGDCuk6"
Property Object containing parameters for querying, sorting and filtering events. "eventQueryCriteria": { "organisationUnit":"a3kGcGDCuk6", "status": "COMPLETED", "createdDate": { "from": "2014-05-01", "to": "2019-03-20" }, "dataElements": ["a3kGcGDCuk6:EQ:1", "a3kGcGDCuk6"], "filters": ["a3kGcGDCuk6:EQ:1"], "programStatus": "ACTIVE", "ouMode": "SELECTED", "assignedUserMode": "PROVIDED", "assignedUsers" : ["a3kGcGDCuk7", "a3kGcGDCuk8"], "followUp": false, "events": ["a3kGcGDCuk7", "a3kGcGDCuk8"], "fields": "eventDate,dueDate", "order": "dueDate:asc,createdDate:desc" }
"enrolledAt": {"type":"RELATIVE","period":"THIS_MONTH"} Property 描述
iasc 和 idesc 是不区分大小写的排序。如果需要对多个属性进行排序,请使用逗号将它们分开。 跟进 Used to filter events based on enrollment followUp flag. Options are true, false.
{"type":"RELATIVE","period":"THIS_MONTH"} organisationUnit To specify the uid of the organisation unit
用户友好型消息,说明操作是否成功。 ouMode To specify the OU selection mode. Options are SELECTED, CHILDREN, DESCENDANTS, ACCESSIBLE, CAPTURE, ALL
用于项目阶段引用的 IdScheme。默认为 idScheme 参数。 assignedUserMode To specify the assigned user selection mode for events. Options are CURRENT, PROVIDED, NONE, ANY. See table below to understand what each value indicates. If PROVIDED (or null), non-empty assignedUsers in the payload will be considered.
"assignedUserMode": PROVIDED assignedUsers To specify a list of assigned users for events. To be used along with PROVIDED assignedUserMode above.
"assignedUsers": ["a3kGcGDCuk7", "a3kGcGDCuk8"] 项目阶段 To specify the output ordering of columns
"displayOrderColumns": ["eventDate", "dueDate", "program"] order To specify ordering/sorting of fields and its directions in comma separated values. A single item in order is of the form "dataItem:direction".
"order"="a3kGcGDCuk6:desc,eventDate:asc" trackedEntityType To specify filters to be applied when listing events

"ouMode": "SELECTED"

status

Any valid EventStatus

"eventStatus": "COMPLETED"

指标组 Parameter name 描述
枚举(参见元数据和渲染类型表中的列表) DateFilterPeriod object date filtering based on completed date. "completedDate": { "startDate": "2014-05-01", "endDate": "2019-03-20", "startBuffer": -5, "endBuffer": 5, "period": "LAST_WEEK", "type": "RELATIVE" }
eventDate DateFilterPeriod object date filtering based on event date. "eventDate": { "startBuffer": -5, "endBuffer": 5, "type": "RELATIVE" }
dueDate DateFilterPeriod object date filtering based on due date. "dueDate": { "period": "LAST_WEEK", "type": "RELATIVE" }
lastUpdatedDate DateFilterPeriod object date filtering based on last updated date. "dueDate": { "period": "LAST_WEEK", "type": "RELATIVE" }
See an example payload below. ```json
{
"name": "event working list",
"program": "VBqh0ynB2wv",
"eventQueryCriteria": {
"eventDate": {
"period": "LAST_WEEK",
"type": "RELATIVE"
},
"dataFilters": [
{
"ge": "35",
"le": "70",
"dataItem": "qrur9Dvnyt5"
}
],
"assignedUserMode": "PROVIDED",
"assignedUsers": [
"CotVI2NX0rI",
"xE7jOejl9FI"
],
"status": "ACTIVE",
"order": "occurredAt:desc",
"displayColumnOrder": [
"occurredAt",
"status",
"assignedUser",
"qrur9Dvnyt5",
"oZg33kd9taw"
]
}
}
``` Common objects { #webapi_tracker_workinglists_common_objects }
Table: DateFilterPeriod object definition Property 描述

可能的重复{ #potential-duplicates }

type

Specify whether the date period type is ABSOLUTE, RELATIVE

"type" : "RELATIVE"

潜在重复的响应有效载荷如下所示。

Specify if a relative system defined period is to be used. Applicable only when type is RELATIVE. (see Relative Periods for supported relative periods)

"period" : "THIS_WEEK"

允许值 Parameter name Potential duplicate status order
Absolute end date. Applicable only when type is ABSOLUTE "startDate":"2014-05-01" startBuffer Relative custom start date. Applicable only when type is RELATIVE
用户友好型消息,说明操作是否成功。 To inspect individual potential duplicate records, use the following endpoint: 不区分大小写的字符串结尾匹配 "startDate":+10

Potential duplicates

Potential duplicates are records identified by the data deduplication feature as possibly being duplicates. Due to the nature of this feature, the API endpoint has certain restrictions. A potential duplicate represents a pair of records suspected to be duplicates.

To retrieve a list of potential duplicates, use the following endpoint:

GET /api/potentialDuplicates

The response payload for a potential duplicate looks like this.s

{
  "created": "2024-06-04T10:11:29.110",
  "lastUpdated": "2024-06-04T10:11:29.110",
  "original": "<UID>",
  "duplicate": "<UID>",
  "status": "OPEN|INVALID|MERGED",
  "id": "<id>"
}

| POST /api/potentialDuplicates | Parameter name | --- | --- | | 400 | 描述 | 403 | 类型 | 404 | Allowed values | 409 | trackedEntities

List of tracked entities

List of string (separated by comma)

允许值 Parameter name Potential duplicate status order
用户友好型消息,说明操作是否成功。 To inspect individual potential duplicate records, use the following endpoint: 不区分大小写的字符串结尾匹配 To create a new potential duplicate, use this endpoint:

| POST /api/potentialDuplicates | Parameter name | --- | --- | | 400 | ```json { "original": "", "duplicate": "" }

| 400 | Status code

### 合并跟踪实体{ #merging-tracked-entities } 

Input original or duplicate is null or has invalid uid

User do not have access to read original or duplicate TEs

TE not found

| 允许值 | Parameter name | Potential duplicate status | `order` |
| --- | --- | --- | --- |
| 描述 | 类型 | 不区分大小写的字符串结尾匹配 | status |

Potential duplicate status

#### 合并策略 自动{ #merge-strategy-auto } 

`OPEN`, `INVALID`

* Status code
* 描述
* You can't update a potential duplicate to MERGED as this is possible only by a merging request

You can't update a potential duplicate that is already in a MERGED status

Merging tracked entities

#### 合并战略 MANUAL{ #merge-strategy-manual } 

To merge a Potential Duplicate, i.e. the two tracked entities the Potential Duplicate represents,
use the following endpoint:

* ```
POST /api/potentialDuplicates/<id>/merge
Parameter name * 描述 类型

Allowed values

mergeStrategy

Strategy to use for merging the potentialDuplicate

string

AUTO(default) or MANUAL

有关合并的其他信息{ #additional-information-about-merging }

Merge strategy AUTO

The automatic merge evaluates the mergability of the two tracked entities and merges them if they are deemed mergeable. The mergability is based on whether the two tracked entities have any conflicts. Conflicts refer to data that cannot be merged automatically. Examples of possible conflicts include:

计划通知模板{ #program-notification-template }

Both tracked entities are enrolled in the same program.

程序通知模板中有几个配置参数对通知的正常运行至关重要。 这些参数的说明如下表所示。下表对这些参数进行了说明。

If any conflict is encountered, an error message is returned to the user.

When no conflicts are found, all data in the duplicate that is not already in the original will be moved to the original. This includes attribute values, enrollments (including events), and relationships. After the merge completes, the duplicate is deleted and the Potential Duplicate is marked as MERGED. When requesting an automatic merge, a payload is not required and will be ignored.

表格:程序通知模板有效载荷{ #table-program-notification-template-payload }

| The manual merge is suitable when there are resolvable conflicts or when not all the data needs to be moved during the merge. For example, if an attribute has different values in both tracked entities , the user can specify whether to keep the original value or move over the duplicate's value. Since the manual merge involves the user explicitly requesting to move data, there are some additional checks: | 检索和删除项目通知模板 | Parameter name | 译 | | --- | --- | --- | --- | | displayColumnOrder | json { "name": "Case notification", "notificationTrigger": "ENROLLMENT", "subjectTemplate": "Case notification V{org_unit_name}", "displaySubjectTemplate": "Case notification V{org_unit_name}", "notifyUsersInHierarchyOnly": false, "sendRepeatable": false, "notificationRecipient": "ORGANISATION_UNIT_CONTACT", "notifyParentOrganisationUnitOnly": false, "displayMessageTemplate": "Case notification A{h5FuguPFF2j}", "messageTemplate": "Case notification A{h5FuguPFF2j}", "deliveryChannels": [ "EMAIL" ] } | When a manual merge is requested without a payload, we are telling the API to merge the two tracked entities without moving any data. In other words, we are just removing the duplicate and marking the potentialDuplicate MERGED. This might be valid in a lot of cases where the tracked entity was just created, but not enrolled for example. | Otherwise, if a manual merge is requested with a payload, the payload refers to what data should be moved from the duplicate to the original. The payload looks like this: | | json { "trackedEntityAttributes": ["B58KFJ45L9D"], "enrollments": ["F61SJ2DhINO"], "relationships": ["ETkkZVSNSVw"] } | json { "name": "Case notification", "notificationTrigger": "ENROLLMENT", "subjectTemplate": "Case notification V{org_unit_name}", "displaySubjectTemplate": "Case notification V{org_unit_name}", "notifyUsersInHierarchyOnly": false, "sendRepeatable": false, "notificationRecipient": "ORGANISATION_UNIT_CONTACT", "notifyParentOrganisationUnitOnly": false, "displayMessageTemplate": "Case notification A{h5FuguPFF2j}", "messageTemplate": "Case notification A{h5FuguPFF2j}", "deliveryChannels": [ "EMAIL" ] } | Additional information about merging | Currently it is not possible to merge tracked entities that are enrolled in the same program, due to the added complexity. A workaround is to manually remove the enrollments from one of the tracked entities before starting the merge. | | All merging is based on data already persisted in the database, which means the current merging service is not validating that data again. This means if data was already invalid, it will not be reported during the merge. The only validation done in the service relates to relationships, as mentioned in the previous section. | Program notification template | 项目通知模板允许您创建可根据不同类型事件发送的信息模板。 消息和主题模板会被转换为实际值,并发送到配置的目的地。 每个项目通知模板都会转化为 MessageConversation 对象或 ProgramMessage 对象,具体取决于收件人是外部还是内部。 这些中间对象将只包含翻译后的信息和主题文本。 | 项目通知模板中有几个配置参数对通知的正常运行至关重要。 这些参数的说明如下表所示。下表对这些参数进行了说明。 | | POST /api/programNotificationTemplates | json { "name": "Case notification", "notificationTrigger": "ENROLLMENT", "subjectTemplate": "Case notification V{org_unit_name}", "displaySubjectTemplate": "Case notification V{org_unit_name}", "notifyUsersInHierarchyOnly": false, "sendRepeatable": false, "notificationRecipient": "ORGANISATION_UNIT_CONTACT", "notifyParentOrganisationUnitOnly": false, "displayMessageTemplate": "Case notification A{h5FuguPFF2j}", "messageTemplate": "Case notification A{h5FuguPFF2j}", "deliveryChannels": [ "EMAIL" ] } | 表:项目通知模板有效载荷 | 领域 | | 需要 | json { "name": "Case notification", "notificationTrigger": "ENROLLMENT", "subjectTemplate": "Case notification V{org_unit_name}", "displaySubjectTemplate": "Case notification V{org_unit_name}", "notifyUsersInHierarchyOnly": false, "sendRepeatable": false, "notificationRecipient": "ORGANISATION_UNIT_CONTACT", "notifyParentOrganisationUnitOnly": false, "displayMessageTemplate": "Case notification A{h5FuguPFF2j}", "messageTemplate": "Case notification A{h5FuguPFF2j}", "deliveryChannels": [ "EMAIL" ] } | Values | 名称 | | 是的 | Program notification template | case-notification-alert | notificationTrigger | | 是的 | Program notification template | ENROLLMENT | subjectTemplate |

检索和删除计划通知模板{ #retrieving-and-deleting-program-notification-template }

Case notification V{org_unit_name}

项目信息{ #program-messages }

是的

Message template string

发送项目信息

notificationRecipient

  • 是的
  • Who is going to receive notification. Options are USER_GROUP, ORGANISATION_UNIT_CONTACT, TRACKED_ENTITY_INSTANCE, USERS_AT_ORGANISATION_UNIT, DATA_ELEMENT, PROGRAM_ATTRIBUTE, WEB_HOOK

收件人{ #recipients }

deliveryChannels

  • Which channel should be used for this notification. It can be either SMS, EMAIL, or HTTP
  • SMS
  • sendRepeatable

Whether notification should be sent multiple times

表:程序报文有效载荷{ #table-program-message-payload }

| The manual merge is suitable when there are resolvable conflicts or when not all the data needs to be moved during the merge. For example, if an attribute has different values in both tracked entities , the user can specify whether to keep the original value or move over the duplicate's value. Since the manual merge involves the user explicitly requesting to move data, there are some additional checks: | 检索和删除项目通知模板 | Parameter name | 译 | |---|---|---|---| | The program message feature enables you to send messages to tracked entities, contact addresses associated with organisation units, phone numbers, and email addresses. Messages can be sent using the messages resource. | json { "name": "Case notification", "notificationTrigger": "ENROLLMENT", "subjectTemplate": "Case notification V{org_unit_name}", "displaySubjectTemplate": "Case notification V{org_unit_name}", "notifyUsersInHierarchyOnly": false, "sendRepeatable": false, "notificationRecipient": "ORGANISATION_UNIT_CONTACT", "notifyParentOrganisationUnitOnly": false, "displayMessageTemplate": "Case notification A{h5FuguPFF2j}", "messageTemplate": "Case notification A{h5FuguPFF2j}", "deliveryChannels": [ "EMAIL" ] } | 发送项目信息 | 项目消息可以使用两个传递渠道发送: | | 文本 | Program notification template | Recipients | 项目消息可以发送给各种收件人: | | The message text. | Program notification template | List of phone numbers: The system will use the explicitly defined phone numbers. | List of email addresses: The system will use the explicitly defined email addresses. | | 是的 | json { "name": "Case notification", "notificationTrigger": "ENROLLMENT", "subjectTemplate": "Case notification V{org_unit_name}", "displaySubjectTemplate": "Case notification V{org_unit_name}", "notifyUsersInHierarchyOnly": false, "sendRepeatable": false, "notificationRecipient": "ORGANISATION_UNIT_CONTACT", "notifyParentOrganisationUnitOnly": false, "displayMessageTemplate": "Case notification A{h5FuguPFF2j}", "messageTemplate": "Case notification A{h5FuguPFF2j}", "deliveryChannels": [ "EMAIL" ] } | 表格项目报文有效载荷 | 领域 | | 需要 | Program notification template | Values | enrollment | | 是的 | Program notification template | Can be trackedEntity, organisationUnit, an array of phoneNumbers or an array of emailAddresses. | enrollment | | 不 | json { "name": "Case notification", "notificationTrigger": "ENROLLMENT", "subjectTemplate": "Case notification V{org_unit_name}", "displaySubjectTemplate": "Case notification V{org_unit_name}", "notifyUsersInHierarchyOnly": false, "sendRepeatable": false, "notificationRecipient": "ORGANISATION_UNIT_CONTACT", "notifyParentOrganisationUnitOnly": false, "displayMessageTemplate": "Case notification A{h5FuguPFF2j}", "messageTemplate": "Case notification A{h5FuguPFF2j}", "deliveryChannels": [ "EMAIL" ] } | Enrollment ID. | enrollment | | 不 | Program notification template | Event ID. | deliveryChannels |

查询项目信息

Array of delivery channels.

SMS, EMAIL

notificationTemplate

GET /api/messages/scheduled/sent?enrollment={uid}
GET /api/messages/scheduled/sent?event={uid}

notificationTemplate

ProgramNotificationTemplate UID 用于交叉检查哪个项目消息属于哪个通知模板。

Text.

程序消息 API 支持使用特定请求参数查询消息。您可以根据 过滤信息。所有请求都应使用 GET HTTP verb 来检索信息。

默认值 Text.
文本 是的
The message text. Text.
storeCopy
是否在 DHIS2 中存储一份项目信息副本。 false, true
查询项目信息 项目消息 API 支持使用特定请求参数查询消息。

程序通知实例{ #program-notification-instance }

To retrieve a specific message.

GET /api/messages/{uid}
GET /api/programNotificationInstances

表格查询程序通知实例 API

类型 Potential duplicate status 检索和删除项目通知模板 Parameter name
计划日期 日期"(ISO-8601) Enrollment Aggregate data dimensions /analytics/enrollments/aggregate/dimensions 返回计划在给定日期发送的通知实例。Example: scheduledAt=2025-01-01.
true|false Field Presets { #field-presets } Enrollment Aggregate data dimensions /analytics/enrollments/aggregate/dimensions 启用或禁用分页。默认为 true。使用 paging=false 可返回不带分页的所有匹配实例。
comma separated list of fields or presets to include 整数 Enrollment Aggregate data dimensions /analytics/enrollments/aggregate/dimensions 启用分页时返回的页码。
默认 整数 Enrollment Aggregate data dimensions /analytics/enrollments/aggregate/dimensions 启用分页时每页的条目数。
事件 Narrows response to tracked entities matching given filters. More on filters here Enrollment Aggregate data dimensions /analytics/enrollments/aggregate/dimensions 该活动附有计划通知实例。
注册 Narrows response to tracked entities matching given filters. More on filters here Enrollment Aggregate data dimensions /analytics/enrollments/aggregate/dimensions 该注册附有计划通知实例。

性能{ #webapi_tracker_performance }

本节包括一般性能原则,然后是针对特定端点的 跟踪器导出端点的具体指导。进一步的性能优化需要了解真实世界的访问 模式和数据分布。如果你的实施能共享这些信息,将有助于 确定改进的优先次序。

有关跟踪器性能相对于以前版本的改进,请参阅相应的发布说明,例如 说明,例如 2.43.

进口{ #import }

通知{ #notifications }

通知在导入后以异步方式发送,但会与并发请求争夺 数据库连接、CPU 和内存的并发请求。如果有很多实体和通知模板,这可能会增加延迟。 增加延迟。对于不需要通知的批量导入,请跳过通知:

POST /api/tracker?skipSideEffects=true

计划规则{ #program-rules }

在导入过程中,规则引擎会同步运行捆绑包中的每个注册和事件、 这会大大增加批量导入的延迟。只有当程序中没有 必须在导入时执行的带有验证或分配的规则时才跳过:

POST /api/tracker?skipRuleEngine=true

出口{ #export }

一般原则{ #general-principles }

导出端点的响应时间通常由数据库查询的执行时间决定。下面的 下面的建议侧重于减少数据库的工作量。

在正确的级别进行查询{ #query-at-the-right-level }

跟踪器数据模型有三个层次:跟踪实体、注册人数和事件。始终在 满足需求的最低级别。使用 GET /api/tracker/events 而不是 GET /api/tracker/trackedEntities?fields=enrollments[events]。通过父端点查询会增加 查询复杂性或查询次数。

使用明确的 fields

默认情况下,所有端点都不包括嵌套集合,如 "注册"、"事件 "和 "关系"。 关系"。每个额外的集合都会增加资源利用率和响应时间。只 请求所需的 "字段",避免使用 "字段=*"。

选择性{ #selectivity }

查询性能取决于数据库在返回结果前必须处理多少条记录。 需要扫描、排序和重复的记录越少,响应速度就越快。这就是**选择性**: 符合查询条件的记录占总记录数的比例。

选择性有几个来源,但都是复合的:请求参数(如 程序"、"过滤器"、日期范围)、用户范围和 "orgUnitMode"。

筛选器

在排序和分页之前,过滤器会缩小结果集的范围。当有 数据库索引支持时最有效。宽泛的筛选器(例如,"filter=w75KJ2mc4zz:like:J")可能会匹配大部分数据集,但几乎不提供选择性。 数据集,选择性很小。窄筛选器(例如,filter=w75KJ2mc4zz:eq:Jerald 或严格的日期范围 严格的日期范围)会大大减少工作集。跟踪实体属性的 like 过滤器 可受益于 [trigram 索引](#scheduling_tracker_index_maintenance)。

程序和跟踪实体类型上的 "搜索所需的最少属性数 "设置 在用户捕获范围外进行搜索时,需要最少数量的属性筛选器。

计划{ #program }

指定 program 可实现基于所有权的访问控制。如果没有 program,系统必须 动态评估被跟踪实体注册的所有程序的访问规则。总是 在查询特定程序数据时包含 program

请注意,即使指定了 "程序",选择性也取决于该程序存在多少数据。 程序的数据量。一个包含了大多数被跟踪实体的程序的选择性不会很高。

组织单位模式{ #webapi_tracker_perf_organisation_unit_mode }

orgUnitMode和用户的组织单位范围会直接影响 数据库处理的记录数量。性能取决于所包含的组织单位 拥有多少数据。只对单个设备有作用域的用户只能查询一小部分记录;而拥有根级 访问权限的用户可能会扫描整个程序。选择 "是最有效的,因为数据库可以 直接查询指定组织单位拥有的记录。

当儿童不拥有数据时,CHILDREN速度较慢。 (最低级别)。在较高层次(如地区)使用 CHILDREN,会返回没有事件的行政组织单位。 单位,迫使数据库扫描程序中的所有事件以确认这一点。 当子机构是实际捕获数据的组织单位时,"CHILDREN "速度很快。

ALL 不包括地域限制。**ACCESSIBLE`**取决于用户的搜索范围、 对于有广泛访问权限的用户,搜索范围可涵盖程序的大部分数据。结合选择性 过滤器相结合,以保持工作集的可管理性。

订购{ #ordering }

order "参数会极大地影响查询性能。顺序字段可分为性能 层:

  • 快速(索引):数据库按顺序运行索引,并在填满所请求的索引后停止运行。 页。成本随页面大小和偏移量而变化,不随数据集大小而变化。假设查询条件为 允许数据库使用索引,这取决于筛选器和 orgUnitMode.
  • 慢(无索引):数据库必须对所有匹配记录进行扫描和排序,然后才能返回 页。成本主要取决于匹配记录的总数。
  • 非常慢(跨资源):排序值来自相关资源(例如,排序跟踪的资源 或属性值)。数据库必须为每个 匹配记录,然后再进行排序。

选择性比顺序字段选择更重要 使用选择性过滤器或缩小用户范围、 即使排序速度慢的字段也能快速排序,因为数据库只对一小部分字段进行排序。请注意 仍会降低排序成本,但不会降低扫描成本。

请参阅下面针对端点的章节,了解哪些订单字段属于哪个层级。

分页

DHIS2 使用基于偏移量的分页。页码越高,速度越慢,因为数据库必须计算并丢弃前面的所有行。 行。这是基于偏移的分页法的基本特性,并非 DHIS2 所特有。

建议: * 保持合理的页面大小(默认值为 50) * 避免浏览到很高的页码 * 除非必要,否则避免使用 totalPages=true ,因为它会运行一个额外的计数查询,必须处理所有页数。 无论页面大小,都能匹配记录 * 避免使用 paging=false ,因为它会在单个响应中返回所有匹配记录

配置 收集限制 以限制结果集大小,保护数据库和服务器资源。 保护数据库和服务器资源。

/api/tracker/trackedEntities

筛选器

程序 "或 "trackedEntityType "都是必需的。程序 "更可取,因为它可以实现基于所有权的直接 基于所有权的访问控制。

订购{ #ordering }
订单字段 费用
快速 被跟踪实体"、"创建时间 page (偏移量) + pageSize 成比例
updatedAt, createdAtClient, updatedAtClient, inactive. 与匹配跟踪实体总数的比例
非常慢 enrolledAt",跟踪的实体属性 UID 与匹配跟踪实体总数的比例 + 相关表格中每条记录的查找量

enrolledAt "还要求在一个被跟踪实体有多个注册同一计划时进行重复数据删除。 同一计划。配置为 "只注册一次 "的计划可避免重复数据删除成本。

/api/tracker/enrollments

订购{ #ordering }
订单字段 费用
已注册用户"、"已创建用户"、"已完成用户"、"已更新用户"、"已创建客户"、"已更新客户 与对等入学总人数的比例

目前,所有注册顺序字段都缺少综合索引。数据库必须对所有 匹配的注册信息,然后再返回所请求的页面。

/api/tracker/events(跟踪程序){ #apitrackerevents-tracker-programs }

筛选器

program "是必填项,可与 "programStage "结合使用,以缩小到一个阶段。

所有权{ #ownership }

每个跟踪器事件查询都必须遍历注册和所有权记录,以执行访问控制。 在一个有成千上万注册用户的程序中,广泛的查询(如不带过滤器的 `orgUnitMode=ALL 不带过滤器)必须先处理所有所有权记录,然后才能开始任何事件级工作。索引 因为所有权检查是在不同的表中进行的。

降低成本的最有效方法是缩小 org 单位范围。一个用户对 单个设施的用户会产生一个小的所有权集,从而使查询的其余部分快速完成,而无需考虑其他参数。 参数。

注册级筛选器("enrollmentStatus"、"followUp"、注册日期范围)不受 索引支持。它们仍然可以减少结果集,但不会减少数据库 扫描。

订购{ #ordering }
订单字段 费用
发生时间"、"计划时间"、"创建时间"、"更新时间"、"完成时间"、"客户创建时间"、"客户更新时间"、"注册时间"、数据元素 UID 与匹配事件总数成比例(加入所有权后)
非常慢 跟踪的实体属性 UID 按匹配事件总数比例 + 按事件跨资源查找

所有跟踪器事件顺序字段都缺少程序级的复合索引。数据库必须 必须遍历注册和所有权记录,收集所有匹配事件,对其进行排序,并返回所请求的页 请求的页面。成本与匹配事件总数而非页面大小成正比。

指定 programStage 并不能提高排序性能,因为瓶颈是所有权连接,而不是事件级扫描。 所有权连接,而不是事件级扫描。

enrolledAt` 来自注册表,而注册表已经是所有权连接的一部分,因此不需要额外的查找。 不需要额外查找。属性 UID 要求对每个匹配事件的被跟踪实体进行跨资源查找。 实体的跨资源查询。

/api/tracker/events(事件程序){ #apitrackerevents-event-programs }

活动计划(无注册的计划)没有注册或所有权方面的开销。数据库 直接从事件转到其 org 单元,使这些查询在结构上比跟踪程序查询更快。 程序查询更快。

筛选器

程序 "是强制性的。

组织单位 模式{ #organisation-unit-mode }

在默认的 "occurredAt "顺序下,数据库会执行排序索引,并按 org 单位过滤每个事件。当匹配事件出现在索引的早期时,这种方法速度很快。对于 SELECTEDDESCENDANTS、 和 ACCESSIBLE 的性能取决于匹配的组织单位事件在排序顺序中的分布情况。 排序顺序。如果匹配事件很少或集中在索引末尾,数据库 必须先扫描许多非匹配事件。在拥有数百万个事件的程序阶段,用户的 org单元只覆盖一小部分的情况下,这可能会导致在扫描索引的大部分内容后才填满单页。 填满一个页面。添加 occurredAfter 和/或 occurredBefore 可以将扫描限制在一个有边界的窗口内,建议用于大容量扫描。 窗口,建议用于大容量程序阶段。

ALL 完全避免了 org 单元过滤,使用默认顺序时速度很快。CHILDREN`速度较慢,原因与 一般原则](#webapi_tracker_perf_organisation_unit_mode) 中所述的相同原因。

如果没有默认的 "occurredAt "顺序,所有模式都需要对所有匹配事件进行扫描和排序。

订购{ #ordering }

默认顺序是 occurredAt desc。这是事件程序最有效的顺序。

订单字段 费用
快速(索引) 发生时间 page (偏移量) + pageSize 成比例。当组织单位过滤激活但匹配稀少时会降低--参见上文组织单位模式
慢速(无索引) 创建于客户"、"更新于客户"、"完成于客户"、"创建于客户"、"更新于客户"。 占计划阶段活动总数的比例
缓慢(JSON 提取) 数据元素 UID 需要提取每个匹配事件的 JSON 值并对其进行排序