mimic-code icon indicating copy to clipboard operation
mimic-code copied to clipboard

Try to retrieve the procedures of CT scan with contrast

Open hhchang0210 opened this issue 1 year ago • 1 comments

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.

hhchang0210 avatar May 28 '23 01:05 hhchang0210