Searches for resources in the given FHIR store according to criteria specified as query parameters. Implements the FHIR standard search interaction (DSTU2, STU3, R4) using the search semantics described in the FHIR Search specification (DSTU2, STU3, R4). 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). 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). 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. For samples and detailed information, see Searching for FHIR resources and Advanced FHIR search features.

Scopes

You will need authorization for at least one of the following scopes to make a valid call:

  • https://www.googleapis.com/auth/cloud-healthcare
  • https://www.googleapis.com/auth/cloud-platform

If unset, the scope for this method defaults to https://www.googleapis.com/auth/cloud-healthcare. You can set the scope for this method like this: healthcare1 --scope <scope> projects locations-datasets-fhir-stores-fhir-search-type ...

Required Scalar Arguments

  • <parent> (string)
    • Required. Name of the FHIR store to retrieve resources from.
  • <resource-type> (string)
    • Required. The FHIR resource type to search, such as Patient or Observation. For a complete list, see the FHIR Resource Index (DSTU2, STU3, R4).

Required Request Value

The request value is a data-structure with various fields. Each field may be a simple scalar or another data-structure. In the latter case it is advised to set the field-cursor to the data-structure's field to specify values more concisely.

For example, a structure like this:

SearchResourcesRequest:
  resource-type: string

can be set completely with the following arguments which are assumed to be executed in the given order. Note how the cursor position is adjusted to the respective structures, allowing simple field names to be used most of the time.

  • -r . resource-type=eos
    • Required. The FHIR resource type to search, such as Patient or Observation. For a complete list, see the FHIR Resource Index (DSTU2, STU3, R4).

About Cursors

The cursor position is key to comfortably set complex nested structures. The following rules apply:

  • The cursor position is always set relative to the current one, unless the field name starts with the . character. Fields can be nested such as in -r f.s.o .
  • The cursor position is set relative to the top-level structure if it starts with ., e.g. -r .s.s
  • You can also set nested fields without setting the cursor explicitly. For example, to set a value relative to the current cursor position, you would specify -r struct.sub_struct=bar.
  • You can move the cursor one level up by using ... Each additional . moves it up one additional level. E.g. ... would go three levels up.

Optional Output Flags

The method's return value a JSON encoded structure, which will be written to standard output by default.

  • -o out
    • out specifies the destination to which to write the server's result to. It will be a JSON-encoded structure. The destination may be - to indicate standard output, or a filepath that is to contain the received bytes. If unset, it defaults to standard output.

Optional General Properties

The following properties can configure any call, and are not specific to this method.

  • -p $-xgafv=string

    • V1 error format.
  • -p access-token=string

    • OAuth access token.
  • -p alt=string

    • Data format for response.
  • -p callback=string

    • JSONP
  • -p fields=string

    • Selector specifying which fields to include in a partial response.
  • -p key=string

    • API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
  • -p oauth-token=string

    • OAuth 2.0 token for the current user.
  • -p pretty-print=boolean

    • Returns response with indentations and line breaks.
  • -p quota-user=string

    • Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
  • -p upload-type=string

    • Legacy upload protocol for media (e.g. "media", "multipart").
  • -p upload-protocol=string

    • Upload protocol for media (e.g. "raw", "multipart").