Help with an error message: Boolean cannot be cast to java.lang.String

Hi all,
Anyone have any insights for me on how to resolve this error message?

Error evaluating antibiotics:
java.lang.ClassCastException:java.lang.Boolean cannot be cast to
java.lang.String=> java.lang.ClassCastException[java.lang.Boolean cannot be
cast to java.lang.String]

The field "antibiotics" is a calculate field with the following
calculation:

if(selected(${medicina}, 'amoxicilina') or selected(${medicina},
'ampicilina_ampibex') or selected(${medicina}, 'bactrim') or
selected(${medicina}, 'benzipenicilina') or selected(${medicina},
'biconcilina_c') or selected(${medicina}, 'cefalexina') or
selected(${medicina}, 'azitromicina') or selected(${medicina}, 'nor
selected(${medicina},floxacina') or selected(${medicina},
'ciprofloxacina') or selected(${medicina}, 'cotrimoxazol') or
selected(${medicina}, 'dicloxacilina') or selected(${medicina},
'diclocil') or selected(${medicina}, 'garamicina') or
selected(${medicina}, 'gentamicina') or selected(${medicina},
'megacilina') or selected(${medicina}, 'paramomicina') or
selected(${medicina}, 'sulfas') or selected(${medicina}, 'sulfatiazol')
or selected(${medicina}, 'sulfatrim') or selected(${medicina},
'terramicina') or selected(${medicina}, 'tetraciclina') or
selected(${medicina}, 'trimetroprin') or selected(${medicina}, 'nr_ab')
or selected(${medicina}, 'augmentin') or selected(${medicina},
'benzetacil') or selected(${medicina}, 'cefuroxima') or
selected(${medicina}, 'claritromicina') or selected(${medicina},
'clindamicina') or selected(${medicina}, 'clor
selected(${medicina},anfenicol') or selected(${medicina}, 'duracef') or
selected(${medicina}, 'eritromicina') or selected(${medicina},
'izoniacida') or selected(${medicina}, 'pantomicina') or
selected(${medicina}, 'pirazinamida') or selected(${medicina},
'rifampicina') or selected(${medicina}, 'rocephin'), 'abs_si', 'abs_no')

I am later using this long field to only start a new group if the answer to
${antibiotics} is 'abs_no'

Would it be better to replace 'abs_si' with TRUE and 'abs_no' with FALSE
and then condition based on TRUE or FALSE in the subsequent group?

Thanks for any help anyone's able to provide

Karen

I think you just have an error in your formula, at the 5th line:

selected(${medicina}, 'azitromicina') or selected(${medicina}, 'nor

the last selected() is missing some characters and a closing parenthesis.

If these are medicines in a certain group (e.g., penicillin derivatives),
you might be better off asking first whether any derivatives have been
prescribed, and then asking which ones.

The first question is then equivalent to the above calculated value, and
the details of which were prescribed are gathered by the second question
(which is only relevant if you answered yes to the first).

Of course, this assumes a knowledgeable staff member is filling out the
form...

··· On Tue, Apr 15, 2014 at 10:55 AM, Karen Levy wrote:

Hi all,
Anyone have any insights for me on how to resolve this error message?

Error evaluating antibiotics:
java.lang.ClassCastException:java.lang.Boolean cannot be cast to
java.lang.String=> java.lang.ClassCastException[java.lang.Boolean cannot be
cast to java.lang.String]

The field "antibiotics" is a calculate field with the following
calculation:

if(selected(${medicina}, 'amoxicilina') or selected(${medicina},
'ampicilina_ampibex') or selected(${medicina}, 'bactrim') or
selected(${medicina}, 'benzipenicilina') or selected(${medicina},
'biconcilina_c') or selected(${medicina}, 'cefalexina') or
selected(${medicina}, 'azitromicina') or selected(${medicina}, 'nor
selected(${medicina},floxacina') or selected(${medicina},
'ciprofloxacina') or selected(${medicina}, 'cotrimoxazol') or
selected(${medicina}, 'dicloxacilina') or selected(${medicina},
'diclocil') or selected(${medicina}, 'garamicina') or
selected(${medicina}, 'gentamicina') or selected(${medicina},
'megacilina') or selected(${medicina}, 'paramomicina') or
selected(${medicina}, 'sulfas') or selected(${medicina}, 'sulfatiazol')
or selected(${medicina}, 'sulfatrim') or selected(${medicina},
'terramicina') or selected(${medicina}, 'tetraciclina') or
selected(${medicina}, 'trimetroprin') or selected(${medicina}, 'nr_ab')
or selected(${medicina}, 'augmentin') or selected(${medicina},
'benzetacil') or selected(${medicina}, 'cefuroxima') or
selected(${medicina}, 'claritromicina') or selected(${medicina},
'clindamicina') or selected(${medicina}, 'clor
selected(${medicina},anfenicol') or selected(${medicina}, 'duracef') or
selected(${medicina}, 'eritromicina') or selected(${medicina},
'izoniacida') or selected(${medicina}, 'pantomicina') or
selected(${medicina}, 'pirazinamida') or selected(${medicina},
'rifampicina') or selected(${medicina}, 'rocephin'), 'abs_si', 'abs_no')

I am later using this long field to only start a new group if the answer
to ${antibiotics} is 'abs_no'

Would it be better to replace 'abs_si' with TRUE and 'abs_no' with FALSE
and then condition based on TRUE or FALSE in the subsequent group?

Thanks for any help anyone's able to provide

Karen

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Thank you Mitch! I will try fixing that and seeing if that resolves the problem.

··· > On Apr 15, 2014, at 8:28 PM, Mitch Sundt wrote: > > I think you just have an error in your formula, at the 5th line: > > selected(${medicina}, 'azitromicina') or selected(${medicina}, 'nor > > the last selected() is missing some characters and a closing parenthesis. > > If these are medicines in a certain group (e.g., penicillin derivatives), you might be better off asking first whether any derivatives have been prescribed, and then asking which ones. > > The first question is then equivalent to the above calculated value, and the details of which were prescribed are gathered by the second question (which is only relevant if you answered yes to the first). > > Of course, this assumes a knowledgeable staff member is filling out the form... > > > >> On Tue, Apr 15, 2014 at 10:55 AM, Karen Levy wrote: >> Hi all, >> Anyone have any insights for me on how to resolve this error message? >> >> Error evaluating antibiotics: java.lang.ClassCastException:java.lang.Boolean cannot be cast to java.lang.String=> java.lang.ClassCastException[java.lang.Boolean cannot be cast to java.lang.String] >> >> The field "antibiotics" is a calculate field with the following calculation: >> >> if(selected(${medicina}, 'amoxicilina') or selected(${medicina}, 'ampicilina_ampibex') or selected(${medicina}, 'bactrim') or selected(${medicina}, 'benzipenicilina') or selected(${medicina}, 'biconcilina_c') or selected(${medicina}, 'cefalexina') or selected(${medicina}, 'azitromicina') or selected(${medicina}, 'nor selected(${medicina},floxacina') or selected(${medicina}, 'ciprofloxacina') or selected(${medicina}, 'cotrimoxazol') or selected(${medicina}, 'dicloxacilina') or selected(${medicina}, 'diclocil') or selected(${medicina}, 'garamicina') or selected(${medicina}, 'gentamicina') or selected(${medicina}, 'megacilina') or selected(${medicina}, 'paramomicina') or selected(${medicina}, 'sulfas') or selected(${medicina}, 'sulfatiazol') or selected(${medicina}, 'sulfatrim') or selected(${medicina}, 'terramicina') or selected(${medicina}, 'tetraciclina') or selected(${medicina}, 'trimetroprin') or selected(${medicina}, 'nr_ab') or selected(${medicina}, 'augmentin') or selected(${medicina}, 'benzetacil') or selected(${medicina}, 'cefuroxima') or selected(${medicina}, 'claritromicina') or selected(${medicina}, 'clindamicina') or selected(${medicina}, 'clor selected(${medicina},anfenicol') or selected(${medicina}, 'duracef') or selected(${medicina}, 'eritromicina') or selected(${medicina}, 'izoniacida') or selected(${medicina}, 'pantomicina') or selected(${medicina}, 'pirazinamida') or selected(${medicina}, 'rifampicina') or selected(${medicina}, 'rocephin'), 'abs_si', 'abs_no') >> >> I am later using this long field to only start a new group if the answer to ${antibiotics} is 'abs_no' >> >> Would it be better to replace 'abs_si' with TRUE and 'abs_no' with FALSE and then condition based on TRUE or FALSE in the subsequent group? >> >> Thanks for any help anyone's able to provide >> >> Karen >> -- >> -- >> Post: opendatakit@googlegroups.com >> Unsubscribe: opendatakit+unsubscribe@googlegroups.com >> Options: http://groups.google.com/group/opendatakit?hl=en >> >> --- >> You received this message because you are subscribed to the Google Groups "ODK Community" group. >> To unsubscribe from this group and stop receiving emails from it, send an email to opendatakit+unsubscribe@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. > > > > -- > Mitch Sundt > Software Engineer > University of Washington > mitchellsundt@gmail.com > -- > -- > Post: opendatakit@googlegroups.com > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > Options: http://groups.google.com/group/opendatakit?hl=en > > --- > You received this message because you are subscribed to a topic in the Google Groups "ODK Community" group. > To unsubscribe from this topic, visit https://groups.google.com/d/topic/opendatakit/RAH62u3nbwY/unsubscribe. > To unsubscribe from this group and all its topics, send an email to opendatakit+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout.