d2:validatePattern

Hi there evryone,

has anybody out there been succesful with the d2:validatePattern pattern program rule,

i impliment it by: !d2:validatePattern(A{index_id} ,‘\d{6}/\d{2}/\d’) which i coppied from the dhis2 user guide and added my own A{} but i get this error:

d2:validatePattern was called with the incorrect number of parameters

my question is how many parameters are required. if they are two can someone give the right format for this.

···

Simon Robert Kununka
DHIS2 implimentor, Analyst and Consultant

Uganda-Kampala
Direct: +256-777-108-323
E-mail: nomisrmugisa@gmail.com

“Don’t wish it was easier, wish you were better. Don’t wish for less problems, wish for more skills. Don’t wish for less change , wish for more wisdom.”

This message and its attachments are confidential and solely for the intended recipients. If received in error, please delete them and notify the sender via reply e-mail immediately.

Hi Simon.

The expression below seems all correct. Tested the same in 2.27 snapshot and it works. Which version are you on? Do you have other rules working for the same variable A{index_id}?

Markus

···

Simon Robert Kununka
DHIS2 implimentor, Analyst and Consultant

Uganda-Kampala
Direct: +256-777-108-323
E-mail: nomisrmugisa@gmail.com

“Don’t wish it was easier, wish you were better. Don’t wish for less problems, wish for more skills. Don’t wish for less change , wish for more wisdom.”

This message and its attachments are confidential and solely for the intended recipients. If received in error, please delete them and notify the sender via reply e-mail immediately.