---
name: appointments-and-diary
description: Understand your appointment book — busiest days and times, no-shows, cancellations and why they happen, and how long clients wait. Use when the user asks about the diary, scheduling, no-shows, cancellations, or waiting times.
---

# Appointments & Diary

## What this does for you

Your appointment book holds answers to questions like "when are we busiest?"
and "how many people just don't turn up?" — this lets you ask them directly,
so you can plan staffing and cut wasted slots.

## Ways to start (copy and paste one of these)

- "**Review my diary** for the last three months."
- "**When are we busiest**, and where are we losing slots?"
- "Run my **appointments report**."

## Try asking

- "What are our busiest days of the week?"
- "How many no-shows did we have last month?"
- "What are the most common reasons appointments get cancelled?"
- "How long do clients wait between arriving and being seen?"
- "How many appointments does each vet have this month?"
- "Compare our appointment numbers this quarter to last quarter."

## Good to know

- No-shows and cancellation reasons only appear if your team records them
  in Provet — if reception rarely marks no-shows, the numbers will look
  lower than reality.
- Waiting time is measured from when the patient is marked as arrived to
  when the consultation starts.

---

## Instructions for the AI assistant

You are helping a veterinary clinic owner or practice manager who is **not
technical**. Data comes from the Provet MCP (`ch_run_query`, ClickHouse SQL,
database `production`).

**Core tables**
- `production.health_schedulingevents` — one row per diary entry:
  `event_start_ts_utc`, `event_start_date`, `duration_minutes`,
  `event_status`, `appointment_status`, `is_no_show`, `is_confirmed`,
  `cancellation_reason_label`, `cancellation_reason_text`,
  `assigned_user_name`, `department_name`, `event_type`, `complaint`.
- `production.health_consultations_metrics` — for waiting and consultation
  times: `wait_time_minutes`, `consultation_duration_minutes`,
  `total_time_minutes`, `consultation_status`.

**Rules that prevent wrong numbers**
1. Yes/no columns are numbers: write `is_no_show = 1`, `is_confirmed = 0`.
2. For busiest day/time, group by `toDayOfWeek(event_start_ts_utc)` or
   `toHour(...)` and translate to day names — never show raw numbers 1–7.
3. If no-shows or cancellations come back as zero, say clearly this may
   mean the team isn't recording them, not that none happened.
4. `wait_time_minutes` can contain outliers (e.g. patients admitted for the
   day). Use the median (`quantile(0.5)(...)`) rather than the average, and
   say so in plain words ("typically about 12 minutes").
5. Default to the last 3 full months if the user gives no period.

**Standard run**: if the user says "review my diary" or "run my
appointments report" with no specifics, produce this fixed mini-report for
the last 3 full months: appointments per month; busiest days of the week;
busiest hours; no-show and cancellation counts (with the recording caveat
if zero); top cancellation reasons; and typical waiting time. End by
offering a per-vet or per-location breakdown.

**Response style**: headline first ("Tuesdays and Fridays are your busiest
days"), then a small table. Where a number suggests an action (lots of
no-shows on one day), point it out gently — the user decides what to do.
