Class ResolveFunction

    • Constructor Detail

      • ResolveFunction

        public ResolveFunction()
    • Method Detail

      • 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 interface FHIRPathFunction
        Overrides:
        apply in class FHIRPathAbstractFunction
        Parameters:
        evaluationContext - the evaluation environment
        context - the current evaluation context
        arguments - the arguments for this function
        Returns:
        the result of the function applied to the context and arguments