Skip to content

Commit

Permalink
Move isTypeSpecifierFunction to InvocationVisitor
Browse files Browse the repository at this point in the history
  • Loading branch information
johngrimes committed Jul 1, 2024
1 parent 54224e1 commit 2b15d19
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@
@SuppressWarnings("unused")
public class StandardFunctions {

public static boolean isTypeSpecifierFunction(@Nonnull final String functionName) {
return "ofType".equals(functionName) || "getReferenceKey".equals(functionName);
}

// TODO: This should be a string collection with a StringCoercible argument
@FhirPathFunction
public static Collection toString(@Nonnull final Collection input) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

package au.csiro.pathling.fhirpath.parser;

import static au.csiro.pathling.fhirpath.function.StandardFunctions.isTypeSpecifierFunction;
import static java.util.Objects.requireNonNull;
import static java.util.function.Predicate.not;
import static java.util.stream.Collectors.toList;
Expand All @@ -32,6 +31,10 @@
import au.csiro.pathling.fhirpath.parser.generated.FhirPathParser.ThisInvocationContext;
import au.csiro.pathling.fhirpath.parser.generated.FhirPathParser.TotalInvocationContext;
import au.csiro.pathling.fhirpath.parser.generated.FhirPathVisitor;
import au.csiro.pathling.fhirpath.path.Paths.EvalFunction;
import au.csiro.pathling.fhirpath.path.Paths.Resource;
import au.csiro.pathling.fhirpath.path.Paths.This;
import au.csiro.pathling.fhirpath.path.Paths.Traversal;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
Expand All @@ -40,10 +43,6 @@
import java.util.stream.Stream;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import au.csiro.pathling.fhirpath.path.Paths.EvalFunction;
import au.csiro.pathling.fhirpath.path.Paths.Resource;
import au.csiro.pathling.fhirpath.path.Paths.This;
import au.csiro.pathling.fhirpath.path.Paths.Traversal;
import org.hl7.fhir.r4.model.Enumerations.ResourceType;

/**
Expand Down Expand Up @@ -71,6 +70,10 @@ public InvocationVisitor() {
this(false);
}

private static boolean isTypeSpecifierFunction(@Nonnull final String functionName) {
return "ofType".equals(functionName) || "getReferenceKey".equals(functionName);
}

/**
* This method gets called when an element is on the right-hand side of the invocation expression,
* or when an identifier is referred to as a term (e.g. "Encounter" or "type").
Expand Down

0 comments on commit 2b15d19

Please sign in to comment.