Class ResolveFunction
- java.lang.Object
-
- org.linuxforhealth.fhir.path.function.FHIRPathAbstractFunction
-
- org.linuxforhealth.fhir.path.function.ResolveFunction
-
- All Implemented Interfaces:
FHIRPathFunction
- Direct Known Subclasses:
ServerResolveFunction
public class ResolveFunction extends FHIRPathAbstractFunction
-
-
Constructor Summary
Constructors Constructor Description ResolveFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<FHIRPathNode>
apply(FHIRPathEvaluator.EvaluationContext evaluationContext, java.util.Collection<FHIRPathNode> context, java.util.List<java.util.Collection<FHIRPathNode>> arguments)
For each item in the collection, if it is a string that is a uri (or canonical or url), locate the target of the reference, and add it to the resulting collection.int
getMaxArity()
int
getMinArity()
java.lang.String
getName()
protected boolean
matchesServiceBaseUrl(java.lang.String baseUrl)
protected Resource
resolveRelativeReference(FHIRPathEvaluator.EvaluationContext evaluationContext, FHIRPathNode node, java.lang.String type, java.lang.String logicalId, java.lang.String versionId)
-
Methods inherited from class org.linuxforhealth.fhir.path.function.FHIRPathAbstractFunction
cacheFunctionResult, equals, generateIssue, getCachedFunctionResult, hasCachedFunctionResult, hashCode
-
-
-
-
Method Detail
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceFHIRPathFunction
- Specified by:
getName
in classFHIRPathAbstractFunction
-
getMinArity
public int getMinArity()
- Specified by:
getMinArity
in interfaceFHIRPathFunction
- Specified by:
getMinArity
in classFHIRPathAbstractFunction
-
getMaxArity
public int getMaxArity()
- Specified by:
getMaxArity
in interfaceFHIRPathFunction
- Specified by:
getMaxArity
in classFHIRPathAbstractFunction
-
apply
public java.util.Collection<FHIRPathNode> apply(FHIRPathEvaluator.EvaluationContext evaluationContext, java.util.Collection<FHIRPathNode> context, java.util.List<java.util.Collection<FHIRPathNode>> arguments)
For each item in the collection, if it is a string that is a uri (or canonical or url), locate the target of the reference, and add it to the resulting collection. If the item does not resolve to a resource, the item is ignored and nothing is added to the output collection. The items in the collection may also represent a Reference, in which case the Reference.reference is resolved.This method creates a resource node that is a placeholder for the actual resource, thus allowing for the FHIRPath evaluator to perform type checking on the result of the resolve function. For example:
Observation.subject.where(resolve() is Patient)
If the resource type cannot be inferred from the reference URL or type, then
FHIR_UNKNOWN_RESOURCE_TYPE
is used so that we index these references by default.- Specified by:
apply
in interfaceFHIRPathFunction
- Overrides:
apply
in classFHIRPathAbstractFunction
- Parameters:
evaluationContext
- the evaluation environmentcontext
- the current evaluation contextarguments
- the arguments for this function- Returns:
- the result of the function applied to the context and arguments
-
resolveRelativeReference
protected Resource resolveRelativeReference(FHIRPathEvaluator.EvaluationContext evaluationContext, FHIRPathNode node, java.lang.String type, java.lang.String logicalId, java.lang.String versionId)
-
matchesServiceBaseUrl
protected boolean matchesServiceBaseUrl(java.lang.String baseUrl)
-
-