ovok_sdk.paging

Paged results and the loaders for each list format Ovok returns.

  • Stable unknown
  • Release candidate since 0.1.0-rc.4
  • Development since 0.1.0-dev.25+2ba84b0

Paged results and the loaders for each list format Ovok returns.

Page

Page(data: list[T], total: int | None, _load_next: NextPage[T] | None = None)

Bases: Generic[T]

One page of a list, able to load the pages after it.

Attributes

NameTypeDescription
datalist[T]Items on this page.
totalint | NoneTotal number of items across all pages, when the API reports it.

Examples

>>> for patient in ovok.fhir.search("Patient").auto_paging_iter():
...     print(patient["id"])

has_more

has_more: bool

Whether a later page exists.

next_page()

next_page() -> Page[T] | None

Load the next page.

Returns

  • Page[T] | None: The next page, or None when this is the last one.

auto_paging_iter()

auto_paging_iter() -> Iterator[T]

Every item from this page on, loading each later page as the walk reaches it.

Yields

  • T: Each item, in order.

bundle_page()

bundle_page(bundle: Json, load_next: Callable[[str], Page[Any]]) -> Page[Any]

Follows the next link by its query only: Medplum writes its own host there, and Ovok is the only door.

numbered_pages()

numbered_pages(
    load: Callable[[int], Json],
    first_page: int = FIRST_NUMBERED_PAGE,
) -> Page[Any]

Ovok's page-numbered lists: {total, page, count, resources} with page 0-based.

numbered_route_pages()

numbered_route_pages(
    read: Callable[[str], Json],
    path: str,
    query: Mapping[str, QueryValue],
) -> Page[Any]

Lists a page-numbered route with Ovok's query encoding; query["page"] is the first page loaded.

cursor_pages()

cursor_pages(load: Callable[[str | None], Json]) -> Page[Any]

Ovok's cursor lists: {items, nextCursor}, with the cursor passed back unchanged.

payload_pages()

payload_pages(
    load: Callable[[int | None], Json],
    first_page: int | None = None,
) -> Page[Any]

Payload CMS lists: {docs, totalDocs, nextPage} with 1-based pages.

Last updated on

On this page