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 016de07 commit bac7e2a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,19 @@ types through the gateway.

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`.
`FHIR-Gateway-Mode` with a value e.g. `list-entries`(Currently only supported).

##### Pagination
##### FHIR-Gateway-Mode: list-entries

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
This mode is used when using the `/List` endpoint. Normally, fetching using this
endpoint returns a list of references which can then be used to query for the
actual resources. With this header value configured the response is instead a
Bundle that contains all the actual (referenced) resources.

###### Pagination

Pagination is supported in fetching the data from a FHIR server. This can be
useful when dealing with List resources that have a large number of referenced
entries like Locations.

To enable pagination, you need to include two parameters in the request URL:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ private Bundle postProcessModeListEntries(
}

Bundle resultBundle = fhirR4Client.transaction().withBundle(requestBundle).execute();

// add total
resultBundle.setTotal(requestBundle.getEntry().size());

// add pagination links
Expand All @@ -329,7 +331,6 @@ private Bundle postProcessModeListEntries(

Bundle.BundleLinkComponent selfLink = new Bundle.BundleLinkComponent();
List<Bundle.BundleLinkComponent> link = new ArrayList<>();
;
String selfUrl = constructUpdatedUrl(request, parameters);
selfLink.setRelation(IBaseBundle.LINK_SELF);
selfLink.setUrl(selfUrl);
Expand Down

0 comments on commit bac7e2a

Please sign in to comment.