Create a healthcare search app

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. For more information, see Create a healthcare data store.
  • 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.

This page describes the second 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 search app, 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 an app

You can create a healthcare search app 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 app 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 app.
  • Through the REST API: You can import FHIR data from a Cloud Healthcare API FHIR store. The FHIR store can be 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 data.
    3. Use the engines.create method to create the healthcare search app and specify an existing healthcare data store.

To create a healthcare search app, follow these steps:

Console

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

    Agent Builder

  2. On the Apps page, click New app.

  3. On the Create app page, select Search.

  4. In the Search app configuration pane, select Healthcare.

  5. To turn on advanced LLM features for this app, click the Advanced LLM features toggle.

    Activate advanced LLM features to get search summaries, which are short summarizations of the top one or more search results.

    When you activate LLM features, it can take up to five minutes for the supported features to become available.

  6. In the Your app name field, enter a name for your app.

  7. In the External name of your company or organization field, enter the common name for your company or organization. You don't need to include suffixes such as Inc or LLC. This field is useful for the LLM to identify the company that the app represents.

  8. Click Continue.

  9. On the Data stores page, do one of the following:

    • Select an existing healthcare data store for batch import or an existing data connector for streaming import. To create a data store or a data connector before creating an app, see Create a healthcare data store.
    • Create a data store (for one-time batch import) or a data connector, which is an instance of a data store (for streaming import):
      1. Click Create data store.
      2. In the Select a data source pane, select Healthcare API (FHIR) as your data source.
      3. 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.
      4. 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.

      5. Select the created data store or data connector.
  10. Click Create.

    If the app and its data store are created successfully, the data store details page displays the details of the imported FHIR data.

REST

  1. Create a healthcare data store and import healthcare data into it.
  2. Create a healthcare search app and connect it to a data store. A healthcare search app can only connect to one data store, whereas a given data store can be connected to several apps.

    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/engines?engineId=APP_ID" \
     -d '{
        "displayName": "APP_DISPLAY_NAME",
        "data_store_ids":"DATA_STORE_ID",
        "industryVertical": "HEALTHCARE_FHIR",
        "solutionTypes": ["SOLUTION_TYPE_SEARCH"],
        "searchEngineConfig": {
          "searchTier": "STANDARD",
          "searchAddOns": ["SEARCH_ADD_ON"]
        }
    }'
    

    Replace the following:

    • PROJECT_ID: the ID of your Google Cloud project.
    • APP_ID: the ID of the Vertex AI Search app that you want to create.
    • APP_DISPLAY_NAME: the display name of the Vertex AI Search app that you want to create.
    • DATA_STORE_ID: the ID of an existing Vertex AI Search data store that you want to add to the Vertex AI Search app.
    • SEARCH_ADD_ON: an optional field to specify whether you want the advanced LLM features, such as searching with generative AI answers, for this app. To activate advanced LLM features, enter the value SEARCH_ADD_ON_LLM. If you don't want advanced LLM features, remove the searchAddOns field or leave this list empty. For more information, see Advanced LLM features.

Verify app creation

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

  • In the Google Cloud console: Select the app and verify its details.
  • Through the REST API, use the engines.get method to get the healthcare data store details.

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. On the Apps page, verify whether the app that you created is in the apps list.

  3. Verify that the data store that you connected to the app is listed in the Connected data stores column.

  4. Select the data store and verify the data store details.

REST

  1. Verify the app 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/engines/APP_ID"
    

    Replace the following:

    • PROJECT_ID: the ID of your Google Cloud project.
    • APP_ID: the ID of the Vertex AI Search app.
  2. Verify data store creation and FHIR data import.

What's next