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

Implement query restriction pushdown for Id #1220

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

Implement query restriction pushdown for Id #1220

JPercival opened this issue Sep 27, 2023 · 2 comments
Assignees

Comments

@JPercival
Copy link
Contributor

JPercival commented Sep 27, 2023

The CQL engine currently supports certain types of query restriction pushdowns, specifically for date filters. In other words, given the following CQL:

[ Condition ] C where C.onset starts 30 days or less before Today()

the CQL compiler can emit an ELM Retrieve that has that date filter captured in the datePath and dateLow elements.

Ideally, we could support the same type of push-downs for Retrieves by id. In other words, these two statements ought to be equivalent with respect to the ELM that's generated:

[Medication] M where M.id = `123`
[Medication: id in {'123'}]

And the ELM that's generated for the Retrieve ought to have both the id and the idProperty populated in both cases.

Acceptance Criteria:

  • Compiler has Id pushdown optimization done
  • Tests for same are implemented
@JPercival JPercival self-assigned this Sep 27, 2023
@brynrhodes
Copy link
Member

Note that it's the DataRequirementsProcessor that does these types of optimizations as a post-processing step. There is some date range pushdown in the translator directly, but it's not as sophisticated as what the DataRequirementsProcessor is doing, and should be deprecated in favor of the DataRequirementsProcessor, IMHO.

@JPercival
Copy link
Contributor Author

Just to clarify, are you saying that we should always do pushdown as post-processing? Including for Ids?

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

2 participants