Last updated
Analyze patient visits, treatment costs, insurance discounts, age risk, and department-wise revenue.
Analyze patient visits, treatment costs, insurance discounts, age risk, and department-wise revenue.
Your dataset contains patient_visits with visit type, department, consultation fee, medicine cost, and insurance status.
| Column | Type | Key / Notes |
|---|---|---|
| patient_id | INT | Unique patient ID |
| patient_name | VARCHAR(50) | Patient name |
| age | INT | Patient age |
| department | VARCHAR(50) | Hospital department visited |
| visit_type | VARCHAR(30) | Type of visit |
| consultation_fee | FLOAT | Consultation fee charged |
| medicine_cost | FLOAT | Medicine cost charged |
| insurance_covered | VARCHAR(10) | Whether insurance is available |
patient_visits — 8 rows
| patient_id | patient_name | age | department | visit_type | consultation_fee | medicine_cost | insurance_covered |
|---|---|---|---|---|---|---|---|
| 301 | Amit | 45 | Cardiology | Follow-up | 1200 | 3500 | Yes |
| 302 | Neha | 29 | Dermatology | New | 800 | 1200 | No |
| 303 | Suresh | 63 | Orthopedics | New | 1500 | 4200 | Yes |
| 304 | Kavita | 52 | Cardiology | Emergency | 2500 | 8500 | Yes |
| 305 | Imran | 34 | Neurology | New | 2000 | 5000 | No |
| 306 | Ritu | 41 | Dermatology | Follow-up | 800 | 900 | Yes |
| 307 | Joseph | 70 | Orthopedics | Emergency | 3000 | 9500 | Yes |
| 308 | Meenal | 26 | Neurology | Follow-up | 1800 | 2500 | No |
Calculate total treatment cost for each patient. Apply a 20% insurance discount for insured patients. Classify age risk as Senior, Adult, or Young. Identify high-cost patients where final bill is above 8000. Summarize total revenue and patient count by department.
Your output should look like this (partial example):
| patient_id | patient_name | department | total_treatment_cost | final_bill | age_risk_group | high_cost_patient |
|---|---|---|---|---|---|---|
| 301 | Amit | Cardiology | 4700 | 3760.0 | Adult | No |
| 302 | Neha | Dermatology | 2000 | 2000.0 | Young | No |
| ... | ... | ... | ... | ... | ... | ... |