Stream: terminology
Topic: Should server honor count parameter on VS expansion
Yunwei Wang (Jan 30 2020 at 16:26):
I used to think that server could apply its own (page) count if the count parameter from client request is "unreasonable". For example, if server has its default page count 500 and client requests $expand with count=5000, server could just return 500 per page. I re-read the $expand operation again and I don't find anywhere says that server could apply its own page count or could NOT apply its own page count. So what is the expectation?
Michael Lawley (Jan 31 2020 at 06:25):
I was pretty sure the count parameter was advisory, but this is the most relevant text I found (at the bottom of https://www.hl7.org/fhir/operation-valueset-expand.html):
Servers are not obliged to support paging, but if they do, SHALL support both the offset and count parameters.
One way to read this is that a server that behaves as you describe is perfectly ok, but PERHAPS cannot be described as "supporting paging" :-)
On a practical level, if a client assumes that a result of < the count parameter implies the last page, then you'll not have a good experience. We have a default page size for Ontoserver and a max page size. If a client asks for more than the max page size then an error is returned. If they ask for more (or less) than the default, then we honor their request.
Grahame Grieve (Jan 31 2020 at 06:28):
server has a right to protect itself against requests that ask too much
Michael Lawley (Feb 01 2020 at 01:15):
Sure, but as a client, if I ask for count = n in the expansion and I get k items where k is less than n, is that okay (when offset + k < total), or must a server protect itself by returning an error (eg too costly).
Richard Kavanagh (Feb 04 2020 at 13:15):
I don't think you need the error (see attached) pasted image text in yellow. Not sure the text in blue is safe, but that's a different issue.
Michael Lawley (Feb 04 2020 at 22:01):
This is text for the _count
parameter and paging in Bundles representing Search results. This is not the same as the count
parameter for ValueSet/$expand
, although it's arguable that the semantics / behaviour should be aligned, especially if this change proposal to support a "next" link gains traction https://jira.hl7.org/browse/FHIR-25786
Last updated: Apr 12 2022 at 19:14 UTC