Creating groups and group sets by using the API

Hi,

I’m trying to create automatically data element groups and group sets by using the API and Pentaho data integration. I had created data element groups (empty groups) successfully. Then, I had tried to created a group set and associate the corresponding groups by using the “items” property of data elements group sets. The group sets had also been created, however, the corresponding groups are not associated. Following, I have pasted a small json that I’m using to reproduce the problem:

{“dataElementGroupSets”:[{“name”:“Laboratory 3”,“items”:[{“name”:“MALARIA TESTING”,“id”:“BIVjmofP0E4”}]}]}

“MALARIA TESTING” is a data element group created before and “Laboratory 3” is the group set. As I said, everything is created, however “MALARIA TESTING” is not linked to “Laboratory 3”

Is this correct way to procedure? Is it possible to create this relations with the API?

Thanks in advance,

Octavio.

It should be “members” not “items”, items is used for something else (its part of the dimensional model), you don’t need the name (but it doesn’t hurt, it just gets ignored)

···


Morten

On Tue, Jul 8, 2014 at 5:06 PM, Octavio GLORIO Octavio.GLORIO@barcelona.msf.org wrote:

Hi,

I’m trying to create automatically data element groups and group sets by using the API and Pentaho data integration. I had created data element groups (empty groups) successfully. Then, I had tried to created a group set and associate the corresponding groups by using the “items” property of data elements group sets. The group sets had also been created, however, the corresponding groups are not associated. Following, I have pasted a small json that I’m using to reproduce the problem:

{“dataElementGroupSets”:[{“name”:“Laboratory 3”,“items”:[{“name”:“MALARIA TESTING”,“id”:“BIVjmofP0E4”}]}]}

“MALARIA TESTING” is a data element group created before and “Laboratory 3” is the group set. As I said, everything is created, however “MALARIA TESTING” is not linked to “Laboratory 3”

Is this correct way to procedure? Is it possible to create this relations with the API?

Thanks in advance,

Octavio.


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

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

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

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

Hi Morten

Is the ‘members’ necessary?

I just tried exporting a groupset from demo using the detailed metadata export and I get rendered something like:

{“created”:“2014-07-08T10:59:37.392+0000”,“dataElementGroupSets”:[{“name”:“Diagnosis”,“created”:“2011-12-24T11:24:25.124+0000”,“lastUpdated”:“2013-03-20T12:15:08.002+0000”,“shortName”:“Diagnosis”,“description”:“Diagnosis”,“compulsory”:false,“dataDimension”:true,“id”:“jp826jAJHUc”,“dataElementGroups”:[{“name”:"Acute Flaccid Paralysis (AFP) ",“created”:“2011-12-24T11:24:24.298+0000”,“lastUpdated”:“2013-03-15T15:08:57.206+0000”,“id”:“oDkJh5Ddh7d”},{“name”:“All Others”,“created”:“2011-12-24T11:24:24.298+0000”,“lastUpdated”:“2014-03-02T21:16:50.246+0000”,“id”:“GBHN1a1Jddh”},{“name”:“Anaemia”,“created”:“2011-12-24T11:24:24.298+0000”,“lastUpdated”:“2014-03-02T21:17:45.177+0000”,“id”:“KmwPVkjp7yl”} …

or is this a case where the output format is maybe not quite in line with the input?

Bob

PS looks like some silly bugger has been messing with the admin password on demo :frowning:

···

On 8 July 2014 11:56, Morten Olav Hansen mortenoh@gmail.com wrote:

It should be “members” not “items”, items is used for something else (its part of the dimensional model), you don’t need the name (but it doesn’t hurt, it just gets ignored)


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

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

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

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


Morten

On Tue, Jul 8, 2014 at 5:06 PM, Octavio GLORIO Octavio.GLORIO@barcelona.msf.org wrote:

Hi,

I’m trying to create automatically data element groups and group sets by using the API and Pentaho data integration. I had created data element groups (empty groups) successfully. Then, I had tried to created a group set and associate the corresponding groups by using the “items” property of data elements group sets. The group sets had also been created, however, the corresponding groups are not associated. Following, I have pasted a small json that I’m using to reproduce the problem:

{“dataElementGroupSets”:[{“name”:“Laboratory 3”,“items”:[{“name”:“MALARIA TESTING”,“id”:“BIVjmofP0E4”}]}]}

“MALARIA TESTING” is a data element group created before and “Laboratory 3” is the group set. As I said, everything is created, however “MALARIA TESTING” is not linked to “Laboratory 3”

Is this correct way to procedure? Is it possible to create this relations with the API?

Thanks in advance,

Octavio.


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

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

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

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

Oh, I’m sorry. It should be dataElementGroups of course, our internal model uses members, but it’s rewritten to dataElementGroups.

···

Morten

On Tue, Jul 8, 2014 at 6:05 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

Hi Morten

Is the ‘members’ necessary?

I just tried exporting a groupset from demo using the detailed metadata export and I get rendered something like:

{“created”:“2014-07-08T10:59:37.392+0000”,“dataElementGroupSets”:[{“name”:“Diagnosis”,“created”:“2011-12-24T11:24:25.124+0000”,“lastUpdated”:“2013-03-20T12:15:08.002+0000”,“shortName”:“Diagnosis”,“description”:“Diagnosis”,“compulsory”:false,“dataDimension”:true,“id”:“jp826jAJHUc”,“dataElementGroups”:[{“name”:"Acute Flaccid Paralysis (AFP) ",“created”:“2011-12-24T11:24:24.298+0000”,“lastUpdated”:“2013-03-15T15:08:57.206+0000”,“id”:“oDkJh5Ddh7d”},{“name”:“All Others”,“created”:“2011-12-24T11:24:24.298+0000”,“lastUpdated”:“2014-03-02T21:16:50.246+0000”,“id”:“GBHN1a1Jddh”},{“name”:“Anaemia”,“created”:“2011-12-24T11:24:24.298+0000”,“lastUpdated”:“2014-03-02T21:17:45.177+0000”,“id”:“KmwPVkjp7yl”} …

or is this a case where the output format is maybe not quite in line with the input?

Bob

PS looks like some silly bugger has been messing with the admin password on demo :frowning:

On 8 July 2014 11:56, Morten Olav Hansen mortenoh@gmail.com wrote:

It should be “members” not “items”, items is used for something else (its part of the dimensional model), you don’t need the name (but it doesn’t hurt, it just gets ignored)


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

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

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

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


Morten

On Tue, Jul 8, 2014 at 5:06 PM, Octavio GLORIO Octavio.GLORIO@barcelona.msf.org wrote:

Hi,

I’m trying to create automatically data element groups and group sets by using the API and Pentaho data integration. I had created data element groups (empty groups) successfully. Then, I had tried to created a group set and associate the corresponding groups by using the “items” property of data elements group sets. The group sets had also been created, however, the corresponding groups are not associated. Following, I have pasted a small json that I’m using to reproduce the problem:

{“dataElementGroupSets”:[{“name”:“Laboratory 3”,“items”:[{“name”:“MALARIA TESTING”,“id”:“BIVjmofP0E4”}]}]}

“MALARIA TESTING” is a data element group created before and “Laboratory 3” is the group set. As I said, everything is created, however “MALARIA TESTING” is not linked to “Laboratory 3”

Is this correct way to procedure? Is it possible to create this relations with the API?

Thanks in advance,

Octavio.


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

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

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

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

OK good. Thanks Morten.

Octavio, you might find the functionality of the detailed metadata export (under import export module/app) to be particularly useful in understanding the format of detailed snippets of metadata. I find it very useful to be able to identify individual snippets like dataelementgroups, groupsets or what have you and be able to export those for further examination.

Best

Bob

···

On 8 July 2014 12:41, Morten Olav Hansen mortenoh@gmail.com wrote:

Oh, I’m sorry. It should be dataElementGroups of course, our internal model uses members, but it’s rewritten to dataElementGroups.

Morten

On Tue, Jul 8, 2014 at 6:05 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

Hi Morten

Is the ‘members’ necessary?

I just tried exporting a groupset from demo using the detailed metadata export and I get rendered something like:

{“created”:“2014-07-08T10:59:37.392+0000”,“dataElementGroupSets”:[{“name”:“Diagnosis”,“created”:“2011-12-24T11:24:25.124+0000”,“lastUpdated”:“2013-03-20T12:15:08.002+0000”,“shortName”:“Diagnosis”,“description”:“Diagnosis”,“compulsory”:false,“dataDimension”:true,“id”:“jp826jAJHUc”,“dataElementGroups”:[{“name”:"Acute Flaccid Paralysis (AFP) ",“created”:“2011-12-24T11:24:24.298+0000”,“lastUpdated”:“2013-03-15T15:08:57.206+0000”,“id”:“oDkJh5Ddh7d”},{“name”:“All Others”,“created”:“2011-12-24T11:24:24.298+0000”,“lastUpdated”:“2014-03-02T21:16:50.246+0000”,“id”:“GBHN1a1Jddh”},{“name”:“Anaemia”,“created”:“2011-12-24T11:24:24.298+0000”,“lastUpdated”:“2014-03-02T21:17:45.177+0000”,“id”:“KmwPVkjp7yl”} …

or is this a case where the output format is maybe not quite in line with the input?

Bob

PS looks like some silly bugger has been messing with the admin password on demo :frowning:

On 8 July 2014 11:56, Morten Olav Hansen mortenoh@gmail.com wrote:

It should be “members” not “items”, items is used for something else (its part of the dimensional model), you don’t need the name (but it doesn’t hurt, it just gets ignored)


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

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

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

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


Morten

On Tue, Jul 8, 2014 at 5:06 PM, Octavio GLORIO Octavio.GLORIO@barcelona.msf.org wrote:

Hi,

I’m trying to create automatically data element groups and group sets by using the API and Pentaho data integration. I had created data element groups (empty groups) successfully. Then, I had tried to created a group set and associate the corresponding groups by using the “items” property of data elements group sets. The group sets had also been created, however, the corresponding groups are not associated. Following, I have pasted a small json that I’m using to reproduce the problem:

{“dataElementGroupSets”:[{“name”:“Laboratory 3”,“items”:[{“name”:“MALARIA TESTING”,“id”:“BIVjmofP0E4”}]}]}

“MALARIA TESTING” is a data element group created before and “Laboratory 3” is the group set. As I said, everything is created, however “MALARIA TESTING” is not linked to “Laboratory 3”

Is this correct way to procedure? Is it possible to create this relations with the API?

Thanks in advance,

Octavio.


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

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

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

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

OK with dataElementGroups. Next time, for sure I will consider using the detailed metadata export either wondering URLs in the browser, je.

Thank you

Octavio.

To: Morten Olav Hansen mortenoh@gmail.com
From: Bob Jolliffe bobjolliffe@gmail.com
Date: 07/08/2014 01:46PM
Cc: Octavio GLORIO Octavio.GLORIO@barcelona.msf.org, dhis2-users dhis2-users@lists.launchpad.net
Subject: Re: [Dhis2-users] Creating groups and group sets by using the API

OK good. Thanks Morten.

Octavio, you might find the functionality of the detailed metadata export (under import export module/app) to be particularly useful in understanding the format of detailed snippets of metadata. I find it very useful to be able to identify individual snippets like dataelementgroups, groupsets or what have you and be able to export those for further examination.

Best

Bob

-----Bob Jolliffe bobjolliffe@gmail.com wrote: -----

···

On 8 July 2014 12:41, Morten Olav Hansen mortenoh@gmail.com wrote:

Oh, I’m sorry. It should be dataElementGroups of course, our internal model uses members, but it’s rewritten to dataElementGroups.

Morten

On Tue, Jul 8, 2014 at 6:05 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

Hi Morten

Is the ‘members’ necessary?

I just tried exporting a groupset from demo using the detailed metadata export and I get rendered something like:

{“created”:“2014-07-08T10:59:37.392+0000”,“dataElementGroupSets”:[{“name”:“Diagnosis”,“created”:“2011-12-24T11:24:25.124+0000”,“lastUpdated”:“2013-03-20T12:15:08.002+0000”,“shortName”:“Diagnosis”,“description”:“Diagnosis”,“compulsory”:false,“dataDimension”:true,“id”:“jp826jAJHUc”,“dataElementGroups”:[{“name”:"Acute Flaccid Paralysis (AFP) ",“created”:“2011-12-24T11:24:24.298+0000”,“lastUpdated”:“2013-03-15T15:08:57.206+0000”,“id”:“oDkJh5Ddh7d”},{“name”:“All Others”,“created”:“2011-12-24T11:24:24.298+0000”,“lastUpdated”:“2014-03-02T21:16:50.246+0000”,“id”:“GBHN1a1Jddh”},{“name”:“Anaemia”,“created”:“2011-12-24T11:24:24.298+0000”,“lastUpdated”:“2014-03-02T21:17:45.177+0000”,“id”:“KmwPVkjp7yl”} …

or is this a case where the output format is maybe not quite in line with the input?

Bob

PS looks like some silly bugger has been messing with the admin password on demo :frowning:

On 8 July 2014 11:56, Morten Olav Hansen mortenoh@gmail.com wrote:

It should be “members” not “items”, items is used for something else (its part of the dimensional model), you don’t need the name (but it doesn’t hurt, it just gets ignored)


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

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

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

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


Morten

On Tue, Jul 8, 2014 at 5:06 PM, Octavio GLORIO Octavio.GLORIO@barcelona.msf.org wrote:

Hi,

I’m trying to create automatically data element groups and group sets by using the API and Pentaho data integration. I had created data element groups (empty groups) successfully. Then, I had tried to created a group set and associate the corresponding groups by using the “items” property of data elements group sets. The group sets had also been created, however, the corresponding groups are not associated. Following, I have pasted a small json that I’m using to reproduce the problem:

{“dataElementGroupSets”:[{“name”:“Laboratory 3”,“items”:[{“name”:“MALARIA TESTING”,“id”:“BIVjmofP0E4”}]}]}

“MALARIA TESTING” is a data element group created before and “Laboratory 3” is the group set. As I said, everything is created, however “MALARIA TESTING” is not linked to “Laboratory 3”

Is this correct way to procedure? Is it possible to create this relations with the API?

Thanks in advance,

Octavio.


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

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

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

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