Skip to content

Errors in the charttime or stayid of chartevens #1961

@zheng523

Description

@zheng523

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions