Package ca.uhn.fhir.fhirpath
Interface IFhirPath
public interface IFhirPath
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
This interface is a marker interface representing a parsed FHIRPath expression. -
Method Summary
Modifier and TypeMethodDescriptionevaluate
(IBase theInput, IFhirPath.IParsedExpression theParsedExpression, Class<T> theReturnType) Apply the given FhirPath expression against the given input and return all results in a list.Apply the given FhirPath expression against the given input and return all results in a listevaluateFirst
(IBase theInput, IFhirPath.IParsedExpression theParsedExpression, Class<T> theReturnType) Apply the given FhirPath expression against the given input and return the first match (if any).evaluateFirst
(IBase theInput, String thePath, Class<T> theReturnType) Apply the given FhirPath expression against the given input and return the first match (if any)Parses the expression and throws an exception if it can not parse correctly.void
setEvaluationContext
(IFhirPathEvaluationContext theEvaluationContext) This method can be used optionally to supply an evaluation context for the FHIRPath evaluator instance.
-
Method Details
-
evaluate
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 expressiontheReturnType
- 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 theevaluate(IBase, String, Class)
method which uses a String containing a FHIRPath expression, this method takes a parsed FHIRPath expression returned by theparse(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 byparse(String)
theReturnType
- The type to return (in order to avoid casting)- Since:
- 6.8.0
-
evaluateFirst
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 expressiontheReturnType
- 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 theevaluateFirst(IBase, String, Class)
method which uses a String containing a FHIRPath expression, this method takes a parsed FHIRPath expression returned by theparse(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 byparse(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 theevaluate(IBase, IParsedExpression, Class)
method on any FHIRPath instance that comes from the sameFhirContext
instance. Any other use will produce unspecified results.- Throws:
Exception
-
setEvaluationContext
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 theresolve()
function to fetch referenced resources.- Since:
- 6.4.0
-