L
Leaphealth - OSDocs

Doctor Configuration

Doctor-specific settings including consultation fees, slot overrides, walk-in strategy, and patient-type durations.

Doctor Configuration

Each doctor can have personalized settings that override hospital-wide defaults. These include consultation fees, slot generation preferences, walk-in availability, and patient-type durations.

Config Hierarchy

Doctor settings are the most specific level in the config hierarchy. They override centre, department, and tenant defaults. See Config Hierarchy for details on how settings merge.

Doctor Config Structure

The doctor config is stored as a JSONB object in the staff profiles table. Here is the complete structure:

{  "consultation_fee": 50000,  "new_patient_fee": 75000,  "follow_up_fee": 30000,  "repeat_fee": 25000,  "follow_up_rules": {    "window_days": 7,    "max_follow_ups": 3,    "requires_same_service": true  },  "repeat_rules": {    "window_days": 30,    "discount_percentage": 10,    "requires_same_doctor": true  },  "slot_generation": {    "granularity_minutes": 15,    "buffer_between_slots_minutes": 5,    "min_slot_duration_minutes": 10,    "break_handling": "EXCLUDE_OVERLAPPING",    "align_to_hour": false  },  "capacity": {    "default_per_slot": 1,    "overbooking_enabled": false,    "overbooking_percentage": 0,    "walk_in_reserve": {      "strategy": "NONE",      "reserve_percentage": 0,      "reserve_count": 0    }  },  "patient_type_duration": {    "NEW": {      "additional_minutes": 10    },    "EXISTING": {      "additional_minutes": 0    },    "FOLLOW_UP": {      "additional_minutes": -5    }  },  "approval": {    "required": false,    "timeout_hours": 24,    "timeout_action": "AUTO_APPROVE"  }}

Fee Fields

All fees are in paise (1/100 of a rupee):

Field

Type

What It Does

consultation_fee

number (paise)

Standard consultation fee for this doctor

new_patient_fee

number (paise)

Fee for first-time patients (overrides consultation_fee)

follow_up_fee

number (paise)

Fee for follow-up visits within the follow-up window

repeat_fee

number (paise)

Fee for repeat visits within the repeat window

Follow-Up Rules

{  "window_days": 7,  "max_follow_ups": 3,  "requires_same_service": true}

Field

Type

What It Does

window_days

number

Days after initial visit during which follow-up pricing applies

max_follow_ups

number

Maximum follow-up visits allowed within the window

requires_same_service

boolean

Whether follow-up must be for the same service as the original visit

Repeat Rules

{  "window_days": 30,  "discount_percentage": 10,  "requires_same_doctor": true}

Field

Type

What It Does

window_days

number

Days after initial visit during which repeat pricing applies

discount_percentage

number

Percentage discount for repeat visits

requires_same_doctor

boolean

Whether repeat visit must be with the same doctor

Slot Generation Overrides

These settings override the tenant/centre-level slot engine config for this specific doctor:

Field

Type

What It Does

granularity_minutes

number

Slot time granularity (e.g., 15 = slots at :00, :15, :30, :45)

buffer_between_slots_minutes

number

Gap between consecutive slots

min_slot_duration_minutes

number

Minimum slot length in minutes

break_handling

enum

How to handle breaks: EXCLUDE_OVERLAPPING or SPLIT_AROUND

align_to_hour

boolean

Force slots to start at the top of each hour

Capacity & Walk-In Reserve

Field

Type

What It Does

default_per_slot

number

How many patients can be booked in each slot

overbooking_enabled

boolean

Allow booking beyond capacity

overbooking_percentage

number

Maximum overbooking as a percentage of capacity

walk_in_reserve.strategy

enum

NONE, PERCENTAGE, or COUNT

walk_in_reserve.reserve_percentage

number

Percentage of slots reserved for walk-ins

walk_in_reserve.reserve_count

number

Fixed number of slots reserved for walk-ins

Patient-Type Duration Adjustments

Adjust slot duration based on patient type. Positive values extend the slot, negative values shorten it:

{  "NEW": {    "additional_minutes": 10  },  "EXISTING": {    "additional_minutes": 0  },  "FOLLOW_UP": {    "additional_minutes": -5  }}

Example: If the base slot is 15 minutes, a new patient gets 25 minutes (15 + 10), while a follow-up gets 10 minutes (15 - 5).

Doctor Walk-In Configuration

Doctors can have additional walk-in-specific settings that control their walk-in patient handling:

{  "enabled": true,  "daily_limit": 20,  "serving_strategy": "FIFO",  "notification_thresholds": [    5,    10,    15  ]}

Field

Type

What It Does

enabled

boolean

Whether this doctor accepts walk-in patients

daily_limit

number or null

Maximum walk-in patients per day (null = unlimited)

serving_strategy

enum

Queue order: FIFO (first-in-first-out) or PRIORITY

notification_thresholds

number[]

Send alerts when queue reaches these counts (e.g., at 5, 10, 15 patients)


What's Next

  • Centre Configuration — Centre-level settings that doctors inherit from
  • Service Configuration — Doctor-service overrides for specific services
  • Config Hierarchy — How doctor settings merge with other levels
doctorconfigurationfeesslots

Last updated on

On this page