Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lincmba committed Feb 7, 2024
1 parent 365d679 commit 8696c88
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,17 @@ URL:
This approach ensures consistency and clarity when accessing various endpoint
types through the gateway.

### Pagination
### Custom Headers

#### FHIR-Gateway-Mode

##### Overview

The FHIR Gateway Mode allows for custom processing of responses from the FHIR
server. The mode is triggered by a HTTP Header sent by the client named
`FHIR-Gateway-Mode` with a value of `list-entries`.

##### Pagination

Pagination is supported in fetching data from a FHIR server using the List
endpoint. This can be useful when dealing with Resources with high volume of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,15 +323,17 @@ private Bundle postProcessModeListEntries(
int prevPage = page > 1 ? page - 1 : 0; // 0 indicates no previous page
Bundle resultBundle = fhirR4Client.transaction().withBundle(requestBundle).execute();
if (nextPage > 0) {
parameters.put("_page", new String[] {String.valueOf(nextPage)});
parameters.put(
Constants.PAGINATION_PAGE_NUMBER, new String[] {String.valueOf(nextPage)});
String nextUrl = constructUpdatedUrl(request, parameters);
Bundle.BundleLinkComponent nextLink = new Bundle.BundleLinkComponent();
nextLink.setRelation(IBaseBundle.LINK_NEXT);
nextLink.setUrl(nextUrl);
resultBundle.addLink(nextLink);
}
if (prevPage > 0) {
parameters.put("_page", new String[] {String.valueOf(prevPage)});
parameters.put(
Constants.PAGINATION_PAGE_NUMBER, new String[] {String.valueOf(prevPage)});
String prevUrl = constructUpdatedUrl(request, parameters);
Bundle.BundleLinkComponent previousLink = new Bundle.BundleLinkComponent();
previousLink.setRelation(IBaseBundle.LINK_PREV);
Expand Down

0 comments on commit 8696c88

Please sign in to comment.