Class CqlEngine
java.lang.Object
org.opencds.cqf.cql.engine.execution.CqlEngine
NOTE: Several possible approaches to traversing the ELM tree for execution:
1. "Executable" Node Hierarchy: Create nodes for each ELM type and deserialize into these nodes
This option works well, but is problematic for maintenance because Java doesn't have partial classes.
There also doesn't seem to be a way to tell JAXB which hierarchy to use if you have two different hierarchies
for the same schema (Trackable-based ELM used by the CQL-to-ELM translator, and Executable-based ELM used by the engine).
This could potentially be a bonus though, as it forces the engine to not take a dependency on the translator, forcing
a clean separation between the translator and the engine.
2. Visitor Pattern: This option is potentially simpler to implement, however:
a. The visitor pattern doesn't lend itself well to aggregation of results, which is the real work of each node anyway
b. Extensibility is compromised, difficult to introduce new nodes (unlikely to be a practical issue though)
c. Without lambdas, the cost of traversal is quite high due to the expensive if-then-else chains in the visitor nodes
So, opting for the Executable Node Hierarchy for now, knowing that it creates a potential maintenance issue, but
this is acceptable because the ELM Hierarchy is settling down, and so long as all the non-generated code is at the
end, this should be easy to maintain. In addition, it will be much more performant, and lend itself much better to
the aggregation of values from child nodes.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionCqlEngine(LibraryLoader libraryLoader) CqlEngine(LibraryLoader libraryLoader, EnumSet<CqlEngine.Options> engineOptions) CqlEngine(LibraryLoader libraryLoader, Map<String, DataProvider> dataProviders, TerminologyProvider terminologyProvider) CqlEngine(LibraryLoader libraryLoader, Map<String, DataProvider> dataProviders, TerminologyProvider terminologyProvider, EnumSet<CqlEngine.Options> engineOptions) -
Method Summary
Modifier and TypeMethodDescriptionevaluate(String libraryName, Set<String> expressions, org.apache.commons.lang3.tuple.Pair<String, Object> contextParameter) evaluate(String libraryName, Set<String> expressions, org.apache.commons.lang3.tuple.Pair<String, Object> contextParameter, Map<String, Object> parameters) evaluate(String libraryName, org.apache.commons.lang3.tuple.Pair<String, Object> contextParameter, Map<String, Object> parameters) evaluate(VersionedIdentifier libraryIdentifier) evaluate(VersionedIdentifier libraryIdentifier, Map<String, Object> parameters) evaluate(VersionedIdentifier libraryIdentifier, Set<String> expressions) evaluate(VersionedIdentifier libraryIdentifier, Set<String> expressions, Map<String, Object> parameters) evaluate(VersionedIdentifier libraryIdentifier, Set<String> expressions, org.apache.commons.lang3.tuple.Pair<String, Object> contextParameter) evaluate(VersionedIdentifier libraryIdentifier, Set<String> expressions, org.apache.commons.lang3.tuple.Pair<String, Object> contextParameter, Map<String, Object> parameters, DebugMap debugMap) evaluate(VersionedIdentifier libraryIdentifier, Set<String> expressions, org.apache.commons.lang3.tuple.Pair<String, Object> contextParameter, Map<String, Object> parameters, DebugMap debugMap, ZonedDateTime evaluationDateTime) evaluate(VersionedIdentifier libraryIdentifier, org.apache.commons.lang3.tuple.Pair<String, Object> contextParameter) evaluate(VersionedIdentifier libraryIdentifier, org.apache.commons.lang3.tuple.Pair<String, Object> contextParameter, Map<String, Object> parameters)
-
Constructor Details
-
CqlEngine
-
CqlEngine
public CqlEngine(LibraryLoader libraryLoader, Map<String, DataProvider> dataProviders, TerminologyProvider terminologyProvider) -
CqlEngine
-
CqlEngine
public CqlEngine(LibraryLoader libraryLoader, Map<String, DataProvider> dataProviders, TerminologyProvider terminologyProvider, EnumSet<CqlEngine.Options> engineOptions)
-
-
Method Details
-
evaluate
-
evaluate
-
evaluate
-
evaluate
-
evaluate
public EvaluationResult evaluate(String libraryName, org.apache.commons.lang3.tuple.Pair<String, Object> contextParameter) -
evaluate
-
evaluate
-
evaluate
-
evaluate
-
evaluate
-
evaluate
public EvaluationResult evaluate(VersionedIdentifier libraryIdentifier, Set<String> expressions, org.apache.commons.lang3.tuple.Pair<String, Object> contextParameter) -
evaluate
public EvaluationResult evaluate(VersionedIdentifier libraryIdentifier, Set<String> expressions, Map<String, Object> parameters) -
evaluate
public EvaluationResult evaluate(VersionedIdentifier libraryIdentifier, org.apache.commons.lang3.tuple.Pair<String, Object> contextParameter) -
evaluate
public EvaluationResult evaluate(VersionedIdentifier libraryIdentifier, org.apache.commons.lang3.tuple.Pair<String, Object> contextParameter, Map<String, Object> parameters) -
evaluate
public EvaluationResult evaluate(VersionedIdentifier libraryIdentifier, Map<String, Object> parameters) -
evaluate
public EvaluationResult evaluate(VersionedIdentifier libraryIdentifier, Set<String> expressions, org.apache.commons.lang3.tuple.Pair<String, Object> contextParameter, Map<String, Object> parameters, DebugMap debugMap) -
evaluate
public EvaluationResult evaluate(VersionedIdentifier libraryIdentifier, Set<String> expressions, org.apache.commons.lang3.tuple.Pair<String, Object> contextParameter, Map<String, Object> parameters, DebugMap debugMap, ZonedDateTime evaluationDateTime)
-