Compile CQL to ELM in the SDK #1365
Labels
effort:large
Large effort - 5 to 10 days
P2
Medium priority issue
type:enhancement
New feature or request
Milestone
Is your feature request related to a problem? Please describe.
PlanDefinitions can include CQL expressions directly. Those expressions need to be compiled to ELM before running on the device.
Here's a valid Action (subcomponent of PlanDefinition) extracted from EmCare as an example:
The SDK must be able to solve
now() - 5 years > %subject.BirthDate
.As another example, the current RuleFilters test case includes a PlanDefinition with a CQL function call:
The text on
expression
must be placed inside a CQL library, compiled, and run to execute theIsReportable
function.As a third example, the current RuleFilters test case includes start and stop conditions as CQL:
Again, the text on
expression
must be placed inside a CQL library, compiled, and run to execute thestart
andstop
conditions.Describe the solution you'd like
The ideal solution would extract the existing compilation technique from the CQL Translator (PR 748) and expose it to the SDK, through the CQL Evaluator. The solution must also be able to read ModelInfos with Jackson's XML Mapper as opposed to the JAXB unmarshalling, which is awaiting a solution for issue #525
Describe alternatives you've considered
Until now, the SDK was expected to deal with already compiled expressions only, represented as ELM/JSON libraries. This requires the SDK to use a server to compile ELM when uncompiled CQL is present in PlanDefinitions. I don't think that solution is feasible in practice.
Additional context
This is related to issues: #1334, #915, #1055, #656 and #718.
Would you like to work on the issue?
Yes
The text was updated successfully, but these errors were encountered: