HS.FHIRPath.API

class HS.FHIRPath.API extends %Library.RegisteredObject

Method Inventory

Methods

method deserializeParseTree(serialData As %String) as Node [ Language = objectscript ]
method enableCache(enable As %Boolean) [ Language = objectscript ]
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, withParseTree As Node, Output OUTPUT) [ Language = objectscript ]
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 evaluateToJson(resource As %DynamicObject, withParseTree As Node) as %DynamicArray [ Language = objectscript ]
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 [ Language = objectscript ]
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) [ Language = objectscript ]
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 [ Language = objectscript ]
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) [ Language = objectscript ]
method setTraceLevel(trace As %Integer) [ Language = objectscript ]

Inherited Members

Inherited Methods

Feedback