Package org.hl7.fhir.r5.utils.sql
Class Runner
java.lang.Object
org.hl7.fhir.r5.utils.sql.Runner
- All Implemented Interfaces:
FHIRPathEngine.IEvaluationContext
How to use the Runner:
create a resource, and fill out:
the context (supports the FHIRPathEngine)
a store that handles the output
a tracker - if you want
Once it's created, you either run it as a batch, or in trickle mode
(1) Batch Mode
* provide a provider
* call execute() with a ViewDefinition
* wait... (watch with an observer if you want to track progress)
(2) Trickle Mode
* call 'prepare', and keep the WorkContext that's returned
* each time there's a resource to process, call processResource and pass in the workContext and the resource
* when done, call finish(WorkContext)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceclassNested classes/interfaces inherited from interface org.hl7.fhir.r5.fhirpath.FHIRPathEngine.IEvaluationContext
FHIRPathEngine.IEvaluationContext.FunctionDefinition -
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 functionbooleanconformsToProfile(FHIRPathEngine engine, Object appContext, Base item, String url) voidvoidexecute(org.hl7.fhir.utilities.json.model.JsonObject viewDefinition) executeFunction(FHIRPathEngine engine, Object appContext, List<Base> focus, String functionName, List<List<Base>> parameters) voidList<org.hl7.fhir.utilities.validation.ValidationMessage>booleanwhen the .log() function is calledbooleanparamIsType(String name, int index) For the moment, there can only be one parameter if it's a type parametervoidresolveConstant(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 refContext) Implementation of resolve() function.resolveValueSet(FHIRPathEngine engine, Object appContext, String url) voidsetContext(IWorkerContext context) voidsetProvider(Provider provider) voidsetStorage(Storage storage)
-
Constructor Details
-
Runner
public Runner()
-
-
Method Details
-
getContext
-
setContext
-
getProvider
-
setProvider
-
getStorage
-
setStorage
-
getProhibitedNames
-
execute
-
execute
-
prepare
public Runner.WorkContext prepare(String path, org.hl7.fhir.utilities.json.model.JsonObject viewDefinition) -
processResource
-
finish
-
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.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. 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:
resolveConstantin interfaceFHIRPathEngine.IEvaluationContextappContext- - 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:
resolveConstantTypein interfaceFHIRPathEngine.IEvaluationContext- Throws:
org.hl7.fhir.exceptions.PathEngineException
-
log
Description copied from interface:FHIRPathEngine.IEvaluationContextwhen the .log() function is called- Specified by:
login interfaceFHIRPathEngine.IEvaluationContext- Returns:
-
resolveFunction
public FHIRPathUtilityClasses.FunctionDetails resolveFunction(FHIRPathEngine engine, String functionName) - Specified by:
resolveFunctionin interfaceFHIRPathEngine.IEvaluationContext- 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.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(FHIRPathEngine engine, Object appContext, List<Base> focus, String functionName, List<List<Base>> parameters) - Specified by:
executeFunctionin interfaceFHIRPathEngine.IEvaluationContext- Returns:
-
resolveReference
public Base resolveReference(FHIRPathEngine engine, Object appContext, String url, Base refContext) 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(FHIRPathEngine engine, Object appContext, Base item, String url) throws org.hl7.fhir.exceptions.FHIRException - Specified by:
conformsToProfilein interfaceFHIRPathEngine.IEvaluationContext- Throws:
org.hl7.fhir.exceptions.FHIRException
-
resolveValueSet
- Specified by:
resolveValueSetin interfaceFHIRPathEngine.IEvaluationContext
-
paramIsType
Description copied from interface:FHIRPathEngine.IEvaluationContextFor the moment, there can only be one parameter if it's a type parameter- Specified by:
paramIsTypein interfaceFHIRPathEngine.IEvaluationContext- Returns:
- true if it's a type parameter
-
getIssues
-