Skip to content

xinranhe/mimic-visualizer

Repository files navigation

mimic-visualizer

Summary

The repo contains a visualizer that lets clinicians or researchers inspect individual admissions from the MIMIC-IV dataset, browse relevant notes and codes, and interactively plot patient data over time.

  • Connects to a local MIMIC-IV MySQL database and a MongoDB instance for discharge notes and ecg metadata.
  • Provides a web interface where you enter a subject_id and pick a hospital admission to explore. Patient demographics, insurance, language, and admission/ICU details are displayed.
  • Shows ICD diagnoses, procedures, and any discharge notes retrieved from MongoDB. ICU stays are visualized on an interactive timeline, with a marker for patient death if applicable.
  • Lists all available data items across chart events, lab results, and prescriptions. You can filter or sort items, add them to a selection, and scroll through paginated results.
  • Allows you to pick a time range during the admission and plot the selected items as trends, events, or timelines, enabling quick inspection of vital signs, lab values, or medication orders.
  • New Include item ECG from MIMIV-IV-ECG and visualization of ECG waveforms.

Usage

  • Following the instruction in mimic-code to populate the mimic-iv dataset to mysql databse.
  • Download the MIMIC-IV-ECG and unzip to /path/to/mimic-ecg.
  • Run pip install -r requirement.txt to install the dependency
  • Run script scripts/load_mimic_note_to_mongo.py to populate the mimic-iv-node discharge notes to mongo
  • Run script scripts/load_mimic_ecg_to_mongo.py to populate the mimic-iv-ecg ECG machine_measurement to mongo
  • Run streamlit run app.py -- --mysql-host YOUR_HOST --mysql-user YOUR_USER --mysql-password YOUR_PASSWORD --mongo-uri YOUR_MONGO_URI --ecg-base-folder /path/to/mimic-ecg to start the server. The ECG base folder should point to the directory that contains the files/pNNNN/... tree.
  • Open http://localhost:8501/?path=ecg/pXXXXXXXX/sZZZZZZZZ (replace with the subject and study identifiers) to view an ECG waveform. If you navigate to ?path=ecg you can use the on-page input to enter a locator manually.

Examples

Screenshot 1 Screenshot 2 Screenshot 3 Screenshot 4 Screenshot 5

About

mimic iv data visualizer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages