Hey davuya,
I think you got it right but would you try to change it a bit by adding an exclamation mark ! to the beginning and changing '[0-9 to d, like the following expression: !d2:validatePattern(A{Idade},'\\d{2}')
So this triggers an action if a number is not two digits.
Hi @dmbantu . Not sure if you are planning to use Android but just wanted to mention that due to this bug ([DHIS2-9854] - Jira) the program rule using the A{XXX} won’t work.
Okay sorry we’d difficulty with the above, but how about making it simple by creating two Program Rules as follows:
Program Rule 1:
A{Idade < 10}
Program Rule 2:
A{Idade > 99}
If you can put that into one expression go ahead. I’m still learning, but it worked this way. And sorry I didn’t know there’s a bug with A{XXX} in Android.
Youre welcome (:… and yes it worked but we still need to figure out how to use the variable directly because A{‘Idade’} isn’t going to work for Android as @jaime.bosque said.