search patient resources on a FHIR R4 server using search parameters, _include, and bundle pagination

domain: fhir · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Send a GET request to {base}/Patient with query parameters such as family, given, birthdate, or identifier to filter results.
  2. Add _include=Patient:general-practitioner or similar to pull related resources into the same Bundle response.
  3. Parse the returned Bundle (type: searchset) and iterate over entry[].resource for each matched Patient.
  4. Check Bundle.link[] for a rel='next' URL and follow it to retrieve subsequent pages; repeat until no next link is present.
  5. Use _count to control page size and _total=accurate if you need the total match count (note: may be expensive on large servers).
  6. Prefer POST to {base}/Patient/_search if query strings are long or contain sensitive data, sending parameters as application/x-www-form-urlencoded.

Known gotchas

Related routes

Read and search Patient resources from a FHIR R4 server
fhir · 6 steps · unrated
Paginate through a large FHIR search result Bundle using next-page links
fhir · 6 steps · unrated
Use FHIR _include and chained search parameters to fetch related resources in one request
fhir · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans