=== modified file 'src/docbkx/en/dhis2_user_man_web_api.xml' --- src/docbkx/en/dhis2_user_man_web_api.xml 2014-04-08 09:24:10 +0000 +++ src/docbkx/en/dhis2_user_man_web_api.xml 2014-04-08 15:26:54 +0000 @@ -4137,8 +4137,12 @@
Tracked entity instance query - To query for tracked entity instances you can interact with the /api/trackedEntityInstances - resource. + To query for tracked entity instances you can interact with the /api/trackedEntityInstances resource. There are two types of queries: One where + a query query parameter and optionally attribute parameters are defined, and one where attribute and filter parameters + are defined.
Request syntax @@ -4229,11 +4233,23 @@ return, or attributes without filters in order to include the attribute in the response without any constraints. Attributes will be included in the response, while filters will only be used as criteria. - If specifying a query with no attributes or program, the attributes defined to be - displayed in lists with no program will be included in the response. You can specify queries - with words separated by space - in that situation the system will query for each word - independently and return records where each word is contained in any attribute. The query is - case insensitive. The following rules apply to the query parameters. + Certain rules apply to which attributes are defined when no attributes are specified in + the request: + + + If not specifying a program, the attributes defined to be displayed in lists with no + program will be included in the response. + + + If specifying a program, the attributes linked to the program will be included in + the response. + + + You can specify queries with words separated by space - in that situation the system will + query for each word independently and return records where each word is contained in any + attribute. A query item can be specified once as an attribute and once as a filter if + needed. The query is case insensitive. The following rules apply to the query + parameters. At least one organisation unit must be specified using the program must also be specified. - Attributes and filters can only be specified once. - - - An item cannot be specified as attribute and filter. + A query cannot be specified together with filters. + + + Attribute items can only be specified once. + + + Filter items can only be specified once. A query for all instances associated with a specific organisation unit can look like @@ -4262,10 +4281,10 @@ api/trackedEntityInstances.json?query=scott&ou=DiszpKrYNg8 You can query on multiple words separated by the the URL character for space which is %20: - api/trackedEntityInstances.json?query=isabel%20may&ou=ImspTQPwCqd + api/trackedEntityInstances.json?query=isabel%20may&ou=DiszpKrYNg8 A query where the attributes to include in th response are specified looks like this: - api/trackedEntityInstances.json?query=wakiki&attribute=dv3nChNSIxy&attribute=AMpUYgxuCaE&ou=DiszpKrYNg8 + api/trackedEntityInstances.json?query=isabel&attribute=dv3nChNSIxy&attribute=AMpUYgxuCaE&ou=DiszpKrYNg8 To query for instances using one attribute with a filter and one attribute without a filter, with one organisation unit using the descendants organisation unit query mode, you can issue a query like this: @@ -4278,9 +4297,9 @@ api/trackedEntityInstances.json?ou=DiszpKrYNg8&attribute=dv3nChNSIxy:IN:Scott;Jimmy;Santiago To constrain the response to instances which are part of a specific program you can include a program query parameter like this: - api/trackedEntityInstances.json?attribute=zHXD5Ve1Efw:EQ:A&ou=O6uvpzGd5pu&ouMode=DESCENDANTS&program=ur1Edk5Oe2n + api/trackedEntityInstances.json?filter=zHXD5Ve1Efw:EQ:A&ou=O6uvpzGd5pu&ouMode=DESCENDANTS&program=ur1Edk5Oe2n To specify program enrollment dates as part of the query you can use this syntax: - api/trackedEntityInstances.json?attribute=zHXD5Ve1Efw:EQ:A&ou=O6uvpzGd5pu&ouMode=DESCENDANTS&program=ur1Edk5Oe2n&programDate=GT:2013-01-01&programDate=LT:2013-09-01 + api/trackedEntityInstances.json?filter=zHXD5Ve1Efw:EQ:A&ou=O6uvpzGd5pu&ouMode=DESCENDANTS&program=ur1Edk5Oe2n&programDate=GT:2013-01-01&programDate=LT:2013-09-01 To constrain the response to instances of a specific tracked entity you can include a tracked entity query parameter like this: api/trackedEntityInstances.json?attribute=zHXD5Ve1Efw:EQ:A&ou=O6uvpzGd5pu&ouMode=DESCENDANTS&trackedEntity=cyl5vuJ5ETQ