Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for pagination of list entries #32

Merged
merged 7 commits into from
Feb 7, 2024
Merged

Conversation

lincmba
Copy link
Contributor

@lincmba lincmba commented Jan 31, 2024

fixes #29

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

Resolves [link to issue]

Engineer Checklist

  • I have written Unit tests for any new feature(s) and edge cases for
    bug fixes
  • I have run mvn spotless:check to check my code follows the project's
    style guide
  • I have run mvn clean test jacoco:report to confirm the coverage report
    was generated at plugins/target/site/jacoco/index.html
  • I ran mvn clean package right before creating this pull request.

@lincmba lincmba force-pushed the paginate_list_entries branch 3 times, most recently from b9fbc6a to 9b0e0ef Compare February 1, 2024 07:27
@pld pld requested a review from ndegwamartin February 1, 2024 13:09
@ndegwamartin
Copy link
Collaborator

@lincmba lets add some documentation on the READ ME

@ndegwamartin
Copy link
Collaborator

@lincmba see my comment here #29 (comment)

@ndegwamartin
Copy link
Collaborator

ndegwamartin commented Feb 2, 2024

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
Copy link
Collaborator

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.

README.md Outdated Show resolved Hide resolved
@lincmba lincmba force-pushed the paginate_list_entries branch 2 times, most recently from a34c46d to 322832a Compare February 7, 2024 12:02
 - Add README documentation
 - Move Magic Strings to constants file
 - Add functionality to a separate use case of when `/List?_id` is used
 - Update Tests with these changes
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Make self link consistent with other pagination links
@lincmba lincmba merged commit d1d1f21 into main Feb 7, 2024
1 check passed
@lincmba lincmba deleted the paginate_list_entries branch February 7, 2024 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pagination for List Entries
2 participants