Changing OrgUnit of Tracked Entity Instance with WebAPI

Hi devs,

I’m trying to move Tracked Entity Instances using the WebAPI by updating a Tracked Entity Instance (/api/trackedEntityInstances/), but with no luck. I get it working with adding relationships, but not with changing the orgUnit. I get a success and updated: 1 in the response, but in the server nothing changes. I’m using DHIS 2.16.

example request:
{“attributes”:[{“value”:“Brad”,“displayName”:“First name”,“attribute”:“eRsJABP4maZ”},{“value”:“Male”,“displayName”:“Sex”,“attribute”:“g8nMl2nGMjo”},{“value”:“Pitt”,“displayName”:“Surname”,“attribute”:“imKbcSFoXYW”},{“value”:“1971-07-27”,“displayName”:“Date of birth”,“attribute”:“jLQqopd8JQt”}],“trackedEntityInstance”:“gD23tKptvsp”,“orgUnit”:“KgKiMe4EZq3”,“trackedEntity”:“OruGrTv39Fd”,“relationships”:[]}

The response:
{“status”:“SUCCESS”,“importCount”:{“imported”:0,“updated”:1,“ignored”:0,“deleted”:0},“reference”:“gD23tKptvsp”}

Is there something I might be doing wrong that I’m not getting?

Thanks,
Simen

Hi Simen

This is not actually supported. Let me see if I can get it in for 2.18 release.

···

On Tue Jan 20 2015 at 1:55:14 PM Simen Skogly Russnes simen_russnes@hotmail.com wrote:

Hi devs,

I’m trying to move Tracked Entity Instances using the WebAPI by updating a Tracked Entity Instance (/api/trackedEntityInstances/), but with no luck. I get it working with adding relationships, but not with changing the orgUnit. I get a success and updated: 1 in the response, but in the server nothing changes. I’m using DHIS 2.16.

example request:
{“attributes”:[{“value”:“Brad”,“displayName”:“First name”,“attribute”:“eRsJABP4maZ”},{“value”:“Male”,“displayName”:“Sex”,“attribute”:“g8nMl2nGMjo”},{“value”:“Pitt”,“displayName”:“Surname”,“attribute”:“imKbcSFoXYW”},{“value”:“1971-07-27”,“displayName”:“Date of birth”,“attribute”:“jLQqopd8JQt”}],“trackedEntityInstance”:“gD23tKptvsp”,“orgUnit”:“KgKiMe4EZq3”,“trackedEntity”:“OruGrTv39Fd”,“relationships”:}

The response:
{“status”:“SUCCESS”,“importCount”:{“imported”:0,“updated”:1,“ignored”:0,“deleted”:0},“reference”:“gD23tKptvsp”}

Is there something I might be doing wrong that I’m not getting?

Thanks,
Simen


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp