LogicService ls = Context.getLogicService();
LogicCriteria logicCriteria = null;
try {
logicCriteria = ls.parse(testStr);
} catch (Exception ex) {
throw new BadFormDesignException(ex.getMessage());
}
if (logicCriteria != null) {
if ("testing-html-form-entry".equals(session.getPatient().getUuid()))
return false;
else {
try {
return ls.eval(session.getPatient(), logicCriteria).toBoolean();
} catch (Exception ex) {
throw new BadFormDesignException(ex.getMessage());
}
}
} else {
throw new BadFormDesignException("The " + testStr + "is not a valid logic expression");//throw a bad form desigm
}
}