tencent cloud

vRead

Download
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-08-28 16:06:55
AI 번역

API Description

This is used to read the content of a specified historical version of a resource based on its resource ID and version number. This API follows the standard FHIR vRead operation. The client accesses the historical version address of the specified resource via the HTTP GET method, and the server returns the complete content and version information for the corresponding version of that resource.
This example demonstrates how to call the API to read a specific historical version of a Patient resource.

Input parameters

Parameter Name
Type
Required
Description
HTTP Method
String
Yes
Fixed as GET.
URL
String
Yes
The address for reading historical versions, in the format [baseUrl]/[resourceType]/[id]/_history/[versionId].
Authorization
String
Yes
The authentication token, in the format Bearer <AccessToken>. The AccessToken is obtained via the GetAccessToken API in Calling Methods (or via the GetWebAccessToken API in the instance console scenario).
Path Parameter Description:
Field
Type
Required
Description
resourceType
String
Yes
The FHIR resource type, such as Patient, Observation, MedicationRequest, and so on. To view all resource types actually supported by the current instance, call the CapabilityStatement API via GET /INSTANCE_ID/fhir/metadata and check the returned rest[].resource[].type (the resource types supported by an instance can be configured and trimmed during creation via supported_resource_types, which may vary across instances). For field definitions of each resource type, refer to FHIR Resource Types.
id
String
Yes
The unique ID of the resource. It is the logical ID automatically assigned by the server when the resource is created, and can be obtained in the following ways:
Call the Create API (POST) to create a resource. Obtain the resource identifier from the Content-Location response header or the id field in the response body.
Call the Search API (GET /[resourceType]?_id= or /[resourceType]?identifier=) to query for existing resource IDs.
versionId
String
Yes
The historical version number of the resource. It can be obtained in the following ways:
When you call the Read API (GET /[resourceType]/[id]), the current version number is located in the ETag response header or the meta.versionId field in the response body.
Calling the History API (GET /[resourceType]/[id]/_history) returns a complete list of all historical versions for that resource. In this list, the versionId of each record is the available version number.
Request URL Example:
https://HOSTNAME/INSTANCE_ID/fhir/Patient/199963/_history/3

Output Parameters

Upon a successful API call, the HTTP status code 200 OK is typically returned. The response headers contain the version information for the currently returned version and the historical version URL, while the response body returns the complete content of the corresponding version of the resource.
Response Header Example Description:
Parameter Name
Type
Description
Status Code
Integer
Returns 200 OK when successful.
ETag
String
Resource version identifier, for example W/"3".
Content-Location
String
The address of the historical version currently returned.
Last-Modified
String
The last modification time of the resource, in the HTTP-date format, for example Mon, 06 Jul 2026 08:42:36 GMT.
Key Response Body Field Descriptions:
Field
Type
Description
resourceType
String
Resource type
id
String
Unique ID of the resource.
meta.versionId
String
Version ID of the currently returned resource.
meta.lastUpdated
String
Update time of this version of the resource.
meta.source
String
Identifier of the resource source, returned only when this field was specified during resource creation/update.
identifier
Array
Identification information.
name
Array
Name information.
gender
String
Gender.
birthDate
String
Date of birth.
address
Array
Address information.
Note:
Whether the text field (Narrative summary) is included in the response body depends on the server's Narrative configuration. When the configuration is enabled (narrative_enabled=true), the text.status and text.div fields are returned. When the configuration is disabled, the text field is not returned.
The possible values for text.status are generated, extensions, additional, and empty.
The meta.source field is returned only if it was specified during resource creation or update. This field is used to identify the original source system of the resource. It can be set via the X-Source request header (which requires the server to enable the CaptureResourceSourceFromHeaderInterceptor) or by the client directly writing to meta.source.
In the Patient resource example, the fields identifier, name, gender, birthDate, and address are sample fields. The actual business fields in the response body depend on the type of resource being read.

Examples

Request Example

GET /INSTANCE_ID/fhir/Patient/199963/_history/3 HTTP/1.1
Host: HOSTNAME
Authorization: Bearer <token>

Response Example

HTTP/1.1 200 OK
ETag: W/"3"
Content-Location: https://HOSTNAME/INSTANCE_ID/fhir/Patient/199963/_history/3
Last-Modified: Mon, 06 Jul 2026 08:42:36 GMT
{
"resourceType": "Patient",
"id": "199963",
"meta": {
"versionId": "3",
"lastUpdated": "2019-07-12T01:58:07.164+00:00",
"source": "#PR9lyCiz7HWynomw"
},
"identifier": [
{
"system": "urn:oid:1.2.36.146.595.217.0.1",
"value": "12345"
}
],
"name": [
{
"family": "Chalmers",
"given": [
"Peter",
"James"
]
}
],
"gender": "male",
"birthDate": "1974-02-13",
"address": [
{
"line": [
"534 Erewhon St"
],
"city": "PleasantVille",
"state": "Vic",
"postalCode": "M5C 2X8"
}
]
}

Error Codes

Common error codes are listed below. For more error codes, see Error Codes.
Error Code
Description
400 Bad Request
The request format is incorrect, or the version number format is invalid.
401 Unauthorized
Not authenticated, and valid credentials are missing.
403 Forbidden
Authenticated but not authorized to read the historical version of the resource.
404 Not Found
The specified resource or historical version does not exist.
410 Gone
The specified historical version is no longer accessible.
500 Internal Server Error
Internal server processing exception.


도움말 및 지원

문제 해결에 도움이 되었나요?

피드백