2

Foe search interactions, while there is support for specifying the number of items expected in the response using the _count parameter, we are not able to find any reference to a parameter to specify the page number. The _query parameter can be used for custom queries, but is that an option or is there a better alternative.

For example, what is the standard way to request for the second page of a patient resultset with each page having 10 records? -

GET Patient?_count=10&[pagenumber?]=2

RahulB
  • 197
  • 1
  • 8

1 Answers1

2

There's no mechanism to navigate to a specific page. You use the URLs provided in Bundle.link (e.g. previous, next, first, last) to navigate through the search result set.

Lloyd McKenzie
  • 6,345
  • 1
  • 13
  • 10
  • 1
    Thanks Lloyd, but I think the same question is applicable for constructing the next/previous/last links as well because they too need some count/page number indications. There seem to be a lot of differences in the reference implementations, like HAPI uses "_getpagesoffset", while spark uses "start" for this purpose. Is it left to individual implementors to define? – RahulB Jun 21 '17 at 12:01
  • yes, left to the implementers. you have to step through the pages to get the link for the page – Grahame Grieve Jun 21 '17 at 12:51
  • 1
    [Vonk](https://simplifier.net/vonk), the successor to Spark, has chosen to implement this with an _skip parameter, so you could do a GET Patient?_count=10&_skip=10 – Mirjam Baltus Jun 21 '17 at 14:38
  • 1
    _skip is not a standard parameter - you can't count on it being supported on all (or even most) servers. FHIR isn't designed to allow navigation to arbitrary points in a result-set – Lloyd McKenzie Jun 21 '17 at 16:19
  • 2
    Right. But I agree with RahulB "comment" (date june 21 2017) .. the "previous" "next" "first" and "last" you still need an actual url-value (as seen here) https://www.hl7.org/fhir/http.html#paging find "This example shows the third page of a search result:" One example from the HL7 link : The HL7 has example has "page=4", but that does not seem to be standard. Not sure why this is so confusing :) its rest-paging. – granadaCoder Oct 29 '20 at 06:40
  • @MirjamBaltus _skip Yes! Very "linq'ish" :) – granadaCoder Oct 29 '20 at 06:44
  • Ah, I think I understand now. The "next" "previous" have placeholders for the URL values, and as long as YOUR server understands those links, then it works. If your server wanted to implement "_count=100&pagingainteasy=5", (a non standard example) , then its fine, because that is what you put in the url values for "next" "previous". Ok. Now all the comments and this answer make sense. Took a few minutes to click. Thanks. – granadaCoder Oct 29 '20 at 06:51