Create a healthcare search data store

To search clinical data in Vertex AI Search, you can follow one of these workflows:

  • Create a healthcare data store, import FHIR R4 data into the data store, connect it to a healthcare search app, and query the clinical data.
  • Create a healthcare search app, create a healthcare data store and import FHIR R4 data into the data store during the app creation process, and query the clinical data. For more information, see Create a healthcare search app.

This page describes the first method.

About data import frequency

You can import FHIR R4 data into a data store in the following ways:

  • Batch import: a one-time import. Data is imported into a data store. For further incremental imports, see Refresh healthcare data.

  • Streaming import (Preview): a near real-time streaming data import. Any incremental changes in the source FHIR store are synchronized in the Vertex AI Search data store. Streaming requires a data connector, which is a type of a data store that contains an entity. An entity is also a data store instance.

    The data streaming rate for a given Google Cloud project is dependent on the following quotas. If you exceed the quota you might experience streaming delays.

You can select the data import frequency at the time of data store creation and you cannot change this configuration later.

Streaming import is available for all the resources that Vertex AI Search supports. For more information, see Healthcare FHIR R4 data schema reference.

Before you begin

Before you create the healthcare data store and import data into it, complete these requirements:

  • Understand the relationship between apps and data stores for healthcare search. For more information, see About apps and data stores.

  • Prepare your FHIR data for ingestion.

  • Vertex AI Search for healthcare provides search services only in the US multi-region (us). Therefore, your healthcare search app and data stores must reside in the us multi-region.

Create a data store

You can create a data store either in the Google Cloud console or using the API. The two approaches differ in the following way:

  • In the Google Cloud console: Select the source FHIR store in the Cloud Healthcare API and import FHIR data as part of the healthcare search data store creation process. To stream FHIR data (Preview), your source FHIR store must be in the same Google Cloud project as the destination Vertex AI Search data store.
  • Through the REST API: You can import FHIR data from a Cloud Healthcare API FHIR store that's in the same Google Cloud project or a different one.
    1. Use the dataStores.create method to create a healthcare data store.
    2. Use the documents.import method to specify the FHIR store in Cloud Healthcare API and import FHIR R4 data.

To create a healthcare data store, complete the following steps.

Console

  1. In the Google Cloud console, go to the Agent Builder page.

    Agent Builder

  2. In the navigation menu, click Data stores.

  3. Click Create data store.

  4. In the Select a data source pane, select Healthcare API (FHIR) as your data source.
  5. To import data from your FHIR store, do one of the following:
    • Select the FHIR store from the list of available FHIR stores:
      1. Expand the FHIR store field.
      2. In this list, select a dataset that resides in a permitted location and then select a FHIR store that uses FHIR version R4.

        To stream FHIR data (Preview), your source FHIR store must be in the same Google Cloud project as the destination Vertex AI Search data store.

    • Enter the FHIR store manually:
      1. Expand the FHIR store field.
      2. Click Enter FHIR store manually.
      3. In the FHIR store name dialog, enter the full name of the FHIR store in the following format:

        project/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID

      4. Click Save.
  6. In the Synchronization section, select one of the following options. This selection cannot be changed after the data store is created.
    • One time: to perform a one-time batch data import. For further incremental imports, see Refresh healthcare data.
      1. Click Continue.
      2. In the Your data store name field, enter a name for your data store.
      3. Click Create.
      4. The data store you created is listed on the Data Stores page.

    • Streaming: to perform a near real-time streaming data import. To stream data, you must create a data connector, which is a type of a data store. This is a Preview feature. To set up a streaming data store using the REST API, contact your customer engineer.
      1. Click Continue.
      2. In the Your data connector name field, enter a name for your data connector.
      3. Click Create.
      4. The data connector you created is listed on the Data Stores page. The source FHIR store is added as an entity within the data connector.

REST

  1. Create a data store.

    curl -X POST\
     -H "Authorization: Bearer $(gcloud auth print-access-token)" \
     -H "Content-Type: application/json"\
     -H "X-Goog-User-Project: PROJECT_ID" \
    "https://us-discoveryengine.googleapis.com/v1alpha/projects/PROJECT_ID/locations/us/collections/default_collection/dataStores?dataStoreId=DATA_STORE_ID" \
     -d '{
        "displayName": "DATA_STORE_DISPLAY_NAME",
        "industryVertical": "HEALTHCARE_FHIR",
        "solutionTypes": ["SOLUTION_TYPE_SEARCH"],
        "searchTier": "STANDARD",
        "searchAddOns": ["LLM"]
    }'
    

    Replace the following:

    • PROJECT_ID: the ID of your Google Cloud project.
    • DATA_STORE_ID: the ID of the Vertex AI Search data store that you want to create. This ID can contain only lowercase letters, digits, underscores, and hyphens.
    • DATA_STORE_DISPLAY_NAME: the display name of the Vertex AI Search data store that you want to create.
  2. If the source FHIR store and the target Vertex AI Search data store are in the same Google Cloud project, call the following method to perform a one-time batch import. If they're not in the same project, go to the next step.

    curl -X POST \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    -H "Content-Type: application/json; charset=utf-8" \
    -H "X-Goog-User-Project: PROJECT_ID" \
    "https://us-discoveryengine.googleapis.com/v1alpha/projects/PROJECT_ID/locations/us/dataStores/DATA_STORE_ID/branches/0/documents:import" \
    -d '{
       "reconciliation_mode": "FULL",
       "fhir_store_source": {"fhir_store": "projects/PROJECT_ID/locations/CLOUD_HEALTHCARE_DATASET_LOCATION/datasets/CLOUD_HEALTHCARE_DATASET_ID/fhirStores/FHIR_STORE_ID"}
    }'
    

    Replace the following:

    • PROJECT_ID: the ID of your Google Cloud project.
    • DATA_STORE_ID: the ID of the Vertex AI Search data store.
    • CLOUD_HEALTHCARE_DATASET_ID: the ID of the Cloud Healthcare API dataset that contains the source FHIR store.
    • CLOUD_HEALTHCARE_DATASET_LOCATION: the location of the Cloud Healthcare API dataset that contains the source FHIR store.
    • FHIR_STORE_ID: the ID of the Cloud Healthcare API FHIR R4 store.
  3. If the source FHIR store and the target Vertex AI Search data store are in different Google Cloud projects, call the following method to perform a one-time batch import. If they're in the same project, go back to the previous step.

    curl -X POST \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    -H "Content-Type: application/json; charset=utf-8" \
    -H "X-Goog-User-Project: TARGET_PROJECT_ID" \
    "https://us-discoveryengine.googleapis.com/v1alpha/projects/TARGET_PROJECT_ID/locations/us/dataStores/DATA_STORE_ID/branches/0/documents:import" \
    -d '{
       "reconciliation_mode": "FULL",
       "fhir_store_source": {"fhir_store": "projects/SOURCE_PROJECT_ID/locations/CLOUD_HEALTHCARE_DATASET_LOCATION/datasets/CLOUD_HEALTHCARE_DATASET_ID/fhirStores/FHIR_STORE_ID"}
    }'
    

    Replace the following:

    • TARGET_PROJECT_ID: the ID of the Google Cloud project that contains the Vertex AI Search data store.
    • DATA_STORE_ID: the ID of the Vertex AI Search data store.
    • SOURCE_PROJECT_ID: the ID of the Google Cloud project that contains the Cloud Healthcare API dataset and FHIR store.
    • CLOUD_HEALTHCARE_DATASET_ID: the ID of the Cloud Healthcare API dataset that contains the source FHIR store.
    • CLOUD_HEALTHCARE_DATASET_LOCATION: the location of the Cloud Healthcare API dataset that contains the source FHIR store.
    • FHIR_STORE_ID: the ID of the Cloud Healthcare API FHIR R4 store.
  4. Optional: To set up a streaming data import (Preview) using the REST API, contact your customer engineer.

Verify data store creation and FHIR data import

This task shows you how to verify whether a data store was created successfully and whether FHIR data was imported into the data store successfully.

  • In the Google Cloud console: Select the data store and verify its details.
  • Through the REST API:
    1. Use the dataStores.get method to get the healthcare data store details.
    2. Use the operations.get method to get the details of the import operation.

To verify data store creation and data import, complete the following steps.

Console

  1. In the Google Cloud console, go to the Agent Builder page.

    Agent Builder

  2. In the navigation menu, click Data stores.

    The Data stores page displays a list of data stores in your Google Cloud project with their details.

  3. Verify whether the data store or the data connector that you created is in the data stores list.

  4. Select the data store or the data connector and verify its details.

    • For a data store:
      • The summary table lists the following details:
        • The data store ID, type, and region.
        • The number of documents indicating the number of FHIR resources imported.
        • The timestamp when the last document was imported.
        • Optionally, click View details to see the document import details, such as the details about a successful, partial, or failed import.
      • The Documents tab lists the resource IDs of the imported FHIR resources and their resource types in a paginated table. You can filter this table to verify whether a particular resource was imported.
      • The Activity tab lists the document import details, such as the details about a successful, partial, or failed import.
    • For a data connector:
      • The summary table lists the following details:
        • The collection ID, type, and region.
        • The name of the connected app.
        • The state of the connector, which is either active or paused.
      • The Entities table shows the entity within the data connector. The entity's name is the source FHIR store name. The entity's ID is the data connector's ID appended with the source FHIR store name.
        • Click the entity name to see its details. Because an entity is a data store instance within a data connector, the entity details are the same as a data store details.

REST

  1. Verify the data store creation.

    curl -X GET -H "Authorization: Bearer $(gcloud auth print-access-token)" \
     -H "Content-Type: application/json"\
     -H "X-Goog-User-Project: PROJECT_ID" \
     "https://us-discoveryengine.googleapis.com/v1alpha/projects/PROJECT_ID/locations/us/collections/default_collection/dataStores/DATA_STORE_ID"
    

    Replace the following:

    • PROJECT_ID: the ID of your Google Cloud project.
    • DATA_STORE_ID: the ID of the Vertex AI Search data store.
  2. Verify whether the FHIR data import operation is complete.

    curl -X GET \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    "https://us-discoveryengine.googleapis.com/v1alpha/projects/PROJECT_ID/locations/us/collections/default_collection/dataStores/DATA_STORE_ID/branches/0/operations/IMPORT_OPERATION_ID"
    

    Replace the following:

    • PROJECT_ID: the ID of your Google Cloud project.
    • DATA_STORE_ID: the ID of the Vertex AI Search data store.
    • IMPORT_OPERATION_ID: the operation ID of the long-running operation that's returned when you call the import method

What's next