← Back to team overview

dhis2-devs team mailing list archive

Re: Need Help with Organisation Unit group

 

Knut reminded me that maybe you do not have the group.

You can also use the API for this as well, so something like

GET /api/organisationUnits=filter=name:like:foo&field=id

where "foo" is the name pattern of the organisation units (if that exists).
Otherwise, you will need to figure out a way to filter the OUs. Point
being, you need to have create the organisation unit group somehow.

You can then iteratively POST to

the  /api/organisationUnitGroups/IDA/organisationUnits/IDB  endpoint

where IDA is the group UID and IDB is the organisation unit UID.

Once you do that, you can use the UI or the API to assign the data sets as
detailed above.

Regards,
Jason

On Tue, Sep 29, 2015 at 9:09 AM, Jason Pickering <
jason.p.pickering@xxxxxxxxx> wrote:

> More specifically, you can get all of the organisation units in a specific
> group with something like
>
>
> https://apps.dhis2.org/demo/api/organisationUnitGroups/CXw2yu5fodb?fields=organisationUnits[id]&paging=false
>
> where "CXw2yu5fodb" is the UID of the group.
>
> Once you have that, you can then iteratively update the dataset
> memberships with a POST request to
>
>
> https://apps.dhis2.org/demo/api/dataSets/DATASETID/organisationUnits/ORGUNITID
>
> as described in
> https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s09.html#d5e715
> (Section 1.9.3 ).
>
> The easier way of course, is to just use the UI, if you are assigning all
> OU group members to a specific data set from the normal dataset assignment
> editor.
>
> Hope this helps.
>
> Regards,
> Jason
>
>
>
> ​
>
>
>
> On Tue, Sep 29, 2015 at 8:33 AM, Knut Staring <knutst@xxxxxxxxx> wrote:
>
>> You can achieve the same through the webapi
>> On Sep 29, 2015 8:32 AM, "Asiz koju" <utsavkoju@xxxxxxxxxxx> wrote:
>>
>>> Thanks Knut,
>>>
>>> Thank you for your suggestion. I can distinguish them easily through sql
>>> but the problem is the server is located else somewhere and i don't have
>>> remote access to it. Is there any other way possible?
>>>
>>> Regards,
>>> Utsav
>>>
>>> ------------------------------
>>> Date: Tue, 29 Sep 2015 08:27:24 +0200
>>> Subject: Re: [Dhis2-devs] Need Help with Organisation Unit group
>>> From: knutst@xxxxxxxxx
>>> To: utsavkoju@xxxxxxxxxxx
>>> CC: dhis2-devs@xxxxxxxxxxxxxxxxxxx
>>>
>>> If you have a way of distinguishing them from the name or code, then you
>>> can do it directly in th db with SQL.
>>>
>>> Knut
>>> On Sep 29, 2015 7:53 AM, "Asiz koju" <utsavkoju@xxxxxxxxxxx> wrote:
>>>
>>> Dear all,
>>> I would be really grateful if someone can help me with my problem. In my
>>> instance, at level 5 i have two different types of org unit (1 is community
>>> workers and other is outlet) so while assigning program to these levels i
>>> can't do it by selecting the levels but instead i need to select the group.
>>> Can Any one suggest me a good way of creating org unit group rather than
>>> selecting each individual members. ( FYI there are 1800 community workers
>>> and 500 facility).
>>>
>>> Thanking for your support.
>>>
>>> Regards,
>>> Utsav
>>>
>>> _______________________________________________
>>> Mailing list: https://launchpad.net/~dhis2-devs
>>> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>>> Unsubscribe : https://launchpad.net/~dhis2-devs
>>> More help   : https://help.launchpad.net/ListHelp
>>>
>>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dhis2-devs
>> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dhis2-devs
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
>
> --
> Jason P. Pickering
> email: jason.p.pickering@xxxxxxxxx
> tel:+46764147049
>



-- 
Jason P. Pickering
email: jason.p.pickering@xxxxxxxxx
tel:+46764147049

PNG image


References