← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-documenters/dhis2/dhis2-docbook-docs] Rev 979: TEI query docs

 

------------------------------------------------------------
revno: 979
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2-docbook-docs
timestamp: Mon 2014-03-17 19:41:45 +0100
message:
  TEI query docs
modified:
  src/docbkx/en/dhis2_user_man_web_api.xml


--
lp:~dhis2-documenters/dhis2/dhis2-docbook-docs
https://code.launchpad.net/~dhis2-documenters/dhis2/dhis2-docbook-docs

Your team DHIS 2 developers is subscribed to branch lp:~dhis2-documenters/dhis2/dhis2-docbook-docs.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-documenters/dhis2/dhis2-docbook-docs/+edit-subscription
=== modified file 'src/docbkx/en/dhis2_user_man_web_api.xml'
--- src/docbkx/en/dhis2_user_man_web_api.xml	2014-03-11 12:14:32 +0000
+++ src/docbkx/en/dhis2_user_man_web_api.xml	2014-03-17 18:41:45 +0000
@@ -1445,7 +1445,7 @@
         </tbody>
       </tgroup>
     </table>
-    <para>The data content of the analytical represantations can be modified by providing a
+    <para>The data content of the analytical representations can be modified by providing a
         <emphasis role="italic">date</emphasis> query parameter. This requires that the analytical
       resource is set up for relative periods for the period dimension.</para>
     <table frame="all">
@@ -3102,9 +3102,9 @@
     <table frame="all">
       <title>Event dimensions</title>
       <tgroup cols="3">
-        <colspec colname="c1" colnum="1" colwidth="2.49*"/>
+        <colspec colname="c1" colnum="1" colwidth="2.46*"/>
         <colspec colname="c2" colnum="2" colwidth="1*"/>
-        <colspec colname="c3" colnum="3" colwidth="5.42*"/>
+        <colspec colname="c3" colnum="3" colwidth="5.37*"/>
         <thead>
           <row>
             <entry>Dimension</entry>
@@ -3189,7 +3189,7 @@
             <entry>Yes</entry>
             <entry>Dimension identifier including data elements, person attributes, person
                 identifiers, periods and organisation units. Parameter can be repeated any number of
-                times. Item filtes can be applied to a dimension on the format
+                times. Item filters can be applied to a dimension on the format
                 &lt;item-id>:&lt;operator>:&lt;filter>. Filter values are case-insensitive.</entry>
             <entry>Operators can be EQ | GT | GE | LT | LE | NE | LIKE | IN</entry>
           </row>
@@ -3259,14 +3259,13 @@
             <row>
               <entry>page</entry>
               <entry>No</entry>
-              <entry>The page number. Page size of 50 will be used if no page size parameter is
-                specified.</entry>
+              <entry>The page number. Default page is 1.</entry>
               <entry>Numeric positive value</entry>
             </row>
             <row>
               <entry>pageSize</entry>
               <entry>No</entry>
-              <entry>The page size. Unlimited if not specified.</entry>
+              <entry>The page size. Default size is 50 items per page.</entry>
               <entry>Numeric zero or positive value</entry>
             </row>
           </tbody>
@@ -4125,6 +4124,134 @@
     </section>
   </section>
   <section>
+    <title>Tracked Entity Instances</title>
+    <para>To query for tracked entity instances you can interact with the <emphasis role="italic"
+        >/trackedEntityInstances</emphasis> resource. This resource supports JSON, JSONP, XLS and
+      CSV resource representations.</para>
+    <table frame="all">
+      <title>Tracked entity instances query parameters</title>
+      <tgroup cols="3">
+        <colspec colname="c1" colnum="1" colwidth="1.41*"/>
+        <colspec colname="c2" colnum="2" colwidth="1*"/>
+        <colspec colname="c3" colnum="3" colwidth="7.42*"/>
+        <thead>
+          <row>
+            <entry>Query parameter</entry>
+            <entry>Required</entry>
+            <entry>Description</entry>
+          </row>
+        </thead>
+        <tbody>
+          <row>
+            <entry>item</entry>
+            <entry>Yes</entry>
+            <entry>Query items referring to attributes. Param can be repeated any number of items.
+              Filters can be applied to a dimension on the format
+              &lt;attribute-id>:&lt;operator>:&lt;filter>. Filter values are case-insensitive.
+              Operators can be EQ | GT | GE | LT | LE | NE | LIKE | IN. Filters can be omitted in
+              order to simply include the attribute in the response without any constraints.</entry>
+          </row>
+          <row>
+            <entry>ou</entry>
+            <entry>Yes</entry>
+            <entry>Organisation unit idenfiers, separated by ";".</entry>
+          </row>
+          <row>
+            <entry>ouMode</entry>
+            <entry>No</entry>
+            <entry>The mode of selecting organisation units, can be SELECTED | CHILDREN |
+              DESCENDANTS. Default is SELECTED, which refers to the selected organisation units
+              only. CHILDREN refers to immediate children in the hierarchy of the specified org
+              units. DESCENDANTS refers to all units in the sub-hierarchy of the specified org
+              units. </entry>
+          </row>
+          <row>
+            <entry>program</entry>
+            <entry>No</entry>
+            <entry>Program identifier. Restricts instances to being enrolled in the given
+              program.</entry>
+          </row>
+          <row>
+            <entry>trackedEntity</entry>
+            <entry>No</entry>
+            <entry>Tracked entity identifer. Restricts instances to the given tracked instance
+              type.</entry>
+          </row>
+          <row>
+            <entry>page</entry>
+            <entry>No</entry>
+            <entry>The page number. Default page is 1.</entry>
+          </row>
+          <row>
+            <entry>pageSize</entry>
+            <entry>No</entry>
+            <entry>The page size. Default size is 50 items per page.</entry>
+          </row>
+        </tbody>
+      </tgroup>
+    </table>
+    <para>Note that you can specify items with filters for constraining the instances to return, or
+      items without filters in order to include the attribute in the response without any
+      constraints. 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:</para>
+    <screen>api/trackedEntityInstances.json?item=zHXD5Ve1Efw:EQ:A&amp;item=AMpUYgxuCaE&amp;ou=DiszpKrYNg8;yMCshbaVExv</screen>
+    <para>To constrain the response to instances which are part of a specific program you can
+      include a program query parameter like this:</para>
+    <screen>api/trackedEntityInstances.json?item=zHXD5Ve1Efw:EQ:A&amp;ou=O6uvpzGd5pu&amp;ouMode=DESCENDANTS&amp;program=uy2gU8kT1jF</screen>
+    <para>By default the instances are returned in pages of size 50, to change this you can use the
+      page and pageSize query parameters like this:</para>
+    <screen>api/trackedEntityInstances.json?item=zHXD5Ve1Efw:EQ:A&amp;ou=O6uvpzGd5pu&amp;ouMode=DESCENDANTS&amp;page=2&amp;pageSize=3</screen>
+    <para>You can use a range of operators for the filtering:</para>
+    <table frame="all">
+      <title>Filter operators</title>
+      <tgroup cols="2">
+        <colspec colname="c1" colnum="1" colwidth="87.75pt"/>
+        <colspec colname="c2" colnum="2" colwidth="368.25pt"/>
+        <thead>
+          <row>
+            <entry><emphasis role="italic">Operator</emphasis></entry>
+            <entry><emphasis role="italic">Description</emphasis></entry>
+          </row>
+        </thead>
+        <tbody>
+          <row>
+            <entry>EQ</entry>
+            <entry>Equal to</entry>
+          </row>
+          <row>
+            <entry>GT</entry>
+            <entry>Greater than</entry>
+          </row>
+          <row>
+            <entry>GE</entry>
+            <entry>Greater than or equal to</entry>
+          </row>
+          <row>
+            <entry>LT</entry>
+            <entry>Less than</entry>
+          </row>
+          <row>
+            <entry>LE</entry>
+            <entry>Less than or equal to</entry>
+          </row>
+          <row>
+            <entry>NE</entry>
+            <entry>Not equal to</entry>
+          </row>
+          <row>
+            <entry>LIKE</entry>
+            <entry>Like (free text match)</entry>
+          </row>
+          <row>
+            <entry>IN</entry>
+            <entry>Equal to one of multiple values separated by ":"</entry>
+          </row>
+        </tbody>
+      </tgroup>
+    </table>
+  </section>
+  <section>
     <title>FRED API</title>
     <para>DHIS 2 from version 2.11 implements support for the current draft
       of the FRED API version 1.0. The project defines itself as <quote>open standard for sharing and updating