tempor.datasources.mivdp.utils.icu_preprocess_util module

ICU preprocessing utilities.

Based on: https://github.com/healthylaife/MIMIC-IV-Data-Pipeline utils/icu_preprocess_util.py

tempor.datasources.mivdp.utils.icu_preprocess_util.dataframe_from_csv(path, compression='gzip', header=0, index_col=0, chunksize=None)[source]
tempor.datasources.mivdp.utils.icu_preprocess_util.read_admissions_table(mimic4_path)[source]
tempor.datasources.mivdp.utils.icu_preprocess_util.read_patients_table(mimic4_path)[source]
tempor.datasources.mivdp.utils.icu_preprocess_util.read_diagnoses_icd_table(mimic4_path)[source]
tempor.datasources.mivdp.utils.icu_preprocess_util.read_d_icd_diagnoses_table(mimic4_path)[source]
tempor.datasources.mivdp.utils.icu_preprocess_util.read_diagnoses(mimic4_path)[source]
tempor.datasources.mivdp.utils.icu_preprocess_util.standardize_icd(mapping, df, root=False)[source]

Takes an ICD9 -> ICD10 mapping table and a diagnosis dataframe; adds column with converted ICD10 column

tempor.datasources.mivdp.utils.icu_preprocess_util.read_procedures_icd_table(mimic4_path)[source]
tempor.datasources.mivdp.utils.icu_preprocess_util.read_d_icd_procedures_table(mimic4_path)[source]
tempor.datasources.mivdp.utils.icu_preprocess_util.read_procedures(mimic4_path)[source]
tempor.datasources.mivdp.utils.icu_preprocess_util.read_icd_mapping(map_path)[source]
tempor.datasources.mivdp.utils.icu_preprocess_util.preproc_meds(module_path: str, adm_cohort_path: str) DataFrame[source]
tempor.datasources.mivdp.utils.icu_preprocess_util.preproc_proc(dataset_path: str, cohort_path: str, time_col: str, dtypes: dict | None, usecols: list) DataFrame[source]

Function for getting hosp observations pertaining to a pickled cohort. Function is structured to save memory when reading and transforming data.

tempor.datasources.mivdp.utils.icu_preprocess_util.preproc_out(dataset_path: str, cohort_path: str, time_col: str, dtypes: dict | None, usecols: list | None) DataFrame[source]

Function for getting hosp observations pertaining to a pickled cohort. Function is structured to save memory when reading and transforming data.

tempor.datasources.mivdp.utils.icu_preprocess_util.preproc_chart(dataset_path: str, cohort_path: str, time_col: str, dtypes: dict | None, usecols: list) DataFrame[source]

Function for getting hosp observations pertaining to a pickled cohort. Function is structured to save memory when reading and transforming data.

tempor.datasources.mivdp.utils.icu_preprocess_util.preproc_icd_module(module_path: str, adm_cohort_path: str, icd_map_path=None, map_code_colname=None, only_icd10=True) DataFrame[source]

Takes an module dataset with ICD codes and puts it in long_format, optionally mapping ICD-codes by a mapping table path

tempor.datasources.mivdp.utils.icu_preprocess_util.pivot_cohort(df: DataFrame, prefix: str, target_col: str, values='values', use_mlb=False, ohe=True, max_features=None)[source]
Pivots long_format data into a multiindex array:

|| feature 1 || … || feature n ||

|| subject_id || label || timedelta ||