private List<Base> opXor(List<Base> left, List<Base> right) { if (left.isEmpty() || right.isEmpty()) return new ArrayList<Base>(); else return makeBoolean(convertToBoolean(left) ^ convertToBoolean(right)); }
/** * evaluate a path and return true or false (e.g. for an invariant) * * @param base - the object against which the path is being evaluated * @return * @throws FHIRException * @ */ public boolean evaluateToBoolean(Base resource, Base base, ExpressionNode node) throws FHIRException { return convertToBoolean(evaluate(null, resource, base, node)); }
private List<Base> opImplies(List<Base> left, List<Base> right) { if (!convertToBoolean(left)) return makeBoolean(true); else if (right.size() == 0) return new ArrayList<Base>(); else return makeBoolean(convertToBoolean(right)); }
/** * evaluate a path and return true or false (e.g. for an invariant) * * @param base - the object against which the path is being evaluated * @param path - the FHIR Path statement to use * @return * @throws FHIRException * @ */ public boolean evaluateToBoolean(Resource resource, Base base, String path) throws FHIRException { return convertToBoolean(evaluate(null, resource, base, path)); }
private List<Base> funcNot(ExecutionContext context, List<Base> focus, ExpressionNode exp) { return makeBoolean(!convertToBoolean(focus)); }
private List<Base> opOr(List<Base> left, List<Base> right) { if (left.isEmpty() && right.isEmpty()) return new ArrayList<Base>(); else if (convertToBoolean(left) || convertToBoolean(right)) return makeBoolean(true); else if (left.isEmpty() || right.isEmpty()) return new ArrayList<Base>(); else return makeBoolean(false); }
/** * evaluate a path and return true or false (e.g. for an invariant) * * @param base - the object against which the path is being evaluated * @return * @throws FHIRException * @ */ public boolean evaluateToBoolean(Resource resource, Base base, ExpressionNode node) throws FHIRException { return convertToBoolean(evaluate(null, resource, base, node)); }
/** * evaluate a path and return true or false (e.g. for an invariant) * * @param appInfo - application context * @param base - the object against which the path is being evaluated * @return * @throws FHIRException * @ */ public boolean evaluateToBoolean(Object appInfo, Base resource, Base base, ExpressionNode node) throws FHIRException { return convertToBoolean(evaluate(appInfo, resource, base, node)); }
private List<Base> funcWhere(ExecutionContext context, List<Base> focus, ExpressionNode exp) throws FHIRException { List<Base> result = new ArrayList<Base>(); List<Base> pc = new ArrayList<Base>(); for (Base item : focus) { pc.clear(); pc.add(item); if (convertToBoolean(execute(changeThis(context, item), pc, exp.getParameters().get(0), true))) result.add(item); } return result; }
private List<Base> opAnd(List<Base> left, List<Base> right) { if (left.isEmpty() && right.isEmpty()) return new ArrayList<Base>(); else if (isBoolean(left, false) || isBoolean(right, false)) return makeBoolean(false); else if (left.isEmpty() || right.isEmpty()) return new ArrayList<Base>(); else if (convertToBoolean(left) && convertToBoolean(right)) return makeBoolean(true); else return makeBoolean(false); }
private List<Base> funcIif(ExecutionContext context, List<Base> focus, ExpressionNode exp) throws FHIRException { List<Base> n1 = execute(context, focus, exp.getParameters().get(0), true); Boolean v = convertToBoolean(n1); if (v) return execute(context, focus, exp.getParameters().get(1), true); else if (exp.getParameters().size() < 3) return new ArrayList<Base>(); else return execute(context, focus, exp.getParameters().get(2), true); }
pc.clear(); pc.add(item); if (!convertToBoolean(execute(changeThis(context, item), pc, exp.getParameters().get(0), true))) { all = false; break;
private List<Base> preOperate(List<Base> left, Operation operation) { switch (operation) { case And: return isBoolean(left, false) ? makeBoolean(false) : null; case Or: return isBoolean(left, true) ? makeBoolean(true) : null; case Implies: return convertToBoolean(left) ? null : makeBoolean(true); default: return null; } }
private List<Base> opXor(List<Base> left, List<Base> right) { if (left.isEmpty() || right.isEmpty()) return new ArrayList<Base>(); else return makeBoolean(convertToBoolean(left) ^ convertToBoolean(right)); }
/** * evaluate a path and return true or false (e.g. for an invariant) * * @param base - the object against which the path is being evaluated * @param path - the FHIR Path statement to use * @return * @throws FHIRException * @ */ public boolean evaluateToBoolean(Resource resource, Base base, String path) throws FHIRException { return convertToBoolean(evaluate(null, resource, base, path)); }
/** * evaluate a path and return true or false (e.g. for an invariant) * * @param base - the object against which the path is being evaluated * @return * @throws FHIRException * @ */ public boolean evaluateToBoolean(Resource resource, Base base, ExpressionNode node) throws FHIRException { return convertToBoolean(evaluate(null, resource, base, node)); }
/** * evaluate a path and return true or false (e.g. for an invariant) * * @param appInfo - application context * @param base - the object against which the path is being evaluated * @return * @throws FHIRException * @ */ public boolean evaluateToBoolean(Object appInfo, Base resource, Base base, ExpressionNode node) throws FHIRException { return convertToBoolean(evaluate(appInfo, resource, base, node)); }
private List<Base> opOr(List<Base> left, List<Base> right) { if (left.isEmpty() && right.isEmpty()) return new ArrayList<Base>(); else if (convertToBoolean(left) || convertToBoolean(right)) return makeBoolean(true); else if (left.isEmpty() || right.isEmpty()) return new ArrayList<Base>(); else return makeBoolean(false); }
private List<Base> opAnd(List<Base> left, List<Base> right) { if (left.isEmpty() && right.isEmpty()) return new ArrayList<Base>(); else if (isBoolean(left, false) || isBoolean(right, false)) return makeBoolean(false); else if (left.isEmpty() || right.isEmpty()) return new ArrayList<Base>(); else if (convertToBoolean(left) && convertToBoolean(right)) return makeBoolean(true); else return makeBoolean(false); }
private List<Base> funcIif(ExecutionContext context, List<Base> focus, ExpressionNode exp) throws FHIRException { List<Base> n1 = execute(context, focus, exp.getParameters().get(0), true); Boolean v = convertToBoolean(n1); if (v) return execute(context, focus, exp.getParameters().get(1), true); else if (exp.getParameters().size() < 3) return new ArrayList<Base>(); else return execute(context, focus, exp.getParameters().get(2), true); }