帮你快速理解、总结文档立即下载

患者全量信息检索

最近更新时间:2026-07-28 16:18:01

我的收藏

接口描述

用于检索与指定患者相关联的全部资源数据。该接口通过患者实例上的 $everything 操作返回该患者的全量关联信息,通常包括患者基本信息、就诊记录、检验结果、诊断、用药等相关资源。
该接口适用于患者全景视图、病历汇总、跨资源数据聚合等场景。
本示例展示了调用患者 $everything 操作以及结合 _count 控制单页返回条数的方式。

输入参数

参数名称
类型
是否必填
说明
HTTP Method
String
固定为 GET
URL
String
操作地址,格式为 [baseUrl]/Patient/[id]/$everything
Authorization
String
访问令牌,格式为 Bearer <AccessToken>。获取方式详见 调用方式
Accept
String
响应格式,建议使用 application/fhir+json
id
String
患者资源唯一 ID。可通过创建资源时返回的 id 字段获取,或通过 基础搜索接口 查询患者列表后获取。
_count
Integer
控制单页返回记录数。
说明:
$everything 用于返回与目标患者相关联的多种资源。
返回结果通常为 Bundle,并可能因数据量较大而分页返回。
可结合 _count 参数控制单页结果数量。

输出参数

接口调用成功后,通常返回 HTTP 状态码 200 OK,响应体一般为 Bundle 资源,包含与指定患者相关的资源集合及分页信息。
响应体主要字段说明:
字段
类型
说明
resourceType
String
返回资源类型,通常为 Bundle
id
String
Bundle 资源的唯一 ID,通常为 UUID。
meta
Object
Bundle 元数据,包含 lastUpdated 等字段。
meta.lastUpdated
String
Bundle 生成时间,ISO 8601 格式。
type
String
Bundle 类型,通常为 searchset
total
Integer
命中的总资源数量。
link
Array
分页链接信息,如 selfnext 等。
entry
Array
关联资源列表。
entry[].fullUrl
String
资源的完整访问地址。
entry[].resource
Object
与患者相关的资源内容。
entry[].resource.id
String
资源的唯一 ID。
entry[].resource.meta
Object
资源元数据,包含 versionIdlastUpdated 等。
entry[].search.mode
String
搜索命中模式,通常为 match

示例

请求示例

示例一:获取指定患者的全部关联资源。
GET /INSTANCE_ID/fhir/Patient/1228032/$everything HTTP/1.1
Host: HOSTNAME
Authorization: Bearer <AccessToken>
Accept: application/fhir+json
示例二:控制单页返回数量。
GET /INSTANCE_ID/fhir/Patient/1228032/$everything?_count=50 HTTP/1.1
Host: HOSTNAME
Authorization: Bearer <AccessToken>
Accept: application/fhir+json

响应示例

{
"resourceType": "Bundle",
"id": "c48fc429-6091-4f61-abce-62388b08ccbc",
"meta": {
"lastUpdated": "2026-07-09T18:45:41.430+08:00"
},
"type": "searchset",
"total": 3,
"link": [
{
"relation": "self",
"url": "https://HOSTNAME/INSTANCE_ID/fhir/Patient/1228032/$everything"
}
],
"entry": [
{
"fullUrl": "https://HOSTNAME/INSTANCE_ID/fhir/Patient/1228032",
"resource": {
"resourceType": "Patient",
"id": "1228032",
"meta": {
"versionId": "1",
"lastUpdated": "2022-10-10T07:07:33.086-04:00"
}
},
"search": {
"mode": "match"
}
},
{
"fullUrl": "https://HOSTNAME/INSTANCE_ID/fhir/Encounter/enc-20001",
"resource": {
"resourceType": "Encounter",
"id": "enc-20001",
"meta": {
"versionId": "1",
"lastUpdated": "2022-10-11T08:30:00.000+08:00"
},
"subject": {
"reference": "Patient/1228032"
}
},
"search": {
"mode": "match"
}
},
{
"fullUrl": "https://HOSTNAME/INSTANCE_ID/fhir/Observation/obs-30001",
"resource": {
"resourceType": "Observation",
"id": "obs-30001",
"meta": {
"versionId": "1",
"lastUpdated": "2022-10-12T09:15:00.000+08:00"
},
"subject": {
"reference": "Patient/1228032"
}
},
"search": {
"mode": "match"
}
}
]
}

错误码

常见错误码如下,更多错误码请参见 错误码
错误码
说明
400 Bad Request
请求参数格式错误,或患者 ID 非法
401 Unauthorized
未认证,缺少有效身份凭证
403 Forbidden
已认证但无访问该患者全量数据的权限
404 Not Found
指定患者不存在
422 Unprocessable Entity
请求语法正确,但未通过业务或规则校验
500 Internal Server Error
服务端内部处理异常