Stay organized with collections
Save and categorize content based on your preferences.
Full name: projects.locations.datasets.fhirStores.fhir.search
Searches for resources in the given FHIR store according to criteria specified as query parameters.
Implements the FHIR standard search interaction (DSTU2, STU3, R4, R5) using the search semantics described in the FHIR Search specification (DSTU2, STU3, R4, R5).
Supports four methods of search defined by the specification:
GET [base]?[parameters] to search across all resources.
GET [base]/[type]?[parameters] to search resources of a specified type.
POST [base]/_search?[parameters] as an alternate form having the same semantics as the GET method across all resources.
POST [base]/[type]/_search?[parameters] as an alternate form having the same semantics as the GET method for the specified type.
The GET and POST methods do not support compartment searches. The POST method does not support application/x-www-form-urlencoded search parameters.
On success, the response body contains a JSON-encoded representation of a Bundle resource of type searchset, containing the results of the search. Errors generated by the FHIR store contain a JSON-encoded OperationOutcome resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead.
The server's capability statement, retrieved through capabilities, indicates what search parameters are supported on each FHIR resource. A list of all search parameters defined by the specification can be found in the FHIR Search Parameter Registry (STU3, R4, R5). FHIR search parameters for DSTU2 can be found on each resource's definition page.
Supported search modifiers: :missing, :exact, :contains, :text, :in, :not-in, :above, :below, :[type], :not, and recurse (DSTU2 and STU3) or :iterate (R4 and R5).
Supported search result parameters: _sort, _count, _include, _revinclude, _summary=text, _summary=data, and _elements.
The maximum number of search results returned defaults to 100, which can be overridden by the _count parameter up to a maximum limit of 1000. The server might return fewer resources than requested to prevent excessively large responses. If there are additional results, the returned Bundle contains a link of relation "next", which has a _page_token parameter for an opaque pagination token that can be used to retrieve the next page.
Resources with a total size larger than 5MB or a field count larger than 50,000 might not be fully searchable as the server might trim its generated search index in those cases.
Note: FHIR resources are indexed asynchronously, so there might be a slight delay between the time a resource is created or changed, and the time when the change reflects in search results. The only exception is resource identifier data, which is indexed synchronously as a special index. As a result, searching using resource identifier is not subject to indexing delay. To use the special synchronous index, the search term for identifier should be in the pattern identifier=[system]|[value] or identifier=[value], and any of the following search result parameters can be used:
_count
_include
_revinclude
_summary
_elements
If your query contains any other search parameters, the standard asynchronous index will be used instead. Note that searching against the special index is optimized for resolving a small number of matches. The search isn't optimized if your identifier search criteria matches a large number (i.e. more than 2,000) of resources. For a search query that will match a large number of resources, you can avoiding using the special synchronous index by including an additional _sort parameter in your query. Use _sort=-_lastUpdated if you want to keep the default sorting order. Note: The special synchronous identifier index are currently disabled for DocumentReference and DocumentManifest searches.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-23 UTC."],[[["\u003cp\u003eThis API endpoint, \u003ccode\u003eprojects.locations.datasets.fhirStores.fhir.search\u003c/code\u003e, allows searching for resources within a specified FHIR store using FHIR standard search parameters across DSTU2, STU3, and R4 versions.\u003c/p\u003e\n"],["\u003cp\u003eIt supports both \u003ccode\u003eGET\u003c/code\u003e and \u003ccode\u003ePOST\u003c/code\u003e methods for searching, with variations to search across all resources or resources of a specific type, however \u003ccode\u003ePOST\u003c/code\u003e methods do not support compartment searches or \u003ccode\u003eapplication/x-www-form-urlencoded\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eSearch results are returned as a JSON-encoded \u003ccode\u003eBundle\u003c/code\u003e resource, with errors described in a JSON-encoded \u003ccode\u003eOperationOutcome\u003c/code\u003e resource, and pagination is supported via a \u003ccode\u003e_page_token\u003c/code\u003e parameter in the \u003ccode\u003enext\u003c/code\u003e relation link within the \u003ccode\u003eBundle\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe search functionality includes support for a variety of search modifiers and result parameters, such as \u003ccode\u003e:missing\u003c/code\u003e, \u003ccode\u003e_sort\u003c/code\u003e, \u003ccode\u003e_count\u003c/code\u003e, and \u003ccode\u003e_include\u003c/code\u003e, with the capability statement indicating supported search parameters.\u003c/p\u003e\n"],["\u003cp\u003eWhile the server indexes FHIR resources asynchronously, searches on resource identifiers, following the pattern \u003ccode\u003eidentifier=[system]|[value]\u003c/code\u003e or \u003ccode\u003eidentifier=[value]\u003c/code\u003e, are indexed synchronously, but this is currently disabled for \u003ccode\u003eDocumentReference\u003c/code\u003e and \u003ccode\u003eDocumentManifest\u003c/code\u003e searches.\u003c/p\u003e\n"]]],[],null,["# Method: fhir.search\n\n**Full name**: projects.locations.datasets.fhirStores.fhir.search\n\nSearches for resources in the given FHIR store according to criteria specified as query parameters.\n\nImplements the FHIR standard search interaction ([DSTU2](https://hl7.org/fhir/DSTU2/http.html#search), [STU3](https://hl7.org/fhir/STU3/http.html#search), [R4](https://hl7.org/fhir/R4/http.html#search), [R5](https://hl7.org/fhir/R5/http.html#search)) using the search semantics described in the FHIR Search specification ([DSTU2](https://hl7.org/fhir/DSTU2/search.html), [STU3](https://hl7.org/fhir/STU3/search.html), [R4](https://hl7.org/fhir/R4/search.html), [R5](https://hl7.org/fhir/R5/search.html)).\n\nSupports four methods of search defined by the specification:\n\n- `GET [base]?[parameters]` to search across all resources.\n- `GET [base]/[type]?[parameters]` to search resources of a specified type.\n- `POST [base]/_search?[parameters]` as an alternate form having the same semantics as the `GET` method across all resources.\n- `POST [base]/[type]/_search?[parameters]` as an alternate form having the same semantics as the `GET` method for the specified type.\n\nThe `GET` and `POST` methods do not support compartment searches. The `POST` method does not support `application/x-www-form-urlencoded` search parameters.\n\nOn success, the response body contains a JSON-encoded representation of a `Bundle` resource of type `searchset`, containing the results of the search. Errors generated by the FHIR store contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead.\n\nThe server's capability statement, retrieved through [capabilities](/healthcare-api/docs/reference/rest/v1beta1/projects.locations.datasets.fhirStores.fhir/capabilities#google.cloud.healthcare.v1beta1.fhir.rest.FhirService.GetCapabilityStatement), indicates what search parameters are supported on each FHIR resource. A list of all search parameters defined by the specification can be found in the FHIR Search Parameter Registry ([STU3](https://hl7.org/fhir/STU3/searchparameter-registry.html), [R4](https://hl7.org/fhir/R4/searchparameter-registry.html), [R5](https://hl7.org/fhir/R5/searchparameter-registry.html)). FHIR search parameters for DSTU2 can be found on each resource's definition page.\n\nSupported search modifiers: `:missing`, `:exact`, `:contains`, `:text`, `:in`, `:not-in`, `:above`, `:below`, `:[type]`, `:not`, and `recurse` (DSTU2 and STU3) or `:iterate` (R4 and R5).\n\nSupported search result parameters: `_sort`, `_count`, `_include`, `_revinclude`, `_summary=text`, `_summary=data`, and `_elements`.\n\nThe maximum number of search results returned defaults to 100, which can be overridden by the `_count` parameter up to a maximum limit of 1000. The server might return fewer resources than requested to prevent excessively large responses. If there are additional results, the returned `Bundle` contains a link of `relation` \"next\", which has a `_page_token` parameter for an opaque pagination token that can be used to retrieve the next page.\n\nResources with a total size larger than 5MB or a field count larger than 50,000 might not be fully searchable as the server might trim its generated search index in those cases.\n\nNote: FHIR resources are indexed asynchronously, so there might be a slight delay between the time a resource is created or changed, and the time when the change reflects in search results. The only exception is resource identifier data, which is indexed synchronously as a special index. As a result, searching using resource identifier is not subject to indexing delay. To use the special synchronous index, the search term for identifier should be in the pattern `identifier=[system]|[value]` or `identifier=[value]`, and any of the following search result parameters can be used:\n\n- `_count`\n- `_include`\n- `_revinclude`\n- `_summary`\n- `_elements`\n\nIf your query contains any other search parameters, the standard asynchronous index will be used instead. Note that searching against the special index is optimized for resolving a small number of matches. The search isn't optimized if your identifier search criteria matches a large number (i.e. more than 2,000) of resources. For a search query that will match a large number of resources, you can avoiding using the special synchronous index by including an additional `_sort` parameter in your query. Use `_sort=-_lastUpdated` if you want to keep the default sorting order. Note: The special synchronous identifier index are currently disabled for DocumentReference and DocumentManifest searches.\n\nFor samples and detailed information, see [Searching for FHIR resources](https://cloud.google.com/healthcare/docs/how-tos/fhir-search) and [Advanced FHIR search features](https://cloud.google.com/healthcare/docs/how-tos/fhir-advanced-search).\n\n### HTTP request\n\n`GET https://healthcare.googleapis.com/v1beta1/{parent=projects/*/locations/*/datasets/*/fhirStores/*}/fhir/{resourceType}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response is a generic HTTP response whose format is defined by the method.\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/cloud-healthcare`\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp)."]]