Package org.hl7.fhir.r4.utils
Class LiquidEngine
- java.lang.Object
-
- org.hl7.fhir.r4.utils.LiquidEngine
-
- All Implemented Interfaces:
FHIRPathEngine.IEvaluationContext
public class LiquidEngine extends Object implements FHIRPathEngine.IEvaluationContext
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceLiquidEngine.ILiquidEngineIcludeResolverstatic classLiquidEngine.LiquidDocument-
Nested classes/interfaces inherited from interface org.hl7.fhir.r4.utils.FHIRPathEngine.IEvaluationContext
FHIRPathEngine.IEvaluationContext.FunctionDetails
-
-
Constructor Summary
Constructors Constructor Description LiquidEngine(IWorkerContext context, FHIRPathEngine.IEvaluationContext hostServices)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TypeDetailscheckFunction(Object appContext, String functionName, List<TypeDetails> parameters)Check the function parameters, and throw an error if they are incorrect, or return the type for the functionbooleanconformsToProfile(Object appContext, Base item, String url)Stringevaluate(LiquidEngine.LiquidDocument document, Resource resource, Object appContext)List<Base>executeFunction(Object appContext, String functionName, List<List<Base>> parameters)LiquidEngine.ILiquidEngineIcludeResolvergetIncludeResolver()booleanlog(String argument, List<Base> focus)when the .log() function is calledLiquidEngine.LiquidDocumentparse(String source, String sourceName)BaseresolveConstant(Object appContext, String name, boolean beforeContext)A constant reference - e.g.TypeDetailsresolveConstantType(Object appContext, String name)FHIRPathEngine.IEvaluationContext.FunctionDetailsresolveFunction(String functionName)BaseresolveReference(Object appContext, String url)Implementation of resolve() function.ValueSetresolveValueSet(Object appContext, String url)voidsetIncludeResolver(LiquidEngine.ILiquidEngineIcludeResolver includeResolver)
-
-
-
Constructor Detail
-
LiquidEngine
public LiquidEngine(IWorkerContext context, FHIRPathEngine.IEvaluationContext hostServices)
-
-
Method Detail
-
getIncludeResolver
public LiquidEngine.ILiquidEngineIcludeResolver getIncludeResolver()
-
setIncludeResolver
public void setIncludeResolver(LiquidEngine.ILiquidEngineIcludeResolver includeResolver)
-
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 Base resolveConstant(Object appContext, String name, boolean beforeContext) throws org.hl7.fhir.exceptions.PathEngineException
Description copied from interface:FHIRPathEngine.IEvaluationContextA 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. This will also be called if the host invokes the FluentPath engine with a context of null- Specified by:
resolveConstantin 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(Object appContext, String name) throws org.hl7.fhir.exceptions.PathEngineException
- Specified by:
resolveConstantTypein interfaceFHIRPathEngine.IEvaluationContext- Throws:
org.hl7.fhir.exceptions.PathEngineException
-
log
public boolean log(String argument, List<Base> focus)
Description copied from interface:FHIRPathEngine.IEvaluationContextwhen the .log() function is called- Specified by:
login interfaceFHIRPathEngine.IEvaluationContext- Returns:
-
resolveFunction
public FHIRPathEngine.IEvaluationContext.FunctionDetails resolveFunction(String functionName)
- Specified by:
resolveFunctionin interfaceFHIRPathEngine.IEvaluationContext- Returns:
- null if the function is not known
-
checkFunction
public TypeDetails checkFunction(Object appContext, String functionName, List<TypeDetails> parameters) throws org.hl7.fhir.exceptions.PathEngineException
Description copied from interface:FHIRPathEngine.IEvaluationContextCheck the function parameters, and throw an error if they are incorrect, or return the type for the function- Specified by:
checkFunctionin interfaceFHIRPathEngine.IEvaluationContext- Returns:
- Throws:
org.hl7.fhir.exceptions.PathEngineException
-
executeFunction
public List<Base> executeFunction(Object appContext, String functionName, List<List<Base>> parameters)
- Specified by:
executeFunctionin interfaceFHIRPathEngine.IEvaluationContext- Returns:
-
resolveReference
public Base resolveReference(Object appContext, String url) throws org.hl7.fhir.exceptions.FHIRException
Description copied from interface:FHIRPathEngine.IEvaluationContextImplementation of resolve() function. Passed a string, return matching resource, if one is known - else null- Specified by:
resolveReferencein interfaceFHIRPathEngine.IEvaluationContexturl- the reference (Reference.reference or the value of the canonical- Returns:
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
conformsToProfile
public boolean conformsToProfile(Object appContext, Base item, String url) throws org.hl7.fhir.exceptions.FHIRException
- Specified by:
conformsToProfilein interfaceFHIRPathEngine.IEvaluationContext- Throws:
org.hl7.fhir.exceptions.FHIRException
-
resolveValueSet
public ValueSet resolveValueSet(Object appContext, String url)
- Specified by:
resolveValueSetin interfaceFHIRPathEngine.IEvaluationContext
-
-