L
Leaphealth - OSDocs

Notification & Reminder Settings

Notification routing rules, escalation chains, reminder schedules, and channel configuration.

Notification & Reminder Settings

Configure how the system sends notifications to staff and patients, including routing rules, escalation chains, reminder schedules, and channel preferences.

Multiple Config Sources

Notification settings come from three places: routing rules (per-event), reminder definitions (hierarchical config), and tenant notification config (templates). Each is described below.

Notification Routing Rules

Routing rules define who gets notified when a specific event occurs. Each rule specifies the event type, target staff, channels, and priority.

{  "event_type": "APPOINTMENT_CONFIRMED",  "routing_strategy": "BY_STAFF_TYPE",  "target_staff_types": [    "DOCTOR",    "RECEPTIONIST"  ],  "target_value": null,  "channels": [    "WHATSAPP",    "IN_APP"  ],  "escalation_config": {    "levels": [      {        "target_staff_types": [          "ADMIN"        ],        "timeout_minutes": 15      },      {        "target_staff_types": [          "MANAGER"        ],        "timeout_minutes": 30      }    ]  },  "priority": "HIGH",  "is_active": true,  "priority_order": 1}

Routing Rule Fields

Field

Type

What It Does

event_type

string

Which system event triggers this rule (e.g., APPOINTMENT_CONFIRMED, VISIT_COMPLETED)

routing_strategy

enum

How to find recipients: BY_STAFF_TYPE, BY_ROLE, BY_DEPARTMENT, SPECIFIC_STAFF

target_staff_types

string[]

Staff types to notify (e.g., DOCTOR, NURSE, RECEPTIONIST)

target_value

string or null

Specific target when strategy is SPECIFIC_STAFF

channels

string[]

Notification channels: WHATSAPP, EMAIL, SMS, IN_APP

escalation_config

object or null

Escalation chain if primary recipients don't acknowledge

priority

enum

LOW, MEDIUM, HIGH, CRITICAL

is_active

boolean

Whether this routing rule is currently active

priority_order

number

When multiple rules match, higher priority_order takes precedence

Escalation Config Structure

The escalation config defines a chain of fallback recipients if the primary notification isn't acknowledged within the timeout:

{  "levels": [    {      "target_staff_types": [        "ADMIN"      ],      "timeout_minutes": 15    },    {      "target_staff_types": [        "MANAGER",        "OWNER"      ],      "timeout_minutes": 30    }  ]}

Field

Type

What It Does

levels

array

Ordered list of escalation levels

levels[].target_staff_types

string[]

Staff types to escalate to at this level

levels[].timeout_minutes

number

Minutes to wait before escalating to this level

Reminder Definitions

Reminders are automated notifications sent before appointments. They are configured via the REMINDER config type in the hierarchical config system, with code defaults as fallback.

{  "appointment_reminders": [    {      "offset_minutes": -1440,      "channels": [        "WHATSAPP",        "EMAIL"      ],      "template_key": "APPOINTMENT_REMINDER_24H",      "priority": "HIGH",      "enabled": true    },    {      "offset_minutes": -120,      "channels": [        "WHATSAPP"      ],      "template_key": "APPOINTMENT_REMINDER_2H",      "priority": "HIGH",      "enabled": true    },    {      "offset_minutes": -30,      "channels": [        "WHATSAPP"      ],      "template_key": "APPOINTMENT_REMINDER_30M",      "priority": "HIGH",      "enabled": true    }  ]}

Reminder Definition Fields

Field

Type

Default

What It Does

offset_minutes

number

-1440, -120, -30

Minutes before appointment (negative = before). -1440 = 24 hours before

channels

string[]

See above

Which channels to use for this reminder

template_key

string

See above

Message template identifier for this reminder

priority

enum

HIGH

Notification priority level

enabled

boolean

true

Whether this reminder is active

Default Reminders

If no REMINDER config exists in the database, the system sends 3 reminders: 24 hours before (WhatsApp + Email), 2 hours before (WhatsApp), and 30 minutes before (WhatsApp).

Tenant Notification Config

Each tenant can configure notification templates and channel preferences stored in the tenant notification config table:

{  "whatsapp_templates": {    "APPOINTMENT_CONFIRMED": "apt_confirmed_v2",    "APPOINTMENT_REMINDER_24H": "apt_reminder_24h",    "BILL_ISSUED": "bill_issued_v1"  },  "email_templates": {    "APPOINTMENT_CONFIRMED": "HOS_APT_CONFIRMED",    "BILL_ISSUED": "HOS_BILL_ISSUED"  }}

Field

Type

What It Does

whatsapp_templates

object

Map of event type to WhatsApp template name (registered with provider)

email_templates

object

Map of event type to email template code (stored in email_templates table)


What's Next

  • Billing Settings — Configure automated bill notifications
  • Doctor Configuration — Doctor-specific notification preferences
  • Settings Reference — Complete list of all notification-related settings
notificationsremindersconfigurationalerts

Last updated on

On this page