Sidebar

Can a equalsIgnoreCase compare 'string1' to a nested list in string2?

0 votes
41 views
asked Jul 11 by jamie-t-1662 (140 points)
I am using a condition node to filter messages based on PV1-3 (patient class).  I am wondering if there is more simple way to allow only 2 possible values in this field through.  

Currently I am trying to use a table and return a 'Y' from column 2 if the value exists, then update a var to return boolean  for the condition node.  

I am wondering if there is a way to use something like "IN" or this:

if (StringUtils.equalsIgnoreCase(patientclass , ('this' or 'this1')) { return true;}

Thanks!
commented Jul 11 by jamie-t-1662 (140 points)
Update:
A nested IF works fine for this process.  Just wondering about a more efficient way.

1 Answer

+1 vote

If you had a long list a table with a dotablelookup would work. This would allow you to not have to change code to update existing.

The code would look something like this.

var processPatientClass = StringUtils.equalsIgnoreCase(qie.doTableLookup(message.getNode('PV1-3'), 'notFound', 'tableName', 'sourceColumn', 'targetColumn'), 'Y');
return processPatientClass;

However if it is a short list then a nested if statement may be simpler to use.

answered Jul 11 by brandon-w-8204 (31,160 points)
edited Jul 13 by gary-t-8719
...