Package com.ibm.fhir.path.function
Class ResolveFunction
- java.lang.Object
-
- com.ibm.fhir.path.function.FHIRPathAbstractFunction
-
- com.ibm.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 Collection<FHIRPathNode>
apply(FHIRPathEvaluator.EvaluationContext evaluationContext, Collection<FHIRPathNode> context, List<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()
String
getName()
protected boolean
matchesServiceBaseUrl(String baseUrl)
protected Resource
resolveRelativeReference(FHIRPathEvaluator.EvaluationContext evaluationContext, FHIRPathNode node, String type, String logicalId, String versionId)
-
Methods inherited from class com.ibm.fhir.path.function.FHIRPathAbstractFunction
equals, generateIssue, hashCode
-
-
-
-
Method Detail
-
getName
public 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 Collection<FHIRPathNode> apply(FHIRPathEvaluator.EvaluationContext evaluationContext, Collection<FHIRPathNode> context, List<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, String type, String logicalId, String versionId)
-
matchesServiceBaseUrl
protected boolean matchesServiceBaseUrl(String baseUrl)
-
-