dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #30724
Re: Metadata filtering in API no longer working?
Great, thanks.
Sorry for the newbie question, but could you please also tell me how to
deal with this? I am trying something like this, but not sure how to access
the ID that comes back:
var url = dhis_api_base
+'organisationUnits.json?userDataViewFallback=true';
console.log(url);
$.getJSON( url, function( json ) {
console.dir(json);
});
On Wed, Jun 11, 2014 at 8:31 AM, Jan Henrik Øverland <
janhenrik.overland@xxxxxxxxx> wrote:
> If you want to get the data view root(s) for the logged in user instead of
> hard coding level:eq:1 you can use
>
>
> http://apps.dhis2.org/demo/api/organisationUnits.json?userDataViewFallback=true
>
> which falls back to level 1 if no data view orgunits are specified.
>
>
> On Wed, Jun 11, 2014 at 8:25 AM, Jan Henrik Øverland <
> janhenrik.overland@xxxxxxxxx> wrote:
>
>> It points to the "parent" field in the object, not to the db directly.
>>
>> filter=parent:null seems to be sufficient.
>>
>>
>> On Wed, Jun 11, 2014 at 8:13 AM, Knut Staring <knutst@xxxxxxxxx> wrote:
>>
>>> This is the other way (I had forgotten to put "true" at the end) -
>>> though I dont understand why it is parent and not parentid...
>>>
>>>
>>> http://apps.dhis2.org/demo/api/organisationUnits.json?filter=parent:null:true
>>>
>>>
>>> On Wed, Jun 11, 2014 at 8:08 AM, Knut Staring <knutst@xxxxxxxxx> wrote:
>>>
>>>> Thanks to Jason, I see this is working:
>>>> http://apps.dhis2.org/demo/api/organisationUnits.json?filter=level:eq:1
>>>> http://apps.dhis2.org/dev/api/organisationUnits.json?filter=level:eq:1
>>>> <http://www.google.com/url?q=http%3A%2F%2Fapps.dhis2.org%2Fdev%2Fapi%2ForganisationUnits.json%3Ffilter%3Dlevel%3Aeq%3A1&sa=D&sntz=1&usg=AFQjCNEIOZsxGq6ZgaqomkAtGOkH5ae3DA>
>>>>
>>>>
>>>>
>>>>
>>>> On Wed, Jun 11, 2014 at 8:03 AM, Knut Staring <knutst@xxxxxxxxx> wrote:
>>>>
>>>>> I am trying to use the filtering as described in the manual:
>>>>> http://www.dhis2.org/doc/snapshot/en/user/html/ch30s06.html
>>>>>
>>>>> My goal is to do something like this (in order to find the Root OU),
>>>>> but the filter seems to have no effect?
>>>>> http://apps.dhis2.org/demo/api/organisationUnits?filter=parentid:null
>>>>>
>>>>> --
>>>>> Knut Staring
>>>>> Dept. of Informatics, University of Oslo
>>>>> +4791880522
>>>>> http://dhis2.org
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Knut Staring
>>>> Dept. of Informatics, University of Oslo
>>>> +4791880522
>>>> http://dhis2.org
>>>>
>>>
>>>
>>>
>>> --
>>> Knut Staring
>>> Dept. of Informatics, University of Oslo
>>> +4791880522
>>> http://dhis2.org
>>>
>>> _______________________________________________
>>> 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
>>>
>>>
>>
>
--
Knut Staring
Dept. of Informatics, University of Oslo
+4791880522
http://dhis2.org
Follow ups
References