Protocol widget
Intake configs define the questionnaires that patients receive before their appointment. The Protocol widget gives healthcare providers a hosted UI for creating and maintaining those questionnaires from inside your application’s settings area.
What Providers Can Manage
The widget lets providers:
- Create intake configs
- Edit a config’s name
- Configure the intake flow with topics and conditional branches
- Set follow-up depth (
None,Short, orDetailed) - Add additional instructions
- Activate or deactivate a config
Changes are autosaved by the widget.
Mounting the widget
Mount the widget in your application’s settings or configuration area.
const widget = squire.mountWidget('#intake-settings-container', 'intake-settings', {
theme: {
colorPrimary: '#337ab7',
colorLightest: '#f8f9fa',
borderRadius: '0.25rem',
font: 'Roboto',
},
});<div id="intake-settings-container"></div>Events
Listen for lifecycle events on the widget handle returned by mountWidget:
widget.on('loaded', () => {
console.log('Protocol widget loaded');
});| Event | Payload | Description |
|---|---|---|
loaded | null | Fired when the widget has initialized |
Theming
Customize the widget’s appearance by passing a theme object:
| Property | Type | Default | Description |
|---|---|---|---|
colorPrimary | string | '#539DD6' | Primary color for buttons and accents |
colorLightest | string | '#E1F1FD' | Lightest color for backgrounds |
borderRadius | string | '0.5rem' | Border radius for UI elements |
font | string | 'system-ui, sans-serif' | Font family (all Google Fonts are supported) |
You can also pass locale to localize the widget. Supported locales are en, nl, de, and fr.
squire.mountWidget('#intake-settings-container', 'intake-settings', {
locale: 'nl',
});Listing Intake Configs via API
Use the API when you need to populate your own UI, such as a dropdown in your booking flow:
const configs = await squire.intake.getIntakeConfigs();Returns an array of intake config objects:
[
{
"id": "proto_abc123",
"name": "General Intake"
},
{
"id": "proto_def456",
"name": "Specialist Referral"
}
]Use the intake config id when creating an intake session to link the correct questionnaire to the appointment.