---
name: practice-health-check
description: A monthly check-up on how your clinic is doing — income, busiest services, and how this month compares to the last one. Use when the user asks "how is my clinic doing?", "what did we earn?", or wants a monthly or quarterly business summary.
---

# Practice Health Check

## What this does for you

Think of this as a check-up for your clinic, not your patients. Ask a simple
question and get a clear picture of how the business is doing — no
spreadsheets, no report builder.

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

- "**Run my practice health check** for last month."
- "Give me my **monthly clinic check-up**."
- "**How's the business doing** this quarter?"

## Try asking

- "How did we do last month?"
- "Show me our income for each of the last 12 months."
- "Which of our services bring in the most money?"
- "How many appointments and consultations did we do this quarter?"
- "Compare this month to the same month last year."
- "Which of our locations is doing best?"

## Good to know

- Figures only include **finalised invoices** — drafts and cancelled invoices
  are left out, so numbers match what you've actually billed.
- You can ask for figures **with or without VAT** — just say which you want.
  If you don't say, you'll get both labelled clearly.
- Recently migrated clinics: invoices from your **previous system are not
  included**, so older months may look emptier than they were.

---

## Instructions for the AI assistant

You are helping a veterinary clinic owner or manager who is **not technical**.
Answer in plain English, keep tables small, and always say which date range
you used. Data comes from the Provet MCP (`ch_run_query`, ClickHouse SQL,
database `production`).

**Core tables**
- `production.invoices` — one row per invoice. Key columns: `invoice_date`,
  `total_excl_vat`, `total_incl_vat`, `invoice_status_str`, `department_name`,
  `supervising_vet_name_from_invoice`, `payment_status`.
- `production.item_report` — one row per invoice line. Best for "what did we
  sell": `item_name`, `item_type_name`, `revenue_excl_vat`, `quantity_sold`,
  `vet_name` (line-level vet — fairer for staff attribution than the
  invoice-level supervising vet).
- `production.item_sales_agg_by_type` / `item_sales_agg_by_item` — pre-built
  monthly sales summaries (`period`), cheaper than aggregating `item_report`.
- `production.health_consultations_metrics` — consultation counts, duration,
  `total_incl_vat` per consultation.

**Rules that prevent wrong numbers**
1. Revenue means `invoice_status_str = 'Finalized'`. Never include Draft or
   Voided invoices in income figures.
2. Yes/no columns are numbers: write `is_finalized = 1`, never bare
   `countIf(is_finalized)` (it fails on Int8 types).
3. Credit notes appear as **negative revenue rows** — leave them in so totals
   match the clinic's accounts, and mention them if they are large.
4. Always state the date range and whether figures include VAT.
5. Some invoices have **no supervising vet** — show them as "Unassigned"
   rather than silently dropping them.
6. Default to the last 12 full months if the user gives no period.

**Standard run**: if the user says "run my health check" (or similar) with
no specifics, produce this fixed mini-report for the last full month:
income (excl VAT) vs the previous month and vs the same month last year;
invoice count; top 5 services/items by revenue; consultations count; and
one sentence on anything unusual. End by offering to go deeper on any line.

**Response style**: lead with the headline ("June was your best month this
year: €X"), then a small table, then one suggested follow-up question.
