MIT-LCP / MIT-LCP/mimic-code

Errors in the charttime or stayid of chartevens

Open
#1,961 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
3.4k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

I used the following code to explore whether there are any chartevents that happened after ICU stay:

SELECT 
ce.stay_id,
ce.charttime, 
ce.itemid,
ie.intime,
ie.outtime,
EXTRACT(EPOCH FROM (ce.charttime - ie.outtime))/3600/24 AS days_diff
FROM mimiciv_icu.chartevents AS ce
LEFT JOIN mimiciv_icu.icustays AS ie
ON ce.stay_id = ie.stay_id
WHERE ce.charttime > ie.outtime
ORDER BY days_diff DESC;

To my surprise, there are 407966 records of chartevents that happened after ICU stay. Some of them happened many days or even years after ICU outtime. Compare to the 432997491 records of all chartevents, they are not too many though. How did it happen?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the supplied query and inspect the relationships among mimiciv_icu.chartevents.stay_id, chartevents.charttime, and mimiciv_icu.icustays.outtime. Check representative records with the largest days_diff values and determine why they appear after ICU discharge; done means documenting the cause of these records and whether the data or query needs correction.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
data, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.