COVID-19 Back to Work template in Microsoft Healthcare Bot with Azure API for FHIR
Published May 29 2020 12:10 AM 6,920 Views

Update: This blog was last edited on 8/10/2020. This blog outlines using Healthcare Bot for Back to Work use case with FHIR backend.


What is the COVID-19 Back to Work Solution Template?


As countries worldwide seek to re-open their economies by relaxing “stay-at-home” orders, many employers are considering how to prepare their facilities and employees for the return to the physical workplace. To do this in a more safe manner, it is critical to monitor employees for common COVID-19 symptoms and provide a simple way for affected employees to physically return to the workplace once they are cleared to do so. Microsoft teams have developed a special solution template to enable employers worldwide to easily create deploy Microsoft technologies to scale and automate those critical steps for return to the workplace. We call it the “Back to Work” solution template and below you will find detailed instructions on how to use this to empower a safer return to the workplace for your organization.


Our COVID-19 "Back To Work" template is built on Microsoft Healthcare Bot service and the Microsoft Azure API for FHIR. Some key elements include:

  • Symptom tracking for essential workers who have been exposed to COVID (physicians, nurses, ancillary staff, volunteers)
  • In accordance with CDC guidelines* 
  • Organizational configurable documentation of information such as symptoms, occupational exposure type, and testing status
  • Allows systems to determine when employees will be safe to return to patient care activities or work or campus
  • Supported by Microsoft’s industry leading compliance, privacy, and security portfolio (link)


COVID-19 Back to Work Template with data persistence in Azure API for FHIR


We will take you step-by-step through the following, so that you can use the “Back to Work” template with FHIR persistence:

  1. Setup Azure API for FHIR
  2. Import Back to Work template
  3. Healthcare Bot Authentication and Data Connection
  4. Create Web Chat Channel and embed in a website


Setup Azure API for FHIR

Prerequisite: If you don't have an Azure subscription, create a free account before you begin.

The COVID-19 Back to Work template uses FHIR persistence. To ensure appropriate configuration, you need 3 steps:

1. Deploy FHIR Server

2. Register a Service Client application in Azure AD

3. Configure Azure RBAC


Step 1: Deploy FHIR Server

​Login to Azure portal. Click +Create a resource. Search for Azure API for FHIR and click Create.



Enter details in Basics 


Enter Resource Group

Account Name (FHIR Server name – must be unique)

Select Region

Select FHIR Version = R4


Click Next:  Additional settings


Additional settings



  • Copy Authority:<tenantid> where Tenant ID = deployment tenant
  • Copy Audience:  https://<your-fhir-api-name> where “your-fhir-api-name is the name of the Server you specified in Basics


Azure API for FHIR uses Azure Cosmos DB as backend database with a default setting of 400 RU/s. You can change Provisioned throughput (RU/s) to a higher number. More details on Request Units (RU) can be found here.


Click Review + Create to create your API for FHIR deployment


Step 2: Register a Service Client application in Azure AD

In Azure portal, on the left navigation panel (if not visible, click on the hamburger symbol on left), click Azure Active Directory -> App registrations -> +New registration.


Enter a user friendly name (something like service-client-<yourfhirapiname>). Leave the default supported account types. 

Click Register. 

Once created the Portal will take you to the new Application Registration.


Read more about Public & Confidential Client applications here (link)

Copy the Application (client) ID and save it for later use as “Client ID”.


In the same service client application blade, under Manage, click on Certificates and secrets. Click on + New client secret. Enter a description and expiry period for the key and click Add. Copy the generated secret and save it for later use as “Client Secret”.




Step 3: Configure Azure RBAC

Go to the Azure API for FHIR created in Step 1. In left pane, click on Access control (IAM) and + Add -> Add role assignment. Choose (1) Role: FHIR Data Contributor (2) Assign access to: Azure AD user, group, or service principal (3) Select service-client-<yourfhirapiname>. Click on Save.





Configure Healthcare Bot and Import Back to Work template


1. Go to Azure Marketplace and Try out Microsoft Healthcare Bot instance for free.

2. Sign into the Azure portal with your Azure credentials and select Create.

3. In the Microsoft Healthcare Bot blade, provide the necessary details and click Subscribe. You can start with the W1 – Free plan and update Plan later.

4. On successful deployment, Go To Resource and click Configure Account. Verify details and click Create.

5. You will be redirected to Healthcare Bot Service admin portal.

6. Navigate to Scenarios -> Manage. At the top bar, you will find option to Import scenario. The Back to Work scenarios for FHIR are available in the GitHub folder for FHIR persistence. Both the scenarios (.json files) need to be imported.

7. Navigate to Language -> Localization. At the top bar, you will find option to Import custom strings. The required excel file Localization - Custom strings is available in the GitHub folder for FHIR persistence.

8. In Scenarios -> Manage, the two new scenarios added are:

- COVID19 Back To Work Core: Logical workflow for (a) Registration/login, (b) Daily screening of exposure, symptoms and lab test

- COVID19 Back To Work CRUD: For backend Create, Read, Edit, Delete operations



9. Click on COVID19 Back To Work Core scenario to run and test or make necessary modification to UI.


Healthcare Bot Authentication and Data Connection


1. Add Authentication Provider

Go to Integration -> Authentication -> click +New. In the "New Authentication provider" dialog box,​ enter the following details - 

  • Click Create



2. Add Data connections​

Go to Integration -> Data Connections > click +Add. In the "New Data connection" dialog box,​ enter the following details - 

  • Name: FHIR Back To Work
  • Enable FHIR Support ​
  • Add Base URL to point to your Azure API for FHIR URL​ 
    • https://<yourname>
  • Authentication Provider: FHIR Back To Work Auth (Server 2 Server)​
  • Click Update​



You are ready to use the Back to Work template!

This template can be used with any of the channels available by default including – Web Chat/DirectLine, Microsoft Teams, Twilio, Facebook and Telegram. 


Creating Web Chat Channel

1. In Healthcare Bot admin portal, navigate to Integration -> Secrets. Copy values of APP_SECRET and WEBCHAT_SECRET



2. To deploy Web Chat channel, go to GitHub repository. Click “Deploy to Azure”.

3. Fill in required details and click Next.



4. Go back to Azure portal and navigate to the chosen Resource Group in previous step. Click on the App Service (fhirbacktowork in this example). On the left pane, look for Development Tools -> App Service Editor (Preview). Click Go.


5. In the App Service Editor screen, Click on Explore -> WWWRoot -> public/index.js file. Scroll down to line 107, remove the comment symbols /* and */ from lines 108 and 116. Change trigger in line 110 to trigger: “covid19_backToWork_core”,



6. Once that’s done, you are ready to run the Back to Work template. Click “Run” in App Service Editor or copy the Azure App Service URL in a new browser window and you will get this Azure website.



Thanks for reading and let us know how we can help!


Microsoft Health Engineering Team



Bert Hoorne, Microsoft Healthcare Industry Technology Strategist



Nikita Pitliya, Microsoft Senior Solutions Architect



Srini Surendranath, WW Customer Lead


Version history
Last update:
‎Aug 10 2020 12:10 PM
Updated by: