Hi Ansou,
Welcome to the DHIS2 Community!
Regarding your issue, I would first separate two things: importing data values and registering a Data Set as complete.
According to the DHIS2 Web API documentation, completeDate is a supported attribute of the POST /api/dataValueSets payload. For example:
{
"dataSet": "DATASET_UID",
"completeDate": "2026-09-01",
"period": "202609",
"orgUnit": "ORGUNIT_UID",
"dataValues": [
{
"dataElement": "DE_UID",
"categoryOptionCombo": "COC_UID",
"value": "10"
}
]
}
So, the presence of completeDate itself should not normally prevent the dataValueSets import. However, if the Data Set has already been registered as complete, there may be additional considerations depending on the configuration, user permissions, locking, or the exact request being sent.
For troubleshooting, I would recommend testing the integration in this order:
-
Send the same payload without completeDate and check whether the data values are imported successfully.
-
If that works, test again with:
"completeDate": "2026-09-01"
-
Check whether the Data Set is already marked as complete for the given:
-
If you need to mark the Data Set as complete, this is handled through:
POST /api/completeDataSetRegistrations
- To un-complete a Data Set, DHIS2 provides the
DELETE operation on:
/api/completeDataSetRegistrations
The relevant parameters are:
ds = Data Set UID
pe = Period
ou = Organisation Unit UID
For example:
DELETE "https://YOUR-DHIS2-SERVER/api/completeDataSetRegistrations?ds=DATASET_UID&pe=202609&ou=ORGUNIT_UID"
I would also recommend checking the exact HTTP response returned by DHIS2. The most useful information would be:
-
HTTP status code (400, 401, 403, 409, etc.)
-
Response body from DHIS2
-
Exact JSON/XML payload sent by OpenClinic
-
Whether the Data Set is already complete
-
The user/API account permissions
-
Whether the same payload succeeds when sent directly with Postman or curl
For example:
curl -X POST "https://YOUR-DHIS2-SERVER/api/dataValueSets" \
-H "Content-Type: application/json" \
-u "USERNAME:PASSWORD" \
-d @payload.json
Since the exact error is currently missing from the post ([PASTE THE EXACT ERROR HERE]), it would be difficult to identify the precise cause yet.
If you can provide the exact DHIS2 error response and the payload generated by OpenClinic (with credentials removed), the community should be able to narrow this down much more quickly.
DHIS2 documentation:
Hope this helps!