Skip to content

Handle pagination in FHIR search #129

@jenniferjiangkells

Description

@jenniferjiangkells

Description

Context

Possible Implementation

# Handle paginated results
def process_all_patients(results: Bundle):
    for entry in results.entry:
        yield entry.resource

# Get first page
results = await gateway.search(Patient, {"family": "Smith"}, "epic")

# Process all pages
for patient in process_all_patients(results):
    print(f"Processing patient: {patient.id}")

# Get next page if available
if results.link:
    next_url = next((link.url for link in results.link if link.relation == "next"), None)
    if next_url:
        # Handle next page...
        pass

Metadata

Metadata

Assignees

Labels

Component: GatewayIssue/PR that handles connections, API gatewayshacktoberfestIssues suitable for hacktoberfest

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions