Skip to main content

Use Semble API with Microsoft 365 to Track Patient Journeys

Welcome to the Semble GraphQL API how-to guide. In this guide, we will demonstrate how you can use the Semble GraphQL public API along with Microsoft 365's Power Automate and Microsoft Planner to monitor the stages of your patients' journey effectively. This setup will run updates daily, tracking patients from arrival to invoicing and letter dispatch, with no need for building custom solutions.

Step 1: Set Up Your Microsoft Planner

Start by setting up a new plan in Microsoft Planner. Within this plan, create the following buckets, each reflecting a distinct stage in the patient journey:

  • Schduled
  • Arrived
  • Seen
  • Invoiced
  • Letter Sent

These buckets represent the current status of each patient in their journey through your practice.

Step 2: Create a Daily Scheduled Flow

With Power Automate, create a flow scheduled to run every morning. This flow should query the Semble API for all patients with a booking on the current day. In Power Automate, this is done using the HTTP connector to make a GraphQL request to the Semble API. This is the query you need to use:

query bookings(
dateRange: {start: "2023-01-01T00:00:00.000z", end: "2023-01-01T23:59:59.000z"}
){
data {
patientId
patient {fullName}
}
}

The response from the Semble API contains each patient's ID and full name. For each returned patient, add a new task in the 'Arrived' bucket of your Microsoft Planner plan, assigning the patient's full name as the task name.

Step 3: Create a Regularly Scheduled Flow

Next, create another cloud flow in Power Automate, scheduled to run every 15 minutes. This flow should list all tasks from the Planner plan you created in step 1. For each task (representing each patient), use the HTTP connector again to make a GraphQL request to the Semble API to get the patient's details, using the following query:

query patient(id: "patientId") {
bookings {
data {
bookingJourney {
arrived
departed
}
}
}
invoices {
data {
date
}
}
letters {
data {
date
reviewStatus
}
}
}

The response from the Semble API contains details about the patient's bookings, invoices, and letters. Depending on the data received, move each task to the appropriate bucket ('Arrived', 'Seen', 'Invoiced', 'Letter Sent') in your Microsoft Planner plan.

By using this setup, you'll be able to utilise your Microsoft 365 license and Power Automate, along with the Semble API, to keep an up-to-date, automatic track of each patient's journey through your practice.