public class FHIRPathEngine extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
FHIRPathEngine.ElementDefinitionMatch |
static class |
FHIRPathEngine.ExpressionNodeWithOffset |
static interface |
FHIRPathEngine.IEvaluationContext |
| Constructor and Description |
|---|
FHIRPathEngine(IWorkerContext worker) |
| Modifier and Type | Method and Description |
|---|---|
TypeDetails |
check(Object appContext,
String resourceType,
String context,
ExpressionNode expr)
check that paths referred to in the ExpressionNode are valid
xPathStartsWithValueRef is a hack work around for the fact that FHIR Path sometimes needs a different starting point than the xpath
returns a list of the possible types that might be returned by executing the ExpressionNode against a particular context
|
TypeDetails |
check(Object appContext,
String resourceType,
String context,
String expr) |
TypeDetails |
check(Object appContext,
StructureDefinition sd,
ExpressionNode expr) |
TypeDetails |
check(Object appContext,
StructureDefinition sd,
String context,
ExpressionNode expr) |
boolean |
convertToBoolean(List<Base> items)
worker routine for converting a set of objects to a boolean representation (for invariants)
|
String |
convertToString(Base item) |
String |
convertToString(List<Base> items)
worker routine for converting a set of objects to a string representation
|
List<Base> |
evaluate(Base base,
ExpressionNode ExpressionNode)
evaluate a path and return the matching elements
|
List<Base> |
evaluate(Base base,
String path)
evaluate a path and return the matching elements
|
List<Base> |
evaluate(Object appContext,
Base focusResource,
Base rootResource,
Base base,
ExpressionNode ExpressionNode)
evaluate a path and return the matching elements
|
List<Base> |
evaluate(Object appContext,
Resource focusResource,
Resource rootResource,
Base base,
ExpressionNode ExpressionNode)
evaluate a path and return the matching elements
|
List<Base> |
evaluate(Object appContext,
Resource focusResource,
Resource rootResource,
Base base,
String path)
evaluate a path and return the matching elements
|
ElementDefinition |
evaluateDefinition(ExpressionNode expr,
StructureDefinition profile,
ElementDefinition element)
given an element definition in a profile, what element contains the differentiating fixed
for the element, given the differentiating expresssion.
|
boolean |
evaluateToBoolean(Object appInfo,
Base focusResource,
Base rootResource,
Base base,
ExpressionNode node)
evaluate a path and return true or false (e.g.
|
boolean |
evaluateToBoolean(Object appInfo,
Resource focusResource,
Resource rootResource,
Base base,
ExpressionNode node)
evaluate a path and return true or false (e.g.
|
boolean |
evaluateToBoolean(Resource focusResource,
Resource rootResource,
Base base,
ExpressionNode node)
evaluate a path and return true or false (e.g.
|
boolean |
evaluateToBoolean(Resource focusResource,
Resource rootResource,
Base base,
String path)
evaluate a path and return true or false (e.g.
|
String |
evaluateToString(Base base,
String path)
evaluate a path and a string containing the outcome (for display)
|
String |
evaluateToString(Object appInfo,
Base focusResource,
Base rootResource,
Base base,
ExpressionNode node) |
String |
forLog() |
protected void |
getChildrenByName(Base item,
String name,
List<Base> result)
Given an item, return all the children that conform to the pattern described in name
Possible patterns:
- a simple name (which may be the base of a name with [] e.g.
|
FHIRPathEngine.IEvaluationContext |
getHostServices() |
org.hl7.fhir.utilities.TerminologyServiceOptions |
getTerminologyServiceOptions() |
IWorkerContext |
getWorker() |
boolean |
hasLog() |
boolean |
isLegacyMode() |
ExpressionNode |
parse(FHIRLexer lexer)
Parse a path that is part of some other syntax
|
ExpressionNode |
parse(String path)
Parse a path for later use using execute
|
ExpressionNode |
parse(String path,
String name) |
FHIRPathEngine.ExpressionNodeWithOffset |
parsePartial(String path,
int i)
Parse a path for later use using execute
|
Quantity |
parseQuantityString(String s) |
void |
setHostServices(FHIRPathEngine.IEvaluationContext constantResolver) |
void |
setLegacyMode(boolean legacyMode) |
String |
takeLog() |
public FHIRPathEngine(IWorkerContext worker)
worker - - used when validating paths (@check), and used doing value set membership when executing tests (once that's defined)public FHIRPathEngine.IEvaluationContext getHostServices()
public void setHostServices(FHIRPathEngine.IEvaluationContext constantResolver)
protected void getChildrenByName(Base item, String name, List<Base> result) throws org.hl7.fhir.exceptions.FHIRException
item - name - result - org.hl7.fhir.exceptions.FHIRExceptionpublic boolean isLegacyMode()
public void setLegacyMode(boolean legacyMode)
public ExpressionNode parse(String path) throws FHIRLexer.FHIRLexerException
path - org.hl7.fhir.exceptions.PathEngineExceptionExceptionFHIRLexer.FHIRLexerExceptionpublic ExpressionNode parse(String path, String name) throws FHIRLexer.FHIRLexerException
FHIRLexer.FHIRLexerExceptionpublic FHIRPathEngine.ExpressionNodeWithOffset parsePartial(String path, int i) throws FHIRLexer.FHIRLexerException
path - org.hl7.fhir.exceptions.PathEngineExceptionExceptionFHIRLexer.FHIRLexerExceptionpublic ExpressionNode parse(FHIRLexer lexer) throws FHIRLexer.FHIRLexerException
org.hl7.fhir.exceptions.PathEngineExceptionExceptionFHIRLexer.FHIRLexerExceptionpublic TypeDetails check(Object appContext, String resourceType, String context, ExpressionNode expr) throws FHIRLexer.FHIRLexerException, org.hl7.fhir.exceptions.PathEngineException, org.hl7.fhir.exceptions.DefinitionException
context - - the logical type against which this path is appliedorg.hl7.fhir.exceptions.DefinitionExceptionorg.hl7.fhir.exceptions.PathEngineExceptionFHIRLexer.FHIRLexerExceptionpublic TypeDetails check(Object appContext, StructureDefinition sd, String context, ExpressionNode expr) throws FHIRLexer.FHIRLexerException, org.hl7.fhir.exceptions.PathEngineException, org.hl7.fhir.exceptions.DefinitionException
FHIRLexer.FHIRLexerExceptionorg.hl7.fhir.exceptions.PathEngineExceptionorg.hl7.fhir.exceptions.DefinitionExceptionpublic TypeDetails check(Object appContext, StructureDefinition sd, ExpressionNode expr) throws FHIRLexer.FHIRLexerException, org.hl7.fhir.exceptions.PathEngineException, org.hl7.fhir.exceptions.DefinitionException
FHIRLexer.FHIRLexerExceptionorg.hl7.fhir.exceptions.PathEngineExceptionorg.hl7.fhir.exceptions.DefinitionExceptionpublic TypeDetails check(Object appContext, String resourceType, String context, String expr) throws FHIRLexer.FHIRLexerException, org.hl7.fhir.exceptions.PathEngineException, org.hl7.fhir.exceptions.DefinitionException
FHIRLexer.FHIRLexerExceptionorg.hl7.fhir.exceptions.PathEngineExceptionorg.hl7.fhir.exceptions.DefinitionExceptionpublic List<Base> evaluate(Base base, ExpressionNode ExpressionNode) throws org.hl7.fhir.exceptions.FHIRException
base - - the object against which the path is being evaluatedExpressionNode - - the parsed ExpressionNode statement to useorg.hl7.fhir.exceptions.FHIRExceptionpublic List<Base> evaluate(Base base, String path) throws org.hl7.fhir.exceptions.FHIRException
base - - the object against which the path is being evaluatedpath - - the FHIR Path statement to useorg.hl7.fhir.exceptions.FHIRExceptionpublic List<Base> evaluate(Object appContext, Resource focusResource, Resource rootResource, Base base, ExpressionNode ExpressionNode) throws org.hl7.fhir.exceptions.FHIRException
base - - the object against which the path is being evaluatedExpressionNode - - the parsed ExpressionNode statement to useorg.hl7.fhir.exceptions.FHIRExceptionpublic List<Base> evaluate(Object appContext, Base focusResource, Base rootResource, Base base, ExpressionNode ExpressionNode) throws org.hl7.fhir.exceptions.FHIRException
base - - the object against which the path is being evaluatedExpressionNode - - the parsed ExpressionNode statement to useorg.hl7.fhir.exceptions.FHIRExceptionpublic List<Base> evaluate(Object appContext, Resource focusResource, Resource rootResource, Base base, String path) throws org.hl7.fhir.exceptions.FHIRException
base - - the object against which the path is being evaluatedpath - - the FHIR Path statement to useorg.hl7.fhir.exceptions.FHIRExceptionpublic boolean evaluateToBoolean(Resource focusResource, Resource rootResource, Base base, String path) throws org.hl7.fhir.exceptions.FHIRException
base - - the object against which the path is being evaluatedpath - - the FHIR Path statement to useorg.hl7.fhir.exceptions.FHIRExceptionpublic boolean evaluateToBoolean(Resource focusResource, Resource rootResource, Base base, ExpressionNode node) throws org.hl7.fhir.exceptions.FHIRException
base - - the object against which the path is being evaluatedorg.hl7.fhir.exceptions.FHIRExceptionpublic boolean evaluateToBoolean(Object appInfo, Resource focusResource, Resource rootResource, Base base, ExpressionNode node) throws org.hl7.fhir.exceptions.FHIRException
appInfo - - application contextbase - - the object against which the path is being evaluatedorg.hl7.fhir.exceptions.FHIRExceptionpublic boolean evaluateToBoolean(Object appInfo, Base focusResource, Base rootResource, Base base, ExpressionNode node) throws org.hl7.fhir.exceptions.FHIRException
base - - the object against which the path is being evaluatedorg.hl7.fhir.exceptions.FHIRExceptionpublic String evaluateToString(Base base, String path) throws org.hl7.fhir.exceptions.FHIRException
base - - the object against which the path is being evaluatedpath - - the FHIR Path statement to useorg.hl7.fhir.exceptions.FHIRExceptionpublic String evaluateToString(Object appInfo, Base focusResource, Base rootResource, Base base, ExpressionNode node) throws org.hl7.fhir.exceptions.FHIRException
org.hl7.fhir.exceptions.FHIRExceptionpublic String convertToString(List<Base> items)
items - - result from @evaluatepublic String convertToString(Base item)
public boolean convertToBoolean(List<Base> items)
items - - result from @evaluatepublic Quantity parseQuantityString(String s)
public boolean hasLog()
public ElementDefinition evaluateDefinition(ExpressionNode expr, StructureDefinition profile, ElementDefinition element) throws org.hl7.fhir.exceptions.DefinitionException
profile - element - org.hl7.fhir.exceptions.PathEngineExceptionorg.hl7.fhir.exceptions.DefinitionExceptionpublic org.hl7.fhir.utilities.TerminologyServiceOptions getTerminologyServiceOptions()
public IWorkerContext getWorker()
Copyright © 2014–2021 Health Level 7. All rights reserved.