-
Notifications
You must be signed in to change notification settings - Fork 157
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
_include search param doesn't support effective paging #346
Comments
Sounds like we actually have two issues here:
|
For number 1, we currently execute one big COUNT query which attempts to count all of the resources (both the query ones and the included ones). I can't explain the reported behavior yet, but based on the spec it sounds like we should be looking at just the resource type being queried (which should actually simplify this query a lot). After the COUNT we execute another big query that UNIONs all the different _include resource types. Instead, it might be simpler to move to executing two separate queries:
|
I used https://alberts-mbp.fios-router.home:9443/fhir-server/api/v4/Appointment?date=ge2019-07-05T18:00:00.000Z&date=le2019-12-06T18:00:00.000Z&_include=Appointment:patient&_count=15 in my local test. UNION ALL (3) the paging issue is as excepted, because currently we paging all the returned resources together. |
Signed-off-by: Albert Wang <xuwang@us.ibm.com>
Signed-off-by: Albert Wang <xuwang@us.ibm.com>
issue #346 paging fix for include/revinclude search
Signed-off-by: Albert Wang <xuwang@us.ibm.com>
Signed-off-by: Albert Wang <xuwang@us.ibm.com>
Signed-off-by: Albert Wang <xuwang@us.ibm.com>
Describe the bug
The FHIR spec states the following in regards to the _include search param: "When search results are paged, each page of search results should include the matching includes for the resources in each page, so that each page stands alone as a coherent package." (https://www.hl7.org/fhir/search.html#include). However, when I run a query such as Appointment?date=ge2019-07-05T18:00:00.000Z&date=le2019-07-06T18:00:00.000Z&_include=Appointment:patient&_count=15, I'm seeing behavior that doesn't match the spec. Specifically, out of the 43 total resources, there's 1 Practitioner resource, 21 Patient resources, and 21 Appointment resource.
There's two problems that I can tell:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I would expect no Practitioner resource to be returned. Furthermore, I'd expect the first Appointment to be returned, followed by its related Patient resource. Then I'd expect the next Appointment and related Patient. Etc.
The text was updated successfully, but these errors were encountered: