Skip to content
Datablare
Claude Code Healthcare Customer analytics

Patient population and payer mix

4,885 patients seen this year, average age 46.6, 2.06 encounters each, and a payer mix led by private insurance.

Data
Synthetic hospital demo data (PostgreSQL)
Asked in
Claude Code
Updated
Try this on your data

1 · The brief

What Claude Code was asked

Who are our patients this year? Give me how many we saw, their age profile, encounters per patient, the payer mix by encounters and cost, and how each age group uses the hospital.

Given exactly like this. Claude Code asked Datablare which tables it could read, wrote the SQL itself, ran each query through Datablare and built the dashboard from what came back.

2 · The dashboard

The dashboard Claude Code built

Patient population and payer mix dashboard: Encounters by age band and type, Payer mix by encounters, Encounters by department and sex, Cost by payer

Built from 4 read-only queries. Every figure on the dashboard was read from the database through Datablare; nothing was estimated or typed in.

Headline numbers (January–October 2026):

  • Patients seen: 4,885 (2026 so far)
  • Encounters per patient: 2.06 (All types)
  • Average age: 47 (Patients seen in 2026)
  • Government insured: 20.3% (Share of patients)

What stands out:

  • Encounters by age band and type: Adults aged 40–64 account for the most visits
  • Payer mix by encounters: Private insurance covers 40% of encounters
  • Encounters by department and sex: Women and men use each department in similar numbers
  • Cost by payer: Private: ₹3.12M

The data is a synthetic hospital dataset made for this example, so the numbers describe no real company. The queries, the dashboard and the audit entries are real: Claude reached the database only through Datablare, read-only, and every query is on record with the question it served.

3 · What Datablare ran

4 read-only queries, nothing changed

Each query below is copied from the audit log of this run. Datablare checked that it only reads, ran it read-only, and gave only the rows to Claude Code; it never stores them.

  1. Query 1

    Patients seen in 2026, encounters per patient, average age and government-insured share

    1 row · 64 ms

    SELECT count(DISTINCT e.patient_id) AS patients_seen,
           round(count(*)::numeric / count(DISTINCT e.patient_id), 2) AS encounters_per_patient,
           round(avg(2026 - p.birth_year), 1) AS avg_age,
           round(count(DISTINCT e.patient_id) FILTER (WHERE p.insurance = 'Government')::numeric / count(DISTINCT e.patient_id), 4) AS government_share
    FROM healthcare.encounters e
    JOIN healthcare.patients p ON p.id = e.patient_id
    WHERE e.admit_date >= DATE '2026-01-01'
  2. Query 2

    Encounters in 2026 by age band and encounter type

    12 rows · 66 ms

    SELECT CASE WHEN 2026 - p.birth_year < 18 THEN '0–17' WHEN 2026 - p.birth_year < 40 THEN '18–39'
                WHEN 2026 - p.birth_year < 65 THEN '40–64' ELSE '65+' END AS age_band,
           e.encounter_type, count(*) AS encounters
    FROM healthcare.encounters e
    JOIN healthcare.patients p ON p.id = e.patient_id
    WHERE e.admit_date >= DATE '2026-01-01'
    GROUP BY 1, 2
    ORDER BY 1, 2
  3. Query 3

    Encounters and cost by insurance type, 2026

    4 rows · 57 ms

    SELECT p.insurance, count(*) AS encounters, round(sum(e.cost), 0) AS cost
    FROM healthcare.encounters e
    JOIN healthcare.patients p ON p.id = e.patient_id
    WHERE e.admit_date >= DATE '2026-01-01'
    GROUP BY 1
    ORDER BY 3 DESC
  4. Query 4

    Encounters in 2026 by department and patient sex

    14 rows · 65 ms

    SELECT e.department, p.sex, count(*) AS encounters
    FROM healthcare.encounters e
    JOIN healthcare.patients p ON p.id = e.patient_id
    WHERE e.admit_date >= DATE '2026-01-01'
    GROUP BY 1, 2
    ORDER BY 1, 2
Tables read healthcare.encountershealthcare.patients

4 · The audit entry

Who asked what, on record

Every query is recorded with the person who asked, the question in their words and why the agent ran it. Admins see this in the audit log; nothing reaches the database without it.

How the audit log works

query_data_source

via Claude Code

Allowed
Who
The person signed in (hidden on this public page)
Question
Who are our patients this year? Give me how many we saw, their age profile, encounters per patient, the payer mix by encounters and cost, and how each age group uses the hospital.
Intent
Patients seen in 2026, encounters per patient, average age and government-insured share
Result
4 queries, 31 rows, read-only

More use cases

All examples
  • Hospital cost and bed utilisation dashboard: Cost per month by encounter type, Cost by department, Bed-days per month
    Claude Code Healthcare Cost & spend

    Hospital cost and bed utilisation

    ₹7.87M spent this year, ₹2.6K per inpatient stay and 10,917 bed-days, by department and month.

    Updated Open

  • Hospital operations and readmissions dashboard: Encounters per month by type, 30-day readmission rate by department, Average inpatient length of stay, Satisfaction by encounter type
    Claude Code Healthcare Operations

    Hospital operations and readmissions

    10,078 encounters this year, a 30-day readmission rate of 11.1% and an average stay of 5.4 days, broken down by department.

    Updated Open

  • E-commerce sales and retention dashboard dashboard: Monthly revenue, Revenue by category, 2026, Lifetime revenue per customer, by channel, Orders per month
    Claude Code E-commerce Executive overview

    E-commerce sales and retention dashboard

    ₹5.21M revenue from 11,897 orders this year, a 57.9% repeat-customer rate, and which channels bring the customers who spend most.

    Updated Open

Build this on your own data.

Connect your database, choose the tables Claude may read, and give it the same brief. Claude is connected in about two minutes.

30 minutes with the founder. Or WhatsApp / [email protected]