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.43k stars 1.5k forks source link

Try to retrieve the procedures of CT scan with contrast #1556

Open hhchang0210 opened 1 year ago

hhchang0210 commented 1 year ago

I am trying to retrieve the procedures of CT scan with contrast. The procedures_icd file contains the CT scan with contrast records. I used procedure icd_code to get the CT scan with contrast records.

df = pd.read_csv("d_icd_procedures.csv")

get the icd_code of CT scan with contrast

df1 = df.loc[df['long_title'].astype(str).str.contains('contrast',na=False, flags=re.IGNORECASE)] df2 = df1.loc[df1['long_title'].astype(str).str.contains('(CT Scan)',na=False, flags=re.IGNORECASE)]

icd_code of CT scan with contrast to a list

a = df2['icd_code'].tolist() separator = '|' b = separator.join(a)

df2 = pd.read_csv("procedures_icd.csv") df2 = df2[['subject_id','hadm_id','icd_code']]

use re to parse the icd_code of CT scan with contrast

df3 = df2.loc[df2['icd_code'].astype(str).str.contains(b,na=False, flags=re.IGNORECASE)]

df3.to_csv("procedure_contrast_id.csv",index=False) print(df3['hadm_id'].nunique())

There are only 15 records of CT scan with contrast in all MIMIC-IV database! This doesn't make sense. The ratio of CT contrast is too low!

Do I miss anything? or how could I get the CT scan with contrast records? Thank you very much.

arielhasidim commented 1 year ago

See also https://github.com/MIT-LCP/mimic-code/issues/795