EDA MIMIC-III Patient Admissions

Bolu Oluwalade | Aug 17, 2024 min read

MIMIC-III (Medical Information Mart for Intensive Care III) is a large, freely-available database comprising deidentified health-related data associated with over forty thousand patients who stayed in critical care units of the Beth Israel Deaconess Medical Center between 2001 and 2012. https://mimic.mit.edu/docs/iii/

Metadata

List of tables in database

select
    database_name,
    table_name,
    estimated_size
from
    duckdb_tables;
Table 1: Displaying records 1 - 3
database_name table_name estimated_size

List of table columns

select
    schema_name,
    table_name,
    column_name,
    column_index,
    data_type
from
    duckdb_columns;
Table 2: Displaying records 1 - 46
schema_name table_name column_name column_index data_type

All patients

select * from patients;
Table 3: Displaying records 1 - 46,520
subject_id gender dob dod dod_hosp dod_ssn expire_flag

All admissions

select * from all_admissions;
Table 4: Displaying records 1 - 58,976
hadm_id subject_id admittime dischtime deathtime admission_type admission_location discharge_location insurance language religion marital_status ethnicity edregtime edouttime diagnosis hospital_expire_flag has_chartevents_data

Exploring Patients

Lets start by exploring the patients table

--number of patients 
select count(*) as n_patients from patients;

--number of unique patients
select count(distinct subject_id) as n_patients from patients;

-- distinct gender
select distinct gender from patients;

-- breakdown by gender
select gender, count(*) as n_patients from patients
group by gender;
Table 5: Displaying records 1 - 2
gender n_patients

Exploring Admissions

  • Identify the data types of the columns
  • How many patients were admitted
  • How many admissions?
  • How old are patients at admissions
  • Group patients into various age groups
  • Breakdown of admissions by race and ethnicity
  • Number of admitted patients over time
  • Number of admissions by day: weekday vs weekends
  • Hospital length of stay or Duration
  • Breakdown by admission types and admission source
    • Where are the patients admitted from?
    • Where are patients discharged to?
  • Types & percentage of insurers
  • What percentage of patients are admitted from the ED. ED Admit Rate
  • What are the average duration of patients in the ED
  • What are the top diagnosis by age groups?
  • Number of patients that expired in the hospital.