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

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

1 · The brief

What Claude Code was asked

Make an operations dashboard for the hospital for this year: patient encounters, average length of stay, 30-day readmission rate and patient satisfaction, monthly volume by encounter type, and which departments have the highest readmission rates and longest stays.

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 operations and readmissions dashboard: Encounters per month by type, 30-day readmission rate by department, Average inpatient length of stay, Satisfaction by encounter type

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

  • Encounters: 10,078 (All types, 2026)
  • Average length of stay: 5.4 days (Inpatient stays)
  • 30-day readmissions: 11.1% (Inpatient stays)
  • Patient satisfaction: 4.45 / 5 (All encounters)

What stands out:

  • Encounters per month by type: Outpatient visits are the bulk of activity every month
  • 30-day readmission rate by department: Cardiology is highest at 17.2%
  • Average inpatient length of stay: Oncology stays average 7.2 days
  • Satisfaction by encounter type: Emergency scores lowest at 3.74

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

    Encounters, inpatient length of stay, readmission rate and satisfaction for 2026

    1 row · 43 ms

    SELECT count(*) AS encounters,
           round(avg(discharge_date - admit_date) FILTER (WHERE encounter_type = 'Inpatient'), 2) AS avg_los_days,
           round(avg(CASE WHEN readmitted_30d THEN 1.0 ELSE 0 END) FILTER (WHERE encounter_type = 'Inpatient'), 4) AS readmission_rate,
           round(avg(satisfaction), 2) AS avg_satisfaction
    FROM healthcare.encounters
    WHERE admit_date >= DATE '2026-01-01'
  2. Query 2

    Monthly encounters by type since January 2025

    66 rows · 73 ms

    SELECT to_char(date_trunc('month', admit_date), 'YYYY-MM') AS month, encounter_type, count(*) AS encounters
    FROM healthcare.encounters
    WHERE admit_date >= DATE '2025-01-01'
    GROUP BY 1, 2
    ORDER BY 1, 2
  3. Query 3

    Inpatient readmission rate and length of stay by department, 2026

    7 rows · 227 ms

    SELECT department,
           count(*) FILTER (WHERE encounter_type = 'Inpatient') AS inpatient_stays,
           round(avg(CASE WHEN readmitted_30d THEN 1.0 ELSE 0 END) FILTER (WHERE encounter_type = 'Inpatient'), 4) AS readmission_rate,
           round(avg(discharge_date - admit_date) FILTER (WHERE encounter_type = 'Inpatient'), 2) AS avg_los_days
    FROM healthcare.encounters
    WHERE admit_date >= DATE '2026-01-01'
    GROUP BY 1
    ORDER BY 3 DESC
  4. Query 4

    Average patient satisfaction by encounter type, 2026

    3 rows · 44 ms

    SELECT encounter_type, round(avg(satisfaction), 2) AS avg_satisfaction, count(*) AS encounters
    FROM healthcare.encounters
    WHERE admit_date >= DATE '2026-01-01'
    GROUP BY 1
    ORDER BY 2 DESC
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
Make an operations dashboard for the hospital for this year: patient encounters, average length of stay, 30-day readmission rate and patient satisfaction, monthly volume by encounter type, and which departments have the highest readmission rates and longest stays.
Intent
Encounters, inpatient length of stay, readmission rate and satisfaction for 2026
Result
4 queries, 77 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

  • 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]