本頁說明如何查看 FHIR 儲存庫的下列指標:
- FHIR 儲存庫中的 FHIR 資源類型
- 各類型資源的數量
- FHIR 儲存庫中的資料大小
您可以利用這些指標執行下列操作:
新增或變更 FHIR 資源時,系統會以非同步方式將資源新增至 FHIR 儲存庫。變更生效後,指標可能不會立即更新。
下列範例說明如何查看 FHIR 存放區的指標。
控制台
gcloud
執行 gcloud healthcare fhir-stores metrics
指令。
使用下方的任何指令資料之前,請先替換以下項目:
- PROJECT_ID:您的 Google Cloud 專案 ID
- LOCATION:資料集位置
- DATASET_ID:FHIR 儲存庫的父項資料集
- FHIR_STORE_ID:FHIR 儲存庫 ID
執行下列指令:
Linux、macOS 或 Cloud Shell
gcloud healthcare fhir-stores metrics FHIR_STORE_ID \ --project=PROJECT_ID \ --location=LOCATION \ --dataset=DATASET_ID
Windows (PowerShell)
gcloud healthcare fhir-stores metrics FHIR_STORE_ID ` --project=PROJECT_ID ` --location=LOCATION ` --dataset=DATASET_ID
Windows (cmd.exe)
gcloud healthcare fhir-stores metrics FHIR_STORE_ID ^ --project=PROJECT_ID ^ --location=LOCATION ^ --dataset=DATASET_ID
您應該會收到類似以下的回應:
回應
metrics: - count: 'FHIR_RESOURCE_TYPE_COUNT' resourceType: FHIR_RESOURCE_TYPE structuredStorageSizeBytes: 'FHIR_RESOURCE_TYPE_SIZE' ... name: projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID
REST
請使用 fhirStores.getFHIRStoreMetrics
方法。
使用任何要求資料之前,請先替換以下項目:
- PROJECT_ID:您的 Google Cloud 專案 ID
- LOCATION:資料集位置
- DATASET_ID:FHIR 儲存庫的父項資料集
- FHIR_STORE_ID:FHIR 儲存庫 ID
如要傳送要求,請選擇以下其中一個選項:
curl
執行下列指令:
curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID:getFHIRStoreMetrics"
PowerShell
執行下列指令:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID:getFHIRStoreMetrics" | Select-Object -Expand Content
APIs Explorer
開啟方法參考頁面。系統會在頁面右側開啟 APIs Explorer 面板。您可以使用這項工具來傳送要求。完成任何必填欄位,然後按一下「執行」。
您應該會收到如下的 JSON 回應: