Transitioning to the v1beta1 API

The Cloud Healthcare API v1alpha API is decommissioned. This page explains the key differences between v1alpha and v1beta1 of the Cloud Healthcare API. It also provides examples of how to transition from v1alpha to v1beta1.

REST paths

All REST paths to the Cloud Healthcare API now use v1beta1 instead of v1alpha. For example:

v1alpha:

GET https://healthcare.googleapis.com/v1alpha/projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID

v1beta1:

GET https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID

Dataset changes

The projects.locations.datasets.create method now returns a long-running operation. This change improves resource isolation and performance.

To create a dataset and poll the long-running operation to ensure that the dataset was created successfully, follow the instructions in Creating a dataset.

De-identification changes

The structure of the request objects in the projects.locations.datasets.deidentify method has changed.

Example: DICOM de-identification using keeplist tags

v1alpha

projects.locations.datasets.deidentify

{
  'destinationDataset': 'projects/PROJECT_ID/locations/REGION/datasets/DESTINATION_DATASET_ID',
  'config': {
    'dicom': {
      'whitelistTags': 'PatientID',
      'whitelistTags': 'TransferSyntaxUID',
      'whitelistTags': 'SOPInstanceUID',
      'whitelistTags': 'StudyInstanceUID',
      'whitelistTags': 'SeriesInstanceUID',
      'whitelistTags': 'PixelData'
    }
  }
}
v1beta1

projects.locations.datasets.deidentify

{
  'destinationDataset': 'projects/PROJECT_ID/locations/REGION/datasets/DESTINATION_DATASET_ID',
  'config': {
    'dicom': {
      'keepList': {
        'tags': [
          'PatientID',
          'TransferSyntaxUID',
          'SOPInstanceUID',
          'StudyInstanceUID',
          'SeriesInstanceUID',
          'PixelData'
        ]
      }
    }
  }
}

Example: DICOM de-identification to redact burnt-in text from images

v1alpha

projects.locations.datasets.deidentify

{
  'destinationDataset': 'projects/PROJECT_ID/locations/REGION/datasets/DESTINATION_DATASET_ID',
  'config': {
    'image': {
      'redactAllText': 'true'
    }
  }
}
v1beta1

projects.locations.datasets.deidentify

{
  'destinationDataset': 'projects/PROJECT_ID/locations/REGION/datasets/DESTINATION_DATASET_ID',
  'config': {
    'image': {
      'textRedactionMode': 'REDACT_ALL_TEXT'
    }
  }
}

DICOM changes

Importing and exporting DICOM data

The structures of the request and response objects in the projects.locations.datasets.dicomStores.import and projects.locations.datasets.dicomStores.export methods have changed.

Example: DICOM import request

v1alpha

projects.locations.datasets.dicomStores.import

{
  'inputConfig': {
    'gcsSource': {
      'contentUri': 'gs://BUCKET/DIRECTORY/DICOM_INSTANCE.dcm'
    }
  }
}
v1beta1

projects.locations.datasets.dicomStores.import

{
  'gcsSource': {
    'uri': 'gs://BUCKET/DIRECTORY/DICOM_INSTANCE.dcm'
  }
}

Example: DICOM import error response

v1alpha

ImportDicomDataErrorDetails

The following response is returned after calling the Operation get method on the long-running operation returned by projects.locations.datasets.dicomStores.import.

{
  "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/operations/OPERATION_ID",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.healthcare.v1beta1.OperationMetadata",
    "apiMethodName": "google.cloud.healthcare.v1beta1.dicom.DicomService.ImportDicomData",
    "createTime": "2018-01-01T00:00:00.000000Z",
    "endTime": "2018-01-01T00:00:00.000000Z"
  },
  "done": true,
  "error": {
    "code": ERROR_CODE,
    "message": "ERROR_MESSAGE",
    "details": [
      {
        "@type": "type.googleapis.com/google.cloud.healthcare.v1alpha.ImportDicomDataErrorDetails",
        "errors": [
          {
            "resource": "RESOURCE_NAME",
            "status": {
              "code": STATUS_CODE,
              "message": "STATUS_MESSAGE"
            }
          }
        ]
      }
    ]
  }
}
v1beta1

ImportDicomDataErrorDetails

The following response is returned after calling the Operation get method on the long-running operation returned by projects.locations.datasets.dicomStores.import.

{
  "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/operations/OPERATION_ID",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.healthcare.v1beta1.OperationMetadata",
    "apiMethodName": "google.cloud.healthcare.v1beta1.dicom.DicomService.ImportDicomData",
    "createTime": "2018-01-01T00:00:00.000000Z",
    "endTime": "2018-01-01T00:00:00.000000Z"
  },
  "done": true,
  "error": {
    "code": ERROR_CODE,
    "message": "ERROR_MESSAGE",
    "details": [
      {
        "@type": "type.googleapis.com/google.cloud.healthcare.v1beta1.dicom.ImportDicomDataErrorDetails",
        "sampleErrors": [
          {
            "resource": "RESOURCE_NAME",
            "error": {
              "code": ERROR_CODE,
              "message": "ERROR_TYPE"
            }
          }
        ]
      }
    ]
  }
}

Example: DICOM export to Cloud Storage request

v1alpha

projects.locations.datasets.dicomStores.export

{
  'outputConfig': {
    'gcsDestination': {
      'uriPrefix': 'gs://BUCKET/DIRECTORY/DICOM_INSTANCE.dcm'
    }
  }
}
v1beta1

projects.locations.datasets.dicomStores.export

{
  'gcsDestination': {
    'uriPrefix': 'gs://BUCKET/DIRECTORY/DICOM_INSTANCE.dcm'
  }
}

Example: DICOM export to BigQuery request

v1alpha

projects.locations.datasets.dicomStores.export

{
  'outputConfig': {
    'bigQueryDestination': {
      'dataset': 'DATASET',
      'table': 'TABLE',
      'overwriteTable': false
    }
  }
}
v1beta1

projects.locations.datasets.dicomStores.export

{
  'bigQueryDestination': {
    'tableUri': 'bq://PROJECT_ID.DATASET.TABLE',
    'force': false
  }
}

FHIR changes

REST paths

The REST paths for interacting with FHIR resources have changed: the resources portion of the path has been replaced with fhir.

Example: Creating a FHIR resource request

v1alpha (projects.locations.datasets.fhirStores.resource.createResource):

POST https://healthcare.googleapis.com/v1alpha/projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/resources/RESOURCE_TYPE

v1beta1 (projects.locations.datasets.fhirStores.fhir.create):

POST https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/RESOURCE_TYPE

Bundle executions

The REST path for the projects.locations.datasets.fhirStores.executeBundle method now contains a trailing /fhir.

Example: Bundle executions

v1alpha (projects.locations.datasets.fhirStores.executeBundle):

POST --data @BUNDLE_FILE.json https://healthcare.googleapis.com/v1alpha/projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID

v1beta1 (projects.locations.datasets.fhirStores.fhir.executeBundle):

POST --data @BUNDLE_FILE.json https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir

IAM policies

The projects.locations.datasets.fhirStores.getIamPolicy and projects.locations.fhirStores.securityLabels.getIamPolicy methods now use the GET HTTP method instead of the POST method.

Example: Getting an IAM policy request

v1alpha (projects.locations.datasets.fhirStores.getIamPolicy):

POST https://healthcare.googleapis.com/v1alpha/projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID:getIamPolicy

v1beta1 (projects.locations.datasets.fhirStores.getIamPolicy)

GET https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID:getIamPolicy

Importing and exporting FHIR data

The structures of the request and response objects in the projects.locations.datasets.fhirStores.import and projects.locations.datasets.fhirStores.export methods have changed.

Notably, the response returned from the Operation get method when FHIR imports fail and/or succeed has changed. In v1alpha of the Cloud Healthcare API, ImportResourcesResponse was returned regardless of whether all FHIR imports were successful or there were any failures. In v1beta1, a new response body called ImportResourcesResponse was added, which is returned only when all imports succeed. If any imports fail, ImportResourcesErrorDetails is returned instead.

Additionally, it is no longer possible to write errors to a Cloud Storage object when importing FHIR resources.

Example: FHIR import request

v1alpha

projects.locations.datasets.fhirStores.import

{
  'contentStructure': 'BUNDLE',
  'gcsSourceLocation': {
    'gcsUri': 'gs://BUCKET/DIRECTORY/FHIR_RESOURCE_FILE
  },
  'gcsErrorLocation': {
    'gcsUri': 'gs://BUCKET/ERROR_DIRECTORY'
  }
}
v1beta1

projects.locations.datasets.fhirStores.import

{
  'contentStructure': 'BUNDLE',
  'gcsSource': {
    'uri': 'gs://BUCKET/DIRECTORY/FHIR_RESOURCE_FILE'
  }
}

Example: FHIR import response (successful)

v1alpha

ImportResourcesResponse

The following response is returned after calling the Operation get method on the long-running operation returned by projects.locations.datasets.fhirStores.import.

{
  "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/operations/OPERATION_ID",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.healthcare.v1alpha.OperationMetadata",
    "apiMethodName": "google.cloud.healthcare.v1alpha.FhirService.ImportResources",
    "createTime": "2018-01-01T00:00:00.000000Z",
    "endTime": "2018-01-01T00:00:00.000000Z"
  },
  "done": true,
  "response": {
    "@type": "type.googleapis.com/google.cloud.healthcare.v1alpha.fhir.rest.ImportResourcesResponse",
    "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID",
    "inputSize": "NUMBER",
    "successCount": "NUMBER"
  }
}
v1beta1

ImportResourcesResponse

The following response is returned after calling the Operation get method on the long-running operation returned by projects.locations.datasets.fhirStores.import.

{
  "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/operations/OPERATION_ID",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.healthcare.v1beta1.OperationMetadata",
    "apiMethodName": "google.cloud.healthcare.v1beta1.fhir.FhirService.ImportResources",
    "createTime": "2018-01-01T00:00:00.000000Z",
    "endTime": "2018-01-01T00:00:00.000000Z"
  },
  "done": true,
  "response": {
    "@type": "type.googleapis.com/google.cloud.healthcare.v1beta1.fhir.rest.ImportResourcesResponse",
    "fhirStore": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/operations/OPERATION_ID",
    "inputSize": "NUMBER"
  }
}

Example: FHIR import response (failure)

v1alpha

ImportResourcesResponse

The following response is returned after calling the Operation get method on the long-running operation returned by projects.locations.datasets.fhirStores.import.

{
  "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/operations/OPERATION_ID",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.healthcare.v1alpha.OperationMetadata",
    "apiMethodName": "google.cloud.healthcare.v1alpha.FhirService.ImportResources",
    "createTime": "2018-01-01T00:00:00Z",
    "endTime": "2018-01-01T00:00:00Z"
  },
  "done": true,
  "response": {
    "@type": "type.googleapis.com/google.cloud.healthcare.v1alpha.fhir.rest.ImportResourcesResponse",
    "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID",
    "inputSize": "NUMBER",
    "errorCount": "NUMBER",
    "successCount": "NUMBER"
  }
}
v1beta1

ImportResourcesErrorDetails

The following response is returned after calling the Operation get method on the long-running operation returned by projects.locations.datasets.fhirStores.import.

{
  "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/operations/OPERATION_ID",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.healthcare.v1beta1.OperationMetadata",
    "apiMethodName": "google.cloud.healthcare.v1beta1.fhir.FhirService.ImportResources",
    "createTime": "2018-01-01T00:00:00.000000Z",
    "endTime": "2018-01-01T00:00:00.000000Z"
  },
  "done": true,
  "error": {
    "code": ERROR_CODE,
    "details": [
      {
        "@type": "type.googleapis.com/google.cloud.healthcare.v1beta1.fhir.rest.ImportResourcesErrorDetails",
        "fhirStore": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/operations/OPERATION_ID",
        "inputSize": "NUMBER",
        "errorCount": "NUMBER",
        "successCount": "NUMBER"
      }
    ]
  }
}

Example: FHIR export to Cloud Storage request

v1alpha

projects.locations.datasets.fhirStores.export

{
  'gcsDestinationLocation': {
    'gcsUri': 'gs://BUCKET/DIRECTORY'
  }
}
v1beta1

projects.locations.datasets.fhirStores.export

{
  'gcsDestination': {
    'uriPrefix': 'gs://BUCKET/DIRECTORY'
  }
}

Example: FHIR export to Cloud Storage response

v1alpha

ExportResourcesResponse

The following response is returned after calling the Operation get method on the long-running operation returned by projects.locations.datasets.fhirStores.export.

{
  "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/operations/OPERATION_ID",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.healthcare.v1alpha.OperationMetadata",
    "apiMethodName": "google.cloud.healthcare.v1alpha.FhirService.ExportResources",
    "createTime": "2018-01-01T00:00:00Z",
    "endTime": "2018-01-01T00:00:00Z"
  },
  "done": true,
  "response": {
    "@type": "type.googleapis.com/google.cloud.healthcare.v1alpha.fhir.rest.ExportResourcesResponse",
    "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID",
    "resourceCount": "NUMBER"
  }
}
v1beta1

ExportResourcesResponse

The following response is returned after calling the Operation get method on the long-running operation returned by projects.locations.datasets.fhirStores.export.

{
  "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/operations/OPERATION_ID",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.healthcare.v1beta1.OperationMetadata",
    "apiMethodName": "google.cloud.healthcare.v1beta1.fhir.FhirService.ExportResources",
    "createTime": "2018-01-01T00:00:00Z",
    "endTime": "2018-01-01T00:00:00Z"
  },
  "done": true,
  "response": {
    "@type": "type.googleapis.com/google.cloud.healthcare.v1beta1.fhir.rest.ExportResourcesResponse",
    "fhirStore": "projects/PROJECT_ID/locations/REGION/datasets/fhirStores/FHIR_STORE_ID",
    "resourceCount": "NUMBER"
  }
}

Example: FHIR export to BigQuery request

v1alpha

projects.locations.datasets.fhirStores.export

{
  'bigqueryDestinationLocation': {
    'projectId': 'PROJECT_ID',
    'datasetId': 'DATASET_ID'
  }
}
v1beta1

projects.locations.datasets.fhirStores.export

{
  'bigqueryDestination': {
    'datasetUri': 'bq://PROJECT_ID.DATASET_ID'
  }
}

Example: FHIR export to BigQuery response

v1alpha

ExportResourcesResponse

The following response is returned after calling the Operation get method on the long-running operation returned by projects.locations.datasets.fhirStores.export.

{
  "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/operations/OPERATION_ID",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.healthcare.v1alpha.OperationMetadata",
    "apiMethodName": "google.cloud.healthcare.v1alpha.FhirService.ExportResources",
    "createTime": "2018-01-01T00:00:00Z",
    "endTime": "2018-01-01T00:00:00Z"
  },
  "done": true,
  "response": {
    "@type": "type.googleapis.com/google.cloud.healthcare.v1alpha.fhir.rest.ExportResourcesResponse",
    "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID",
    "resourceCount": "NUMBER"
  }
}
v1beta1

ExportResourcesResponse

The following response is returned after calling the Operation get method on the long-running operation returned by projects.locations.datasets.fhirStores.export.

{
  "name": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/operations/OPERATION_ID",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.healthcare.v1beta1.OperationMetadata",
    "apiMethodName": "google.cloud.healthcare.v1beta1.fhir.FhirService.ExportResources",
    "createTime": "2018-01-01T00:00:00Z",
    "endTime": "2018-01-01T00:00:00Z"
  },
  "done": true,
  "response": {
    "@type": "type.googleapis.com/google.cloud.healthcare.v1beta1.fhir.rest.ExportResourcesResponse",
    "fhirStore": "projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID",
    "resourceCount": "NUMBER"
  }
}

HL7v2 changes

There are no changes to HL7v2 in v1beta1 of the Cloud Healthcare API.

Changes from v1alpha2 to v1beta1

If you are transitioning from v1alpha2 to v1beta1, take note of the following changes:

  • The fhirStores.capabilities method is no longer available. Instead, use fhirStores.fhir.capabilities. For example:

    v1alpha2:

    GET https://healthcare.googleapis.com/v1alpha2/projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/metadata
    

    v1beta1:

    GET https://healthcare.googleapis.com/v1beta1/projects/PROJECT_ID/locations/REGION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/metadata
    
  • It is no longer possible to write errors to a Cloud Storage object when importing FHIR resources.

  • The methods for getting and setting IAM permissions on FHIR security labels are not available in v1beta1. Instead, use the v1alpha2 methods. Permissions set using the v1alpha2 methods are enforced on all relevant calls, regardless of the API version called.

¿Te ha resultado útil esta página? Enviar comentarios:

Enviar comentarios sobre...

Cloud Healthcare API