FHIR Chat · Paging Sizes · australia

Stream: australia

Topic: Paging Sizes


view this post on Zulip Philip Wilford (May 02 2018 at 00:43):

Hi Guys,

When a FHIR Server returns a bundle from a Search, The link section returns the paging links.
It seems that paging is server specific (ie how many rows are returned in one go)
So if Page size is 20, and there are 101 record, then there are 6 pages.
Is there anywhere that specifies what the paging size is used by the server?
Should it be returned in the bundle?
Should the capability statement specify this?

view this post on Zulip Brett Esler (May 02 2018 at 01:03):

Hi @Philip Wilford http://hl7.org/fhir/search.html#count - it is really up to the server to define - _count on search is a request by the client and can't be exceeded by the server

view this post on Zulip Brett Esler (May 02 2018 at 01:03):

capability statement is interesting - maybe it should...

view this post on Zulip Brett Esler (May 02 2018 at 01:04):

also server could have variable paging size I guess - might be based on how many results in a period of time (i.e. max response time)

view this post on Zulip Brett Esler (May 02 2018 at 01:05):

i.e. search engine like..

view this post on Zulip Angus Millar (May 02 2018 at 02:49):

Its a good point Phill, I'm not aware of anywhere the page size is reported by the server. I have these command in my server config for the server admin to configure page size. But as said, if your not the admin I don't know how you woudl find out. Extention in the capability statement maybe, not great!
<!-- =====================================================================================================
Command: NumberOfRecordsPerPageDefault
Value: integer
Default: 50
Description: This setting is to set the default number of Resource returned in a bundle, for example,
in a FHIR search call. The default can be over-ridden per API call using the _count search parameter
in the call. -->
<add key="NumberOfRecordsPerPageDefault" value="50" />

<!-- =====================================================================================================
Command: MaxNumberOfRecordsPerPage
Value: integer
Default: 500
Description: This setting is to set the absolute maximum number of Resource that can be requested
when using the _count search parameter. For example, if an API caller sets the parameter _count=500
and this command 'MaxNumberOfRecordsPerPage' is set to 200 then the _count search parameter value
will be ignored and only 200 will be returned. This is to prevent users asking for a _count value
that is too large, resulting in poor performance of the service. Also, beware that the service has
an internal setting called 'SystemDefaultMaxNumberOfRecordsPerPage' that can not be changed by
configuration. This command 'MaxNumberOfRecordsPerPage' cannot exceed the
'SystemDefaultMaxNumberOfRecordsPerPage' command which is currently set at 5000 and the command
here will default to the 'SystemDefaultMaxNumberOfRecordsPerPage' value if set higher.-->
<add key="MaxNumberOfRecordsPerPage" value="200" />

view this post on Zulip Grahame Grieve (May 02 2018 at 08:12):

we've kept away from making rules about this because internal engines vary so widely

view this post on Zulip Brian Postlethwaite (May 02 2018 at 23:17):

another factor could be that the server counts the byte size of the bundle as its preparing it, and cut of the pages so they don't exceed 2MB (mine doesn't but it could be possible).
All that really matters is that you can follow the next link to get to the next page of data

view this post on Zulip Brian Postlethwaite (May 02 2018 at 23:18):

And just a reminder Phil, resources brought in through the _include option to count towards the bundle.total property.

view this post on Zulip Philip Wilford (May 02 2018 at 23:32):

And just a reminder Phil, resources brought in through the _include option to count towards the bundle.total property.

Hey Brian,
That bundle.total count .. that adds a bit of a curve ball there to peoples UIs.
Example: query for Organisations with a certain Filter, and you _include the Location.
If your UI is handling paging, it will want to know how many organisations are returned.
The bundle.total therefore becomes a bit confusing ... as that wont be the number of organisations
for the UI paging to use.
Doesnt there need to be an additional counter to indicate Organisations found ??

view this post on Zulip Brian Postlethwaite (May 02 2018 at 23:35):

That was my point, it IS the number of organizations.
But won't be the count of resource.entry results

view this post on Zulip Philip Wilford (May 02 2018 at 23:37):

Ok - so thats good then :)
bundle.total = organisations
and then the _includes are extra .. yes?

view this post on Zulip Brian Postlethwaite (May 02 2018 at 23:38):

yes.
_count = 10 might result in bundle.entry.count() = 15 (with 5 included resources) and bundle.total = 13

view this post on Zulip Philip Wilford (May 03 2018 at 00:05):

So we would return 10 organisations and the included resources ? in the response to the request for _count=10 ?

view this post on Zulip Brian Postlethwaite (May 03 2018 at 00:13):

[base]/Location?_count=10&_include=location.organization
resulting bundle has 10 locations, 5 organizations, and total = 13
Page 2 might contain 3 locations, 2 orgs and total = 13

view this post on Zulip Angus Millar (May 03 2018 at 00:23):

And then for _count there is this gotcha that I have not implemented but found a few days ago: Quote Spec: "if _count has the value 0, this shall be treated the same as _summary=count: the server returns a bundle that reports the total number of resources that match in Bundle.total, but with no entries, and no prev/next/last links. Note that the Bundle.total only include the total number of matching resources. It does not count extra resources such as OperationOutcome or included resources that may also be returned."

view this post on Zulip Brian Postlethwaite (May 03 2018 at 03:00):

[base]/[resourcename]?_count=0

This is what you're referring to as being handled as a shorthand? for _summary=count


Last updated: Apr 12 2022 at 19:14 UTC