Import TrackedEntityInstances through api

Dear Tracker Team,

I am trying to import trackedEntityInstances (json file) for HISP Uganda demo.

When I send the json file, I get an error below.

{“httpStatus”:“Conflict”,“httpStatusCode”:409,“status”:“ERROR”,“message”:“program is required for program scope”}Done

Below is the json I am sending

{“lastUpdated”:“2014-09-02 13:40:25.845”,“trackedEntity”:“lq6b0EbvbWJ”,“created”:“2014-09-02 13:40:25.416”,“orgUnit”:“V5XvX1wr1kF”,“trackedEntityInstance”:“qqPocsUTn0D”,“relationships”:[],“attributes”:[{“displayName”:“Gravida”,“valueType”:“NUMBER”,“attribute”:“UuNwH6pSBfT”,“value”:“1”},{“displayName”:“ANC Client Number”,“valueType”:“TEXT”,“attribute”:“XS1hnJSUhJR”,“value”:“18887X8YP2015”},{“displayName”:“Para (>7 months)”,“valueType”:“NUMBER”,“attribute”:“rKqAjEn6zrS”,“value”:“0”},{“displayName”:“Para (miscarriages < 7 months)”,“valueType”:“NUMBER”,“attribute”:“pRgEk4Ao5CO”,“value”:“0”},{“displayName”:“Age”,“valueType”:“NUMBER”,“attribute”:“j7gaoJddiXp”,“value”:“22”}]}

What is the right endpoint for trackedEntityInstances while respecting the programScope.

I am using 2.21 snapshot build 20702

I believe it is the same with 2.20. We need this to meet the deadline.

Alex

Thanks.

···

Alex Tumwesigye

Technical Advisor - DHIS2 (Consultant),
Ministry of Health/AFENET

Kampala

Uganda

IT Consultant - BarefootPower Uganda Ltd, SmartSolar, Kenya

IT Specialist (Servers, Networks and Security, Health Information Systems - DHIS2 ) & Solar Consultant

+256 774149 775, + 256 759 800161

"I don’t want to be anything other than what I have been - one tree hill "

Hi

One of the attributes you are sending in is using scope = program, which means it needs to know which program this belongs to… since you are just creating a TEI without doing enrollment etc… maybe its a misconfiguration? probably the scope is wrong?

···

On Thu, Oct 15, 2015 at 4:29 PM, Alex Tumwesigye atumwesigye@gmail.com wrote:

Dear Tracker Team,

I am trying to import trackedEntityInstances (json file) for HISP Uganda demo.

When I send the json file, I get an error below.

{“httpStatus”:“Conflict”,“httpStatusCode”:409,“status”:“ERROR”,“message”:“program is required for program scope”}Done

Below is the json I am sending

{“lastUpdated”:“2014-09-02 13:40:25.845”,“trackedEntity”:“lq6b0EbvbWJ”,“created”:“2014-09-02 13:40:25.416”,“orgUnit”:“V5XvX1wr1kF”,“trackedEntityInstance”:“qqPocsUTn0D”,“relationships”:[],“attributes”:[{“displayName”:“Gravida”,“valueType”:“NUMBER”,“attribute”:“UuNwH6pSBfT”,“value”:“1”},{“displayName”:“ANC Client Number”,“valueType”:“TEXT”,“attribute”:“XS1hnJSUhJR”,“value”:“18887X8YP2015”},{“displayName”:“Para (>7 months)”,“valueType”:“NUMBER”,“attribute”:“rKqAjEn6zrS”,“value”:“0”},{“displayName”:“Para (miscarriages < 7 months)”,“valueType”:“NUMBER”,“attribute”:“pRgEk4Ao5CO”,“value”:“0”},{“displayName”:“Age”,“valueType”:“NUMBER”,“attribute”:“j7gaoJddiXp”,“value”:“22”}]}

What is the right endpoint for trackedEntityInstances while respecting the programScope.

I am using 2.21 snapshot build 20702

I believe it is the same with 2.20. We need this to meet the deadline.

Alex

Thanks.


Alex Tumwesigye

Technical Advisor - DHIS2 (Consultant),
Ministry of Health/AFENET

Kampala

Uganda

IT Consultant - BarefootPower Uganda Ltd, SmartSolar, Kenya

IT Specialist (Servers, Networks and Security, Health Information Systems - DHIS2 ) & Solar Consultant

+256 774149 775, + 256 759 800161

"I don’t want to be anything other than what I have been - one tree hill "


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


Morten

Dear Morten,

Yes. You are right. One of the attribute was unique “program within organisationunit”.

I just disabled it and it worked. I will re-enable after import.

Alex

···

On Thu, Oct 15, 2015 at 12:33 PM, Morten Olav Hansen mortenoh@gmail.com wrote:

Hi

One of the attributes you are sending in is using scope = program, which means it needs to know which program this belongs to… since you are just creating a TEI without doing enrollment etc… maybe its a misconfiguration? probably the scope is wrong?


Morten

On Thu, Oct 15, 2015 at 4:29 PM, Alex Tumwesigye atumwesigye@gmail.com wrote:

Dear Tracker Team,

I am trying to import trackedEntityInstances (json file) for HISP Uganda demo.

When I send the json file, I get an error below.

{“httpStatus”:“Conflict”,“httpStatusCode”:409,“status”:“ERROR”,“message”:“program is required for program scope”}Done

Below is the json I am sending

{“lastUpdated”:“2014-09-02 13:40:25.845”,“trackedEntity”:“lq6b0EbvbWJ”,“created”:“2014-09-02 13:40:25.416”,“orgUnit”:“V5XvX1wr1kF”,“trackedEntityInstance”:“qqPocsUTn0D”,“relationships”:[],“attributes”:[{“displayName”:“Gravida”,“valueType”:“NUMBER”,“attribute”:“UuNwH6pSBfT”,“value”:“1”},{“displayName”:“ANC Client Number”,“valueType”:“TEXT”,“attribute”:“XS1hnJSUhJR”,“value”:“18887X8YP2015”},{“displayName”:“Para (>7 months)”,“valueType”:“NUMBER”,“attribute”:“rKqAjEn6zrS”,“value”:“0”},{“displayName”:“Para (miscarriages < 7 months)”,“valueType”:“NUMBER”,“attribute”:“pRgEk4Ao5CO”,“value”:“0”},{“displayName”:“Age”,“valueType”:“NUMBER”,“attribute”:“j7gaoJddiXp”,“value”:“22”}]}

What is the right endpoint for trackedEntityInstances while respecting the programScope.

I am using 2.21 snapshot build 20702

I believe it is the same with 2.20. We need this to meet the deadline.

Alex

Thanks.


Alex Tumwesigye

Technical Advisor - DHIS2 (Consultant),
Ministry of Health/AFENET

Kampala

Uganda

IT Consultant - BarefootPower Uganda Ltd, SmartSolar, Kenya

IT Specialist (Servers, Networks and Security, Health Information Systems - DHIS2 ) & Solar Consultant

+256 774149 775, + 256 759 800161

"I don’t want to be anything other than what I have been - one tree hill "


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

Alex Tumwesigye

Technical Advisor - DHIS2 (Consultant),
Ministry of Health/AFENET

Kampala

Uganda

IT Consultant - BarefootPower Uganda Ltd, SmartSolar, Kenya

IT Specialist (Servers, Networks and Security, Health Information Systems - DHIS2 ) & Solar Consultant

+256 774149 775, + 256 759 800161

"I don’t want to be anything other than what I have been - one tree hill "