DHIS EventReport Plugin

Hello Devs

We are leveraging the eventreport plugin for rendering the event reports in one of our custom apps.

We want to get data for specific periods and these could very well be in the past as well.

To achieve this we use the “pe” dimension and pass it as “rows” property while making a call to the getEventReport function.

The event report is fetched alright in the Event Report web app but while we try to get it through the plugin (the API query string as created by this plugin) we get a 409 Conflict.

On further investigation we realize that there are two “pe” type dimensions getting added which is apparently the cause of the conflict.

This is the way we are trying to make a call to the plugin:

DHIS.getEventReport({

                url: dhisUrl, el: eventReport.id, id: eventReport.id,

                **rows: [{dimension: "pe", items: dimensionPeriods}]**

            });

Here the items for the “pe” contains the iso periods for which we want data.

And this is the API query that gets generated:

http://localhost:8000/api/analytics/events/aggregate/FqtMkfZk93u.json?stage=SKQlKPszsak&dimension=ou:zOyMxdCLXBM&dimension=pe:LAST_12_MONTHS&dimension=pe:201510;201511;201512;201601;201602;201603;201604;201605;201606;201607;201608;201609&outputType=EVENT&displayProperty=NAME

Can you help us identify the right way to invoke this plugin?

Thanks for the help in advance.

···

With Regards

Vanya
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!

Hi Jan

We are working with DHIS 2.24 and the plugin has been copied from our fork of dhis-core. So, its from the master branch.

Please let know in case you need more info.

Regards

Vanya

···

On Fri, Sep 16, 2016 at 3:36 PM, Jan Henrik Øverland jan@dhis2.org wrote:

Hi Vanya,

I will look at it, but I need to know the version of the plugin and the version of the dhis2 instance.

Jan

On 16 September 2016 at 11:58, Vanya Seth vanyas@thoughtworks.com wrote:

Hello Devs

We are leveraging the eventreport plugin for rendering the event reports in one of our custom apps.

We want to get data for specific periods and these could very well be in the past as well.

To achieve this we use the “pe” dimension and pass it as “rows” property while making a call to the getEventReport function.

The event report is fetched alright in the Event Report web app but while we try to get it through the plugin (the API query string as created by this plugin) we get a 409 Conflict.

On further investigation we realize that there are two “pe” type dimensions getting added which is apparently the cause of the conflict.

This is the way we are trying to make a call to the plugin:

DHIS.getEventReport({

                url: dhisUrl, el: eventReport.id, id: eventReport.id,
                **rows: [{dimension: "pe", items: dimensionPeriods}]**
            });

Here the items for the “pe” contains the iso periods for which we want data.

And this is the API query that gets generated:

http://localhost:8000/api/analytics/events/aggregate/FqtMkfZk93u.json?stage=SKQlKPszsak&dimension=ou:zOyMxdCLXBM&dimension=pe:LAST_12_MONTHS&dimension=pe:201510;201511;201512;201601;201602;201603;201604;201605;201606;201607;201608;201609&outputType=EVENT&displayProperty=NAME

Can you help us identify the right way to invoke this plugin?

Thanks for the help in advance.


With Regards

Vanya
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Jan Henrik Øverland

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!

HI Jan

Thats true. For that favorite we can see both “ou” and “pe” in the columns. What you mentioned is exactly whats happening when we provide “pe” as rows again.

“pe” on the columns is the relative time period of the event report and the ones that we supply on the rows is the specific periods that we want to fetch the data for.

Do you see any issue with this config?

Ideally I was hoping that the plugin would take care of appending the dim items. Similar configs are working fine for other 3 types of viz objects.

Regards

Vanya

Hi Jan

Thanks for adding the issue.

Couple of interesting points that you might want to consider.

Whenever there is an issue in the configuration of the viz object, say the “pe” dimension is missing. The plugin creates a web alert with the error message. But when we are using this plugin in the context of a custom app where on a single web page there might be lot of visualization objects. Then the web alert really falls out of place. It’s nearly impossible for the end user to make out which chart or report is faulty.

Ideally it would be good if the plugin could throw an exception or write the error message on the DOM element. That ways its more intuitive. And I believe we are doing the same when there are “no values in the system” for the given viz object config.

Thoughts?

Let me know if you need more information.

Regards

Vanya

Thanks Jan.

Regards

Vanya

···

On Thu, Sep 22, 2016 at 1:44 PM, Jan Henrik Øverland jan@dhis2.org wrote:

Hi Vanya,

Agreed. I’m swamped with work though for 2.25, but let’s see what we can do as soon as it’s out.

Also, the plugin will be upgraded along with the ER refactor for 2.26, so things like what you describe here will definitley be fixed by then.

Jan

On 22 September 2016 at 08:48, Vanya Seth vanyas@thoughtworks.com wrote:

Hi Jan

Thanks for adding the issue.

Couple of interesting points that you might want to consider.

Whenever there is an issue in the configuration of the viz object, say the “pe” dimension is missing. The plugin creates a web alert with the error message. But when we are using this plugin in the context of a custom app where on a single web page there might be lot of visualization objects. Then the web alert really falls out of place. It’s nearly impossible for the end user to make out which chart or report is faulty.

Ideally it would be good if the plugin could throw an exception or write the error message on the DOM element. That ways its more intuitive. And I believe we are doing the same when there are “no values in the system” for the given viz object config.

Thoughts?

Let me know if you need more information.

Regards

Vanya


Jan Henrik Øverland

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!

Hi Jan

We are working with the eventchart plugin and want to understand the following:

  • When we specify the “startDate” and “endDate” config params and on the favorite the relative period is “last 6 months”, then we are always getting the chart rendered with time axis between March and August. The data lying between these months and also satisfying the ‘startDate’ and ‘endDate’ criterion gets displayed.

Is this is expected? Does modifying the startDate and endDate not modify the period axis?

Although the analytics API is honoring the start and end dates properly. The data that we get from the API call has all the data between the specified start and end dates. It’s the plugin which is not displaying the data as returned by the API. But displays only between the configured periodicity of the favorite.

Any help would be much appreciated.

Regards

Vanya

···

On Thu, Sep 22, 2016 at 2:25 PM, Vanya Seth vanyas@thoughtworks.com wrote:

Thanks Jan.

Regards

Vanya

On Thu, Sep 22, 2016 at 1:44 PM, Jan Henrik Øverland jan@dhis2.org wrote:

Hi Vanya,

Agreed. I’m swamped with work though for 2.25, but let’s see what we can do as soon as it’s out.

Also, the plugin will be upgraded along with the ER refactor for 2.26, so things like what you describe here will definitley be fixed by then.

Jan


With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!

On 22 September 2016 at 08:48, Vanya Seth vanyas@thoughtworks.com wrote:

Hi Jan

Thanks for adding the issue.

Couple of interesting points that you might want to consider.

Whenever there is an issue in the configuration of the viz object, say the “pe” dimension is missing. The plugin creates a web alert with the error message. But when we are using this plugin in the context of a custom app where on a single web page there might be lot of visualization objects. Then the web alert really falls out of place. It’s nearly impossible for the end user to make out which chart or report is faulty.

Ideally it would be good if the plugin could throw an exception or write the error message on the DOM element. That ways its more intuitive. And I believe we are doing the same when there are “no values in the system” for the given viz object config.

Thoughts?

Let me know if you need more information.

Regards

Vanya


Jan Henrik Øverland

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

With Regards
ThoughtWorks Technologies

Hyderabad

–Stay Hungry Stay Foolish!!