JEXL extended syntax for program rules

Quick question to all you tacker experts out there…

For Program Rules (e.g. for event capture), is the extended JEXL syntax (e.g. =^ for ‘starts with’ … or !^ for ‘not starts with’ etc.) valid? And if so, can we assume this extended skip logic applies to the mobile client?

David

Dear David,
these operators are not supported. See chapter 31.5 for the full list that is supported: http://dhis2.github.io/dhis2-docs/2.21/en/user/html/ch31s05.html

The android and web clients support the same operators.

In table 31.1 you see a list of supported functions, if you create a blueprint with the function(s) you want, we can add them. "d2:startsWith" seems like a useful feature, although we have already discussed adding d2:left and d2:right functions, that could also serve your purpose?

Best regards
Markus

···

26. jan. 2016 kl. 16.19 skrev David Hagan <david.hagan@sagehagan.com>:

Quick question to all you tacker experts out there…

For Program Rules (e.g. for event capture), is the extended JEXL syntax (e.g. =^ for ‘starts with' … or !^ for ‘not starts with’ etc.) valid? And if so, can we assume this extended skip logic applies to the mobile client?

David
_______________________________________________
Mailing list: DHIS 2 Users in Launchpad
Post to : dhis2-users@lists.launchpad.net
Unsubscribe : DHIS 2 Users in Launchpad
More help : ListHelp - Launchpad Help

Hi Markus,

OK, as I suspected. I just saw another reference in the documentation for filters supporting JEXL and was hoping that extended to this as well :slight_smile:

Any function that supports looking inside a string for comparison purposes would be excellent! d2:left and d2:right would work (you might want to add a d2:in to that list as well).

On a slightly more complex question but related to skip-logic potential … I’m comparing the selected value for a data element supplied from an option set. In our case, we have users who could be using one of 3 languages. Rather than having to create a more complex rule to support the different language variations, is there any way of accessing and comparing against the underlying option code? To me, this seems to be a more valid approach to comparing with option names that may ‘change’ due to spelling corrections or in our case, changes in Locale.

Any thoughts?

David

···

On 26 January 2016 at 18:28, Markus Bekken markus.bekken@gmail.com wrote:

Dear David,

these operators are not supported. See chapter 31.5 for the full list that is supported: http://dhis2.github.io/dhis2-docs/2.21/en/user/html/ch31s05.html

The android and web clients support the same operators.

In table 31.1 you see a list of supported functions, if you create a blueprint with the function(s) you want, we can add them. “d2:startsWith” seems like a useful feature, although we have already discussed adding d2:left and d2:right functions, that could also serve your purpose?

Best regards

Markus

  1. jan. 2016 kl. 16.19 skrev David Hagan david.hagan@sagehagan.com:

Quick question to all you tacker experts out there…

For Program Rules (e.g. for event capture), is the extended JEXL syntax (e.g. =^ for ‘starts with’ … or !^ for ‘not starts with’ etc.) valid? And if so, can we assume this extended skip logic applies to the mobile client?

David


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

Hi again David,

writing rules against the option set code would be really useful, and is a requested feature. In the source field config we could specify wether we want to use the option code or the name. Will add a blueprint for this.

Markus

···

On 26 January 2016 at 18:28, Markus Bekken markus.bekken@gmail.com wrote:

Dear David,

these operators are not supported. See chapter 31.5 for the full list that is supported: http://dhis2.github.io/dhis2-docs/2.21/en/user/html/ch31s05.html

The android and web clients support the same operators.

In table 31.1 you see a list of supported functions, if you create a blueprint with the function(s) you want, we can add them. “d2:startsWith” seems like a useful feature, although we have already discussed adding d2:left and d2:right functions, that could also serve your purpose?

Best regards

Markus

  1. jan. 2016 kl. 16.19 skrev David Hagan david.hagan@sagehagan.com:

Quick question to all you tacker experts out there…

For Program Rules (e.g. for event capture), is the extended JEXL syntax (e.g. =^ for ‘starts with’ … or !^ for ‘not starts with’ etc.) valid? And if so, can we assume this extended skip logic applies to the mobile client?

David


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