O3 Framework / useFhirPagination
useFhirPagination<
T>(url,pageSize,options):object
Defined in: packages/framework/esm-react-utils/src/useFhirPagination.ts:27
Fhir REST endpoints that return a list of objects, are server-side paginated. The server limits the max number of results being returned, and multiple requests are needed to get the full data set if its size exceeds this limit.
This function is the FHIR counterpart of useOpenmrsPagination.
T extends ResourceBase
The URL of the paginated rest endpoint.
which will be overridden and manipulated by the goTo* callbacks
string |
URL |
number
The number of results to return per page / fetch.
UseServerPaginationOptions<Bundle> = {}
The options object
currentPage:
number
currentPageSize:
MutableRefObject<number>
data:
undefined|T[]
error:
any
The error object thrown by the fetcher function.
goTo: (
page) =>void
number
void
goToNext: () =>
void
void
goToPrevious: () =>
void
void
isLoading:
boolean
isValidating:
boolean
mutate:
KeyedMutator<FetchResponse<Bundle>>
paginated:
boolean
showNextButton:
boolean
showPreviousButton:
boolean
totalCount:
number=totalCount.current
totalPages:
number
useOpenmrsPagination
@see useFhirInfinite
@see useFhirFetchAll
@see usePagination for pagination of client-side data