dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #40235
Re: Validation Rule for Yes Only Tick boxes
Hi Tim,
unfortunately at the moment validation rules only work for numeric data
elements. Feel free to write a blueprint for support for boolean values.
It will however change the way rules are being evaluated in aggregate
forms. Perhaps this could rather be implemented as an anonymous event
program, where we have support for more sophisticated "program rules"?
regards,
Lars
On Sun, Sep 27, 2015 at 11:52 AM, Timothy Harding <tharding@xxxxxxxxxxxxxx>
wrote:
> Hello Developers,
>
> This is a different question, but tangentially related to my forthcoming
> question about Option Sets:
>
> *How does one make a validation rule using the yes/only tick boxes? *
>
> (The following examples are pretty rudimentary, I've created a blank 2.20
> instance just for testing this logic out) While my example might be a good
> case for the tracker (which has radio buttons for Option Sets), this will
> be all part of a much larger aggregate data entry form.
>
> It seems that analytics interpret a ☑ as a "1" in 2.18 (2.20 the jury is
> still out), which makes doing things like pivot table very straight
> forward. When I applied that logic to the validation rules I have come up
> empty.
>
> So I have three optionCombos for a data element:
> [image: Inline image 1]
>
> I'd like to prevent the user from checking more than one box. *The ideal
> thing would be to make a radio button, but the users don't have the
> time/expertise to set up and maintain a custom form, so I am left with
> validation rules. *
>
> So I made a validation rule where the Left side:
> [image: Inline image 3]
> and the right side is "1"
> [image: Inline image 4]
> and the operator was ==
>
> I tried many variations of operator, and have even put in things that can
> never be true, and in every case I cannot get the validation step to come
> back with anything but passed:[image: Inline image 2]
>
> Am I missing any kind of gotcha or proper syntax for checking "Yes Only"
> values? The only other thing I can think of is to have the user input a "1"
> into a number entry and check that with a validation rule.
>
> I checked what this looked like in the DB, and they are coded as "true"
> just like a Yes/No:
> [image: Inline image 5]
>
> I tried various combinations of "Yes" "yes" "true" "TRUE" and couldn't get
> any to take.
>
> Any help on this would be greatly appreciated. Thanks!
>
>
>
> *Timothy Harding*
> Sr. Systems Analyst, BAO Systems
> +1 202-536-1541 | tharding@xxxxxxxxxxxxxx | http://www.baosystems.com | Skype:
> hardingt@xxxxxxxxx | 2900 K Street, Suite 404, Washington D.C. 20007
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> 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
http://www.dhis2.org <https://www.dhis2.org>
Follow ups
References