Skip to content
Datablare
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.

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

1 · The brief

What Claude Code was asked

Where does our cost go this year? Show total cost, cost per encounter and per inpatient stay, bed-days used, cost by department, the monthly cost trend by encounter type, and bed-days per month.

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

Hospital cost and bed utilisation dashboard: Cost per month by encounter type, Cost by department, Bed-days per month

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):

  • Total cost: ₹7.87M (All encounters, 2026)
  • Cost per encounter: ₹781 (Average)
  • Cost per inpatient stay: ₹2.6K (Average)
  • Bed-days: 10,917 (Inpatient, 2026)

What stands out:

  • Cost per month by encounter type: Inpatient care is most of the cost every month
  • Cost by department: Paediatrics costs most at ₹1.17M
  • Bed-days per month: Peak: May ’26 with 1,331 bed-days

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

    Total cost, cost per encounter, cost per inpatient stay and bed-days, 2026

    1 row · 78 ms

    SELECT round(sum(cost), 0) AS total_cost, round(avg(cost), 0) AS cost_per_encounter,
           round(avg(cost) FILTER (WHERE encounter_type = 'Inpatient'), 0) AS cost_per_inpatient_stay,
           sum(discharge_date - admit_date) FILTER (WHERE encounter_type = 'Inpatient') AS bed_days
    FROM healthcare.encounters
    WHERE admit_date >= DATE '2026-01-01'
  2. Query 2

    Cost by department, 2026

    7 rows · 49 ms

    SELECT department, round(sum(cost), 0) AS cost, count(*) AS encounters
    FROM healthcare.encounters
    WHERE admit_date >= DATE '2026-01-01'
    GROUP BY 1
    ORDER BY 2 DESC
  3. Query 3

    Monthly cost by encounter type, 2026

    30 rows · 55 ms

    SELECT to_char(date_trunc('month', admit_date), 'YYYY-MM') AS month, encounter_type, round(sum(cost), 0) AS cost
    FROM healthcare.encounters
    WHERE admit_date >= DATE '2026-01-01'
    GROUP BY 1, 2
    ORDER BY 1, 2
  4. Query 4

    Inpatient bed-days by admission month, 2026

    10 rows · 54 ms

    SELECT to_char(date_trunc('month', admit_date), 'YYYY-MM') AS month, sum(discharge_date - admit_date) AS bed_days
    FROM healthcare.encounters
    WHERE encounter_type = 'Inpatient' AND admit_date >= DATE '2026-01-01'
    GROUP BY 1
    ORDER BY 1
Tables read healthcare.encounters

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
Where does our cost go this year? Show total cost, cost per encounter and per inpatient stay, bed-days used, cost by department, the monthly cost trend by encounter type, and bed-days per month.
Intent
Total cost, cost per encounter, cost per inpatient stay and bed-days, 2026
Result
4 queries, 48 rows, read-only

More use cases

All examples
  • 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

  • Patient population and payer mix dashboard: Encounters by age band and type, Payer mix by encounters, Encounters by department and sex, Cost by payer
    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.

    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]