Smart Reminder Scheduling
Our scheduling service empowers web developers with two primary functionalities: it facilitates the creation and sending of customizable patient reminders by SMS and email, and serves as a versatile scheduler capable of triggering your own notification solution for enhanced flexibility via webhooks.
Feature overview
- Configure PROMs scheduling and patient reminders
- Assign PROMs to patients
- Send by SMS or email
- Connect your custom notification solution via webhooks
Before Getting Started
- Reminder configurations are defined at the Tenant level
- The reminder configuration provides basic configurations that are shared by all created schedules for a given Tenant
- Scheduler checks for notifications every 15 minutes
- Notifcations can be sent on the hour, a quarter past the hour, half past the hour or a quarter to the hour
- Ex: 9:00, 9:15, 9:30 and 9:45
Before you get started you may like to reference Initial API Setup
Reminder Configuration Template
Here we will demonstrate creating your first reminder configuration template. You will need your Access Token and Tenant ID.
Request
import axios from 'axios'
const FORMS_API_BASE_URL = 'https://api.visiontree.com/v1'
const TENANT_ID = '1'
const AUTH_TOKEN = 'Your_Auth_Token'
const options = {
headers: {
Authorization: `Bearer ${AUTH_TOKEN}`,
},
}
const body = {
maxRemindersPerDay: 1,
reminderInterval: {
unit: 'days',
quantity: 3,
},
expirationWarning: {
unit: 'days',
quantity: 2,
},
messageTimePreference: {
time: '09:00',
timezone: 'America/Los_Angeles',
},
emailSubject: 'Email subject here',
emailTemplate: 'Email body here',
smsTemplate: 'SMS body here',
expirationEmailSubject: 'Email expiration subject here',
expirationWarningEmailTemplate: 'Warning email form will expire soon',
expirationWarningSmsTemplate: 'Warning sms form will expire soon',
}
axios
.post(`${FORMS_API_BASE_URL}/tenants/${TENANT_ID}/reminders`, body, options)
.then((res) => console.log(res.data))Response
{
id: '124652b4-5a9d-4c10-b02c-53907e87ce09',
tenantId: '1',
maxRemindersPerDay: 1,
reminderInterval: {
quantity: 3,
unit: 'days',
},
expirationWarning: {
quantity: 2,
unit: 'days',
},
messageTimePreference: {
time: '09:00',
timezone: 'America/Los_Angeles',
},
emailSubject: 'Email subject here',
emailTemplate: 'Email body here',
smsTemplate: 'SMS body here',
expirationEmailSubject: 'Email expiration subject here',
expirationWarningEmailTemplate: 'Warning email form will expire soon',
expirationWarningSmsTemplate: 'Warning sms form will expire soon'
createdOn: '2023-11-30T13:51:03.704Z',
updatedOn: '2023-11-30T13:51:03.704Z',
}Explanations
Request
Let's look at the request and go over it line by line. First, we made use of the axios library to simplify promise-based HTTP requests. You may use any HTTP library of your choosing. The following three lines set our base Forms API URL, our Tenant ID as well as our Auth Token previously retrieved. The Tenant ID here will be used to create a reminder configuration template to be used by all reminders under this Tenant ID's ownership.
Next, we have the request's body, which represents the Forms API's smart reminder configuration. The first property maxRemindersPerDay is as it sounds and provides a maximum limit of messages sent to a patient in a given day. Depending on your reminder interval, discussed shortly, it is possible that more than one reminder can be sent per day and the maxRemindersPerDay property can provide a safeguard from overburdening your patient with solicitations.
The property reminderInterval contains two parts: unit and quantity. These properties determine the frequency of your reminders to your patients. The quantity property takes a numeric value and represents the amount of time assigned to the unit property, which takes values: hours, days, weeks and months. In our example here, a reminder will be sent every 3 days.
The next property, expirationWarning also contains the nested properties: unit and quantity. This is just like the reminderInterval property except that the expirationWarning represents when a patient should receive and additional reminder that their time to complete their assigned PROM is nearing expiration. Our example depicts an expiration warning being sent out 2 days prior to the PROM's expiration date.
The property messageTimePreference is used to set the tenant's preferred time to send SMS reminders to patients. It has two properties: time and timezone. The time property uses the 24-hour clock and can be set on the hour, 15 minutes past the hour, 30 minutes past the hour or 45 minutes past the hour. The timezone property represents time zone values from the Intl javascript class, which represents an IANA time zones. The scheduler service will send the SMS at that time in the provded time zone and not prior to this time, however if multiple messages are sent in a single day the subsequent messages will be managed by the reminderInterval time set in the reminder configuration.
The remaining properties are fairly straight forward, but let's go over them still. The emailSubject is simply the subject line for your email reminders. Following that we have emailTemplate which is the email's text body. Similarly, smsTemplate defines the text message sent via SMS reminders. The final three properties expirationEmailSubject, expirationWarningEmailTemplate and expirationWarningSmsTemplate are just like their aforementioned counterparts but are specificly used to tailor your expiration warning notifications.
The final line is the HTTP request itself where we introduce the full API endpoint, body and headers.
TIP
Additional information about SMS reminders:
It should be known that longer SMS reminders will be broken up over multiple SMS messages. We encourage you to test your reminders before notifying patients by SMS to confirm their format comports with what you intended.
Response
Let's briefly look at the response. In the response you will see the reminder configuration is returned and most importantly the id property, which is the unique identifier for your reminder configuration. With this ID, you can update and make changes to your reminder configuration whenever you need to.
Important: Remember to swap out TENANT_ID with your own.