Class FHIRPathEvaluator


  • @NotThreadSafe
    public class FHIRPathEvaluator
    extends java.lang.Object
    A FHIRPath evaluation engine that implements the FHIRPath 2.0.0 specification
    • Field Detail

      • SINGLETON_TRUE

        public static final java.util.Collection<FHIRPathNode> SINGLETON_TRUE
      • SINGLETON_FALSE

        public static final java.util.Collection<FHIRPathNode> SINGLETON_FALSE
    • Method Detail

      • getEvaluationContext

        public FHIRPathEvaluator.EvaluationContext getEvaluationContext()
        Get the EvaluationContext associated with this FHIRPathEvaluator
        Returns:
        get the EvaluationContext associated with this FHIRPathEvaluator
      • evaluate

        public java.util.Collection<FHIRPathNode> evaluate​(java.lang.String expr)
                                                    throws FHIRPathException
        Evaluate a FHIRPath expression
        Parameters:
        expr - the FHIRPath expression to evaluate
        Returns:
        the result of evaluation as a non-null, potentially empty collection of FHIRPath nodes
        Throws:
        java.lang.NullPointerException - if any of the parameters are null
        FHIRPathException - if an exception occurs during evaluation
      • evaluate

        public java.util.Collection<FHIRPathNode> evaluate​(Visitable resourceOrElement,
                                                           java.lang.String expr)
                                                    throws FHIRPathException
        Evaluate a FHIRPath expression against a Resource or Element
        Parameters:
        resourceOrElement - the Resource or Element
        expr - the FHIRPath expression to evaluate
        Returns:
        the result of evaluation as a non-null, potentially empty collection of FHIRPath nodes
        Throws:
        java.lang.NullPointerException - if any of the parameters are null
        FHIRPathException - if an exception occurs during evaluation
      • evaluate

        public java.util.Collection<FHIRPathNode> evaluate​(Resource resource,
                                                           java.lang.String expr)
                                                    throws FHIRPathException
        Evaluate a FHIRPath expression against a Resource
        Parameters:
        resource - the resource
        expr - the FHIRPath expression to evaluate
        Returns:
        the result of evaluation as a non-null, potentially empty collection of FHIRPath nodes
        Throws:
        java.lang.NullPointerException - if any of the parameters are null
        FHIRPathException - if an exception occurs during evaluation
      • evaluate

        public java.util.Collection<FHIRPathNode> evaluate​(Element element,
                                                           java.lang.String expr)
                                                    throws FHIRPathException
        Evaluate a FHIRPath expression against an Element
        Parameters:
        element - the element
        expr - the FHIRPath expression to evaluate
        Returns:
        the result of evaluation as a non-null, potentially empty collection of FHIRPath nodes
        Throws:
        java.lang.NullPointerException - if any of the parameters are null
        FHIRPathException - if an exception occurs during evaluation
      • evaluate

        public java.util.Collection<FHIRPathNode> evaluate​(FHIRPathEvaluator.EvaluationContext evaluationContext,
                                                           java.lang.String expr)
                                                    throws FHIRPathException
        Evaluate a FHIRPath expression using an existing evaluation context
        Parameters:
        evaluationContext - the evaluation context
        expr - the FHIRPath expression to evaluate
        Returns:
        the result of evaluation as a non-null, potentially empty collection of FHIRPath nodes
        Throws:
        java.lang.NullPointerException - if any of the parameters are null
        FHIRPathException - if an exception occurs during evaluation
      • evaluate

        public java.util.Collection<FHIRPathNode> evaluate​(FHIRPathEvaluator.EvaluationContext evaluationContext,
                                                           java.lang.String expr,
                                                           FHIRPathNode node)
                                                    throws FHIRPathException
        Evaluate a FHIRPath expression using an existing evaluation context against a FHIRPath node
        Parameters:
        evaluationContext - the evaluation context
        expr - the FHIRPath expression to evaluate
        node - the FHIRPath node
        Returns:
        the result of evaluation as a non-null, potentially empty collection of FHIRPath nodes
        Throws:
        java.lang.NullPointerException - if any of the parameters are null
        FHIRPathException - if an exception occurs during evaluation
      • evaluate

        public java.util.Collection<FHIRPathNode> evaluate​(FHIRPathEvaluator.EvaluationContext evaluationContext,
                                                           java.lang.String expr,
                                                           java.util.Collection<FHIRPathNode> initialContext)
                                                    throws FHIRPathException
        Evaluate a FHIRPathExpression using an existing EvaluationContext against a collection of FHIRPath nodes
        Parameters:
        evaluationContext - the evaluation context
        expr - the FHIRPath expression to evaluate
        initialContext - the initial context as a non-null, potentially empty collection of FHIRPath nodes
        Returns:
        the result of evaluation as a collection of FHIRPath nodes
        Throws:
        java.lang.NullPointerException - if any of the parameters are null
        FHIRPathException - if an exception occurs during evaluation
      • evaluator

        public static FHIRPathEvaluator evaluator()
        Static factory method for creating FHIRPathEvaluator instances
        Returns:
        a new FHIRPathEvaluator instance