Closed lincmba closed 8 months ago
We have to different handler methods for this functionality:
/List/12345
/List?_id=12345
- See line L251The current implementation works for the first one. We need the second one to have the same implementation.
succeeds https://github.com/onaio/fhir-gateway-plugin/issues/27
Problem: When the FHIR gateway is used to fetch data from a FHIR server using the List endpoint with a specific ID (
[GET] /List?_id=<some-id>
), it currently fetches a bundle containing entry URLs. For certain resources, like Locations, with a large number of entries, the gateway faces timeout errors due to the volume of data.Temporary Fix: The temporary fix for the SID project was to increase the HTTP client timeout .
Proposed Solution: Implement pagination consistent with the current FHIR responses. Introduce two parameters,
_page
(default set to 1) and_count
(default set to 20), passed to the URL. These parameters will help limit the number of items fetched from the FHIR server.Workflow:
[GET] /List?_id=<some-id>&_count=<page-size>&_sort=<some-sort>&<others>
.[GET] /List?_id=<some-id>&_page<page-number>&_count=<page-size>
.start = (_page - 1) * _count
,end = start + _count
.Acceptance Criteria: