API Call for Append Single Addition or Single Subtraction

Hello Devs,

I’ve looked at the following but I think my ask is slightly different: http://dhis2.github.io/dhis2-docs/master/en/developer/html/ch01s10.html#d5e875

Ive got a data element group with a fair amount of data elements in it. Rather than downloading the whole thing, appending to that what I would like to add, and re-uploading the result, is there a way to just send a single new value I would like to add? In a similar vein, is there a way to do a single removal?

If not, is there a way to include a data element’s group membership in the node and have DHIS2 add it to the proper group?

If not, this would be helpful in rapidly changing systems where you might not know 100% what should be in a data element group, but you are 100% sure that your new element belongs there.

image

···

Timothy Harding
Sr. Systems Analyst, BAO Systems

+1 202-536-1541 | tharding@baosystems.com | http://www.baosystems.com | Skype: hardingt@gmail.com | 2900 K Street, Suite 404, Washington D.C. 20007

Hi

We have a simple API for adding/removing a -single- object from a collection [1]. That would probably help you? PATCH support is still a bit flaky sadly, and really only works for primitives, I’m hoping to add fixes to it in 2.23/2.24.

[1] http://dhis2.github.io/dhis2-docs/master/en/developer/html/ch01s10.html#d5e848

image

···

On Mon, Feb 8, 2016 at 4:27 PM, Timothy Harding tharding@baosystems.com wrote:

Hello Devs,

I’ve looked at the following but I think my ask is slightly different: http://dhis2.github.io/dhis2-docs/master/en/developer/html/ch01s10.html#d5e875

Ive got a data element group with a fair amount of data elements in it. Rather than downloading the whole thing, appending to that what I would like to add, and re-uploading the result, is there a way to just send a single new value I would like to add? In a similar vein, is there a way to do a single removal?

If not, is there a way to include a data element’s group membership in the node and have DHIS2 add it to the proper group?

If not, this would be helpful in rapidly changing systems where you might not know 100% what should be in a data element group, but you are 100% sure that your new element belongs there.

Timothy Harding
Sr. Systems Analyst, BAO Systems

+1 202-536-1541 | tharding@baosystems.com | http://www.baosystems.com | Skype: hardingt@gmail.com | 2900 K Street, Suite 404, Washington D.C. 20007


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

Hi Tim,
I think this should work

Remove a single data element:

curl -X DELETE -u admin:district https://play.dhis2.org/dev/api/dataSets/lyLU2wR22tC/dataElements/a5MxE5H7d3q

Add it back:

curl -X POST -u admin:district https://play.dhis2.org/dev/api/dataSets/lyLU2wR22tC/dataElements/a5MxE5H7d3q

Its described in the section above ( 1.10.4. Adding and removing objects to/from collections )

Regards,

Jason

image

···

On Mon, Feb 8, 2016 at 10:27 AM, Timothy Harding tharding@baosystems.com wrote:

Hello Devs,

I’ve looked at the following but I think my ask is slightly different: http://dhis2.github.io/dhis2-docs/master/en/developer/html/ch01s10.html#d5e875

Ive got a data element group with a fair amount of data elements in it. Rather than downloading the whole thing, appending to that what I would like to add, and re-uploading the result, is there a way to just send a single new value I would like to add? In a similar vein, is there a way to do a single removal?

If not, is there a way to include a data element’s group membership in the node and have DHIS2 add it to the proper group?

If not, this would be helpful in rapidly changing systems where you might not know 100% what should be in a data element group, but you are 100% sure that your new element belongs there.

Timothy Harding
Sr. Systems Analyst, BAO Systems

+1 202-536-1541 | tharding@baosystems.com | http://www.baosystems.com | Skype: hardingt@gmail.com | 2900 K Street, Suite 404, Washington D.C. 20007


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

Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049

Awesome, Thank you Jason and Morten,

I will give those a shot. Thanks for the fast response. Do you know off hand how far back do these go version wise?

image

···

On Mon, Feb 8, 2016 at 4:37 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi Tim,
I think this should work

Remove a single data element:

curl -X DELETE -u admin:district https://play.dhis2.org/dev/api/dataSets/lyLU2wR22tC/dataElements/a5MxE5H7d3q

Add it back:

curl -X POST -u admin:district https://play.dhis2.org/dev/api/dataSets/lyLU2wR22tC/dataElements/a5MxE5H7d3q

Its described in the section above ( 1.10.4. Adding and removing objects to/from collections )

Regards,

Jason

Timothy Harding
Sr. Systems Analyst, BAO Systems

+1 202-536-1541 | tharding@baosystems.com | http://www.baosystems.com | Skype: hardingt@gmail.com | 2900 K Street, Suite 404, Washington D.C. 20007

On Mon, Feb 8, 2016 at 10:27 AM, Timothy Harding tharding@baosystems.com wrote:

Hello Devs,

I’ve looked at the following but I think my ask is slightly different: http://dhis2.github.io/dhis2-docs/master/en/developer/html/ch01s10.html#d5e875

Ive got a data element group with a fair amount of data elements in it. Rather than downloading the whole thing, appending to that what I would like to add, and re-uploading the result, is there a way to just send a single new value I would like to add? In a similar vein, is there a way to do a single removal?

If not, is there a way to include a data element’s group membership in the node and have DHIS2 add it to the proper group?

If not, this would be helpful in rapidly changing systems where you might not know 100% what should be in a data element group, but you are 100% sure that your new element belongs there.

Timothy Harding
Sr. Systems Analyst, BAO Systems

+1 202-536-1541 | tharding@baosystems.com | http://www.baosystems.com | Skype: hardingt@gmail.com | 2900 K Street, Suite 404, Washington D.C. 20007


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

Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049

Down to 2.20 at least

image

···

On Mon, Feb 8, 2016 at 4:51 PM, Timothy Harding tharding@baosystems.com wrote:

Awesome, Thank you Jason and Morten,

I will give those a shot. Thanks for the fast response. Do you know off hand how far back do these go version wise?


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

Timothy Harding
Sr. Systems Analyst, BAO Systems

+1 202-536-1541 | tharding@baosystems.com | http://www.baosystems.com | Skype: hardingt@gmail.com | 2900 K Street, Suite 404, Washington D.C. 20007

On Mon, Feb 8, 2016 at 4:37 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi Tim,
I think this should work

Remove a single data element:

curl -X DELETE -u admin:district https://play.dhis2.org/dev/api/dataSets/lyLU2wR22tC/dataElements/a5MxE5H7d3q

Add it back:

curl -X POST -u admin:district https://play.dhis2.org/dev/api/dataSets/lyLU2wR22tC/dataElements/a5MxE5H7d3q

Its described in the section above ( 1.10.4. Adding and removing objects to/from collections )

Regards,

Jason

On Mon, Feb 8, 2016 at 10:27 AM, Timothy Harding tharding@baosystems.com wrote:

Hello Devs,

I’ve looked at the following but I think my ask is slightly different: http://dhis2.github.io/dhis2-docs/master/en/developer/html/ch01s10.html#d5e875

Ive got a data element group with a fair amount of data elements in it. Rather than downloading the whole thing, appending to that what I would like to add, and re-uploading the result, is there a way to just send a single new value I would like to add? In a similar vein, is there a way to do a single removal?

If not, is there a way to include a data element’s group membership in the node and have DHIS2 add it to the proper group?

If not, this would be helpful in rapidly changing systems where you might not know 100% what should be in a data element group, but you are 100% sure that your new element belongs there.

Timothy Harding
Sr. Systems Analyst, BAO Systems

+1 202-536-1541 | tharding@baosystems.com | http://www.baosystems.com | Skype: hardingt@gmail.com | 2900 K Street, Suite 404, Washington D.C. 20007


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

Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049

Morten