Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for id and idProperty in ELM #1219

Open
JPercival opened this issue Sep 27, 2023 · 0 comments
Open

Add support for id and idProperty in ELM #1219

JPercival opened this issue Sep 27, 2023 · 0 comments

Comments

@JPercival
Copy link
Contributor

JPercival commented Sep 27, 2023

In CQL, you can retrieve an object via its id property by doing something like this:

[ Encounter ] E where E.id = '123`

or, alternatively:

[ Encounter: id in { '123' } ]

Currently, the CQL compiler emits that as a filter by codes and codePath. In other words, the emitted ELM contains a Retrieve where codes = { '123' } and codePath = 'id' as if it were a terminology operation. Ideally, the CQL compiler would correctly detect this correct and emit ELM with id = '123' and idProperty = 'id'.

There are several places we need to update to support this correctly:

  1. ModelInfos (or at least ModelResolvers) need to have the idProperty added (if absent)
  2. The compiler needs to check the where clause to determine if the the path that's accessed is an id, and if so emit id and idProperty accordingly
  3. The RetrieveProvider interface and the RetrieveEvaluator in the engine need to be updated to have id and idProperty
  4. The implementations of RetrieveProvider need to add support for that path.

Acceptance criteria:

  • ModelInfos updated as needed, in particular the FHIR-based models
  • Compiler checks for idPath in where clauses, and attempts pushdown
  • RetrieveProvider interface updated
  • RetrieveProvider implementations updated
  • Tests for all of the above added
@JPercival JPercival changed the title Add support for id and idPath in ELM Add support for id and idProperty in ELM Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant