Method: fhirStores.import

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

Import resources to the FHIR store by loading data from the specified sources. This method is optimized to load large quantities of data using import semantics that ignore some FHIR store configuration options and are not suitable for all use cases. It is primarily intended to load data into an empty FHIR store that is not being used by other clients. In cases where this method is not appropriate, consider using fhir.executeBundle to load data.

Every resource in the input must contain a client-supplied ID, and will be stored using that ID regardless of the enableUpdateCreate setting on the FHIR store.

The import process does not enforce referential integrity, regardless of the disableReferentialIntegrity setting on the FHIR store. This allows the import of resources with arbitrary interdependencies without considering grouping or ordering, but if the input data contains invalid references or if some resources fail to be imported, the FHIR store might be left in a state that violates referential integrity.

If a resource with the specified ID already exists, the most recent version of the resource is overwritten without creating a new historical version, regardless of the disableResourceVersioning setting on the FHIR store. If transient failures occur during the import, it is possible that successfully imported resources will be overwritten more than once.

The import operation is idempotent unless the input data contains multiple valid resources with the same ID but different contents. In that case, after the import completes, the store will contain exactly one resource with that ID but there is no ordering guarantee on which version of the contents it will have. The operation result counters do not count duplicate IDs as an error and will count one success for each resource in the input, which might result in a success count larger than the number of resources in the FHIR store. This often occurs when importing data organized in bundles produced by Patient-everything where each bundle contains its own copy of a resource such as Practitioner that might be referred to by many patients.

If some resources fail to import, for example due to parsing errors, successfully imported resources are not rolled back.

The location and format of the input data is specified by the parameters below. Note that if no format is specified, this method assumes the BUNDLE format. When using the BUNDLE format this method ignores the Bundle.type field, except for the special case of history, and does not apply any of the bundle processing semantics for batch or transaction bundles. Unlike in fhir.executeBundle, transaction bundles are not executed as a single transaction and bundle-internal references are not rewritten. The bundle is treated as a collection of resources to be written as provided in Bundle.entry.resource, ignoring Bundle.entry.request. As an example, this allows the import of searchset bundles produced by a FHIR search or Patient-everything operation.

If history imports are enabled by setting enableHistoryImport in the FHIR store's configuration, this method can import historical versions of a resource by supplying a bundle of type history and using the BUNDLE format. The historical versions in the bundle must have lastUpdated timestamps, and the resulting resource history on the server will appear as if the versions had been created at those timestamps. If a current or historical version with the supplied resource ID already exists, the bundle is rejected to avoid creating an inconsistent sequence of resource versions.

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, errors are also logged to Stackdriver (see Viewing logs). 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/v1beta1/{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)
  }
}
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.

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 If the content structure is not specified, the default value BUNDLE will be used.
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.

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.

Var denne siden nyttig? Si fra hva du synes:

Send tilbakemelding om ...

Cloud Healthcare API