ייבוא וייצוא של משאבי FHIR באמצעות Cloud Storage

בדף הזה מוסבר איך לייצא ולייבא משאבי FHIR אל Cloud Storage וממנו באמצעות השיטות projects.locations.datasets.fhirStores.import ו-projects.locations.datasets.fhirStores.export.

בהתאם לפורמט של נתוני FHIR, כדי לטעון נתונים למאגר FHIR, אפשר להשתמש בשיטה projects.locations.datasets.fhirStores.import או בשיטה projects.locations.datasets.fhirStores.fhir.executeBundle. הנחיות לבחירת שיטה זמינות במאמר בנושא ייבוא FHIR.

הגדרת הרשאות ב-Cloud Storage

לפני שמייצאים ומייבאים משאבי FHIR אל Cloud Storage וממנו, צריך להעניק הרשאות נוספות לחשבון השירות של סוכן Cloud Healthcare Service. מידע נוסף זמין במאמר בנושא הרשאות Cloud Storage למאגר FHIR.

יצירת נתוני מטופלים מסימולציה

‫Synthea™ הוא סימולטור ליצירת נתונים של אוכלוסיית מטופלים. אם אתם לא משתמשים ב-Synthea™‎ כדי ליצור נתונים של אוכלוסיית מטופלים, דלגו אל ייבוא משאבי FHIR או אל ייצוא משאבי FHIR.

אפשר לייבא נתונים רק בגרסה שהוגדרה בחנות FHIR שלכם.

כדי להוריד ולהתקין את Synthea™‎, מבצעים את השלבים הבאים:

  1. משכפלים את מאגר הכלים Synthea™‎ מ-GitHub:

    git clone https://github.com/synthetichealth/synthea.git
    
  2. משלימים את שלבי ההתקנה.

כדי ליצור נתונים לגרסה ספציפית של FHIR, ממשיכים לאחד מהקטעים הבאים:

יצירת נתוני מטופלים בסימולציה עבור R4

כברירת מחדל, נתוני Synthea™‎ שנוצרו משתמשים בייצוג JSON של FHIR R4 למשאבים. כדי ליצור נתונים בפורמט Synthea™ FHIR R4 ולייבא אותם למאגר FHIR של Cloud Healthcare API, מבצעים את השלבים הבאים:

  1. פועלים לפי ההוראות ליצירת נתוני מטופלים סינתטיים. הפלט של הנתונים שנוצרו הוא synthea/output/fhir_r4 עבור FHIR R4.

  2. מעתיקים את הנתונים שנוצרו לקטגוריה של Cloud Storage כדי שתוכלו לייבא אותם למאגר FHIR של Cloud Healthcare API. לדוגמה, כדי להעתיק את הנתונים לספרייה בשם synthea-data בקטגוריה של Cloud Storage קיימת, מריצים את הפקודה הבאה gcloud storage cp מהספרייה synthea:

    gcloud storage cp output/fhir_r4/* gs://BUCKET/synthea-data
  3. פועלים לפי ההוראות לייבוא משאבי FHIR.

יצירת נתוני מטופלים מסימולציה עבור DSTU2 או STU3

כדי ליצור נתוני Synthea™ FHIR DSTU2 או STU3 ולייבא אותם למאגר FHIR של Cloud Healthcare API, מבצעים את השלבים הבאים:

  1. בספרייה synthea, משתמשים בכלי לעריכת טקסט כדי לפתוח את הקובץ src/main/resources/synthea.properties ומבצעים את השינויים הבאים, בהתאם לסוג הנתונים שאתם יוצרים (DSTU2 או STU3).

    כדי ליצור נתוני FHIR STU3:

    • מגדירים את כל הערכים של *.fhir.export ו-*.fhir_dstu2.export ל-false
    • הגדרת כל הערכים של *.fhir_stu3.export כ-true

    כדי ליצור נתוני FHIR DSTU2:

    • מגדירים את כל הערכים של *.fhir.export ו-*.fhir_stu3.export ל-false
    • הגדרת כל הערכים של *.fhir_dstu2.export כ-true

    לדוגמה, כדי ליצור נתוני FHIR STU3:

    exporter.fhir.export = false
    exporter.fhir_stu3.export = true
    exporter.fhir_dstu2.export = false
    
    exporter.hospital.fhir.export = false
    exporter.hospital.fhir_stu3.export = true
    exporter.hospital.fhir_dstu2.export = false
    
    exporter.practitioner.fhir.export = false
    exporter.practitioner.fhir_stu3.export = true
    exporter.practitioner.fhir_dstu2.export = false
  2. פועלים לפי ההוראות ליצירת נתוני מטופלים סינתטיים. הפלט של הנתונים שנוצר מועבר אל synthea/output/fhir_stu3 עבור FHIR STU3 או אל הספרייה synthea/output/fhir_dstu2 עבור FHIR DSTU2.

  3. מעתיקים את הנתונים שנוצרו לקטגוריה של Cloud Storage כדי שתוכלו לייבא אותם למאגר FHIR של Cloud Healthcare API. לדוגמה, כדי להעתיק את הנתונים לספרייה בשם synthea-data בקטגוריה של Cloud Storage קיימת, מריצים את הפקודה הבאה gcloud storage cp מהספרייה synthea:

    gcloud storage cp output/fhir_stu3/* gs://BUCKET/synthea-data
  4. פועלים לפי ההוראות לייבוא משאבי FHIR.

ייבוא משאבי FHIR

כשמגדירים את גוף בקשת הייבוא, צריך להגדיר את הערך של ContentStructure לאחד מהערכים הבאים:

  • CONTENT_STRUCTURE_UNSPECIFIED
  • ‫BUNDLE: קובץ המקור מכיל שורה אחת או יותר של JSON שמופרד בתו שורה חדשה (ndjson). כל שורה היא חבילה שמכילה משאב אחד או יותר. אם לא מציינים את ContentStructure, ברירת המחדל היא BUNDLE.
  • ‫RESOURCE: קובץ המקור מכיל שורה אחת או יותר של JSON (ndjson) עם תווי מעבר שורה כמפריד. כל שורה היא משאב יחיד.
  • ‫BUNDLE_PRETTY: קובץ המקור כולו הוא חבילת JSON אחת. קובץ ה-JSON יכול לכלול כמה שורות.
  • ‫RESOURCE_PRETTY: קובץ המקור כולו הוא משאב JSON אחד. קובץ ה-JSON יכול לכלול כמה שורות.

לדוגמה, נניח שאתם מייבאים קובץ בשם resources.ndjson עם התוכן הבא:

{"class":{"code":"IMP","display":"inpatient encounter","system":"http://hl7.org/fhir/v3/ActCode"},"id":"6090e773-3e91-40a7-8fce-1e22f6774c29","reason":[{"text":"The patient had an abnormal heart rate. She was concerned about this."}],"resourceType":"Encounter","status":"finished","subject":{"reference":"Patient/2938bb9e-1f16-429e-8d44-9508ab0e4151"}}
{"class":{"code":"IMP","display":"inpatient encounter","system":"http://hl7.org/fhir/v3/ActCode"},"id":"7101f884-4f02-51b8-9gdf-2f33g7885d30","reason":[{"text":"The patient was experiencing recurrent fevers."}],"resourceType":"Encounter","status":"finished","subject":{"reference":"Patient/3049cc0f-2g27-530f-9e55-0619bc1f5262"}}
{"birthDate":"1970-01-01","gender":"female","id":"2938bb9e-1f16-429e-8d44-9508ab0e4151","name":[{"family":"Smith","given":["Darcy"],"use":"official"}],"resourceType":"Patient"}

הקובץ מכיל שני משאבי Encounter ומשאב Patient אחד. כל משאב נמצא בשורה נפרדת, ולכן מגדירים את ContentStructure לערך RESOURCE.

יכול להיות שהנתונים יובאו בצורה שגויה או שלא יובאו בכלל אם ContentStructure לא תואם לפורמט של הנתונים. לדוגמה, לא ניתן לייבא את קובץ הדוגמה שלמעלה בצורה תקינה אלא אם הערך של ContentStructure מוגדר כ-RESOURCE בבקשת הייבוא.

בדוגמאות הבאות מוצגות דרכים לייבא משאבי FHIR מקטגוריה של Cloud Storage.

המסוף

כדי לייבא משאבי FHIR מקטגוריית Cloud Storage, מבצעים את השלבים הבאים:

  1. נכנסים לדף Datasets במסוף Google Cloud .
    מעבר לדף Datasets
  2. לוחצים על מערך הנתונים שמכיל את מאגר ה-FHIR שאליו מייבאים משאבי FHIR.
  3. ברשימת מאגרי הנתונים, בוחרים באפשרות ייבוא מתוך הרשימה פעולות של מאגר FHIR.

    מופיע הדף ייבוא למאגר FHIR.
  4. ברשימה Project, בוחרים פרויקט של Cloud Storage.
  5. ברשימה מיקום, בוחרים קטגוריה של Cloud Storage.
  6. בקטע FHIR import settings (הגדרות ייבוא של FHIR), בוחרים את מבנה התוכן הרלוונטי.
  7. לוחצים על ייבוא כדי לייבא משאבי FHIR.
  8. כדי לעקוב אחרי סטטוס הפעולה, לוחצים על הכרטיסייה פעולות. אחרי שהפעולה מסתיימת, מופיעים הסימנים הבאים:
    • בקטע Long-running operation status (סטטוס של פעולה ממושכת) מופיע סימן וי ירוק מתחת לכותרת OK.
    • בקטע סקירה כללית מופיעים סימן וי ירוק והאינדיקטור OK באותה שורה של מזהה הפעולה.
    אם נתקלתם בשגיאות, לוחצים על פעולות ואז על הצגת הפרטים ב-Cloud Logging.

gcloud

כדי לייבא משאבי FHIR למאגר FHIR, משתמשים בפקודה gcloud healthcare fhir-stores import gcs. מציינים את הפרטים הבאים:

  • השם של קבוצת הנתונים הראשית
  • השם של מאגר FHIR
  • המיקום של האובייקט בקטגוריה של Cloud Storage. המיקום של הקבצים בתוך הדלי הוא שרירותי, והוא לא חייב להיות זהה לפורמט שמופיע בדוגמה הבאה. כשמציינים את המיקום של משאבי FHIR ב-Cloud Storage, אפשר להשתמש בתווים כלליים כדי לייבא כמה קבצים מספרייה אחת או מכמה ספריות. יש תמיכה בתווים הכלליים לחיפוש הבאים:
    • משתמשים ב-* כדי להתאים 0 או יותר תווים שאינם מפרידים. לדוגמה, gs://BUCKET/DIRECTORY/Example*.ndjson תואם לקבצים Example.ndjson ו-Example22.ndjson ב-DIRECTORY.
    • משתמשים ב-** כדי להתאים 0 תווים או יותר (כולל מפרידים). חובה להשתמש בו בסוף הנתיב, בלי תווים כלליים אחרים בנתיב. אפשר להשתמש גם בסיומת של שם קובץ (כמו ‎ .ndjson), כדי לייבא את כל הקבצים עם הסיומת של שם הקובץ בספרייה שצוינה ובספריות המשנה שלה. לדוגמה, הפקודה gs://BUCKET/DIRECTORY/**.ndjson מייבאת את כל הקבצים עם סיומת שם הקובץ ‎ .ndjson בתיקייה DIRECTORY ובתיקיות המשנה שלה.
    • כדי להתאים תו אחד, משתמשים ב-?. לדוגמה, ‫gs://BUCKET/DIRECTORY/Example?.ndjson תואם ל- Example1.ndjson אבל לא תואם ל-Example.ndjson או ל-Example01.ndjson.

בדוגמה הבאה אפשר לראות את הפקודה gcloud healthcare fhir-stores import gcs.

gcloud healthcare fhir-stores import gcs FHIR_STORE_ID \
  --dataset=DATASET_ID \
  --location=LOCATION \
  --gcs-uri=gs://BUCKET/DIRECTORY/FHIR_RESOURCE_NAME.ndjson

כדי לציין את המבנה של קובצי המקור של FHIR, משתמשים בדגל --content-structure.

בשורת הפקודה מוצג מזהה הפעולה, ואחרי שהפעולה מסתיימת, done:

Request issued for: [FHIR_STORE_ID]
Waiting for operation [OPERATION_ID] to complete...done.
name: projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID

כדי לראות פרטים נוספים על הפעולה, מריצים את הפקודה gcloud healthcare operations describe ומזינים את הערך OPERATION_ID מהתשובה:

gcloud healthcare operations describe OPERATION_ID \
  --dataset=DATASET_ID

התשובה כוללת את done: true.

done: true
metadata:
'@type': type.googleapis.com/google.cloud.healthcare.v1.OperationMetadata
apiMethodName: google.cloud.healthcare.v1.fhir.FhirService.ImportResources
createTime: 'CREATE_TIME'
endTime: 'END_TIME'
logsUrl: https://console.cloud.google.com/logs/query/CLOUD_LOGGING_URL,
counter:
  success: 'SUCCESS_COUNT' 
name: projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID
response:
'@type': type.googleapis.com/google.cloud.healthcare.v1.fhir.rest.ImportResourcesResponse
fhirStore: projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID

API

כדי לייבא משאבי FHIR למאגר FHIR, משתמשים בשיטה projects.locations.datasets.fhirStores.import.

  • המיקום של הקבצים בתוך הדלי הוא שרירותי, והוא לא חייב להיות בדיוק בפורמט שמופיע בדוגמאות הבאות.
  • כשמציינים את המיקום של משאבי FHIR ב-Cloud Storage, אפשר להשתמש בתווים כלליים כדי לייבא כמה קבצים מספרייה אחת או יותר. יש תמיכה בתווים הכלליים לחיפוש הבאים:
    • משתמשים ב-* כדי להתאים 0 או יותר תווים שאינם מפרידים. לדוגמה, gs://BUCKET/DIRECTORY/Example*.ndjson תואם לקבצים Example.ndjson ו-Example22.ndjson ב-DIRECTORY.
    • משתמשים ב-** כדי להתאים 0 תווים או יותר (כולל מפרידים). חובה להשתמש בו בסוף הנתיב, בלי תווים כלליים אחרים בנתיב. אפשר להשתמש גם בסיומת של שם קובץ (כמו ‎ .ndjson), כדי לייבא את כל הקבצים עם הסיומת של שם הקובץ בספרייה שצוינה ובספריות המשנה שלה. לדוגמה, הפקודה gs://BUCKET/DIRECTORY/**.ndjson מייבאת את כל הקבצים עם סיומת שם הקובץ ‎ .ndjson בתיקייה DIRECTORY ובתיקיות המשנה שלה.
    • כדי להתאים תו אחד, משתמשים ב-?. לדוגמה, ‫gs://BUCKET/DIRECTORY/Example?.ndjson תואם ל- Example1.ndjson אבל לא תואם ל-Example.ndjson או ל-Example01.ndjson.

curl

כדי לייבא משאבי FHIR למאגר FHIR, שולחים בקשת POST ומציינים את הפרטים הבאים:

  • השם של קבוצת הנתונים הראשית
  • השם של מאגר FHIR
  • המיקום של האובייקט בקטגוריה של Cloud Storage
  • טוקן גישה

בדוגמה הבאה אפשר לראות איך מייבאים קובץ יחיד באמצעות בקשת POST באמצעות curl.

curl -X POST \
    -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
    -H "Content-Type: application/json; charset=utf-8" \
    --data "{
      'contentStructure': 'CONTENT_STRUCTURE',
      'gcsSource': {
        'uri': 'gs://BUCKET/DIRECTORY/FHIR_RESOURCE_FILE'
      }
    }" "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID:import"

אם הבקשה מצליחה, השרת מחזיר את התגובה בפורמט JSON:

{
  "name": "projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID"
}

התשובה מכילה שם פעולה. כדי לעקוב אחרי סטטוס הפעולה, אפשר להשתמש ב-method‏ Operation get:

curl -X GET \
    -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
    "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID"

אם הבקשה מצליחה, השרת מחזיר תגובה עם סטטוס הפעולה בפורמט JSON:

{
  "name": "projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.healthcare.v1.OperationMetadata",
    "apiMethodName": "google.cloud.healthcare.v1.fhir.FhirService.ImportResources",
    "createTime": "CREATE_TIME",
    "endTime": "END_TIME",
    "logsUrl": "https://console.cloud.google.com/logs/query/CLOUD_LOGGING_URL",
    "counter": {
      "success": "SUCCESS_COUNT"
    }
  },
  "done": true,
  "response": {
    "@type": "type.googleapis.com/google.cloud.healthcare.v1.fhir.rest.ImportResourcesResponse",
  }
}

PowerShell

כדי לייבא משאבי FHIR למאגר FHIR, שולחים בקשת POST ומציינים את הפרטים הבאים:

  • השם של קבוצת הנתונים הראשית
  • השם של מאגר FHIR
  • המיקום של האובייקט בקטגוריה של Cloud Storage
  • טוקן גישה

בדוגמה הבאה מוצגת בקשת POST באמצעות Windows PowerShell.

$cred = gcloud auth application-default print-access-token
$headers = @{ Authorization = "Bearer $cred" }

Invoke-WebRequest `
  -Method Post `
  -Headers $headers `
  -ContentType: "application/json; charset=utf-8" `
  -Body "{
    'contentStructure': 'CONTENT_STRUCTURE',
    'gcsSource': {
      'uri': 'gs://BUCKET/DIRECTORY/FHIR_RESOURCE_FILE'
    }
  }" `
  -Uri "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID:import" | Select-Object -Expand Content

אם הבקשה מצליחה, השרת מחזיר את התגובה בפורמט JSON:

{
  "name": "projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID"
}

התשובה מכילה שם פעולה. כדי לעקוב אחרי סטטוס הפעולה, אפשר להשתמש ב-method‏ Operation get:

$cred = gcloud auth application-default 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/operations/OPERATION_ID" | Select-Object -Expand Content

אם הבקשה מצליחה, השרת מחזיר תגובה עם סטטוס הפעולה בפורמט JSON:

{
  "name": "projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.healthcare.v1.OperationMetadata",
    "apiMethodName": "google.cloud.healthcare.v1.fhir.FhirService.ImportResources",
    "createTime": "CREATE_TIME",
    "endTime": "END_TIME",
    "logsUrl": "https://console.cloud.google.com/logs/query/CLOUD_LOGGING_URL",
    "counter": {
      "success": "SUCCESS_COUNT"
    }
  },
  "done": true,
  "response": {
    "@type": "type.googleapis.com/google.cloud.healthcare.v1.fhir.rest.ImportResourcesResponse",
  }
}

Go

import (
	"context"
	"fmt"
	"io"
	"time"

	healthcare "google.golang.org/api/healthcare/v1"
)

// importsFHIRResource imports an FHIR resource.
func importFHIRResource(w io.Writer, projectID, location, datasetID, fhirStoreID, gcsURI string) error {
	ctx := context.Background()

	healthcareService, err := healthcare.NewService(ctx)
	if err != nil {
		return fmt.Errorf("healthcare.NewService: %w", err)
	}

	storesService := healthcareService.Projects.Locations.Datasets.FhirStores

	name := fmt.Sprintf("projects/%s/locations/%s/datasets/%s/fhirStores/%s", projectID, location, datasetID, fhirStoreID)
	req := &healthcare.ImportResourcesRequest{
		ContentStructure: "RESOURCE",
		GcsSource: &healthcare.GoogleCloudHealthcareV1FhirGcsSource{
			Uri: gcsURI,
		},
	}

	op, err := storesService.Import(name, req).Do()
	if err != nil {
		return fmt.Errorf("Import: %w", err)
	}

	operationsService := healthcareService.Projects.Locations.Datasets.Operations
	ticker := time.NewTicker(1 * time.Second)
	defer ticker.Stop()
	for {
		select {
		case <-ctx.Done():
			return ctx.Err()
		case <-ticker.C:
			newOp, err := operationsService.Get(op.Name).Do()
			if err != nil {
				return fmt.Errorf("operationsService.Get(%q): %v", op.Name, err)
			}
			if newOp.Done {
				if newOp.Error != nil {
					return fmt.Errorf("import operation %q completed with error: %s", op.Name, newOp.Error.Details)
				}
				return nil
			}
		}
	}
}

Java

import com.google.api.client.http.HttpRequestInitializer;
import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.gson.GsonFactory;
import com.google.api.services.healthcare.v1.CloudHealthcare;
import com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.FhirStores;
import com.google.api.services.healthcare.v1.CloudHealthcareScopes;
import com.google.api.services.healthcare.v1.model.GoogleCloudHealthcareV1FhirGcsSource;
import com.google.api.services.healthcare.v1.model.ImportResourcesRequest;
import com.google.api.services.healthcare.v1.model.Operation;
import com.google.auth.http.HttpCredentialsAdapter;
import com.google.auth.oauth2.GoogleCredentials;
import java.io.IOException;
import java.util.Collections;

public class FhirStoreImport {
  private static final String FHIR_NAME = "projects/%s/locations/%s/datasets/%s/fhirStores/%s";
  private static final JsonFactory JSON_FACTORY = new GsonFactory();
  private static final NetHttpTransport HTTP_TRANSPORT = new NetHttpTransport();

  public static void fhirStoreImport(String fhirStoreName, String gcsUri) throws IOException {
    // String fhirStoreName =
    //    String.format(
    //        FHIR_NAME, "your-project-id", "your-region-id", "your-dataset-id", "your-fhir-id");
    // String gcsUri = "gs://your-bucket-id/path/to/destination/dir"

    // Initialize the client, which will be used to interact with the service.
    CloudHealthcare client = createClient();

    // Configure where the store should be imported from.
    GoogleCloudHealthcareV1FhirGcsSource gcsSource =
        new GoogleCloudHealthcareV1FhirGcsSource().setUri(gcsUri);
    ImportResourcesRequest importRequest = new ImportResourcesRequest().setGcsSource(gcsSource);

    // Create request and configure any parameters.
    FhirStores.CloudHealthcareImport request =
        client
            .projects()
            .locations()
            .datasets()
            .fhirStores()
            .healthcareImport(fhirStoreName, importRequest);

    // Execute the request, wait for the operation to complete, and process the results.
    try {
      Operation operation = request.execute();
      while (operation.getDone() == null || !operation.getDone()) {
        // Update the status of the operation with another request.
        Thread.sleep(500); // Pause for 500ms between requests.
        operation =
            client
                .projects()
                .locations()
                .datasets()
                .operations()
                .get(operation.getName())
                .execute();
      }
      System.out.println("FHIR store import complete: " + operation.getResponse());
    } catch (Exception ex) {
      System.out.printf("Error during request execution: %s", ex.toString());
      ex.printStackTrace(System.out);
    }
  }

  private static CloudHealthcare createClient() throws IOException {
    // Use Application Default Credentials (ADC) to authenticate the requests
    // For more information see https://cloud.google.com/docs/authentication/production
    GoogleCredentials credential =
        GoogleCredentials.getApplicationDefault()
            .createScoped(Collections.singleton(CloudHealthcareScopes.CLOUD_PLATFORM));

    // Create a HttpRequestInitializer, which will provide a baseline configuration to all requests.
    HttpRequestInitializer requestInitializer =
        request -> {
          new HttpCredentialsAdapter(credential).initialize(request);
          request.setConnectTimeout(60000); // 1 minute connect timeout
          request.setReadTimeout(60000); // 1 minute read timeout
        };

    // Build the client for interacting with the service.
    return new CloudHealthcare.Builder(HTTP_TRANSPORT, JSON_FACTORY, requestInitializer)
        .setApplicationName("your-application-name")
        .build();
  }
}

Node.js

const google = require('@googleapis/healthcare');
const healthcare = google.healthcare({
  version: 'v1',
  auth: new google.auth.GoogleAuth({
    scopes: ['https://www.googleapis.com/auth/cloud-platform'],
  }),
  responseType: 'json',
});
const sleep = ms => {
  return new Promise(resolve => setTimeout(resolve, ms));
};

const importFhirResources = async () => {
  // TODO(developer): uncomment these lines before running the sample
  // const cloudRegion = 'us-central1';
  // const projectId = 'adjective-noun-123';
  // const datasetId = 'my-dataset';
  // const fhirStoreId = 'my-fhir-store';
  // const gcsUri = 'my-bucket/my-directory/*.json'
  const name = `projects/${projectId}/locations/${cloudRegion}/datasets/${datasetId}/fhirStores/${fhirStoreId}`;
  const request = {
    name,
    resource: {
      contentStructure: 'RESOURCE',
      gcsSource: {
        uri: `gs://${gcsUri}`,
      },
    },
  };
  try {
    const operation =
      await healthcare.projects.locations.datasets.fhirStores.import(request);
    const operationName = operation.data.name;

    console.log(`Import operation started: ${operationName}`);

    let done = false;
    let operationStatus;
    let attempts = 0;

    while (!done && attempts < 100) {
      console.log('Waiting for import operation to complete...');
      attempts++;
      await sleep(5000); // Wait 5 seconds between polls

      operationStatus =
        await healthcare.projects.locations.datasets.operations.get({
          name: operationName,
        });

      done = operationStatus.data.done;
    }

    if (operationStatus.data.error) {
      console.error(
        'Import FHIR resources failed:',
        operationStatus.data.error
      );
    } else if (done) {
      const successCount =
        operationStatus.data.metadata?.counter?.success || 0;
      console.log(
        `Import FHIR resources succeeded. ${successCount} resources imported.`
      );
    } else {
      console.error('Import operation timed out in the sample.');
    }
  } catch (error) {
    console.error(
      'An error occurred during the import process:',
      error.message || error
    );
  }
};

importFhirResources();

Python

def import_fhir_resources(project_id, location, dataset_id, fhir_store_id, gcs_uri):
    """Import resources into the FHIR store by copying them from the
    specified source.

    See https://github.com/GoogleCloudPlatform/python-docs-samples/tree/main/healthcare/api-client/v1/fhir
    before running the sample."""
    # Imports the Google API Discovery Service.
    from googleapiclient import discovery

    api_version = "v1"
    service_name = "healthcare"
    # Instantiates an authorized API client by discovering the Healthcare API
    # and using GOOGLE_APPLICATION_CREDENTIALS environment variable.
    client = discovery.build(service_name, api_version)

    # TODO(developer): Uncomment these lines and replace with your values.
    # project_id = 'my-project'  # replace with your GCP project ID
    # location = 'us-central1'  # replace with the parent dataset's location
    # dataset_id = 'my-dataset'  # replace with the parent dataset's ID
    # fhir_store_id = 'my-fhir-store'  # replace with the FHIR store ID
    # gcs_uri = 'my-bucket'  # replace with a Cloud Storage bucket
    fhir_store_parent = "projects/{}/locations/{}/datasets/{}".format(
        project_id, location, dataset_id
    )
    fhir_store_name = f"{fhir_store_parent}/fhirStores/{fhir_store_id}"

    body = {
        "contentStructure": "CONTENT_STRUCTURE_UNSPECIFIED",
        "gcsSource": {"uri": f"gs://{gcs_uri}"},
    }

    # Escape "import()" method keyword because "import"
    # is a reserved keyword in Python
    request = (
        client.projects()
        .locations()
        .datasets()
        .fhirStores()
        .import_(name=fhir_store_name, body=body)
    )

    response = request.execute()
    print(f"Imported FHIR resources: {gcs_uri}")

    return response

ייצוא משאבי FHIR

בדוגמאות הבאות מוסבר איך לייצא משאבי FHIR לקטגוריה של Cloud Storage. כשמייצאים משאבי FHIR מחנות FHIR, כל המשאבים בחנות FHIR מיוצאים.

אם אתם מייצאים משאבי FHIR לפי לוח זמנים, כדאי לייצא את הנתונים באופן מצטבר. הוראות מפורטות מופיעות במאמר ייצוא מצטבר.

במהלך הייצוא, Cloud Healthcare API יוצר קובץ אחד לכל סוג משאב ממאגר FHIR. שם הקובץ מורכב ממזהה הפעולה ומסוג המשאב, מופרדים באמצעות קו תחתון. כל קובץ מורכב מ-JSON מופרד בשורות חדשות, כאשר כל שורה היא משאב FHIR שמתאים לסוג המשאב בשם הקובץ. לדוגמה, אם מייצאים כמה רשומות של מטופלים, קובץ הפלט ייקרא בשם שדומה ל-1264567891234567_Patient ויכיל שורה לכל משאב Patient ממאגר ה-FHIR.

המסוף

כדי לייצא משאבי FHIR ל-Cloud Storage:

  1. נכנסים לדף Datasets במסוף Google Cloud .
    מעבר לדף Datasets
  2. לוחצים על מערך הנתונים שמכיל את מאגר ה-FHIR שממנו מייצאים משאבי FHIR.
  3. ברשימת מאגרי הנתונים, בוחרים באפשרות ייצוא מתוך הרשימה פעולות של מאגר FHIR.

    מוצג הדף ייצוא משאבי FHIR.
  4. בוחרים באפשרות Google Cloud Storage Bucket (קטגוריה של Google Cloud Storage).
  5. ברשימה Project, בוחרים פרויקט של Cloud Storage.
  6. ברשימה מיקום, בוחרים קטגוריה של Cloud Storage.
  7. לוחצים על ייצוא כדי לייצא משאבי FHIR למיקום שהוגדר ב-Cloud Storage.
  8. כדי לעקוב אחרי סטטוס הפעולה, לוחצים על הכרטיסייה פעולות. אחרי שהפעולה מסתיימת, מופיעים הסימנים הבאים:
    • בקטע Long-running operation status (סטטוס של פעולה ממושכת) מופיע סימן וי ירוק מתחת לכותרת OK.
    • בקטע סקירה כללית מופיעים סימן וי ירוק והאינדיקטור OK באותה שורה של מזהה הפעולה.
    אם נתקלתם בשגיאות, לוחצים על פעולות ואז על הצגת הפרטים ב-Cloud Logging.

gcloud

כדי לייצא משאבי FHIR לקטגוריה של Cloud Storage, משתמשים בפקודה gcloud healthcare fhir-stores export gcs. מציינים את הפרטים הבאים:

  • השם של קבוצת הנתונים הראשית
  • השם של מאגר FHIR
  • שם הפרויקט הראשי
  • קטגוריית היעד או הספרייה ב-Cloud Storage. כדאי לכתוב לקטגוריה של Cloud Storage או לספרייה, ולא לאובייקט, כי Cloud Healthcare API יוצר אובייקט אחד לכל סוג משאב. כל אובייקט מורכב מ-JSON שמופרד בתו שורה חדשה, כאשר כל שורה היא משאב FHIR. אם מציינים ספרייה שלא קיימת, היא נוצרת.
  • דגל אופציונלי, --resource-type, שמייצא רק סוגים ספציפיים של משאבים, שמוגדרים כרשימה מופרדת בפסיקים של סוג משאב FHIR אחד או יותר
  • דגל אופציונלי, --since, שמייצא רק משאבים שעודכנו אחרי שעה מסוימת, שמוגדרת כ-YYYY-MM-DDThh:mm:ss.sss+zz:zz

בדוגמה הבאה אפשר לראות את הפקודה gcloud healthcare fhir-stores export gcs.

gcloud healthcare fhir-stores export gcs FHIR_STORE_ID \
  --dataset=DATASET_ID \
  --location=LOCATION \
  --project=PROJECT_ID
  --gcs-uri=gs://BUCKET/DIRECTORY

מזהה הפעולה מוצג בשורת הפקודה:

Waiting for operation [OPERATION_ID] to complete...done.
name: projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID

כדי לראות את סטטוס הפעולה, מריצים את הפקודה gcloud healthcare operations describe ומזינים את הערך OPERATION_ID מהתגובה:

gcloud healthcare operations describe OPERATION_ID \
  --dataset=DATASET_ID

אחרי שהפקודה מסתיימת, התשובה כוללת את done.

metadata:
'@type': type.googleapis.com/google.cloud.healthcare.v1.OperationMetadata
apiMethodName: google.cloud.healthcare.v1.fhir.FhirService.ExportFhirData
createTime: "CREATE_TIME"
endTime: "END_TIME"
name: projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID
response:
'@type': type.googleapis.com/google.cloud.healthcare.v1.fhir.rest.ExportResourcesResponse
fhirStore: projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID
resourceCount: 'RESOURCE_COUNT'

API

כדי לייצא משאבי FHIR, משתמשים בשיטה projects.locations.datasets.fhirStores.export.

  • כדאי לכתוב לקטגוריה של Cloud Storage או לספרייה, ולא לאובייקט, כי Cloud Healthcare API יוצר קובץ JSON אחד עם תווי שורה כמפרידים לכל סוג משאב. בכל קובץ JSON, כל שורה היא משאב FHIR.
  • אם הפקודה מציינת ספרייה שלא קיימת, הספרייה נוצרת.

curl

כדי לייצא משאבי FHIR, שולחים בקשת POST ומציינים את הפרטים הבאים:

  • השם של קבוצת הנתונים הראשית
  • השם של מאגר FHIR
  • קטגוריית היעד של Cloud Storage
  • טוקן גישה
  • שדה אופציונלי, _type, שמייצא רק סוגים ספציפיים של משאבים, שמוגדרים כרשימה מופרדת בפסיקים של סוג משאב FHIR אחד או יותר
  • שדה אופציונלי, _since, שמייצא רק משאבים שעודכנו אחרי שעה מסוימת, שמוגדרת כ-YYYY-MM-DDThh:mm:ss.sss+zz:zz

בדוגמה הבאה מוצגת בקשת POST באמצעות curl.

curl -X POST \
    -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
    -H "Content-Type: application/json; charset=utf-8" \
    --data "{
      'gcsDestination': {
        'uriPrefix': 'gs://BUCKET/DIRECTORY'
      },
    }" "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID:export"

אם הבקשה מצליחה, השרת מחזיר את התגובה בפורמט JSON:

{
  "name": "projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID"
}

התשובה מכילה שם פעולה. כדי לעקוב אחרי סטטוס הפעולה, אפשר להשתמש ב-method‏ Operation get:

curl -X GET \
    -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
    "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID"

אם הבקשה מצליחה, השרת מחזיר תשובה עם סטטוס הפעולה בפורמט JSON:

{
  "name": "projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.healthcare.v1.OperationMetadata",
    "apiMethodName": "google.cloud.healthcare.v1.fhir.FhirService.ExportResources",
    "createTime": "CREATE_TIME",
    "endTime": "END_TIME",
    "logsUrl": "https://console.cloud.google.com/logs/query/CLOUD_LOGGING_URL",
    "counter": {
      "success": "SUCCESS_COUNT"
    }
  },
  "done": true,
  "response": {
    "@type": "type.googleapis.com/google.cloud.healthcare.v1.fhir.rest.ExportResourcesResponse",
  }
}

PowerShell

כדי לייצא משאבי FHIR, שולחים בקשת POST ומציינים את הפרטים הבאים:

  • השם של קבוצת הנתונים הראשית
  • השם של מאגר FHIR
  • קטגוריית היעד או הספרייה ב-Cloud Storage. כדאי לכתוב לקטגוריה של Cloud Storage או לספרייה, ולא לאובייקט, כי Cloud Healthcare API יוצר אובייקט אחד לכל סוג משאב. כל אובייקט מורכב מ-JSON שמופרד בתו שורה חדשה, כאשר כל שורה היא משאב FHIR.
  • טוקן גישה
  • שדה אופציונלי, _type, שמייצא רק סוגים ספציפיים של משאבים, שמוגדרים כרשימה מופרדת בפסיקים של סוג משאב FHIR אחד או יותר
  • שדה אופציונלי, _since, שמייצא רק משאבים שעודכנו אחרי שעה מסוימת, שמוגדרת כ-YYYY-MM-DDThh:mm:ss.sss+zz:zz

בדוגמה הבאה מוצגת בקשת POST באמצעות Windows PowerShell.

$cred = gcloud auth application-default print-access-token
$headers = @{ Authorization = "Bearer $cred" }

Invoke-WebRequest `
  -Method Post `
  -Headers $headers `
  -ContentType: "application/json; charset=utf-8" `
  -Body "{
    'gcsDestination': {
      'uriPrefix': 'gs://BUCKET/DIRECTORY'
    },
  }" `
  -Uri "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID:export" | Select-Object -Expand Content

אם הבקשה מצליחה, השרת מחזיר את התגובה בפורמט JSON:

{
  "name": "projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID"
}

התשובה מכילה שם פעולה. כדי לעקוב אחרי סטטוס הפעולה, אפשר להשתמש ב-method‏ Operation get:

$cred = gcloud auth application-default 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/operations/OPERATION_ID" | Select-Object -Expand Content

אם הבקשה מצליחה, השרת מחזיר תגובה עם סטטוס הפעולה בפורמט JSON:

{
  "name": "projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.healthcare.v1.OperationMetadata",
    "apiMethodName": "google.cloud.healthcare.v1.fhir.FhirService.ExportResources",
    "createTime": "CREATE_TIME",
    "endTime": "END_TIME",
    "logsUrl": "https://console.cloud.google.com/logs/query/CLOUD_LOGGING_URL",
    "counter": {
      "success": "SUCCESS_COUNT"
    }
  },
  "done": true,
  "response": {
    "@type": "type.googleapis.com/google.cloud.healthcare.v1.fhir.rest.ExportResourcesResponse",
  }
}

Go

import (
	"context"
	"fmt"
	"io"
	"time"

	healthcare "google.golang.org/api/healthcare/v1"
)

// exportFHIRResource exports the resources in the FHIR store.
func exportFHIRResource(w io.Writer, projectID, location, datasetID, fhirStoreID, gcsURIPrefix string) error {
	ctx := context.Background()

	healthcareService, err := healthcare.NewService(ctx)
	if err != nil {
		return fmt.Errorf("healthcare.NewService: %w", err)
	}

	storesService := healthcareService.Projects.Locations.Datasets.FhirStores

	name := fmt.Sprintf("projects/%s/locations/%s/datasets/%s/fhirStores/%s", projectID, location, datasetID, fhirStoreID)
	req := &healthcare.ExportResourcesRequest{
		GcsDestination: &healthcare.GoogleCloudHealthcareV1FhirGcsDestination{
			UriPrefix: gcsURIPrefix,
		},
	}

	op, err := storesService.Export(name, req).Do()
	if err != nil {
		return fmt.Errorf("Export: %w", err)
	}

	operationsService := healthcareService.Projects.Locations.Datasets.Operations
	ticker := time.NewTicker(1 * time.Second)
	defer ticker.Stop()
	for {
		select {
		case <-ctx.Done():
			return ctx.Err()
		case <-ticker.C:
			newOp, err := operationsService.Get(op.Name).Do()
			if err != nil {
				return fmt.Errorf("operationsService.Get(%q): %v", op.Name, err)
			}
			if newOp.Done {
				if newOp.Error != nil {
					return fmt.Errorf("export operation %q completed with error: %v", op.Name, newOp.Error)
				}
				return nil
			}
		}
	}
}

Java

import com.google.api.client.http.HttpRequestInitializer;
import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.gson.GsonFactory;
import com.google.api.services.healthcare.v1.CloudHealthcare;
import com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets.FhirStores;
import com.google.api.services.healthcare.v1.CloudHealthcareScopes;
import com.google.api.services.healthcare.v1.model.ExportResourcesRequest;
import com.google.api.services.healthcare.v1.model.GoogleCloudHealthcareV1FhirGcsDestination;
import com.google.api.services.healthcare.v1.model.Operation;
import com.google.auth.http.HttpCredentialsAdapter;
import com.google.auth.oauth2.GoogleCredentials;
import java.io.IOException;
import java.util.Collections;

public class FhirStoreExport {
  private static final String FHIR_NAME = "projects/%s/locations/%s/datasets/%s/fhirStores/%s";
  private static final JsonFactory JSON_FACTORY = new GsonFactory();
  private static final NetHttpTransport HTTP_TRANSPORT = new NetHttpTransport();

  public static void fhirStoreExport(String fhirStoreName, String gcsUri) throws IOException {
    // String fhirStoreName =
    //    String.format(
    //        FHIR_NAME, "your-project-id", "your-region-id", "your-dataset-id", "your-fhir-id");
    // String gcsUri = "gs://your-bucket-id/path/to/destination/dir"

    // Initialize the client, which will be used to interact with the service.
    CloudHealthcare client = createClient();

    // Configure where the store will be exported too.
    GoogleCloudHealthcareV1FhirGcsDestination gcsDestination =
        new GoogleCloudHealthcareV1FhirGcsDestination().setUriPrefix(gcsUri);
    ExportResourcesRequest exportRequest =
        new ExportResourcesRequest().setGcsDestination(gcsDestination);

    // Create request and configure any parameters.
    FhirStores.Export request =
        client.projects().locations().datasets().fhirStores().export(fhirStoreName, exportRequest);

    // Execute the request, wait for the operation to complete, and process the results.
    try {
      Operation operation = request.execute();
      while (operation.getDone() == null || !operation.getDone()) {
        // Update the status of the operation with another request.
        Thread.sleep(500); // Pause for 500ms between requests.
        operation =
            client
                .projects()
                .locations()
                .datasets()
                .operations()
                .get(operation.getName())
                .execute();
      }
      System.out.println("Fhir store export complete." + operation.getResponse());
    } catch (Exception ex) {
      System.out.printf("Error during request execution: %s", ex.toString());
      ex.printStackTrace(System.out);
    }
  }

  private static CloudHealthcare createClient() throws IOException {
    // Use Application Default Credentials (ADC) to authenticate the requests
    // For more information see https://cloud.google.com/docs/authentication/production
    GoogleCredentials credential =
        GoogleCredentials.getApplicationDefault()
            .createScoped(Collections.singleton(CloudHealthcareScopes.CLOUD_PLATFORM));

    // Create a HttpRequestInitializer, which will provide a baseline configuration to all requests.
    HttpRequestInitializer requestInitializer =
        request -> {
          new HttpCredentialsAdapter(credential).initialize(request);
          request.setConnectTimeout(60000); // 1 minute connect timeout
          request.setReadTimeout(60000); // 1 minute read timeout
        };

    // Build the client for interacting with the service.
    return new CloudHealthcare.Builder(HTTP_TRANSPORT, JSON_FACTORY, requestInitializer)
        .setApplicationName("your-application-name")
        .build();
  }
}

Node.js

const google = require('@googleapis/healthcare');
const healthcare = google.healthcare({
  version: 'v1',
  auth: new google.auth.GoogleAuth({
    scopes: ['https://www.googleapis.com/auth/cloud-platform'],
  }),
  responseType: 'json',
});
const sleep = ms => {
  return new Promise(resolve => setTimeout(resolve, ms));
};

const exportFhirResourcesGcs = async () => {
  // TODO(developer): uncomment these lines before running the sample
  // const cloudRegion = 'us-central1';
  // const projectId = 'adjective-noun-123';
  // const datasetId = 'my-dataset';
  // const fhirStoreId = 'my-fhir-store';
  // const gcsUri = 'my-bucket/my-directory'
  const name = `projects/${projectId}/locations/${cloudRegion}/datasets/${datasetId}/fhirStores/${fhirStoreId}`;
  const request = {
    name,
    resource: {
      gcsDestination: {
        // The destination location in Cloud Storage for the FHIR resources
        uriPrefix: `gs://${gcsUri}`,
      },
    },
  };

  try {
    const operation =
      await healthcare.projects.locations.datasets.fhirStores.export(request);
    const operationName = operation.data.name;

    let done = false;
    let operationStatus;

    while (!done) {
      console.log('Waiting for operation to complete...');
      await sleep(5000);

      operationStatus =
        await healthcare.projects.locations.datasets.operations.get({
          name: operationName,
        });

      done = operationStatus.data.done;
    }

    if (operationStatus.data.error) {
      console.log('Export failed with error:', operationStatus.data.error);
    } else {
      console.log('Exported FHIR resources successfully');
    }
  } catch (error) {
    console.error('Error exporting FHIR resources:', error.message || error);
  }
};

exportFhirResourcesGcs();

Python

def export_fhir_store_gcs(project_id, location, dataset_id, fhir_store_id, gcs_uri):
    """Export resources to a Google Cloud Storage bucket by copying
    them from the FHIR store.

    See https://github.com/GoogleCloudPlatform/python-docs-samples/tree/main/healthcare/api-client/v1/fhir
    before running the sample."""
    # Imports the Google API Discovery Service.
    from googleapiclient import discovery

    api_version = "v1"
    service_name = "healthcare"
    # Instantiates an authorized API client by discovering the Healthcare API
    # and using GOOGLE_APPLICATION_CREDENTIALS environment variable.
    client = discovery.build(service_name, api_version)

    # TODO(developer): Uncomment these lines and replace with your values.
    # project_id = 'my-project'  # replace with your GCP project ID
    # location = 'us-central1'  # replace with the parent dataset's location
    # dataset_id = 'my-dataset'  # replace with the parent dataset's ID
    # fhir_store_id = 'my-fhir-store' # replace with the FHIR store ID
    # gcs_uri = 'my-bucket' # replace with a Cloud Storage bucket
    fhir_store_parent = "projects/{}/locations/{}/datasets/{}".format(
        project_id, location, dataset_id
    )
    fhir_store_name = f"{fhir_store_parent}/fhirStores/{fhir_store_id}"

    body = {"gcsDestination": {"uriPrefix": f"gs://{gcs_uri}/fhir_export"}}

    request = (
        client.projects()
        .locations()
        .datasets()
        .fhirStores()
        .export(name=fhir_store_name, body=body)
    )

    response = request.execute()
    print(f"Exported FHIR resources to bucket: gs://{gcs_uri}")

    return response

ייצוא מצטבר

אפשר לציין חותמת זמן כדי לייצא רק משאבי FHIR שנוספו למאגר FHIR מאז ייצוא קודם מוצלח. כך משפרים את הביצועים ונמנעים מהעלות של ייצוא מחדש של כל מאגר ה-FHIR, וגם מוודאים שהנתונים המיוצאים תמיד עדכניים.

כשמתקשרים אל fhirStores.export, צריך לציין את חותמת הזמן בשדה _since.

פתרון בעיות בבקשות ייבוא וייצוא של FHIR

אם מתרחשות שגיאות במהלך בקשת ייבוא או ייצוא של FHIR, השגיאות נרשמות ביומן של Cloud Logging. מידע נוסף זמין במאמר צפייה ביומני שגיאות ב-Cloud Logging.

אם כל הפעולה מחזירה שגיאה, אפשר לעיין במאמר בנושא פתרון בעיות בפעולות ארוכות טווח.

המאמרים הבאים