https://hapi.fhir.org/baseR4/Patient?family=wang&_count=30
Describe the bug
In the last page of the search results (via pagination), the offset and _count in the "previous" link are both wrong, unless the total number of results is a multiple of the page size (_count).
To Reproduce
Steps to reproduce the behavior:
Try this search:
https://hapi.fhir.org/baseR4/Patient?family=wang&_count=30
Click the "next link", you will see the "previous" link looks something like (note the offset and _count):
http://hapi.fhir.org/baseR4?_getpages=3b68200d-ac42-44d4-aca4-c0434cdd5f07&_getpagesoffset=19&_count=11&_pretty=true&_bundletype=searchset
Environment (please complete the following information):
- HAPI FHIR Version: 5.3
- OS: Windows
- Browser: Chrome