
Package ca.uhn.fhir.jpa.patch
Class ParsedFhirPath
java.lang.Object
ca.uhn.fhir.jpa.patch.ParsedFhirPath
This class creates and contains a parsed fhirpath.
-
It does not *validate* said fhir path (it might not be a valid path at all).
It is only used for parsing convenience.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A fhirpath node that is actually a function see http://hl7.org/fhirpath/N1/#literalsstatic class
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
boolean
void
getAllNodesWithPred
(List<ParsedFhirPath.FhirPathNode> theNodes, Predicate<ParsedFhirPath.FhirPathNode> thePred) Returns all nodes, ordered, filtering by the provided predicateReturns the fhir path up to the last element.Returns the last non-function, non-value nodegetFirstNode
(Predicate<ParsedFhirPath.FhirPathNode> thePred) getHead()
Returns the final non-function node value in the expression.getNodes
(Predicate<ParsedFhirPath.FhirPathNode> thePred) Retrieve a list of nodes that meet the given predicate.getTail()
getTopLevelPathFromTo
(Predicate<ParsedFhirPath.FhirPathNode> theFromPred, Predicate<ParsedFhirPath.FhirPathNode> theToPred) Returns the top level path from the provided from predicate to the provided to predicate Top level means it will not delve into subpaths.static ParsedFhirPath
Create a ParsedFhirPath from a raw string.void
setEndsWithAnIndex
(boolean theEndsWithAnIndex) void
setEndsWithFilter
(boolean theEndsWithFilter) void
setTail
(ParsedFhirPath.FhirPathNode theTail)
-
Method Details
-
getRawPath
-
getHead
-
setTail
-
getTail
-
setEndsWithFilter
-
endsWithAFilter
-
setEndsWithAnIndex
-
endsWithAnIndex
-
endsWithFilterOrIndex
-
getFirstNode
-
getTopLevelPathFromTo
public String getTopLevelPathFromTo(Predicate<ParsedFhirPath.FhirPathNode> theFromPred, Predicate<ParsedFhirPath.FhirPathNode> theToPred) Returns the top level path from the provided from predicate to the provided to predicate Top level means it will not delve into subpaths. So, given the example Patient.name.where(given.startsWith('homer')).first() you cannot construct a path from "Patient" to "given"- Parameters:
theFromPred
- the inclusive beginning predicatetheToPred
- the exclusive ending predicate- Returns:
-
getContainingPath
Returns the fhir path up to the last element. If there is a filter, it will return the element before the last (filtered) element. -
getAllNodesWithPred
public void getAllNodesWithPred(List<ParsedFhirPath.FhirPathNode> theNodes, Predicate<ParsedFhirPath.FhirPathNode> thePred) Returns all nodes, ordered, filtering by the provided predicate -
getFinalPathNode
Returns the last non-function, non-value node -
getLastElementName
Returns the final non-function node value in the expression. Eg: Patient.name.given -> returns "given" Patient.name.where(given.startsWith("John")) -> returns "given" -
getNodes
Retrieve a list of nodes that meet the given predicate. These nodes may or may not be siblings, but it will not include children of nodes (ie, only top-level nodes). -
parse
Create a ParsedFhirPath from a raw string.
-