onaio / fhir-gateway-extension

This repo holds the OpenSRP permissions checker and data access checker
Other
0 stars 1 forks source link

Add support for pagination of list entries #32

Closed lincmba closed 8 months ago

lincmba commented 8 months ago

fixes https://github.com/onaio/fhir-gateway-plugin/issues/29

IMPORTANT: Where possible all PRs must be linked to a Github issue

Resolves [link to issue]

Engineer Checklist

ndegwamartin commented 8 months ago

@lincmba lets add some documentation on the READ ME

ndegwamartin commented 8 months ago

@lincmba see my comment here https://github.com/onaio/fhir-gateway-plugin/issues/29#issuecomment-1923329141

ndegwamartin commented 8 months ago

Tested out the implementation, the pagination itself works 👍🏾 but the pagination links are not returned.

Getting this as a response (tested with paginated count of 2):

{
    "resourceType": "Bundle",
    "id": "04bc098a-5ab8-42bb-ab5f-f9a2198f3900",
    "type": "batch-response",
    "link": [
        {
            "relation": "self",
            "url": "http://fhir-shared-stage-sync-hapi-fhir.opensrp.svc:8080/fhir"
        }
    ],
    "entry": [
        {
            "resource": {
                "resourceType": "Group",
                "id": "6f3980e0-d1d6-4a7a-a950-939f3ca7b301",
                ....
ndegwamartin commented 8 months ago

Additionally update the unit tests to verify that the (previous/next) pagination links are returned correctly (depending on provided _ count).

Note, the base url should be the same one from the request that was made.