L
Leaphealth - OSDocs

Availability Calendar

Complete guide to doctor availability — schedules (daily, weekly, monthly, yearly), blocks, overrides, multi-schedule merging, and how they combine to produce bookable slots.

Availability Calendar

The Availability Calendar controls when a doctor is bookable. Every slot the system offers to patients is derived from what's defined here. The calendar uses three entry types — Schedules, Blocks, and Overrides — which combine to produce the final availability for any given day.

Three Entry Types

Every calendar entry is one of these three types:

Entry Type

Purpose

Example

Schedule

Defines when a doctor is regularly available

Every Monday, Wednesday, Friday from 10:00 AM to 5:00 PM

Block

Marks time as unavailable (subtracts from schedule)

On leave Dec 25-26, or blocked every Saturday afternoon

Override

Replaces the schedule for a specific date

This Friday, available 8:00 AM to 12:00 PM instead of usual hours

Resolution Priority

When the system calculates availability for a date, it follows this order: Override wins over everything. If no override exists, the schedule applies. Blocks then subtract from the schedule. This means an override completely replaces the normal schedule for that date.

Schedules — Regular Availability

Schedules define the doctor's recurring working pattern. Each schedule entry has a frequency (Daily, Weekly, Monthly, or Yearly), optional day/date filters, and time windows.

A doctor can have multiple schedule entries — the system merges them automatically. This is the key to building complex availability patterns.

Frequency Types

Frequency

What It Means

When to Use

Daily

Every single day

Doctors who work all 7 days with the same hours

Weekly

Specific days of the week

Most common — Mon-Fri, or specific days like Mon/Wed/Fri

Monthly

Specific dates or weeks of the month

Visiting consultants, rotating schedules, 1st-and-15th patterns

Yearly

Specific date each year

Annual recurring events (e.g. yearly holiday blocks)


Daily Schedule

The doctor is available every single day during the specified time windows.

Setting

Value

Frequency

Daily

Time Window

e.g. 09:00 AM – 01:00 PM, 03:00 PM – 06:00 PM

Weekly Schedule

The most common pattern. The doctor is available on specific days of the week.

Setting

Value

Frequency

Weekly

Days

Select from: Mon, Tue, Wed, Thu, Fri, Sat, Sun

Time Window

e.g. 10:00 AM – 05:00 PM

Examples:

  • Standard weekday — Mon through Fri, 10:00 AM to 5:00 PM
  • Specific days only — Mon, Wed, Fri with different time windows
  • Weekend-only — Sat and Sun, 09:00 AM to 01:00 PM

Alternating Week Schedule

For doctors who rotate between clinics or work alternate weeks, set an interval on weekly schedules.

Setting

Value

Meaning

Frequency

Weekly

Repeats weekly

Interval

2

Every 2nd week

Days

Mon, Wed, Fri

Only these days in the active week

An interval of 2 means every other week. Interval of 3 means every third week. The starting week is determined by the Valid From date.


Monthly Schedule — By Date

The doctor is available on specific dates each month. Use the by month day setting to list which days of the month.

Setting

Value

Meaning

Frequency

Monthly

Repeats monthly

Month Days

1, 15

Available on the 1st and 15th of every month

Time Window

10:00 AM – 05:00 PM

Hours on those dates

Examples:

  • 1st and 15th — Visiting consultant who comes twice a month
  • 1st through 10th — Doctor available only in the first 10 days of each month
  • 20th, 21st, 22nd — Three specific days per month for a specialty clinic

Monthly Schedule — By Week

The doctor is available during specific weeks of the month. Use the by week number setting combined with days.

Weeks are numbered 1 through 5 based on day of month: days 1-7 = week 1, days 8-14 = week 2, days 15-21 = week 3, days 22-28 = week 4, days 29-31 = week 5. Use -1 for the last week of the month.

Setting

Value

Meaning

Frequency

Monthly

Repeats monthly

Week Numbers

1

First week only (days 1-7)

Days

Mon – Fri

Only weekdays in that week

Time Window

01:00 PM – 02:00 PM

Hours during matching days

Examples:

  • Mon-Fri of 1st week — Week 1, days Mon-Fri. Matches days 1-7 that fall on a weekday
  • Mon-Fri of 2nd and 4th weeks — Weeks 2 and 4, days Mon-Fri
  • Last Friday of month — Week -1 (last week), day Fri. Matches the last 7 days of the month that fall on Friday
  • Every Saturday of week 1 and 3 — Weeks 1 and 3, day Sat

Week -1 = Last Week

The special value -1 means 'last 7 days of the month'. This handles months of different lengths correctly — in February (28 days) the last week starts on day 22, in March (31 days) it starts on day 25.

Yearly Schedule

Available on a specific date every year. Primarily used for recurring holiday blocks, but can also define annual special clinic days.

Setting

Value

Meaning

Frequency

Yearly

Repeats annually

Month

1 (January)

Which month

Month Day

26

Which day of month

Example: Republic Day (Jan 26) every year — create a yearly block to automatically mark the doctor as unavailable.


Combining Multiple Schedules

A doctor can have any number of schedule entries. The system automatically merges all matching entries for any given date. This is the most powerful feature of the calendar — it lets you build complex availability from simple building blocks.

How Merging Works

On any date, the system:

  1. Checks every active schedule entry for this doctor
  2. Keeps all entries whose recurrence pattern matches the date
  3. Collects time windows from all matching entries into a single list
  4. The doctor is available during the union of all these windows

Each schedule entry is independent — they don't interfere with each other. If two entries both match a date, both contribute their time windows.

Example: Visiting Consultant with Mixed Pattern

A visiting consultant is available on the 2nd and 4th week (Mon-Fri) plus the 20th through 22nd of every month. Set this up with two schedule entries:

Entry

Frequency

Pattern

Time Window

Entry 1

Monthly

Weeks 2 and 4, Mon-Fri

09:00 AM – 05:00 PM

Entry 2

Monthly

Days 20, 21, 22

09:00 AM – 05:00 PM

How this plays out in February:

Date

Entry 1 Match?

Entry 2 Match?

Result

Feb 3 (Mon, week 1)

No (week 1)

No

Not available

Feb 10 (Mon, week 2)

Yes

No

Available 9-5

Feb 14 (Fri, week 2)

Yes

No

Available 9-5

Feb 17 (Mon, week 3)

No (week 3)

No

Not available

Feb 20 (Thu, week 3)

No (week 3)

Yes (day 20)

Available 9-5

Feb 21 (Fri, week 3)

No (week 3)

Yes (day 21)

Available 9-5

Feb 24 (Mon, week 4)

Yes

No

Available 9-5

Feb 28 (Fri, week 4)

Yes

No

Available 9-5

Example: Different Hours on Different Days

A doctor works mornings on weekdays and full days on specific dates:

Entry

Frequency

Pattern

Time Window

Entry 1

Weekly

Mon, Wed, Fri

09:00 AM – 01:00 PM

Entry 2

Monthly

Days 1, 15

09:00 AM – 05:00 PM

On a day where both match (e.g. March 1 which is a Friday), both time windows are collected. If the windows overlap, the slot engine produces slots covering the full merged range.

Example: Summer and Winter Rotations

Use the month filter to create seasonal schedules. The month filter works as a pre-check on any frequency — if the current month is not in the list, the entry is skipped entirely.

Entry

Frequency

Days

Months

Time Window

Summer

Weekly

Mon-Fri

Apr, May, Jun, Jul, Aug, Sep

07:00 AM – 02:00 PM

Winter

Weekly

Mon-Fri

Oct, Nov, Dec, Jan, Feb, Mar

10:00 AM – 05:00 PM

In June, only the summer entry matches → early morning hours. In November, only the winter entry matches → later hours. No manual switching needed.

Overlap Protection

The system prevents creating schedules that overlap on the same day and time. If you try to add a Tuesday 10 AM–2 PM schedule when the doctor already has a Tuesday 09 AM–5 PM schedule, the system will reject it. You must modify or deactivate the existing schedule first.

Date Exceptions

Any schedule entry can have an exceptions list — specific dates where the schedule does not apply, even though the recurrence pattern would normally match.

  • Skip one date — Doctor works every Monday, but not this specific Monday (add that date to exceptions)
  • Skip a holiday — Daily schedule with Dec 25 in exceptions → no slots on Christmas
  • Skip from monthly — Monthly schedule for 1st and 15th, with Mar 15 excepted → no slots on that one date

Exceptions are checked before the recurrence pattern. If the date is in the exceptions list, the entry is immediately skipped — regardless of frequency or day matching.


Multiple Time Windows

A single schedule entry can have multiple time windows in a day. This is common for doctors with a lunch break or split shifts.

Window

Start

End

Morning

09:00 AM

01:00 PM

Afternoon

03:00 PM

06:00 PM

Each window generates its own set of bookable slots. There are no slots during the gap.

Service-Specific Windows

Each time window can optionally be restricted to specific services. This lets a doctor offer different services at different times of day.

Window

Time

Services Allowed

Morning

09:00 AM – 12:00 PM

General Consultation, Follow-up

Afternoon

02:00 PM – 05:00 PM

Specialist Procedure, Surgery Consultation

If no services are specified on a window, all services assigned to that doctor are available during that time.


Validity Period

Every schedule has an optional Valid From and Valid Until date. This controls when the schedule is active.

  • Both set — Schedule only applies between those dates (e.g. a seasonal rotation)
  • Only Valid From — Schedule starts on that date and runs indefinitely
  • Neither set — Schedule applies from the beginning of time onward

This lets you set up future schedule changes ahead of time. For example, create a new schedule with Valid From = March 1 for an upcoming rotation.

Centre-Specific Schedules

If a doctor works at multiple centres, each schedule entry can be linked to a specific centre. This means the doctor can have different hours at different locations.

  • Centre A — Mon, Wed, Fri from 10:00 AM to 5:00 PM
  • Centre B — Tue, Thu from 09:00 AM to 1:00 PM

Blocks — Marking Time Unavailable

Blocks subtract from the schedule. When a block is active, the system removes those hours from the available slots. Blocks do not affect override entries.

One-Time Block

Block a specific date — a single day off or a partial day block.

Setting

Value

Date

A specific date (e.g. Dec 25, 2025)

All Day

Yes — blocks the entire day, or No — blocks specific hours

Reason Type

Leave, Holiday, Emergency, Personal, or Training

Reason

Free-text description (e.g. 'Annual leave')

All-Day vs Partial Block

Block Type

Effect

Example

All-day

Zero slots generated for the day

Doctor on leave — block entire Dec 25

Partial (morning)

Only afternoon slots remain

Doctor unavailable until noon — block 09:00 AM to 12:00 PM

Partial (afternoon)

Only morning slots remain

Doctor leaving early — block 02:00 PM to 06:00 PM

Recurring Blocks

Blocks can also follow a recurring pattern, just like schedules.

  • Daily recurring block — Block the same hours every day (e.g. admin time 12:00–1:00 PM daily)
  • Weekly recurring block — Block specific days each week (e.g. every Saturday afternoon for research)

Recurring blocks also support intervals. For example, block every other Friday for training sessions.

Block Reason Types

Reason Type

Typical Use

Leave

Planned vacation, personal time off

Holiday

Public holidays, bank holidays

Emergency

Sudden unavailability (illness, urgent matter)

Personal

Personal appointments, errands

Training

Conferences, workshops, continuing education

The reason type is for categorisation and reporting. Patients see a general 'Doctor unavailable' message — they do not see the specific reason.

Centre-Specific Blocks

  • Centre-specific block — Doctor is unavailable only at that centre (still bookable at other centres)
  • Global block (no centre) — Doctor is unavailable at all centres

Overrides — One-Time Custom Hours

An override replaces the regular schedule for a specific date. When the system finds an override for a date, it ignores the schedule entirely and uses only the override's time windows.

When to Use Overrides

  • Doctor wants to work different hours on a specific day
  • Doctor wants to add availability on a day they normally don't work
  • Special clinic day with extended hours
  • Reduced hours for a specific date without blocking

How Overrides Work

Scenario

Normal Schedule

Override

Result

Extended hours

10 AM – 5 PM

8 AM – 7 PM

Slots from 8 AM to 7 PM

Reduced hours

10 AM – 5 PM

10 AM – 1 PM

Slots only until 1 PM

Different windows

10 AM – 5 PM

7 AM – 11 AM, 4 PM – 8 PM

Two separate windows replace normal hours

Work on off-day

No schedule (Sunday)

9 AM – 12 PM

Slots appear on a normally off day

Override Priority

Overrides completely replace the schedule. They are not additive. If a doctor normally works 10 AM–5 PM and you create an override for 2 PM–4 PM, only the 2 PM–4 PM window is available — the morning hours are gone for that date.

How the System Calculates Final Availability

For each date in a slot search, the system follows this exact sequence:

  1. Check for overrides — If an override exists for this date, use its time windows. Skip to step 4.
  2. Get all matching schedules — Find every active schedule entry whose recurrence pattern matches this date and whose validity period includes this date. Collect all their time windows into one list.
  3. Apply blocks — Find all active block entries matching this date. Subtract blocked time windows from the schedule windows. If an all-day block exists, the result is zero availability.
  4. Intersect with centre hours — The remaining doctor windows are intersected with the centre's working hours. Only the overlap produces slots.
  5. Generate slots — The final time windows are divided into discrete appointment slots based on the configured slot duration and buffer time.

Example: A Typical Wednesday

Doctor's calendar:

  • Schedule — Weekly, Wed, 09:00 AM – 01:00 PM and 03:00 PM – 06:00 PM
  • Block — Wed Dec 18, partial, 03:00 PM – 06:00 PM (training)
  • No override for this date

Result:

  1. No override found — use schedule
  2. Schedule matches Wednesday — windows: 09:00–13:00 and 15:00–18:00
  3. Block matches — subtract 15:00–18:00 → remaining: 09:00–13:00 only
  4. Intersect with centre hours (08:00–20:00) → 09:00–13:00 passes
  5. Generate 15-minute slots: 09:00, 09:15, 09:30, ... , 12:45

Example: Multiple Schedule Merge

Doctor's calendar — two entries:

  • Schedule A — Monthly, weeks 2 and 4, Mon-Fri, 09:00 AM – 05:00 PM
  • Schedule B — Monthly, days 20-22, 09:00 AM – 05:00 PM

On Feb 21 (Friday, week 3, day 21):

  1. No override found
  2. Schedule A: week 3 not in [2, 4] → no match. Schedule B: day 21 in [20, 21, 22] → match
  3. Windows from Schedule B: 09:00 AM–05:00 PM
  4. No blocks → full window available
  5. Intersect with centre hours → generate slots

On Feb 10 (Monday, week 2, day 10):

  1. No override found
  2. Schedule A: week 2 in [2, 4], Monday in [Mon-Fri] → match. Schedule B: day 10 not in [20, 21, 22] → no match
  3. Windows from Schedule A: 09:00 AM–05:00 PM
  4. Result: available 9-5 from schedule A alone

Common Calendar Patterns

Real-world scheduling patterns and how to set them up:

Pattern

How to Configure

Standard 5-day week

1 weekly schedule: Mon–Fri, single time window

Split shift with lunch break

1 weekly schedule with 2 time windows (morning + afternoon)

Alternating weeks at 2 centres

2 weekly schedules: interval=2, different Valid From dates, different centres

Morning-only on Saturdays

Separate weekly schedule for Sat with shorter window

1st and 15th of every month

1 monthly schedule: by_month_day [1, 15]

Mon-Fri of 2nd and 4th weeks

1 monthly schedule: by_week_no [2, 4], days Mon-Fri

Last Friday of every month

1 monthly schedule: by_week_no [-1], day Fri

Complex visiting pattern

2 monthly schedules merged: one by week, one by date

Summer vs Winter hours

2 weekly schedules with different by_month filters

Annual leave

1 one-time all-day block with reason type Leave

Half-day leave

1 one-time partial block covering morning or afternoon

Public holiday

1 one-time all-day block with reason type Holiday

Recurring holiday (Jan 26)

1 yearly block: by_month [1], by_month_day [26], all_day

Weekly admin time

Recurring weekly block (e.g. every Fri 12:00–1:00 PM)

Special extended clinic

Override on the specific date with extended hours

Doctor covering another's shift

Override on the specific date (creates availability on an off-day)

Skip one Monday from weekly

Weekly schedule with that Monday's date in exceptions list


Deactivating Calendar Entries

Calendar entries are not deleted — they are deactivated. Deactivating an entry stops it from affecting future slot generation, but the record is preserved for audit purposes.

  • Deactivating a schedule removes future availability for those days
  • Deactivating a block restores the original schedule availability
  • Deactivating an override reverts to the normal schedule for that date

What's Next?

Now that you understand the calendar, learn how it feeds into slot search in How Slot Search Works, or explore the full list of scheduling settings in Appointment Settings.

availabilitycalendarscheduleblocksoverridesdoctor-schedule

Last updated on

On this page