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

Offset, count, and total are wrong for some queries. _offset produces short pages, and repeats results on different pages #4190

Closed
StevenXLi opened this issue Oct 24, 2022 · 0 comments · Fixed by #4193 or #4208

Comments

@StevenXLi
Copy link
Contributor

Our SQL queries can return a single resource id more than once.
During the "async" cached path, we track every prior id in a search result, and discard duplicates.
But during _offset queries, or when a client uses the _total=accurate parameter, this de-duplication does not happen.
This problem shows up as a few bug reports reporting either short pages, duplicate results, or incorrect totals.

Steps to reproduce the behavior:

  1. Create 5 Patients
  2. Create 20 Observations for each patient with code=sample
  3. Query _has:Observation:patient:code=sample&_offset=0&_count=5
  4. fewer than 5 patients in the bundle

Expected behavior
all 5 patients in the bundle.

Environment (please complete the following information):

  • HAPI FHIR Version 6.2.0
  • OS: MacOS
  • Browser: chrome
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant