Paging Through FHIR® Results

This page covers the query parameters accepted when retrieving FHIR® resources from the legacy /R4/ API, and how to page through a result set. Any query parameter not listed below returns a 400.

If you have any questions about your specific use case, reach out to your Particle account team.


Supported query parameters

ParameterNotes
patientRequired. The FHIR® Patient ID whose resources you want.
_countNumber of resources per page. Default and maximum 1000.
_page_tokenReturns the next page. Take the value from the response's next link.
❗️

Particle does not implement the wider FHIR® search specification. code, identifier, _text, _include, _revinclude, _lastUpdated and the :missing modifier all return a 400, as do comma-separated (OR) values.


Paging through results

📘

🔥 See HL7 FHIR® Spec

The _count query parameter limits the number of resources returned on a single page. If, for example, a patient has 500 observation resources available, and a client only wants to return 50 observations per page, _count=50 can be added to the search request to apply this to the response:

https://api.particlehealth.com/R4/Observation/?patient={patient_id}&_count=50

The last element at the bottom of the response will contain a JSON element labeled link. If one of the relation elements in link contains next, this indicates there are more pages as a part of the response. If "relation": "next" is present, copy the url and use it as the next endpoint to query. That will provide the next page of entries. Once there is no "relation": "next" present, there are no more entries or pages to review.

Example:

"link": [
    {
        "relation": "search",
        "url": "search_url"
    },
    {
        "relation": "next",
        "url": "url_to_return_next_50_resources"
    },
    {
        "relation": "first",
        "url": "url_to_first_page"
    },
    {
        "relation": "self",
        "url": "url_to_current_page"
    }
]
❗️

🔥 The maximum number of resources the API returns per page is 1000, which is also the default when _count is omitted. A _count above 1000 or below 1 is treated as 1000 rather than rejected.

If more than 1000 resources exist, use the next link to paginate through all results.



Did this page help you?