thbndi commited on
Commit
f502432
·
verified ·
1 Parent(s): 4b506bd

Update dataset_utils.py

Browse files
Files changed (1) hide show
  1. dataset_utils.py +1 -1
dataset_utils.py CHANGED
@@ -282,7 +282,7 @@ def generate_text(data,icd,items,feat_cond,feat_chart,feat_meds, feat_proc, feat
282
  #Diagnosis
283
  if feat_cond:
284
  conds = data.get('Cond', {}).get('fids', [])
285
- conds=[icd[icd['icd_code'] == code]['long_title'].to_string(index=False) for code in conds if not icd[icd['icd_code'] == code].empty]
286
  cond_text = '; '.join(conds)
287
  cond_text = f"The patient ({ethn} {gender}, {age} years old, covered by {ins}) was diagnosed with {cond_text}. " if cond_text else ''
288
  else:
 
282
  #Diagnosis
283
  if feat_cond:
284
  conds = data.get('Cond', {}).get('fids', [])
285
+ conds=[icd[icd['icd_code'] == code]['long_title'].values[0] for code in conds if not icd[icd['icd_code'] == code].empty]
286
  cond_text = '; '.join(conds)
287
  cond_text = f"The patient ({ethn} {gender}, {age} years old, covered by {ins}) was diagnosed with {cond_text}. " if cond_text else ''
288
  else: