Problem with the transfer of completeness

Hello,

I am trying to transfer data from a dataset from one dhis 2 to another with completeness from a script I have developed.
For that I use the endpoint /dataValueSets for the data and the endpoint /completeDataSetRegistrations for the recovery of the completeness.

But I see that instead of taking the completeness of the dhis 2 source, it puts me as completude the execution date of the script and the logged in account.

Here is the completeness data that I send:

image

The date and the storedBy are replaced by the execution date of the script and the connected account

Please how can i fix this problem ?

Regards;

Hello @Gassim :grinning:

1 Like

Hey @didate,

I think this is because that date is generated automatically from the backend and it has to register the correct date so I really don’t think it’s possible! However, do you think this might be possible to do directly from the PostgreSQL database?
As for the user, I think there might be an issue executing it and registering it to be another user’s action, right? What if this user exists in an instance but doesn’t exist in another instance? (:

Hi @Gassim

Thank you for your response.

I think this is because that date is generated automatically from the backend and it has to register the correct date so I really don’t think it’s possible!
Ok I understand

However, do you think this might be possible to do directly from the PostgreSQL database?

Yes It’s possible but litle complicated, because the 2 dhis 2 are not in the same server. I have to find a way to automate it.

En ce qui concerne l’utilisateur, je pense qu’il pourrait y avoir un problème pour l’exécuter et l’enregistrer comme action d’un autre utilisateur, n’est-ce pas ? Que se passe-t-il si cet utilisateur existe dans une instance mais n’existe pas dans une autre instance ?

The same users exist in both dhis 2 instances.

1 Like

Then maybe perform the execution using the same user?

you know, there are several users who enter data in the dataSet for their organisation unit, so it’s almost impossible to do like that.

I Think, the solution I have to find is how to automate a select-insert SQL from one server to another one

This might be it!

It does sound like impossible, but do you think there could be a multiple-instance user? :sweat_smile: Maybe create a feature request! After all, you don’t want to create a replicate so the instances seem to have different purposes…etc but it does seem like we are facing a concurrency issue too!

The two dhis 2 instances have the same configuration (same users, same organization unites…). My final goal is to have decentralized dhis 2 and a central dhis 2. The data of decentralized DHIS 2 must be synchronized with the central dhis 2 according to the entry period (weekly, monthly…).
But I’ll find a way to automate sending completeness with SQL queries. I’ll explain it here if I find anything .

1 Like

I think it’s designed to support what you are saying, do you think it’s possible for the two instances to use the same database? Then each instance will also have a local backup?