Clinical Automation with Google Workspace and the Healthcare API

Ruchika Kharwar
Google Cloud - Community
6 min readMay 13, 2021

--

Introduction

As healthcare continues to automate, Google Cloud is seeking ways to ease the technical debt for clinical systems while furthering their ability to serve patients with easy-to-use-tools. Google Workspace has been used across the industry to help streamline patient care and provide collaboration tools for clinicians and patients alike.

This article shares how health systems can use Google Forms to integrate their workflows with Google’s Cloud Healthcare API. The specific use case referred to for the purpose of this article is when a new or existing patient reaches out to a provider to make an appointment. Typically, a provider asks the patient to arrive 15–30 minutes before the appointment time to fill out forms. There is paperwork involved. A patient might fill out hand written forms which are handed over to the clinical administrative staff. The staff then enters it into an electronic system of record.

In this article, a workflow is described where the provider sends the patient a link to a Google form. The patient fills the form securely using an electronic device of choice such as a phone or a laptop. The patient submits the form online. On submission, the process of validating the patient data and creation of the patients resource in the provider’s system of record is completely automated. Use cases for such workflow automation might include

  • New patient onboarding
  • Returning patient — Adaptation of the solution described could be used to send customized forms to the patient where the patient is saved from re-filling information that might have submitted in the past and only needing to update information that might have changed.
  • Patient surveys
  • Tele-monitoring of non serious patient conditions such as non serious burn wounds, acne, hair growth etc. — which involve taking images by a patient and attaching it to a form to communicate securely with a provider.

The solution described uses Google Forms and Google Apps Script to automate the patient provided information to a patient resource in Fast Healthcare Interoperability Resources (FHIR).

Google Forms is an easy to use, user friendly, information collection tool which is part of Google Workspace suite of tools. The integration is accomplished using the open source Google Healthcare Data Harmonization tool, Whistle. Cloud Dataflow is used to transform input data to FHIR format and write to the Cloud Healthcare API FHIR Store.

By utilizing the FHIR Store on Google Cloud, patient data is stored in a secure and industry-standard format. This allows for further integration with downstream applications, analytics and machine learning applications.

Solution Guide

Before you begin

For this reference guide, you need a Google Cloud project. You can create a new one, or select a project you already created:

  1. Select or create a Google Cloud project.
  2. Enable billing for your project.
  3. Enable the PubSub, Dataflow, Healthcare API and the Cloud Storage APIs.
  4. Ensure you have a Google Workspace account (aka Gmail for Enterprise). The workspace admin should accept the HIPAA BAA when using workspace tools such as forms and apps script) to process any kind of PHI data (https://support.google.com/a/answer/3407054?hl=en)
  5. Ensure you have the GCP SDK installed locally or use Cloud Shell

When you finish this tutorial, you can avoid continued billing by deleting the resources you created.

PART A: Setting up Google Cloud Platform

Use the Healthcare API to create a FHIR R4 store

#Create Healthcare DATASETgcloud healthcare datasets create <DATASET>#Create Healthcare FHIR STORE named “workspace”gcloud healthcare fhir-stores create workspace \
— dataset=<DATASET> \
— location=us-central1 \
— version=R4 \
— disable-referential-integrity \
— enable-update-create

Create a PubSub topic and a subscription

#Create a pubsub topic named “workspace”gcloud pubsub topics create workspace#Create a subscription to the topic named “dfjob” to topic “workspace”gcloud pubsub subscriptions create dfjob --topic workspace

Create a dataflow pipeline

For this step I am going to fork off from this repository open sourced by Google. https://github.com/GoogleCloudPlatform/healthcare-data-harmonization-dataflow

Follow the steps for the setting up the software dependencies and building the jar file used to run the dataflow streaming job.

This repository is forked here. Noteworthy changes include the following

  • Adaptation to get non HL7v2 messages from a pubsub topic
  • Sample whistle map used to accept Google workspace form data and harmonize it

Upload the map files to the {MAPPING_BUCKET} referenced below.

Start this streaming pipeline.

PROJECT=<PROJECT>
SUBSCRIPTION=workspace #Setup in Step 1,2
ERROR_BUCKET=workspace/error
MAPPING_BUCKET=workspace/mapping
LOCATION=<LOCATION>
DATASET=<DATASET>
FHIRSTORE=workspace
java -jar build/libs/converter-0.1.0-all.jar — pubSubSubscription=”<>” \
— readErrorPath=”gs://${ERROR_BUCKET}/read/read_error.txt” \
— writeErrorPath=”gs://${ERROR_BUCKET}/write/write_error.txt” \
— mappingErrorPath=”gs://${ERROR_BUCKET}/mapping/mapping_error.txt” \
— mappingPath=”gs://${MAPPING_BUCKET}/dhconfig.textproto” \
— fhirStore=”projects/${PROJECT}/locations/${LOCATION}/datasets/${DATASET}/fhirStores/${FHIRSTORE}” \
— runner=DataflowRunner \
— project=${PROJECT}

PART B: Setting up Google Workspace

Create a Google Workspace Form

When you create a form, in order to create an Apps Script project, click the “Responses” tab, and then click the trix image.

Create a Google Apps Script Application

Script Editor
Apps Script

In the script editor, you will see a development platform where you write your application that interacts with the healthcare API.

Write your javascript code and setup a trigger thus

The example above sets up a trigger to call your function named “onFormSubmit” when a form is submitted.

Example Code for an Apps Script Application

A link to a form is here

Ready for showtime (test it out)

Now that Google Workspace and the Data Ingest pipeline is setup, we will test out the tutorial by submitting a populated google form that you created in a previous step. An example form and the associated whistle maps are included in this article. However, you will need to make adjustments to suit your requirements.

After submitting the form, you should see your patient information land in the FHIR R4 store you created in the first step. You can confirm the working of your data pipeline by looking at the Dataflow pipeline statistics. An example of the same is pasted below.

Dataflow pipeline

The final confirmation can be made by going to

GCP Console->Healthcare->FHIR Viewer-><FHIR Store>Filter Patient.

You should see your patient created from the form you just submitted.

Summary

While the form collects some amount of information, a bare bones Patient resource is created with the solution described. The opportunity to use Google Workspace Forms with the Healthcare API for clinical use cases is limitless.

An extensible solution using enterprise grade, scalable products can be envisioned for a provider of any size — big or small, established or startup where all data is handled securely, compliantly to address workflows in healthcare.

Thanks to Alexander Sicular, Vivian Neilly, Roman Polyanovsky, Yatish Gupta, Mary Wholey.

Please Note

This article represents my and my alone personal view and opinion.

Reference links

[1] Whistle library for harmonization

[2] Setting up a HIPAA-aligned project

[3] HIPAA Compliance on Google Cloud Platform

[4] Google Cloud Healthcare Repository

[5] Apps Script Command line Interface

--

--

Ruchika Kharwar
Google Cloud - Community

I work for Google helping customers achieve their data modernization with Google Cloud Platform.