发送反馈
刷新健康数据
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
在将数据首次导入到 Vertex AI Search 医疗保健数据存储区后,您可能在源 FHIR 存储区中执行了以下任一更新:
添加了新的 FHIR 资源
更新了现有的 FHIR 资源
已删除的 FHIR 资源
在这种情况下,您可以将源 FHIR 存储区中的更改协调 到 Vertex AI Search 医疗保健数据存储区中。
对账概览
关键术语 : Vertex AI Search 医疗保健数据存储区中的文档对应于 FHIR 存储区中的 FHIR R4 资源。
您可以增量或完全协调更改。下表对这两种模式进行了比较。
源 FHIR 存储区的更改
增量模式
完整模式
新的 FHIR 资源
向 Vertex AI Search 数据存储区添加新文档
向 Vertex AI Search 数据存储区添加新文档
更新了 FHIR 资源
替换 Vertex AI Search 数据存储区中的现有文档,同时保留文档 ID
替换 Vertex AI Search 数据存储区中的现有文档,同时保留文档 ID
已删除的 FHIR 资源
不进行对账
从 Vertex AI Search 数据存储区中移除相应文档
准备工作
查看 Google Cloud 项目的配额和限制 。每个项目的 Vertex AI Search Healthcare 数据存储区最多可包含 100 万个文档。如果在导入过程中达到此配额,导入过程会停止。
以下示例展示了如何使用 documents.import
方法从 Cloud Healthcare API FHIR 存储区导入增量更改。
执行此任务所需的权限
向包含 AI 应用数据存储区的项目中的 service-PROJECT_NUMBER @gcp-sa-discoveryengine.iam.gserviceaccount.com
服务账号授予以下 Identity and Access Management (IAM) 角色:
在包含 Cloud Healthcare API FHIR R4 数据存储区的项目中,向 service-PROJECT_NUMBER @gcp-sa-discoveryengine.iam.gserviceaccount.com
服务账号授予以下 Identity and Access Management 角色:
用途
角色
从不同 Google Cloud 项目中的 Cloud Healthcare API FHIR 存储区执行 FHIR 数据流式导入。
在包含 Cloud Healthcare API FHIR R4 数据存储区的项目中,向 service-SOURCE_PROJECT_NUMBER @gcp-sa-healthcare.iam.gserviceaccount.com
服务账号授予以下 Identity and Access Management 角色:
REST
执行增量导入。
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-H "X-Goog-User-Project: PROJECT_ID " \
"https://us-discoveryengine.googleapis.com/v1alpha/projects/PROJECT_ID /locations/us/dataStores/DATA_STORE_ID /branches/0/documents:import" \
-d '{
"reconciliation_mode": "INCREMENTAL",
"fhir_store_source": {"fhir_store": "projects/PROJECT_ID /locations/CLOUD_HEALTHCARE_DATASET_LOCATION /datasets/CLOUD_HEALTHCARE_DATASET_ID /fhirStores/FHIR_STORE_ID "}
}'
替换以下内容:
PROJECT_ID
:您的 Google Cloud 项目的 ID。
DATA_STORE_ID
:Vertex AI Search 数据存储区的 ID。
CLOUD_HEALTHCARE_DATASET_ID
:包含源 FHIR 存储区的 Cloud Healthcare API 数据集的 ID。
CLOUD_HEALTHCARE_DATASET_LOCATION
:包含源 FHIR 存储区的 Cloud Healthcare API 数据集的位置。
FHIR_STORE_ID
:Cloud Healthcare API FHIR R4 存储区的 ID。
响应
您应该收到类似以下内容的 JSON 响应。响应包含长时间运行的操作的标识符。当方法调用可能需要大量时间才能完成时,会返回长时间运行的操作。记下 IMPORT_OPERATION_ID 的值。您需要此值来验证导入状态 。
{
"name": "projects/PROJECT_ID /locations/us/collections/default_collection/dataStores/DATA_STORE_ID /branches/0/operations/IMPORT_OPERATION_ID ",
"metadata": {
"@type": "type.googleapis.com/google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata"
}
}
验证 FHIR 数据导入操作是否已完成。
curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://us-discoveryengine.googleapis.com/v1alpha/projects/PROJECT_ID /locations/us/collections/default_collection/dataStores/DATA_STORE_ID /branches/0/operations/IMPORT_OPERATION_ID "
替换以下内容:
PROJECT_ID
:您的 Google Cloud 项目的 ID。
DATA_STORE_ID
:Vertex AI Search 数据存储区的 ID。
IMPORT_OPERATION_ID
:调用 import
方法时返回的长时间运行的操作的操作 ID。
响应
您应该收到类似以下内容的 JSON 响应。导入操作是一项长时间运行的操作。在操作运行期间,响应包含以下字段:
successCount
:表示目前已成功导入的 FHIR 资源数量。
failureCount
:表示目前导入失败的 FHIR 资源数量。仅当有任何 FHIR 资源未能成功导入时,此字段才会显示。
操作完成后,响应将包含以下字段:
successCount
:表示成功导入的 FHIR 资源数量。
failureCount
:表示导入失败的 FHIR 资源数量。仅当有任何 FHIR 资源未能成功导入时,此字段才会显示。
totalCount
:表示源 FHIR 存储区中存在的 FHIR 资源数量。仅当有任何 FHIR 资源未能成功导入时,此字段才会显示。
done
:值为 true
,表示导入操作已完成
errorSamples
:提供有关未能成功导入的资源的信息。仅当有任何 FHIR 资源未能成功导入时,此字段才会显示。
errorConfig
:提供包含错误摘要日志文件的 Cloud Storage 位置的路径。
{
"name": "projects/PROJECT_ID /locations/us/collections/default_collection/dataStores/DATA_STORE_ID /branches/0/operations/IMPORT_OPERATION_ID ",
"metadata": {
"@type": "type.googleapis.com/google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata",
"createTime": "START_TIMESTAMP ",
"updateTime": "END_TIMESTAMP ",
"successCount": "SUCCESS_COUNT ",
"failureCount": "FAILURE_COUNT ",
"totalCount": "TOTAL_COUNT ",
},
"done": true,
"response": {
"@type": "type.googleapis.com/google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse",
"errorSamples": [ERROR_SAMPLE ],
"errorConfig": {
"gcsPrefix": "LOG_FILE_LOCATION "
}
}
}
发送反馈
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可 获得了许可,并且代码示例已根据 Apache 2.0 许可 获得了许可。有关详情,请参阅 Google 开发者网站政策 。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-04。
需要向我们提供更多信息?
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-04。"],[[["Generative AI Services must not be used for clinical purposes, such as direct diagnosis or treatment, without review by a licensed professional, but can be used for administrative tasks."],["Outputs from Generative AI may be unreliable, containing incorrect or biased information, and should be considered draft content rather than final."],["This product's intended use is to retrieve and summarize existing medical information and not to provide recommendations pertaining to the prevention, diagnosis or treatment of illness or disease."],["You can reconcile changes to your source FHIR store, such as adding, updating, or deleting FHIR resources, into your Vertex AI Search healthcare data store using either incremental or full modes."],["To perform a FHIR data import, you will need to grant specific IAM roles to service accounts, depending on the task and the location of the FHIR data."]]],[]]