# Help - OpenClinic to DHIS2 2.41 Integration: Errors with dataValueSets and completeDate

**URL:** <https://community.dhis2.org/t/help-openclinic-to-dhis2-2-41-integration-errors-with-datavaluesets-and-completedate/77092>\
**Category:** Support - Assistance technique\
**Tags:** server-admin\
**Created:** [25 September 2026 23:48 UTC](https://community.dhis2.org/t/help-openclinic-to-dhis2-2-41-integration-errors-with-datavaluesets-and-completedate/77092 "2026-09-25T23:48:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ansou\_Daff](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/ansou_daff/32/36177_2.png) [@Ansou\_Daff](https://community.dhis2.org/u/Ansou_Daff)\
**Post date:** [25 September 2026 23:48 UTC](https://community.dhis2.org/t/help-openclinic-to-dhis2-2-41-integration-errors-with-datavaluesets-and-completedate/77092/1 "2026-09-25T23:48:34Z")

</div>

OpenClinic to DHIS2 integration – Error when sending data to DHIS2 2.41

Hello everyone,

I am currently working on an integration between OpenClinic and DHIS2 2.41.

The objective is to send aggregated data from OpenClinic to DHIS2 using the DHIS2 Web API, specifically the `dataValueSets` endpoint.

The integration was working during our initial tests, but we are now encountering errors when OpenClinic sends the data to DHIS2.

One of the issues we noticed is related to the `completeDate` of the Data Set. For example:

text  
completeDate = 2026-09-01

I would like to know whether the `completeDate` can prevent or interfere with importing data through the `dataValueSets` API in DHIS2 2.41.

I would also like to know the recommended way to mark a Data Set as incomplete (un-complete) in DHIS2 2.41, either through the user interface or through the Web API.

The error we are getting from OpenClinic is:

text  
[PASTE THE EXACT ERROR HERE]

Has anyone experienced a similar issue when integrating OpenClinic with DHIS2 2.41?

Any guidance on the cause of the error and the correct API request would be greatly appreciated.

Thank you.

---

<div class="post-metadata">

**Author:** ![Baba\_Yahaya\_Mohamme1](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/baba_yahaya_mohamme1/32/45433_2.png) [@Baba\_Yahaya\_Mohamme1](https://community.dhis2.org/u/Baba_Yahaya_Mohamme1)\
**Post date:** [26 September 2026 05:36 UTC](https://community.dhis2.org/t/help-openclinic-to-dhis2-2-41-integration-errors-with-datavaluesets-and-completedate/77092/2 "2026-09-26T05:36:18Z")

</div>

My senior, you are at the right place.  
Your issue will be looked at and possible solution will be given. So be patient and hang tight. ✌

---

<div class="post-metadata">

**Author:** ![fidelelukeka](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/fidelelukeka/32/47692_2.png) [@fidelelukeka](https://community.dhis2.org/u/fidelelukeka)\
**Post date:** [26 September 2026 09:14 UTC](https://community.dhis2.org/t/help-openclinic-to-dhis2-2-41-integration-errors-with-datavaluesets-and-completedate/77092/3 "2026-09-26T09:14:23Z")

</div>

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:

```auto
{
  "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:

1. **Send the same payload without `completeDate`** and check whether the data values are imported successfully.

2. If that works, test again with:

```auto
"completeDate": "2026-09-01"

```

1. Check whether the Data Set is already marked as complete for the given:

2. If you need to mark the Data Set as complete, this is handled through:

```auto
POST /api/completeDataSetRegistrations

```

1. To **un-complete** a Data Set, DHIS2 provides the `DELETE` operation on:

```auto
/api/completeDataSetRegistrations

```

The relevant parameters are:

```auto
ds = Data Set UID
pe = Period
ou = Organisation Unit UID

```

For example:

```auto
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:

```auto
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:

- `POST /api/dataValueSets` is the endpoint used for importing data values.

- `completeDataSetRegistrations` is used to register or un-register Data Set completeness.

Hope this helps!
