Interface IFhirPath


public interface IFhirPath
  • Method Details

    • evaluate

      <T extends IBase> List<T> evaluate(IBase theInput, String thePath, Class<T> theReturnType)
      Apply the given FhirPath expression against the given input and return all results in a list
      Parameters:
      theInput - The input object (generally a resource or datatype)
      thePath - The fluent path expression
      theReturnType - The type to return (in order to avoid casting)
    • evaluate

      <T extends IBase> List<T> evaluate(IBase theInput, IFhirPath.IParsedExpression theParsedExpression, Class<T> theReturnType)
      Apply the given FhirPath expression against the given input and return all results in a list. Unlike the evaluate(IBase, String, Class) method which uses a String containing a FHIRPath expression, this method takes a parsed FHIRPath expression returned by the parse(String) method. This has the advantage of avoiding re-parsing expressions if the same expression will be evaluated repeatedly.
      Parameters:
      theInput - The input object (generally a resource or datatype)
      theParsedExpression - A parsed FHIRPath expression returned by parse(String)
      theReturnType - The type to return (in order to avoid casting)
      Since:
      6.8.0
    • evaluateFirst

      <T extends IBase> Optional<T> evaluateFirst(IBase theInput, String thePath, Class<T> theReturnType)
      Apply the given FhirPath expression against the given input and return the first match (if any)
      Parameters:
      theInput - The input object (generally a resource or datatype)
      thePath - The fluent path expression
      theReturnType - The type to return (in order to avoid casting)
    • evaluateFirst

      <T extends IBase> Optional<T> evaluateFirst(IBase theInput, IFhirPath.IParsedExpression theParsedExpression, Class<T> theReturnType)
      Apply the given FhirPath expression against the given input and return the first match (if any). Unlike the evaluateFirst(IBase, String, Class) method which uses a String containing a FHIRPath expression, this method takes a parsed FHIRPath expression returned by the parse(String) method. This has the advantage of avoiding re-parsing expressions if the same expression will be evaluated repeatedly.
      Parameters:
      theInput - The input object (generally a resource or datatype)
      theParsedExpression - A parsed FHIRPath expression returned by parse(String)
      theReturnType - The type to return (in order to avoid casting)
      Since:
      6.8.0
    • parse

      Parses the expression and throws an exception if it can not parse correctly. Note that the return type from this method is intended to be a "black box". It can be passed back into the evaluate(IBase, IParsedExpression, Class) method on any FHIRPath instance that comes from the same FhirContext instance. Any other use will produce unspecified results.
      Throws:
      Exception
    • setEvaluationContext

      void setEvaluationContext(@Nonnull IFhirPathEvaluationContext theEvaluationContext)
      This method can be used optionally to supply an evaluation context for the FHIRPath evaluator instance. The context can be used to supply data needed by specific functions, e.g. allowing the resolve() function to fetch referenced resources.
      Since:
      6.4.0