dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #45599
Re: Return number of records in a program stage
Hi Muturi,
one approach is using the event analytics API. Of course this means that
the result will depend on when analytics tables were generated last time.
Docs:
http://dhis2.github.io/dhis2-docs/master/en/developer/html/ch01s33.html
A query that will give you the number of events for a given program,
program stage, entire country (see ou dimension) and between a start and
end date looks like this:
https://play.dhis2.org/demo/api/analytics/events/aggregate/eBAyeGv0exc.json?stage=Zj7UnCAulEk&dimension=ou:ImspTQPwCqd&startDate=2015-03-01&endDate=2016-06-30&outputType=EVENT
Will return a single row with the count of events:
- rows:
[
-
[
- "ImspTQPwCqd",
- "71676"
]
],
regards,
Lars
On Thu, Jun 23, 2016 at 6:40 AM, David Muturi <dnmuturi@xxxxxxxxx> wrote:
> Hi Devs,
>
> Is there an api call that returns a count of records in the tracker in a
> program stage. I am using a custom form to generate an alpha numeric ID
> based on a count of program stage records e.g. no. Of mothers attending
> ANC. I wanted to use a count returned from an sql view but am wondering if
> there is another way to this.
> rgds
> David
>
> _______________________________________________
> 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
>
>
--
Lars Helge Øverland
Lead developer, DHIS 2
University of Oslo
Skype: larshelgeoverland
lars@xxxxxxxxx
http://www.dhis2.org <https://www.dhis2.org/>
Follow ups
References