Package org.hl7.fhir.r4.utils
Class LiquidEngine
java.lang.Object
org.hl7.fhir.r4.utils.LiquidEngine
- All Implemented Interfaces:
FHIRPathEngine.IEvaluationContext
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static class
-
Constructor Summary
ConstructorDescriptionLiquidEngine
(IWorkerContext context, FHIRPathEngine.IEvaluationContext hostServices) -
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 functionboolean
conformsToProfile
(FHIRPathEngine engine, Object appContext, Base item, String url) evaluate
(LiquidEngine.LiquidDocument document, Resource resource, Object appContext) executeFunction
(FHIRPathEngine engine, Object appContext, List<Base> focus, String functionName, List<List<Base>> parameters) boolean
when the .log() function is calledresolveConstant
(FHIRPathEngine engine, Object appContext, String name, boolean beforeContext, boolean explicitConstant) A constant reference - e.g.resolveConstantType
(FHIRPathEngine engine, Object appContext, String name, boolean explicitConstant) resolveFunction
(FHIRPathEngine engine, String functionName) resolveReference
(FHIRPathEngine engine, Object appContext, String url, Base base) Implementation of resolve() function.resolveValueSet
(FHIRPathEngine engine, Object appContext, String url) void
setIncludeResolver
(LiquidEngine.ILiquidEngineIcludeResolver includeResolver)
-
Constructor Details
-
LiquidEngine
-
-
Method Details
-
getIncludeResolver
-
setIncludeResolver
-
parse
public LiquidEngine.LiquidDocument parse(String source, String sourceName) throws org.hl7.fhir.exceptions.FHIRException - Throws:
org.hl7.fhir.exceptions.FHIRException
-
evaluate
public String evaluate(LiquidEngine.LiquidDocument document, Resource resource, Object appContext) throws org.hl7.fhir.exceptions.FHIRException - Throws:
org.hl7.fhir.exceptions.FHIRException
-
resolveConstant
public List<Base> resolveConstant(FHIRPathEngine engine, Object appContext, String name, boolean beforeContext, boolean explicitConstant) throws org.hl7.fhir.exceptions.PathEngineException Description copied from interface:FHIRPathEngine.IEvaluationContext
A constant reference - e.g. a reference to a name that must be resolved in context. The % will be removed from the constant name before this is invoked. Variables created with defineVariable will not be processed by resolveConstant (or resolveConstantType) This will also be called if the host invokes the FluentPath engine with a context of null- Specified by:
resolveConstant
in interfaceFHIRPathEngine.IEvaluationContext
- Parameters:
appContext
- - content passed into the fluent path enginename
- - name reference to resolvebeforeContext
- - whether this is being called before the name is resolved locally, or not- Returns:
- the value of the reference (or null, if it's not valid, though can throw an exception if desired)
- Throws:
org.hl7.fhir.exceptions.PathEngineException
-
resolveConstantType
public TypeDetails resolveConstantType(FHIRPathEngine engine, Object appContext, String name, boolean explicitConstant) throws org.hl7.fhir.exceptions.PathEngineException - Specified by:
resolveConstantType
in interfaceFHIRPathEngine.IEvaluationContext
- Throws:
org.hl7.fhir.exceptions.PathEngineException
-
log
Description copied from interface:FHIRPathEngine.IEvaluationContext
when the .log() function is called- Specified by:
log
in interfaceFHIRPathEngine.IEvaluationContext
- Parameters:
argument
-focus
-- Returns:
-
resolveFunction
public FHIRPathUtilityClasses.FunctionDetails resolveFunction(FHIRPathEngine engine, String functionName) - Specified by:
resolveFunction
in interfaceFHIRPathEngine.IEvaluationContext
- 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:FHIRPathEngine.IEvaluationContext
Check the function parameters, and throw an error if they are incorrect, or return the type for the function- Specified by:
checkFunction
in interfaceFHIRPathEngine.IEvaluationContext
- 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 interfaceFHIRPathEngine.IEvaluationContext
- Parameters:
appContext
-functionName
-parameters
-- Returns:
-
resolveReference
public Base resolveReference(FHIRPathEngine engine, Object appContext, String url, Base base) throws org.hl7.fhir.exceptions.FHIRException Description copied from interface:FHIRPathEngine.IEvaluationContext
Implementation of resolve() function. Passed a string, return matching resource, if one is known - else null- Specified by:
resolveReference
in interfaceFHIRPathEngine.IEvaluationContext
- Parameters:
url
- the reference (Reference.reference or the value of the canonical- Returns:
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
conformsToProfile
public boolean conformsToProfile(FHIRPathEngine engine, Object appContext, Base item, String url) throws org.hl7.fhir.exceptions.FHIRException - Specified by:
conformsToProfile
in interfaceFHIRPathEngine.IEvaluationContext
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
resolveValueSet
- Specified by:
resolveValueSet
in interfaceFHIRPathEngine.IEvaluationContext
-