New CQL value type for structured types in engine runtime#1713
New CQL value type for structured types in engine runtime#1713
Conversation
Related IssuesThe following open issues may be related to this PR:
|
|
Formatting check succeeded! |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1713 +/- ##
============================================
+ Coverage 62.00% 62.74% +0.74%
+ Complexity 3944 3889 -55
============================================
Files 210 210
Lines 20374 19946 -428
Branches 3882 3767 -115
============================================
- Hits 12632 12516 -116
+ Misses 6131 5870 -261
+ Partials 1611 1560 -51 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| ) { | ||
| return operand | ||
| return when (target) { | ||
| is Quantity -> { |
There was a problem hiding this comment.
thought: This is most of the ModelProvider functionality, but now written against the internal CQL types. Might make sense to factor that out as a class and test it independently rather than rolling it into the Environment, which manages cache, library loading, etc.
There was a problem hiding this comment.
Another possibility would be a specialized kind of "Evaluator" class in the engine.
There was a problem hiding this comment.
I agree. I moved is(), as(), etc. into repsective evaluators, so now it looks better.
|
We are currently using a custom modelinfo and a custom modelresolver to implement cql over internal data types that are not fhir related. This is well supported currently. These changes to modelresolver seem to make that impossible now. Is this engine only going to support FHIR, specifically hapi fhir, or is there some other avenue to get existing behavior that i am missing. Fully extracting every record into a CqlClassInstance would be prohibitively poorly performing for us. Right now, the fact that we can retrieve objects at request time with If CqlClassInstance were an interface that allowed similar behavior we could make this work, maybe. You could even then implement the interface by something identical to the current implementation if for some reason that is performant for you, where |
|


FHIR.Patient,FHIR.string, etc.) are now represented in the engine asCqlClassInstances. ACqlClassInstancecan be thought of as a named tuple type (a tuple with a QName type tag like{http://hl7.org/fhir}Patient). As a result:resolvePath(),as(),setValue(),objectEqual(),objectEquivalent(),resolveType()are no longer needed in theModelResolverinterface.Class<T>references are replaced with type specifiers and type QNames (both multiplatform) in the engine. As a result:packageName(s)is no longer needed inModelResolverandis(value: Any?, type: Class<*>?): Boolean?changed tois(valueType: String, type: QName): Boolean?,Interval[1,2] is Interval<Integer>returns true andInterval[1,2] is Interval<Time>returns false,FhirModelResolver : ModelResolver, theis(valueType: String, type: QName): Boolean?method now returnstrueonly if{http://hl7.org/fhir}_valueType_extendstypeor is the same astype. As a result, expressions likeFHIR.integer { ... } is FHIR.positiveIntandFHIR.Quantity { ... } is FHIR.Agereturn false becauseFHIR.integeris a supertype ofFHIR.positiveIntandFHIR.Quantityis a supertype ofFHIR.Age.DescendentsEvaluator.