1589 patients' first_careunit is different from last_careunit in mimic_icu.icustays but had the only stay_id. #1225
Unanswered
zyh1996007
asked this question in
MIMIC-IV
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I found that 1589 patients' first_careunit is different from last_careunit in mimic IV_"mimic_icu"."icustays" but had the only stay_id.
what happened? thank you
create MATERIALIZED view a1 as
①SELECT b3.subject_id,b3.hadm_id,b4.stay_id,b3.admittime,b4.intime,b4.outtime,b3.dischtime,b3.deathtime,b4.los,b4.first_careunit,b4.last_careunit from
(select subject_id,hadm_id,admittime,dischtime,deathtime from admissions INNER join (select subject_id,count (distinct hadm_id) from admissions group by (subject_id ) having count (distinct hadm_id)=1) as b1 using (subject_id)) as b3
INNER join
(select subject_id,hadm_id,stay_id,intime,outtime,first_careunit,last_careunit,los from "mimic_icu"."icustays" INNER join (select subject_id from "mimic_icu"."icustays" GROUP BY(subject_id) having count(DISTINCT stay_id)=1 ) as b2 using (subject_id) ORDER BY subject_id) as b4 using (hadm_id)
ORDER BY subject_id;
②SELECT * from a1 where first_careunit<>last_careunit
Beta Was this translation helpful? Give feedback.
All reactions