Skip to main content

HS.FHIRPath.API

class HS.FHIRPath.API extends %Library.RegisteredObject

Method Inventory

Methods

method deserializeParseTree(serialData As %String) as Node
method enableCache(enable As %Boolean)
API Clears and existing cached expressions and enables or disables an in-memory cache of parsed FHIRPath expressions. Provides performance improvement for repetitive usage of a limited set of expressions (e.g. search parameter expressions, etc).
@Input enable - If 1, enables caching, if 0, disables caching
method evaluate(resource As %DynamicObject, treeOrExpression, Output OUTPUT, env As HS.FHIRPath.Environment = "")
API Evaluate a FHIRPath Node (from a previously parsed expression) and return the value collection selected by that expression from the provided resource object.
Output is a multi-dimensional array of the following form
Output         the count of value nodes
Output(n)      the value information of the n-th element in the output collection
Output(n,"t")  the FHIR datatype of the n-th element in the output collection
method evaluateArray(ByRef array, treeOrExpression, Output OUTPUT, env As HS.FHIRPath.Environment = "")
API Evaluate a FHIRPath Node (from a previously parsed expression) and return the value collection selected by that expression from the array of objects.
Input and Output are multi-dimensional arrays of the following form
Output         the count of value nodes
Output(n)      the value information of the n-th element in the output collection
Output(n,"t")  the FHIR datatype of the n-th element in the output collection
method evaluateToJson(resource As %DynamicObject, treeOrExpression, env As HS.FHIRPath.Environment = "") as %DynamicArray
API Evaluate a FHIRPath Node (from a previously parsed expression) and return the %DynamicArray of the values selected by that expression from the provided resource object.
Note, if the FHIR datatype of the collection elements is needed, use the evaluate method
classmethod getInstance(mdSetKey As %String, traceLevel As %Integer = 0) as HS.FHIRPath.API
Obtain an instance of a FHIRPath processor for the specified schema.
method getPathAndType(resourceType As %String, withParseTree As Node, Output contextPath As %List, Output datatype)
Returns the contextPath and datatype of a FHIRPath expression. The contextPath
Output contextPath - is a %List of the field names used to navigate to the expression value.
Output datatype - A multi-dimensional result. The top-node is the resulting datatype of the expression. It may not be the datatype of the referenced data element if, say, a boolean function like 'exists' is applied to that data element. If the datatype is "Reference", then datatype("tl") will be a %List of allowable target ResourceType's datatype("ar") 1 if the referenced property is an array, 0 if a scalar datatype("mv") 1 if the expression can yield more than one value, 0 if a single value datatype("t") the FHIR datatype of expression datatype("tl") If the property contains a reference, a %List of allowable target ResourceType's, otherwise not present datatype("vt") If the datatype is "variant", the allowable variant datatype(s), otherwise not present
NOTE: This function is intended for single-path expressions and will fail otherwise.
method parse(fhirPath As %String) as Node
API Parse a FHIRPath expression into a "parse tree" of HS.FHIRPath.Node objects.
returns the root Node of the tree.
method serializeParseTree(parseTree As Node)
method setDecimalPrecision(precision As %Boolean = 1)
method setTraceLevel(trace As %Integer)

Inherited Members

Inherited Methods

FeedbackOpens in a new tab