Count events for specific program stage

Hi,

I’m trying to do a program with many program stage.

My program indicator is to know the count of events for just the first program stage for example.

How can I do that ?

Thanks.

DHIS2 Version : 2.21 - 20994.

Hasinarivelo RAMASOMANANA

mHealth Specialist

Population Services International

Antananarivo - Madagascar

image
​Vies Saines - Résultats mesurables

Hi Ramaso,

we do not support that directly per now. However it has come up a number of times so we will try to get it done for 2.24.

I am thinking we can add another variable for program stage, which allows you to filter on the program stage ID in the indicator filter, e.g.

V{program_stage} = ‘A03MvHHogjR’

https://blueprints.launchpad.net/dhis2/+spec/program-indicator-event-program-stage-count

However, there could be a workaround. Given that you have a numerical data element which is always filled for the stage, can use the event count variable in the expression:

V{event_count}

and use that data element in the expression where you filter on a a value greater > 0, e.g.

#{A03MvHHogjR.wQLfBvPrXqq} > 0

This way, the filter will filter out event which do not have a value for that data element in that stage.

regards,

Lars

image

···

On Tue, May 3, 2016 at 9:28 AM, ramaso hasina hasina.ramaso@gmail.com wrote:

Hi,

I’m trying to do a program with many program stage.

My program indicator is to know the count of events for just the first program stage for example.

How can I do that ?

Thanks.

DHIS2 Version : 2.21 - 20994.

Hasinarivelo RAMASOMANANA

mHealth Specialist

Population Services International

Antananarivo - Madagascar

​Vies Saines - Résultats mesurables


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

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

http://www.dhis2.org

I’ve try this solution in the demo :

***Program indicator ***:

https://play.dhis2.org/demo/dhis-web-maintenance-program/showUpdateProgramIndicator.action?id=858928

Tracker Capture:

https://play.dhis2.org/demo/dhis-web-tracker-capture/index.html#/dashboard?tei=kKctZA8jmCV&program=dxHHSR1fWo3

There’s no value seen in the program indicator

Hasina.

image

···

2016-05-03 11:36 GMT+03:00 ramaso hasina hasina.ramaso@gmail.com:

Thanks Lars,

I’ll try this workaround.

Hasina.

2016-05-03 11:28 GMT+03:00 Lars Helge Øverland lars@dhis2.org:

Hi Ramaso,

we do not support that directly per now. However it has come up a number of times so we will try to get it done for 2.24.

I am thinking we can add another variable for program stage, which allows you to filter on the program stage ID in the indicator filter, e.g.

V{program_stage} = ‘A03MvHHogjR’

https://blueprints.launchpad.net/dhis2/+spec/program-indicator-event-program-stage-count

However, there could be a workaround. Given that you have a numerical data element which is always filled for the stage, can use the event count variable in the expression:

V{event_count}

and use that data element in the expression where you filter on a a value greater > 0, e.g.

#{A03MvHHogjR.wQLfBvPrXqq} > 0

This way, the filter will filter out event which do not have a value for that data element in that stage.

regards,

Lars

On Tue, May 3, 2016 at 9:28 AM, ramaso hasina hasina.ramaso@gmail.com wrote:

Hi,

I’m trying to do a program with many program stage.

My program indicator is to know the count of events for just the first program stage for example.

How can I do that ?

Thanks.

DHIS2 Version : 2.21 - 20994.

Hasinarivelo RAMASOMANANA

mHealth Specialist

Population Services International

Antananarivo - Madagascar

​Vies Saines - Résultats mesurables


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

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

http://www.dhis2.org

Hi there Ramaso,

the reason you are not seeing the program indicator in tracker capture for the particular TEI below is the program indicators filter. There is a shortcoming when combining the filters with indicators shown in the data entry form. Working on fixing this, but in the meantime we can probably help with a workaround in the data entry form.

Did you want to show the number of events of the “Contact” program stage, assuming there is other program stages that you do not want to count events from?

Best regards,

Markus

···

2016-05-03 11:36 GMT+03:00 ramaso hasina hasina.ramaso@gmail.com:

Thanks Lars,

I’ll try this workaround.

Hasina.

2016-05-03 11:28 GMT+03:00 Lars Helge Øverland lars@dhis2.org:

Hi Ramaso,

we do not support that directly per now. However it has come up a number of times so we will try to get it done for 2.24.

I am thinking we can add another variable for program stage, which allows you to filter on the program stage ID in the indicator filter, e.g.

V{program_stage} = ‘A03MvHHogjR’

https://blueprints.launchpad.net/dhis2/+spec/program-indicator-event-program-stage-count

However, there could be a workaround. Given that you have a numerical data element which is always filled for the stage, can use the event count variable in the expression:

V{event_count}

and use that data element in the expression where you filter on a a value greater > 0, e.g.

#{A03MvHHogjR.wQLfBvPrXqq} > 0

This way, the filter will filter out event which do not have a value for that data element in that stage.

regards,

Lars

On Tue, May 3, 2016 at 9:28 AM, ramaso hasina hasina.ramaso@gmail.com wrote:

Hi,

I’m trying to do a program with many program stage.

My program indicator is to know the count of events for just the first program stage for example.

How can I do that ?

Thanks.

DHIS2 Version : 2.21 - 20994.

Hasinarivelo RAMASOMANANA

mHealth Specialist

Population Services International

Antananarivo - Madagascar

<logo_psi_75px.png>
​Vies Saines - Résultats mesurables


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

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

http://www.dhis2.org

Hi Markkus,

Yes, I want to have the number of events of a specific program stage as a program indicator (hide or show in the tracker capture) because later this program indicator will be used to calculate other indicators.

I’ve try what Lars suggest me to do that’s why you see the example in the demo but it doesn’t work.

Thanks.

Hasina

···

2016-05-03 15:20 GMT+03:00 Markus Bekken markus.bekken@gmail.com:

Hi there Ramaso,
the reason you are not seeing the program indicator in tracker capture for the particular TEI below is the program indicators filter. There is a shortcoming when combining the filters with indicators shown in the data entry form. Working on fixing this, but in the meantime we can probably help with a workaround in the data entry form.

Did you want to show the number of events of the “Contact” program stage, assuming there is other program stages that you do not want to count events from?

Best regards,

Markus

  1. mai 2016 kl. 11.52 skrev ramaso hasina hasina.ramaso@gmail.com:

I’ve try this solution in the demo :

***Program indicator ***:

https://play.dhis2.org/demo/dhis-web-maintenance-program/showUpdateProgramIndicator.action?id=858928

Tracker Capture:

https://play.dhis2.org/demo/dhis-web-tracker-capture/index.html#/dashboard?tei=kKctZA8jmCV&program=dxHHSR1fWo3

There’s no value seen in the program indicator

Hasina.


Mailing list: https://launchpad.net/~dhis2-users
Post to : dhis2-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-users
More help : https://help.launchpad.net/ListHelp

2016-05-03 11:36 GMT+03:00 ramaso hasina hasina.ramaso@gmail.com:

Thanks Lars,

I’ll try this workaround.

Hasina.

2016-05-03 11:28 GMT+03:00 Lars Helge Øverland lars@dhis2.org:

Hi Ramaso,

we do not support that directly per now. However it has come up a number of times so we will try to get it done for 2.24.

I am thinking we can add another variable for program stage, which allows you to filter on the program stage ID in the indicator filter, e.g.

V{program_stage} = ‘A03MvHHogjR’

https://blueprints.launchpad.net/dhis2/+spec/program-indicator-event-program-stage-count

However, there could be a workaround. Given that you have a numerical data element which is always filled for the stage, can use the event count variable in the expression:

V{event_count}

and use that data element in the expression where you filter on a a value greater > 0, e.g.

#{A03MvHHogjR.wQLfBvPrXqq} > 0

This way, the filter will filter out event which do not have a value for that data element in that stage.

regards,

Lars

On Tue, May 3, 2016 at 9:28 AM, ramaso hasina hasina.ramaso@gmail.com wrote:

Hi,

I’m trying to do a program with many program stage.

My program indicator is to know the count of events for just the first program stage for example.

How can I do that ?

Thanks.

DHIS2 Version : 2.21 - 20994.

Hasinarivelo RAMASOMANANA

mHealth Specialist

Population Services International

Antananarivo - Madagascar

<logo_psi_75px.png>
​Vies Saines - Résultats mesurables


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

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

http://www.dhis2.org

Hi @Lars , Have this solution been implemented to count event number by program stage ID, I am faced with the same scenario.

I am on 2.35

Thanks

Hi @Yashiindi,

Welcome back to the community! :slight_smile:

Yes this has been implemented. Would you please explain your use case more?

There’s no need for the program stage ID because this will be selected in the configuration when you create an event program indicator.

Thank you, and my apology for taking long…

I want to count a distinct number of events for a given stage.
currently I have a PI of Event analytical type

–v(event_count) as an expression

–and my filter have v(program stage) =UID

This works however it is not deduplicated, the moment I change analytic type to enrolment and v(tei_count) the PI will not pull as I thought that will deduplicate the events count.

Best Regards,

how do I reference the exact program stage to count events for ?

Please note I do not have a numeric data element or any other unique data element that is overall populated completely

I think one way to approach this is by using a program rule. The program rule will count the number of events in the selected program stage in the configuration and then assign the V(event_count) to a data element or TEA:


I don’t think it should haveto be unique data element, as the filter should pull the program stage uid as well as the data element uid. I see your point about “overall populated completely” which is definitely relevant—perhaps there are a collection of data elements that would always be answered, and thus you could have a #{A03MvHHogjR.wQLfBvPrXqq} != ‘’ || #{A03MvHHogjR.wQLfBvPrXqq} != ‘’ || #{A03MvHHogjR.wQLfBvPrXqq} != ‘’

1 Like