Stream: implementers
Topic: Question about paging
John Gresh (Apr 10 2017 at 14:35):
The information below is what I’m finding regarding paging in the current FHIR specification. Is there really no standard way to indicate a page size and an offset in the FHIR specification? This would make doing things like navigating to a specific page much easier (e.g. navigation to page 10 of 100 pages).
Also, this seems to be saying that any request that returns a Bundle SHALL use the RFC 5005 type of paging if paging is implemented for that request (e.g. https://server/path/Patient). Is this correct?
http://hl7.org/fhir/http.html#paging
2.21.0.20 Paging
If servers provide paging for the results of a search or history interaction, they SHALL conform to this method (adapted from RFC 5005 (Feed Paging and Archiving) for sending continuation links to the client when returning a Bundle (e.g. with history and search). If the server does not do this then there is no way to continue paging.
This example shows the third page of a search result:
<Bundle xmlns="http://hl7.org/fhir">
<!-- snip metadata -->
<!-- This Search url starts with base search, and adds the effective
parameters, and additional parameters for search state. All searches
SHALL return this value.
In this case, the search continuation method is that the server maintains a state, with page references into the stateful list. -->
<link>
<relation value="self">
<url value="http://example.org/Patient?name=peter&stateid=23&page=3"/>
</link>
<!-- 4 links for navigation in the search. All of these are optional, but recommended -->
<link>
<relation value="first"/>
<url value="http://example.org/Patient?name=peter&stateid=23&page=1"/>
</link>
<link>
<relation value="previous"/>
<url value="http://example.org/Patient?name=peter&stateid=23&page=2"/>
</link>
<link>
<relation value="next"/>
<url value="http://example.org/Patient?name=peter&stateid=23&page=4"/>
</link>
<link>
<relation value="last"/>
<url value="http://example.org/Patient?name=peter&stateid=23&page=26"/>
</link>
<!-- then the search results... -->
</Bundle>
Lloyd McKenzie (Apr 10 2017 at 14:41):
There is no standard way to do this. You're welcome to submit a change proposal. If we went this route, we'd also need an additional element to allow systems to ensure subsequent calls navigate within the original result set.
Michele Mottini (Apr 11 2017 at 18:29):
Be able to jump to an arbitrary page can be hard (or impossible) to implement - depending on the underlying server architecture - and does not buy you much in term of usability: a user does not know what's in the pages, so there is not much sense / need to jump to a specific one
Last updated: Apr 12 2022 at 19:14 UTC