Tracker Relationship API

Hello Dhis2 team,
Is there a way of creating relationships between enrolled TEI’s via the API similar to enrollment as described in the dhis2 docs here http://dhis2.github.io/dhis2-docs/master/en/developer/html/dhis2_developer_manual_full.html#d7532e12063

rgds

David

Hi

Yes, you can add this to your create or update TEI payload:

“relationships”: [

{ “trackedEntityInstanceA”: “UID of TEI A”, “trackedEntityInstanceB”: “UID of TEI B” }

]

···

On Tue, Jul 26, 2016 at 9:13 PM, David Muturi dnmuturi@gmail.com wrote:

Hello Dhis2 team,
Is there a way of creating relationships between enrolled TEI’s via the API similar to enrollment as described in the dhis2 docs here http://dhis2.github.io/dhis2-docs/master/en/developer/html/dhis2_developer_manual_full.html#d7532e12063

rgds

David


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 Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

Hi Morten,

Many thanks for this. I will add it to my json payload.Hope this will be added to the online documentation too.

rgds

David

···

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Tue, Jul 26, 2016 at 9:13 PM, David Muturi dnmuturi@gmail.com wrote:

Hello Dhis2 team,
Is there a way of creating relationships between enrolled TEI’s via the API similar to enrollment as described in the dhis2 docs here http://dhis2.github.io/dhis2-docs/master/en/developer/html/dhis2_developer_manual_full.html#d7532e12063

rgds

David


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

Hi Devs

Could this be a bug? The attached error is getting generated when I send the attached TEI Payload via curl.

rgds

David

output.txt (235 Bytes)

export3.json (383 Bytes)

···

2016-07-27 10:12 GMT+03:00 Morten Olav Hansen morten@dhis2.org:

Hi

Yes, you can add this to your create or update TEI payload:

“relationships”: [

{ “trackedEntityInstanceA”: “UID of TEI A”, “trackedEntityInstanceB”: “UID of TEI B” }

]

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Tue, Jul 26, 2016 at 9:13 PM, David Muturi dnmuturi@gmail.com wrote:

Hello Dhis2 team,
Is there a way of creating relationships between enrolled TEI’s via the API similar to enrollment as described in the dhis2 docs here http://dhis2.github.io/dhis2-docs/master/en/developer/html/dhis2_developer_manual_full.html#d7532e12063

rgds

David


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

I will have a look on Monday

···

On Sat, Jul 30, 2016 at 10:03 AM, David Muturi dnmuturi@gmail.com wrote:

Hi Devs

Could this be a bug? The attached error is getting generated when I send the attached TEI Payload via curl.

rgds

David

---------- Forwarded message ----------
From: “David Muturi” dnmuturi@gmail.com
Date: 29 Jul 2016 21:46
Subject: Re: [Dhis2-devs] Tracker Relationship API
To: “Morten Olav Hansen” morten@dhis2.org
Cc:

Hi Morten,
Sorry to come back to you again on this, I am getting the error in the attached output.txt file when I try too update relationship between two TEIs. I have attached my JSON payload as well, when I look at it, I cant seem to see any errors in the syntax.

rgds

David


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 Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

2016-07-27 10:12 GMT+03:00 Morten Olav Hansen morten@dhis2.org:

Hi

Yes, you can add this to your create or update TEI payload:

“relationships”: [

{ “trackedEntityInstanceA”: “UID of TEI A”, “trackedEntityInstanceB”: “UID of TEI B” }

]

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Tue, Jul 26, 2016 at 9:13 PM, David Muturi dnmuturi@gmail.com wrote:

Hello Dhis2 team,
Is there a way of creating relationships between enrolled TEI’s via the API similar to enrollment as described in the dhis2 docs here http://dhis2.github.io/dhis2-docs/master/en/developer/html/dhis2_developer_manual_full.html#d7532e12063

rgds

David


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

Hi Morten,
Many thanks for you response.

rgds

David

···

2016-07-30 12:06 GMT+03:00 Morten Olav Hansen morten@dhis2.org:

I will have a look on Monday

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Sat, Jul 30, 2016 at 10:03 AM, David Muturi dnmuturi@gmail.com wrote:

Hi Devs

Could this be a bug? The attached error is getting generated when I send the attached TEI Payload via curl.

rgds

David

---------- Forwarded message ----------
From: “David Muturi” dnmuturi@gmail.com
Date: 29 Jul 2016 21:46
Subject: Re: [Dhis2-devs] Tracker Relationship API
To: “Morten Olav Hansen” morten@dhis2.org
Cc:

Hi Morten,
Sorry to come back to you again on this, I am getting the error in the attached output.txt file when I try too update relationship between two TEIs. I have attached my JSON payload as well, when I look at it, I cant seem to see any errors in the syntax.

rgds

David


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

2016-07-27 10:12 GMT+03:00 Morten Olav Hansen morten@dhis2.org:

Hi

Yes, you can add this to your create or update TEI payload:

“relationships”: [

{ “trackedEntityInstanceA”: “UID of TEI A”, “trackedEntityInstanceB”: “UID of TEI B” }

]

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Tue, Jul 26, 2016 at 9:13 PM, David Muturi dnmuturi@gmail.com wrote:

Hello Dhis2 team,
Is there a way of creating relationships between enrolled TEI’s via the API similar to enrollment as described in the dhis2 docs here http://dhis2.github.io/dhis2-docs/master/en/developer/html/dhis2_developer_manual_full.html#d7532e12063

rgds

David


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

Hi Morten,
I have investigated and found out the issue below is a bug and will go ahead and report on launchpad. I have made the field relationship typeid to allow nulls then sent the json payload with 10 records. From the attached image the records have inserted in the relationship table via the API. I will use this method to push in the relationship of several hundred thousand recs then run an update sql to fill in the column for now before setting its constraints not to allow nulls.

rgds

David

···

2016-08-01 15:54 GMT+03:00 David Muturi dnmuturi@gmail.com:

Hi Morten,
Many thanks for you response.

rgds

David

2016-07-30 12:06 GMT+03:00 Morten Olav Hansen morten@dhis2.org:

I will have a look on Monday

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Sat, Jul 30, 2016 at 10:03 AM, David Muturi dnmuturi@gmail.com wrote:

Hi Devs

Could this be a bug? The attached error is getting generated when I send the attached TEI Payload via curl.

rgds

David

---------- Forwarded message ----------
From: “David Muturi” dnmuturi@gmail.com
Date: 29 Jul 2016 21:46
Subject: Re: [Dhis2-devs] Tracker Relationship API
To: “Morten Olav Hansen” morten@dhis2.org
Cc:

Hi Morten,
Sorry to come back to you again on this, I am getting the error in the attached output.txt file when I try too update relationship between two TEIs. I have attached my JSON payload as well, when I look at it, I cant seem to see any errors in the syntax.

rgds

David


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

2016-07-27 10:12 GMT+03:00 Morten Olav Hansen morten@dhis2.org:

Hi

Yes, you can add this to your create or update TEI payload:

“relationships”: [

{ “trackedEntityInstanceA”: “UID of TEI A”, “trackedEntityInstanceB”: “UID of TEI B” }

]

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Tue, Jul 26, 2016 at 9:13 PM, David Muturi dnmuturi@gmail.com wrote:

Hello Dhis2 team,
Is there a way of creating relationships between enrolled TEI’s via the API similar to enrollment as described in the dhis2 docs here http://dhis2.github.io/dhis2-docs/master/en/developer/html/dhis2_developer_manual_full.html#d7532e12063

rgds

David


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

Hi Devs,
I managed to get the relationships for linking TEI to work based on the json syntax sent by Morten. I am checking the documentation for creating program stages i.e. http://dhis2.github.io/dhis2-docs/2.24/en/developer/html/ch01s58.html#d0e12001 and I am not finding some guide on this.

Please help with any guide on the json payload syntax for creating a program stage instance through the API.

rgds

David

···

2016-08-01 21:26 GMT+03:00 David Muturi dnmuturi@gmail.com:

Hi Morten,
I have investigated and found out the issue below is a bug and will go ahead and report on launchpad. I have made the field relationship typeid to allow nulls then sent the json payload with 10 records. From the attached image the records have inserted in the relationship table via the API. I will use this method to push in the relationship of several hundred thousand recs then run an update sql to fill in the column for now before setting its constraints not to allow nulls.

rgds

David

2016-08-01 15:54 GMT+03:00 David Muturi dnmuturi@gmail.com:

Hi Morten,
Many thanks for you response.

rgds

David

2016-07-30 12:06 GMT+03:00 Morten Olav Hansen morten@dhis2.org:

I will have a look on Monday

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Sat, Jul 30, 2016 at 10:03 AM, David Muturi dnmuturi@gmail.com wrote:

Hi Devs

Could this be a bug? The attached error is getting generated when I send the attached TEI Payload via curl.

rgds

David

---------- Forwarded message ----------
From: “David Muturi” dnmuturi@gmail.com
Date: 29 Jul 2016 21:46
Subject: Re: [Dhis2-devs] Tracker Relationship API
To: “Morten Olav Hansen” morten@dhis2.org
Cc:

Hi Morten,
Sorry to come back to you again on this, I am getting the error in the attached output.txt file when I try too update relationship between two TEIs. I have attached my JSON payload as well, when I look at it, I cant seem to see any errors in the syntax.

rgds

David


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

2016-07-27 10:12 GMT+03:00 Morten Olav Hansen morten@dhis2.org:

Hi

Yes, you can add this to your create or update TEI payload:

“relationships”: [

{ “trackedEntityInstanceA”: “UID of TEI A”, “trackedEntityInstanceB”: “UID of TEI B” }

]

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Tue, Jul 26, 2016 at 9:13 PM, David Muturi dnmuturi@gmail.com wrote:

Hello Dhis2 team,
Is there a way of creating relationships between enrolled TEI’s via the API similar to enrollment as described in the dhis2 docs here http://dhis2.github.io/dhis2-docs/master/en/developer/html/dhis2_developer_manual_full.html#d7532e12063

rgds

David


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