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.52k stars 1.51k forks source link

where to find the code which created mimic_derived.icustay_hours #804

Closed yugangjia closed 4 years ago

yugangjia commented 4 years ago

Prerequisites

Description

Description of the issue, including:

This table is referenced in the pivoted_sofa.sql, but I can not find the code which created that table from code repository

alistairewj commented 4 years ago

Check the demographics folder!

On Wed, Sep 2, 2020, 9:10 PM yugangjia notifications@github.com wrote:

Prerequisites

Description

Description of the issue, including:

This table is referenced in the pivoted_sofa.sql, but I can not find the code which created that table from code repository

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/MIT-LCP/mimic-code/issues/804, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJZE5FHUBF6D5QKJIFZ763SD3UJJANCNFSM4QUB57UQ .

yugangjia commented 4 years ago

Thanks. I wrote my own one for mimiciv as well

select ihr.STAY_ID, hr , DATETIME_TRUNC(DATETIME_ADD(ihr.intime, interval hr+1 hour), hour) as endtime from ( select i.STAY_ID,i.los, ( select GENERATE_ARRAY(-24,DATETIME_DIFF(i.outtime,i.intime, hour),1)) as hra,i.intime from physionet-data.mimic_icu.icustays as i) as ihr, unnest(hra) as hr order by ihr.STAY_ID