Program Indicator using data from multiple event stages to find TEA

Hi all,

I’m trying to create a program indicator (or just query to the API directly) that evaluates conditions on data elements from two different event stages and then be used to find a relevant tracked entity attribute.

From the docs, it seems that a program indicator type of enrollment would be most appropriate, but this only works at the aggregate level and not at an individual tracked entity instance level. When I use an event type indicator, I don’t receive any values back because the indicator definition contains data from two stages.

Am I correct in this assessment? Any thoughts on how to get around this?

I’ve been testing on a v2.28 instance. A similar reference example from the demo server would be the “Weight gain(in g) between birth and last postnatal for Child Programme” program indicator. The one change would be that I want to see the weight gain for individual TEIs and view a TEA based on the weight gain amount instead of the average over all tracked entity instances.

Thanks in advance,

Aaron

···

Aaron C. White

919.522.5585

Hi Aaron,

Could you try by setting the analytics type to ‘Events’ and then filter all the events by Program stage id/Program stage name variable? Please let me know if this serves as a workaround for your blocker.

Thanks

Preeti A

···

On Thu, Feb 8, 2018 at 8:19 PM, Aaron C White aaroncwhite@gmail.com wrote:

Hi all,

I’m trying to create a program indicator (or just query to the API directly) that evaluates conditions on data elements from two different event stages and then be used to find a relevant tracked entity attribute.

From the docs, it seems that a program indicator type of enrollment would be most appropriate, but this only works at the aggregate level and not at an individual tracked entity instance level. When I use an event type indicator, I don’t receive any values back because the indicator definition contains data from two stages.

Am I correct in this assessment? Any thoughts on how to get around this?

I’ve been testing on a v2.28 instance. A similar reference example from the demo server would be the “Weight gain(in g) between birth and last postnatal for Child Programme” program indicator. The one change would be that I want to see the weight gain for individual TEIs and view a TEA based on the weight gain amount instead of the average over all tracked entity instances.

Thanks in advance,

Aaron

Aaron C. White

919.522.5585


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

Thanks
Preeti Ajgaonkar

Hi Aaron,

from your description I think enrollment type program indicators will be appropriate. Can you tell us a bit more about your usecase? I am assuming you want information from two different stages in the same program. Do you have multiple enrollments per person (TEI) in your program? If not I think enrollment indicators will do the job.

regards,

Lars

···

On 8 February 2018 at 21:49, Aaron C White aaroncwhite@gmail.com wrote:

Hi all,

I’m trying to create a program indicator (or just query to the API directly) that evaluates conditions on data elements from two different event stages and then be used to find a relevant tracked entity attribute.

From the docs, it seems that a program indicator type of enrollment would be most appropriate, but this only works at the aggregate level and not at an individual tracked entity instance level. When I use an event type indicator, I don’t receive any values back because the indicator definition contains data from two stages.

Am I correct in this assessment? Any thoughts on how to get around this?

I’ve been testing on a v2.28 instance. A similar reference example from the demo server would be the “Weight gain(in g) between birth and last postnatal for Child Programme” program indicator. The one change would be that I want to see the weight gain for individual TEIs and view a TEA based on the weight gain amount instead of the average over all tracked entity instances.

Thanks in advance,

Aaron

Aaron C. White

919.522.5585


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

lars@dhis2.org

http://www.dhis2.org

Thanks, Lars and Preeti. I checked the indicator formulation and found a problem with a d2:condition() statement using a text option set value. I converted it to an integer and was able to see the calculated data across stages. I think it might be related to the parentheses issue inside the condition as a few other recent emails have suggested. How should the condition be formulated if you also need to check a text option inside that condition? Using double quotes on the outside of the formulation does not seem to work properly. i.e. d2:condition(“my_de == ‘3’”, true, false)

Aaron

···

On Mon, Feb 12, 2018 at 1:34 AM, Lars Helge Øverland lars@dhis2.org wrote:

Hi Aaron,

from your description I think enrollment type program indicators will be appropriate. Can you tell us a bit more about your usecase? I am assuming you want information from two different stages in the same program. Do you have multiple enrollments per person (TEI) in your program? If not I think enrollment indicators will do the job.

regards,

Lars

Aaron C. White

919.522.5585

On 8 February 2018 at 21:49, Aaron C White aaroncwhite@gmail.com wrote:

Hi all,

I’m trying to create a program indicator (or just query to the API directly) that evaluates conditions on data elements from two different event stages and then be used to find a relevant tracked entity attribute.

From the docs, it seems that a program indicator type of enrollment would be most appropriate, but this only works at the aggregate level and not at an individual tracked entity instance level. When I use an event type indicator, I don’t receive any values back because the indicator definition contains data from two stages.

Am I correct in this assessment? Any thoughts on how to get around this?

I’ve been testing on a v2.28 instance. A similar reference example from the demo server would be the “Weight gain(in g) between birth and last postnatal for Child Programme” program indicator. The one change would be that I want to see the weight gain for individual TEIs and view a TEA based on the weight gain amount instead of the average over all tracked entity instances.

Thanks in advance,

Aaron

Aaron C. White

919.522.5585


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

lars@dhis2.org

http://www.dhis2.org

HI Aaron,

that sounds good, glad to hear you got cross-stage calculations to work.

Unfortunately program indicator expressions do not support nested parentheses/functions - we plan to develop a new version of our program indicator parser which will be more flexible in this regard.

regards,

Lars

···

On 13 February 2018 at 20:56, Aaron C White aaroncwhite@gmail.com wrote:

Thanks, Lars and Preeti. I checked the indicator formulation and found a problem with a d2:condition() statement using a text option set value. I converted it to an integer and was able to see the calculated data across stages. I think it might be related to the parentheses issue inside the condition as a few other recent emails have suggested. How should the condition be formulated if you also need to check a text option inside that condition? Using double quotes on the outside of the formulation does not seem to work properly. i.e. d2:condition(“my_de == ‘3’”, true, false)

Aaron

Aaron C. White

919.522.5585

On Mon, Feb 12, 2018 at 1:34 AM, Lars Helge Øverland lars@dhis2.org wrote:

Hi Aaron,

from your description I think enrollment type program indicators will be appropriate. Can you tell us a bit more about your usecase? I am assuming you want information from two different stages in the same program. Do you have multiple enrollments per person (TEI) in your program? If not I think enrollment indicators will do the job.

regards,

Lars

On 8 February 2018 at 21:49, Aaron C White aaroncwhite@gmail.com wrote:

Hi all,

I’m trying to create a program indicator (or just query to the API directly) that evaluates conditions on data elements from two different event stages and then be used to find a relevant tracked entity attribute.

From the docs, it seems that a program indicator type of enrollment would be most appropriate, but this only works at the aggregate level and not at an individual tracked entity instance level. When I use an event type indicator, I don’t receive any values back because the indicator definition contains data from two stages.

Am I correct in this assessment? Any thoughts on how to get around this?

I’ve been testing on a v2.28 instance. A similar reference example from the demo server would be the “Weight gain(in g) between birth and last postnatal for Child Programme” program indicator. The one change would be that I want to see the weight gain for individual TEIs and view a TEA based on the weight gain amount instead of the average over all tracked entity instances.

Thanks in advance,

Aaron

Aaron C. White

919.522.5585


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

lars@dhis2.org

http://www.dhis2.org

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

Hi everyone.

Thanks Lars for the answer - we face problems with priorities (hence needing parenthesis) there too. Glad to know this will be solved, but what would be the possible workarounds in the meantime? I wanted to decompose in different indicators, but programIndicators can’t use other programIndicators (like the “aggregate” indicators does), correct? Any other way we would apply our proper priorities ?

Thanks,

Martin

···

On Wed, Feb 14, 2018 at 8:18 AM, Lars Helge Øverland lars@dhis2.org wrote:

HI Aaron,

that sounds good, glad to hear you got cross-stage calculations to work.

Unfortunately program indicator expressions do not support nested parentheses/functions - we plan to develop a new version of our program indicator parser which will be more flexible in this regard.

regards,

Lars


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

On 13 February 2018 at 20:56, Aaron C White aaroncwhite@gmail.com wrote:

Thanks, Lars and Preeti. I checked the indicator formulation and found a problem with a d2:condition() statement using a text option set value. I converted it to an integer and was able to see the calculated data across stages. I think it might be related to the parentheses issue inside the condition as a few other recent emails have suggested. How should the condition be formulated if you also need to check a text option inside that condition? Using double quotes on the outside of the formulation does not seem to work properly. i.e. d2:condition(“my_de == ‘3’”, true, false)

Aaron


Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

Aaron C. White

919.522.5585

On Mon, Feb 12, 2018 at 1:34 AM, Lars Helge Øverland lars@dhis2.org wrote:

Hi Aaron,

from your description I think enrollment type program indicators will be appropriate. Can you tell us a bit more about your usecase? I am assuming you want information from two different stages in the same program. Do you have multiple enrollments per person (TEI) in your program? If not I think enrollment indicators will do the job.

regards,

Lars

On 8 February 2018 at 21:49, Aaron C White aaroncwhite@gmail.com wrote:

Hi all,

I’m trying to create a program indicator (or just query to the API directly) that evaluates conditions on data elements from two different event stages and then be used to find a relevant tracked entity attribute.

From the docs, it seems that a program indicator type of enrollment would be most appropriate, but this only works at the aggregate level and not at an individual tracked entity instance level. When I use an event type indicator, I don’t receive any values back because the indicator definition contains data from two stages.

Am I correct in this assessment? Any thoughts on how to get around this?

I’ve been testing on a v2.28 instance. A similar reference example from the demo server would be the “Weight gain(in g) between birth and last postnatal for Child Programme” program indicator. The one change would be that I want to see the weight gain for individual TEIs and view a TEA based on the weight gain amount instead of the average over all tracked entity instances.

Thanks in advance,

Aaron

Aaron C. White

919.522.5585


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

lars@dhis2.org

http://www.dhis2.org

**Martin Van Aken - **Freelance Enthusiast Developer

Mobile : +32 486 899 652

Follow me on Twitter : @martinvanaken

Call me on Skype : vanakenm

Hang out with me : martin@joyouscoding.com

Contact me on LinkedIn : http://www.linkedin.com/in/martinvanaken

Company website : www.joyouscoding.com

Hi Martin,

to my knowledge the parenthesis work in general, with the exception of passing parenthesis into the d2:condition() function: DHIS2-2813

You would be able to write parenthesis in program indicators expressions and filters. What is not supported is nested d2: function calls.

Please report if you experience problems with parenthesis outside the known issue above.

Markus

···

On Wed, Feb 14, 2018 at 8:18 AM, Lars Helge Øverland lars@dhis2.org wrote:

HI Aaron,

that sounds good, glad to hear you got cross-stage calculations to work.

Unfortunately program indicator expressions do not support nested parentheses/functions - we plan to develop a new version of our program indicator parser which will be more flexible in this regard.

regards,

Lars


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

On 13 February 2018 at 20:56, Aaron C White aaroncwhite@gmail.com wrote:

Thanks, Lars and Preeti. I checked the indicator formulation and found a problem with a d2:condition() statement using a text option set value. I converted it to an integer and was able to see the calculated data across stages. I think it might be related to the parentheses issue inside the condition as a few other recent emails have suggested. How should the condition be formulated if you also need to check a text option inside that condition? Using double quotes on the outside of the formulation does not seem to work properly. i.e. d2:condition(“my_de == ‘3’”, true, false)

Aaron


Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

Aaron C. White

919.522.5585

On Mon, Feb 12, 2018 at 1:34 AM, Lars Helge Øverland lars@dhis2.org wrote:

Hi Aaron,

from your description I think enrollment type program indicators will be appropriate. Can you tell us a bit more about your usecase? I am assuming you want information from two different stages in the same program. Do you have multiple enrollments per person (TEI) in your program? If not I think enrollment indicators will do the job.

regards,

Lars

On 8 February 2018 at 21:49, Aaron C White aaroncwhite@gmail.com wrote:

Hi all,

I’m trying to create a program indicator (or just query to the API directly) that evaluates conditions on data elements from two different event stages and then be used to find a relevant tracked entity attribute.

From the docs, it seems that a program indicator type of enrollment would be most appropriate, but this only works at the aggregate level and not at an individual tracked entity instance level. When I use an event type indicator, I don’t receive any values back because the indicator definition contains data from two stages.

Am I correct in this assessment? Any thoughts on how to get around this?

I’ve been testing on a v2.28 instance. A similar reference example from the demo server would be the “Weight gain(in g) between birth and last postnatal for Child Programme” program indicator. The one change would be that I want to see the weight gain for individual TEIs and view a TEA based on the weight gain amount instead of the average over all tracked entity instances.

Thanks in advance,

Aaron

Aaron C. White

919.522.5585


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

lars@dhis2.org

http://www.dhis2.org

**Martin Van Aken - **Freelance Enthusiast Developer

Mobile : +32 486 899 652

Follow me on Twitter : @martinvanaken

Call me on Skype : vanakenm

Hang out with me : martin@joyouscoding.com

Contact me on LinkedIn : http://www.linkedin.com/in/martinvanaken

Company website : www.joyouscoding.com

Ok, thanks for the clarification. I’ll check our concrete situation and see what are our options there.

Martin

···

On Wed, Feb 14, 2018 at 10:39 AM, Markus Bekken markus@dhis2.org wrote:

Hi Martin,
to my knowledge the parenthesis work in general, with the exception of passing parenthesis into the d2:condition() function: DHIS2-2813

You would be able to write parenthesis in program indicators expressions and filters. What is not supported is nested d2: function calls.

Please report if you experience problems with parenthesis outside the known issue above.

Markus

  1. feb. 2018 kl. 08:30 skrev Martin Van Aken martin@joyouscoding.com:

Hi everyone.

Thanks Lars for the answer - we face problems with priorities (hence needing parenthesis) there too. Glad to know this will be solved, but what would be the possible workarounds in the meantime? I wanted to decompose in different indicators, but programIndicators can’t use other programIndicators (like the “aggregate” indicators does), correct? Any other way we would apply our proper priorities ?

Thanks,

Martin


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

On Wed, Feb 14, 2018 at 8:18 AM, Lars Helge Øverland lars@dhis2.org wrote:

HI Aaron,

that sounds good, glad to hear you got cross-stage calculations to work.

Unfortunately program indicator expressions do not support nested parentheses/functions - we plan to develop a new version of our program indicator parser which will be more flexible in this regard.

regards,

Lars


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


**Martin Van Aken - **Freelance Enthusiast Developer

Mobile : +32 486 899 652

Follow me on Twitter : @martinvanaken

Call me on Skype : vanakenm

Hang out with me : martin@joyouscoding.com

Contact me on LinkedIn : http://www.linkedin.com/in/martinvanaken

Company website : www.joyouscoding.com

On 13 February 2018 at 20:56, Aaron C White aaroncwhite@gmail.com wrote:

Thanks, Lars and Preeti. I checked the indicator formulation and found a problem with a d2:condition() statement using a text option set value. I converted it to an integer and was able to see the calculated data across stages. I think it might be related to the parentheses issue inside the condition as a few other recent emails have suggested. How should the condition be formulated if you also need to check a text option inside that condition? Using double quotes on the outside of the formulation does not seem to work properly. i.e. d2:condition(“my_de == ‘3’”, true, false)

Aaron


Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

Aaron C. White

919.522.5585

On Mon, Feb 12, 2018 at 1:34 AM, Lars Helge Øverland lars@dhis2.org wrote:

Hi Aaron,

from your description I think enrollment type program indicators will be appropriate. Can you tell us a bit more about your usecase? I am assuming you want information from two different stages in the same program. Do you have multiple enrollments per person (TEI) in your program? If not I think enrollment indicators will do the job.

regards,

Lars

On 8 February 2018 at 21:49, Aaron C White aaroncwhite@gmail.com wrote:

Hi all,

I’m trying to create a program indicator (or just query to the API directly) that evaluates conditions on data elements from two different event stages and then be used to find a relevant tracked entity attribute.

From the docs, it seems that a program indicator type of enrollment would be most appropriate, but this only works at the aggregate level and not at an individual tracked entity instance level. When I use an event type indicator, I don’t receive any values back because the indicator definition contains data from two stages.

Am I correct in this assessment? Any thoughts on how to get around this?

I’ve been testing on a v2.28 instance. A similar reference example from the demo server would be the “Weight gain(in g) between birth and last postnatal for Child Programme” program indicator. The one change would be that I want to see the weight gain for individual TEIs and view a TEA based on the weight gain amount instead of the average over all tracked entity instances.

Thanks in advance,

Aaron

Aaron C. White

919.522.5585


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

lars@dhis2.org

http://www.dhis2.org

**Martin Van Aken - **Freelance Enthusiast Developer

Mobile : +32 486 899 652

Follow me on Twitter : @martinvanaken

Call me on Skype : vanakenm

Hang out with me : martin@joyouscoding.com

Contact me on LinkedIn : http://www.linkedin.com/in/martinvanaken

Company website : www.joyouscoding.com