Need help in Program Rules

Hello All,

I am using DHIS version 2.20 build revision 19691.

I am having a doubt in Program rules.

We have a case where

Data element ‘Age Type’ has options i.e. Hours/Days/Weeks/Months/Years

Now if the user is selecting ‘Age type’ as Hours then another data element ‘Age’ should accept value between 0 to 23, application should not accept any value more that 23 in case of Hours ‘Age type’.

Similarly, If ‘Age type’ is **Days **then it should not accept more that 6 for ‘Age’ data element.

Can we add these kind of program rules?

Can some one please guide?

···

Thanks,
Neeraj Gupta

Hi Neeraj.

This kind of cross validation rules is half way supported already, and the full support is right around the corner. The program rule can be created in the editor, it is being run - but how to display the error message in the UI is still under discussion. Keep an eye out in release notes 2.21!

To construct the cross validation you want you would have to make one rule for each of your options. For ex. one rule that validates that if ‘Hours’ is selected, age must be below 24, and another for ‘Days’.

See the rule created in the editor:

···

Thanks,
Neeraj Gupta

Thanks Markus.

image

···

On Mon, Aug 17, 2015 at 1:37 PM, Markus Bekken markus.bekken@gmail.com wrote:

Hi Neeraj.
This kind of cross validation rules is half way supported already, and the full support is right around the corner. The program rule can be created in the editor, it is being run - but how to display the error message in the UI is still under discussion. Keep an eye out in release notes 2.21!

To construct the cross validation you want you would have to make one rule for each of your options. For ex. one rule that validates that if ‘Hours’ is selected, age must be below 24, and another for ‘Days’.

See the rule created in the editor:

  1. aug. 2015 kl. 09.38 skrev Neeraj Gupta neeraj.hisp@gmail.com:

Hello All,

I am using DHIS version 2.20 build revision 19691.

I am having a doubt in Program rules.

We have a case where

Data element ‘Age Type’ has options i.e. Hours/Days/Weeks/Months/Years

Now if the user is selecting ‘Age type’ as Hours then another data element ‘Age’ should accept value between 0 to 23, application should not accept any value more that 23 in case of Hours ‘Age type’.

Similarly, If ‘Age type’ is **Days **then it should not accept more that 6 for ‘Age’ data element.

Can we add these kind of program rules?

Can some one please guide?


Thanks,
Neeraj Gupta


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

Thanks,
Neeraj Gupta

Hi

Strange syntax in that expression: “Less than 24 hours” is the same as #{age}>23 ??? I would have thought it would be #{age} <=23 ??

Regards

Calle

image

···

On 17 August 2015 at 12:49, Neeraj Gupta neeraj.hisp@gmail.com wrote:

Thanks Markus.


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 Mon, Aug 17, 2015 at 1:37 PM, Markus Bekken markus.bekken@gmail.com wrote:

Hi Neeraj.
This kind of cross validation rules is half way supported already, and the full support is right around the corner. The program rule can be created in the editor, it is being run - but how to display the error message in the UI is still under discussion. Keep an eye out in release notes 2.21!

To construct the cross validation you want you would have to make one rule for each of your options. For ex. one rule that validates that if ‘Hours’ is selected, age must be below 24, and another for ‘Days’.

See the rule created in the editor:

  1. aug. 2015 kl. 09.38 skrev Neeraj Gupta neeraj.hisp@gmail.com:

Hello All,

I am using DHIS version 2.20 build revision 19691.

I am having a doubt in Program rules.

We have a case where

Data element ‘Age Type’ has options i.e. Hours/Days/Weeks/Months/Years

Now if the user is selecting ‘Age type’ as Hours then another data element ‘Age’ should accept value between 0 to 23, application should not accept any value more that 23 in case of Hours ‘Age type’.

Similarly, If ‘Age type’ is **Days **then it should not accept more that 6 for ‘Age’ data element.

Can we add these kind of program rules?

Can some one please guide?


Thanks,
Neeraj Gupta


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

Thanks,
Neeraj Gupta


Calle Hedberg

46D Alma Road, 7700 Rosebank, SOUTH AFRICA

Tel/fax (home): +27-21-685-6472

Cell: +27-82-853-5352

Iridium SatPhone: +8816-315-19274

Email: calle.hedberg@gmail.com

Skype: calle_hedberg


Hi Calle,

When the expression is true, action taken is to show an error message. You can say that the expression is not defining a “valid range” - rather the opposite; it is defining what would be concidered invalid. So if you have selected ‘Hours’ as the type, and put a number higher than 23 - we should display the error message provided.

Best regards,

Markus

···

On 17 August 2015 at 12:49, Neeraj Gupta neeraj.hisp@gmail.com wrote:

Thanks Markus.


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 Mon, Aug 17, 2015 at 1:37 PM, Markus Bekken markus.bekken@gmail.com wrote:

Hi Neeraj.
This kind of cross validation rules is half way supported already, and the full support is right around the corner. The program rule can be created in the editor, it is being run - but how to display the error message in the UI is still under discussion. Keep an eye out in release notes 2.21!

To construct the cross validation you want you would have to make one rule for each of your options. For ex. one rule that validates that if ‘Hours’ is selected, age must be below 24, and another for ‘Days’.

See the rule created in the editor:

<Skjermbilde 2015-08-17 kl. 10.00.23.png>

  1. aug. 2015 kl. 09.38 skrev Neeraj Gupta neeraj.hisp@gmail.com:

Hello All,

I am using DHIS version 2.20 build revision 19691.

I am having a doubt in Program rules.

We have a case where

Data element ‘Age Type’ has options i.e. Hours/Days/Weeks/Months/Years

Now if the user is selecting ‘Age type’ as Hours then another data element ‘Age’ should accept value between 0 to 23, application should not accept any value more that 23 in case of Hours ‘Age type’.

Similarly, If ‘Age type’ is **Days **then it should not accept more that 6 for ‘Age’ data element.

Can we add these kind of program rules?

Can some one please guide?


Thanks,
Neeraj Gupta


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

Thanks,
Neeraj Gupta


Calle Hedberg

46D Alma Road, 7700 Rosebank, SOUTH AFRICA

Tel/fax (home): +27-21-685-6472

Cell: +27-82-853-5352

Iridium SatPhone: +8816-315-19274

Email: calle.hedberg@gmail.com

Skype: calle_hedberg