tencent cloud

Basic Search API

Download
フォーカスモード
フォントサイズ
最終更新日: 2026-08-28 16:06:55
AI翻訳

API Description

This is used to perform conditional searches on specified resource types based on standard FHIR search capabilities. The client can access the resource type endpoint via the HTTP GET method and include search parameters in the URL to filter for resource records that meet the criteria.
Basic search supports the following common methods:
No-parameter search: returns a list of records for the specified resource type.
Single-parameter search: filters results based on a single search field.
Multi-parameter combined search: multiple parameters are combined by default using an AND relationship.
Comma-separated value search: multiple values within the same parameter are matched using an OR relationship.
This example demonstrates common methods for performing basic searches on Patient resources.

Input parameters

Parameter Name
Type
Required
Description
HTTP Method
String
Yes
Fixed as GET.
URL
String
Yes
The search address, in the format [baseUrl]/[resourceType] or [baseUrl]/[resourceType]?[searchParams].
Authorization
String
Yes
The access token, in the format Bearer <AccessToken>. For details on how to obtain it, see Calling Method.
Accept
String
No
The response format. It is recommended to use application/fhir+json.
searchParams
String
No
Search parameters, which are appended after the URL in the form of a URL query string (key=value&...), supporting single or multiple parameter combinations.
Common search parameter descriptions:
Parameter Name
Type
Required
Description
name
String
No
Search by patient name, matching name-related fields.
gender
String
No
Search by gender, for example, male or female.
family
String
No
Search by family name.
given
String
No
Search by given name. Multiple values separated by commas are supported.
Note:
When no search parameters are passed, the system returns a list of records for the specified resource type.
When multiple different parameters are passed simultaneously, they are combined by default using an AND relationship.
When multiple comma-separated values are passed for the same parameter, they are typically processed using an OR relationship.
Search results are typically returned using a paging policy, and a single response may contain only a subset of records.

Output Parameters

Upon a successful API call, the HTTP status code 200 OK is typically returned. The response body is usually a Bundle resource, which contains the list of resources matched by the search and pagination information.
Key Response Body Field Descriptions:
Field
Type
Description
resourceType
String
Returns the resource type, usually Bundle.
id
String
Unique ID of the Bundle resource, usually a UUID.
meta
Object
Metadata of the Bundle, containing fields such as lastUpdated.
meta.lastUpdated
String
Generation time of the Bundle, in ISO 8601 format.
type
String
The Bundle type is usually searchset in search scenarios.
total
Integer
The total number of matched records. This field may not be returned by default and is only returned when the server can efficiently calculate. The current server does not support forcing the return of an accurate total via _total=accurate.
entry
Array
The list of search results.
entry[].fullUrl
String
The complete access URL of the resource.
entry[].resource
Object
The matched resource content.
entry[].resource.id
String
Unique ID of the resource.
entry[].resource.meta
Object
Metadata of the resource, containing fields such as versionId and lastUpdated.
entry[].search.mode
String
Search hit mode.
link
Array
Pagination link information, such as the first page, the next page, and so on.

Examples

Request Example

Example 1: No-parameter search
GET /INSTANCE_ID/fhir/Patient HTTP/1.1
Host: HOSTNAME
Authorization: Bearer <AccessToken>
Accept: application/fhir+json
Example 2: Search by name
GET /INSTANCE_ID/fhir/Patient?name=chalmers HTTP/1.1
Host: HOSTNAME
Authorization: Bearer <AccessToken>
Accept: application/fhir+json
Example 3: Multi-parameter combined search (AND)
GET /INSTANCE_ID/fhir/Patient?name=chalmers&gender=male HTTP/1.1
Host: HOSTNAME
Authorization: Bearer <AccessToken>
Accept: application/fhir+json
Example 4: Comma-separated multi-value search (OR)
GET /INSTANCE_ID/fhir/Patient?given=peter,james HTTP/1.1
Host: HOSTNAME
Authorization: Bearer <AccessToken>
Accept: application/fhir+json

Response Example

{
"resourceType": "Bundle",
"id": "2d7b3566-1773-40b3-abd4-0c8ebdd6466f",
"meta": {
"lastUpdated": "2026-07-08T21:24:05.941+08:00"
},
"type": "searchset",
"link": [
{
"relation": "self",
"url": "https://HOSTNAME/INSTANCE_ID/fhir/Patient?name=chalmers"
}
],
"entry": [
{
"fullUrl": "https://HOSTNAME/INSTANCE_ID/fhir/Patient/199963",
"resource": {
"resourceType": "Patient",
"id": "199963",
"meta": {
"versionId": "1",
"lastUpdated": "2022-10-10T07:07:33.086-04:00"
},
"name": [
{
"family": "Chalmers",
"given": [
"Peter",
"James"
]
}
],
"gender": "male"
},
"search": {
"mode": "match"
}
}
]
}

Error Codes

Common error codes are listed below. For more error codes, see Error Codes.
Error Code
Description
400 Bad Request
The search parameter format is incorrect, or the parameter value does not meet the requirements.
401 Unauthorized
Not authenticated, and valid credentials are missing.
403 Forbidden
Authenticated but not authorized to search the resource.
404 Not Found
The specified resource type does not exist.
422 Unprocessable Entity
The search parameter syntax is correct, but it fails business or rule validation.
500 Internal Server Error
Internal server processing exception.


ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック