MIT-LCP / mimic-code

MIMIC Code Repository: Code shared by the research community for the MIMIC family of databases
https://mimic.mit.edu
MIT License
2.51k stars 1.5k forks source link

KDIGO improvements #1470

Closed alistairewj closed 1 year ago

alistairewj commented 1 year ago

This PR improves the implementation of the KDIGO guidelines for MIMIC-IV.

The big changes:

  1. Refactored the UO query with better syntax for calculating a sum over the last X hours (no change in content)
  2. Added the aki_stage_smoothed column which carries forward the highest AKI stage for 6 hours (arbitrary but seems reasonable). Helps smooth over the aki_stage alternating between the creatinine/UO derived stage, e.g.
time uo cr aki_stage aki_stage_smoothed
18:00:00 0.3833 3 3
19:30:00 0.8 0 3
  1. Rewrote the UO query to more closely align with the ranges given by KDIGO - stage 1 uses UO from 6-12 hours, stage 2 uses UO from >= 12 hours, and stage 3 uses UO from >12 hours and >= 24 hours. Difference in UO stages across stays is below:
aki_stage_uo n_row_updated n_row_before n_stay_updated n_stay_before
NULL 1043972 628376 73181 73151
0 2222462 2586664 60458 68250
1 185797 135580 37718 27675
2 385465 358460 29103 27513
3 173559 195757 8317 9355

Seems to result in a lot more stage 1 AKI - but I think the logic is better. Would welcome any thoughts.