← Back to team overview

dhis2-devs team mailing list archive

Re: Filtering by attribute values on /api/organisations

 

Hi

You can do something like this:
/api/organisationUnits?filter=attributeValues.attribute.id:
eq:ATTRIBUTE_ID&filter=attributeValues.value:eq:VALUE

You can read more about the object filter here:
https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s06.html

Please be aware that attributeValue paths are not currently optimised, so
it means they will use in-memory filtering

--
Morten

On Sat, Mar 28, 2015 at 10:57 PM, Mahendra Kariya <
mahendra.kariya@xxxxxxxxxxxxxxxx> wrote:

> Hi,
>
> We have a few custom attributes for org units. For example, attribute
> named "Type" can have values like "Hospital", "Dispensary", etc.
>
> We want to GET org units having particular attribute values through
> /api/organisationUnits. Say, we want to GET all org units of type
> "Hospital".
>
> What would be the easiest way to do this?
>

Follow ups