/** * 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)); }
/** * 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)); }
/** * evaluate a path and a string containing the outcome (for display) * * @param base - the object against which the path is being evaluated * @param path - the FHIR Path statement to use * @return * @throws FHIRException * @ */ public String evaluateToString(Base base, String path) throws FHIRException { return convertToString(evaluate(base, path)); }
public String evaluateToString(Object appInfo, Base resource, Base base, ExpressionNode node) throws FHIRException { return convertToString(evaluate(appInfo, resource, base, node)); }
@SuppressWarnings("unchecked") @Override public <T extends IBase> List<T> evaluate(IBase theInput, String thePath, Class<T> theReturnType) { List<Base> result; try { result = myEngine.evaluate((Base) theInput, thePath); } catch (FHIRException e) { throw new FluentPathExecutionException(e); } for (Base next : result) { if (!theReturnType.isAssignableFrom(next.getClass())) { throw new FluentPathExecutionException("FluentPath expression \"" + thePath + "\" returned unexpected type " + next.getClass().getSimpleName() + " - Expected " + theReturnType.getName()); } } return (List<T>) result; }
@Override public void evaluate(StringBuilder b, Resource resource, LiquidEngineContext ctxt) throws FHIRException { if (compiled == null) compiled = engine.parse(condition); List<Base> list = engine.evaluate(ctxt, resource, resource, compiled); LiquidEngineContext lctxt = new LiquidEngineContext(ctxt); for (Base o : list) { lctxt.vars.put(varName, o); for (LiquidNode n : body) { n.evaluate(b, resource, lctxt); } } } }
@Override public void evaluate(StringBuilder b, Resource resource, LiquidEngineContext ctxt) throws FHIRException { String src = includeResolver.fetchInclude(LiquidEngine.this, page); LiquidParser parser = new LiquidParser(src); LiquidDocument doc = parser.parse(page); LiquidEngineContext nctxt = new LiquidEngineContext(ctxt.externalContext); Tuple incl = new Tuple(); nctxt.vars.put("include", incl); for (String s : params.keySet()) { incl.addProperty(s, engine.evaluate(ctxt, resource, resource, params.get(s))); } for (LiquidNode n : doc.body) { n.evaluate(b, resource, nctxt); } } }
List<Base> allValues; try { allValues = fp.evaluate((Base) theResource, nextPath); } catch (FHIRException e) { String msg = getContext().getLocalizer().getMessage(BaseSearchParamExtractor.class, "failedToExtractPaths", nextPath, e.toString());
tgt.setUserData(MAP_WHERE_EXPRESSION, expr); List<Base> v = fpe.evaluate(vars, null, tgt.getParameter().size() == 2 ? getParam(vars, tgt.getParameter().get(0)) : new BooleanType(false), expr); if (v.size() == 0) return null;
/** * 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 a string containing the outcome (for display) * * @param base - the object against which the path is being evaluated * @param path - the FHIR Path statement to use * @return * @throws FHIRException * @ */ public String evaluateToString(Base base, String path) throws FHIRException { return convertToString(evaluate(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)); }
/** * 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)); }
public String evaluateToString(Object appInfo, Base resource, Base base, ExpressionNode node) throws FHIRException { return convertToString(evaluate(appInfo, resource, base, node)); }
@SuppressWarnings("unchecked") @Override public <T extends IBase> List<T> evaluate(IBase theInput, String thePath, Class<T> theReturnType) { List<Base> result; try { result = myEngine.evaluate((Base) theInput, thePath); } catch (FHIRException e) { throw new FluentPathExecutionException(e); } for (Base next : result) { if (!theReturnType.isAssignableFrom(next.getClass())) { throw new FluentPathExecutionException("FluentPath expression \"" + thePath + "\" returned unexpected type " + next.getClass().getSimpleName() + " - Expected " + theReturnType.getName()); } } return (List<T>) result; }
@Override public void evaluate(StringBuilder b, Resource resource, LiquidEngineContext ctxt) throws FHIRException { if (compiled == null) compiled = engine.parse(condition); List<Base> list = engine.evaluate(ctxt, resource, resource, compiled); LiquidEngineContext lctxt = new LiquidEngineContext(ctxt); for (Base o : list) { lctxt.vars.put(varName, o); for (LiquidNode n : body) { n.evaluate(b, resource, lctxt); } } } }
@Override public void evaluate(StringBuilder b, Resource resource, LiquidEngineContext ctxt) throws FHIRException { String src = includeResolver.fetchInclude(LiquidEngine.this, page); LiquidParser parser = new LiquidParser(src); LiquidDocument doc = parser.parse(page); LiquidEngineContext nctxt = new LiquidEngineContext(ctxt.externalContext); Tuple incl = new Tuple(); nctxt.vars.put("include", incl); for (String s : params.keySet()) { incl.addProperty(s, engine.evaluate(ctxt, resource, resource, params.get(s))); } for (LiquidNode n : doc.body) { n.evaluate(b, resource, nctxt); } } }