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 time windows to longitudinal queries #54

Closed
flaneuse opened this issue Dec 1, 2022 · 1 comment
Closed

Add time windows to longitudinal queries #54

flaneuse opened this issue Dec 1, 2022 · 1 comment
Assignees
Labels
good first issue Good for newcomers guru

Comments

@flaneuse
Copy link
Contributor

flaneuse commented Dec 1, 2022

For longitudinal queries, add a parameter datemin and datemax (feel free to change the names) to filter queries based on dates.

API handlers / routes covered:

Expected behavior

  1. User runs a GET query like https://api.outbreak.info/genomics/prevalence-by-location?pangolin_lineage=BA.5&datemin=2022-06-01&datemax=2022-10-01
  2. ElasticSearch query runs the date filter before the aggregation, to restrict the data going into the aggregation step to those records between the dates.
  • datemin and datemax should be in ISO 8601 YYYY-MM-DD format
  • filtering should be inclusive (as in <= (less than or equal to) and >= (greater than or equal to) of the datemin and datemax.
  • if no datemax is specified, it should only filter the datemin
  • if no datemin is specified, it should only filter the datemax`
  • if neither datemin not datemax is specified, there should be no filtering.
  • Should also have basic error checking, if datemin or datemax is not specified as an ISO string. Should return a 400 error (bad request)
  1. ElasticSearch passes the filtered data to the existing aggregation code.
  2. Output format is unchanged, just with fewer dates.

Expected outcome

  • Should decrease API call query times by only aggregating a subset of the data, rather than all the data.
  • Should lower the amount of data passed to the front-end, since only the relevant dates are passed.

Related docs

@flaneuse
Copy link
Contributor Author

closed in 0e38feb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers guru
Projects
None yet
Development

No branches or pull requests

2 participants