
Package org.hl7.fhir.r4.fhirpath
Class BaseHostServices
java.lang.Object
org.hl7.fhir.r4.fhirpath.BaseHostServices
- All Implemented Interfaces:
IHostApplicationServices
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IWorkerContext
protected Map
<String, FHIRPathFunctionDefinition> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckFunction
(FHIRPathEngine engine, Object appContext, String functionName, TypeDetails focus, List<TypeDetails> parameters) Check the function parameters, and throw an error if they are incorrect, or return the type for the functionexecuteFunction
(FHIRPathEngine engine, Object appContext, List<Base> focus, String functionName, List<List<Base>> parameters) protected org.hl7.fhir.exceptions.FHIRException
makeException
(String constName, Object... args) registerFunction
(FHIRPathFunctionDefinition function) resolveConstant
(FHIRPathEngine engine, Object appContext, String name, org.hl7.fhir.utilities.fhirpath.FHIRPathConstantEvaluationMode mode) A constant reference - e.g. a reference to a name that must be resolved in context.resolveConstantType
(FHIRPathEngine engine, Object appContext, String name, org.hl7.fhir.utilities.fhirpath.FHIRPathConstantEvaluationMode mode) Compile time support for a constant reference - e.g. a reference to a name that must be resolved in context.resolveFunction
(FHIRPathEngine engine, String functionName) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.hl7.fhir.r4.fhirpath.IHostApplicationServices
conformsToProfile, log, paramIsType, resolveReference, resolveValueSet
-
Field Details
-
context
-
functions
-
-
Constructor Details
-
BaseHostServices
-
-
Method Details
-
resolveFunction
public FHIRPathUtilityClasses.FunctionDetails resolveFunction(FHIRPathEngine engine, String functionName) - Specified by:
resolveFunction
in interfaceIHostApplicationServices
- Parameters:
functionName
-- Returns:
- null if the function is not known
-
checkFunction
public TypeDetails checkFunction(FHIRPathEngine engine, Object appContext, String functionName, TypeDetails focus, List<TypeDetails> parameters) throws org.hl7.fhir.exceptions.PathEngineException Description copied from interface:IHostApplicationServices
Check the function parameters, and throw an error if they are incorrect, or return the type for the function- Specified by:
checkFunction
in interfaceIHostApplicationServices
- Parameters:
functionName
-parameters
-- Returns:
- Throws:
org.hl7.fhir.exceptions.PathEngineException
-
executeFunction
public List<Base> executeFunction(FHIRPathEngine engine, Object appContext, List<Base> focus, String functionName, List<List<Base>> parameters) - Specified by:
executeFunction
in interfaceIHostApplicationServices
- Parameters:
appContext
-functionName
-parameters
-- Returns:
-
registerFunction
-
resolveConstantType
public TypeDetails resolveConstantType(FHIRPathEngine engine, Object appContext, String name, org.hl7.fhir.utilities.fhirpath.FHIRPathConstantEvaluationMode mode) throws org.hl7.fhir.exceptions.PathEngineException Description copied from interface:IHostApplicationServices
Compile time support for a constant reference - e.g. a reference to a name that must be resolved in context. resolveConstant is invoked under 3 different circumstances, which are reflected in the mode parameter: * an explicit constant of the form %{token}, where the token isn't a known internal constant * every evaluation of any expression to allow the Host Application to decide whether to interpret the expression as a constant even if it is not explicitly a constant * at the start of evaluating an expression if the focus provided by the application when invoking the expression is {} The return value is a TypeDetails - a collection, though most constants are singleton values note that variables created using defineVariable() in the FHIRPath expressions will not be processed by resolveConstant (or resolveConstantType)- Specified by:
resolveConstantType
in interfaceIHostApplicationServices
- Parameters:
appContext
- - application context passed into the FHIRPath engine when first executedname
- - name reference to resolve. if mode = EXPLICIT, the % will NOT be in the namemode
- - what situation the reference comes from - see the documentation for @FHIRPathConstantEvaluationMode- Returns:
- the type of the constant, or null, though the host application can choose to throw an exception
- Throws:
org.hl7.fhir.exceptions.PathEngineException
-
makeException
-
resolveConstant
public List<Base> resolveConstant(FHIRPathEngine engine, Object appContext, String name, org.hl7.fhir.utilities.fhirpath.FHIRPathConstantEvaluationMode mode) throws org.hl7.fhir.exceptions.PathEngineException Description copied from interface:IHostApplicationServices
A constant reference - e.g. a reference to a name that must be resolved in context. resolveConstant is invoked under 3 different circumstances, which are reflected in the mode parameter: * an explicit constant of the form %{token}, where the token isn't a known internal constant * every evaluation of any expression to allow the Host Application to decide whether to interpret the expression as a constant even if it is not explicitly a constant * at the start of evaluating an expression if the focus provided by the application when invoking the expression is {} The return value is a List- a collection, though most constants are singleton values note that variables created using defineVariable() in the FHIRPath expressions will not be processed by resolveConstant (or resolveConstantType) - Specified by:
resolveConstant
in interfaceIHostApplicationServices
- Parameters:
appContext
- - application context passed into the FHIRPath engine when first executedname
- - name reference to resolve. if mode = EXPLICIT, the % will NOT be in the namemode
- - what situation the reference comes from - see the documentation for @FHIRPathConstantEvaluationMode- Returns:
- the value of the constant , or an empty list, though the host application can choose to throw an exception
- Throws:
org.hl7.fhir.exceptions.PathEngineException
-