Method: fhirStores.import

Full name: projects.locations.datasets.fhirStores.import

Import resources to the FHIR store by loading data from the specified sources. Each resource must have a client-supplied ID, which is retained by the server.

The import operation is idempotent. Upon retry, the most recent data (matching the client-supplied ID) is overwritten, without creating a new resource version. If partial failures occur during the import, successful changes are not rolled back.

If history imports are enabled(enableHistoryImport is set in the FHIR store's configuration), you can import historical versions of a resource by supplying a bundle of type history. The historical versions in the bundle must have lastUpdated timestamps. If a current or historical version with the supplied resource ID already exists, the bundle is rejected.

This method returns an Operation that can be used to track the status of the import by calling operations.get.

Immediate fatal errors appear in the error field. Otherwise, when the operation finishes, a detailed response of type ImportResourcesResponse is returned in the response field. The metadata field type for this operation is OperationMetadata.

HTTP request

POST https://healthcare.googleapis.com/v1alpha2/{name=projects/*/locations/*/datasets/*/fhirStores/*}:import

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
name

string

The name of the FHIR store to import FHIR resources to. The name should be in the format of projects/{projectId}/locations/{locationId}/datasets/{datasetId}/fhirStores/{fhirStoreId}.

Authorization requires the following Google IAM permission on the specified resource name:

  • healthcare.fhirStores.import

Request body

The request body contains data with the following structure:

JSON representation
{
  "contentStructure": enum(ContentStructure),
  "gcsSource": {
    object(GcsSource)
  },
  "gcsErrorDestination": {
    object(GcsErrorDestination)
  }
}
Fields
contentStructure

enum(ContentStructure)

The content structure in the source location. If not specified, the server treats the input source files as BUNDLE.

gcsSource

object(GcsSource)

Cloud Storage source data location and import configuration.

The Cloud Storage location requires the roles/storage.objectViewer Cloud IAM role.

Each Cloud Storage object should be a text file that contains the format specified in [ContentStructure][].

gcsErrorDestination

object(GcsErrorDestination)

The Cloud Storage destination to write the error report to.

The Cloud Storage location requires the roles/storage.objectAdmin Cloud IAM role.

Note that writing a file to the same destination multiple times will result in the previous version of the file being overwritten.

Response body

If successful, the response body contains an instance of Operation.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-healthcare
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ContentStructure

The content structure of the input source files.

Enums
CONTENT_STRUCTURE_UNSPECIFIED
BUNDLE The source file contains one or more lines of newline-delimited JSON (ndjson). Each line is a bundle, which contains one or more resources. Set the bundle type to history to import resource versions.
RESOURCE The source file contains one or more lines of newline-delimited JSON (ndjson). Each line is a single resource.
BUNDLE_PRETTY The entire file is one JSON bundle. The JSON can span multiple lines.
RESOURCE_PRETTY The entire file is one JSON resource. The JSON can span multiple lines.

GcsSource

Specifies the configuration for importing data from Cloud Storage.

JSON representation
{
  "uri": string
}
Fields
uri

string

Points to a Cloud Storage URI containing file(s) to import.

The URI must be in the following format: gs://{bucket_id}/{object_id}. The URI can include wildcards in object_id and thus identify multiple files. Supported wildcards:

  • * to match 0 or more non-separator characters
  • ** to match 0 or more characters (including separators). Must be used at the end of a path and with no other wildcards in the path. Can also be used with a file extension (such as .ndjson), which imports all files with the extension in the specified directory and its sub-directories. For example, gs://my-bucket/my-directory/**.ndjson imports all files with .ndjson extensions in my-directory/ and its sub-directories.
  • ? to match 1 character

Files matching the wildcard are expected to contain content only, no metadata.

GcsErrorDestination

Specifies the Cloud Storage destination where errors will be recorded.

JSON representation
{
  "uriPrefix": string
}
Fields
uriPrefix

string

URI for a Cloud Storage directory to which error report files should be written (in the format gs://{bucket-id}/{path/to/destination/dir}). If there is no trailing slash, the service will append one when composing the object path. The user is responsible for creating the Cloud Storage bucket referenced in uriPrefix.

Var denne siden nyttig? Si fra hva du synes:

Send tilbakemelding om ...

Cloud Healthcare API