Closed guoyi-smh closed 3 months ago
Note: This can be resolved together with issue #76, which will a) convert all date-time variables into the appropriate format, b) return warning messages about missing/invalid date-times, and c) allows for additional, customized warning messages. I'm working on #76 right now and will add the warning message you suggested.
I'll mark this issue as closed since the fix has been implemented together with issue #76 (requires review).
In current version of the GEMINI data
drm_cleandb_v2
. Despite the fact that majority of the sites have good quality in the date time of ICU admission and discharge, the ICU discharge time is missing completely for one site, with only date available. Theicu_los()
function now only computes the ICU length-of-stay for records with completescu_admission_date_time
andscu_discharge_date_time
in%Y%m%d %H%M
format, and it fills0
for encounters without any compete ICU records. As a result, all encounters from this one site will get0
in the output ICU length-of-stay.Considering that different project may take different approach to deal with issue , such as impute all with "00:00" or maybe use date only for all records. It may be better for the function to return a warning like
x rows in the input ipscu table do not have a valid scu_admission_date_time or scu_discharge_date_time and the computed ICU length-of-stay will be 0 for these records. If you want to include these records in the computation, please impute the missing date-time in your table and re-run the function