anicolson commited on
Commit
3bc68dd
1 Parent(s): 7f33232

Upload model

Browse files
Files changed (1) hide show
  1. modelling_cxrmate_ed.py +10 -3
modelling_cxrmate_ed.py CHANGED
@@ -1111,9 +1111,16 @@ class MIMICIVEDCXRMultimodalModel(VisionEncoderDecoderModel):
1111
  connect.sql(f"CREATE TABLE {k}_study_ids AS SELECT * FROM df")
1112
 
1113
  @staticmethod
1114
- def get_dataset(split, transforms, database_path, mimic_cxr_jpg_dir, max_images_per_study=5):
1115
-
1116
- records = EDCXRSubjectRecords(database_path=database_path, time_delta_map=lambda x: 1 / math.sqrt(x + 1))
 
 
 
 
 
 
 
1117
 
1118
  dataset = StudyIDEDStayIDSubset(
1119
  mimic_iv_duckdb_path=database_path,
 
1111
  connect.sql(f"CREATE TABLE {k}_study_ids AS SELECT * FROM df")
1112
 
1113
  @staticmethod
1114
+ def get_dataset(split, transforms, database_path, mimic_cxr_jpg_dir, max_images_per_study=5, records=None):
1115
+
1116
+ if records is None:
1117
+
1118
+ # This is the setup for CXRs + all effective inputs - medicine reconciliation:
1119
+ records = EDCXRSubjectRecords(database_path=database_path, time_delta_map=lambda x: 1 / math.sqrt(x + 1))
1120
+
1121
+ records.ed_module_tables = {k: records.ed_module_tables[k] for k in ['edstays', 'triage', 'vitalsign']}
1122
+ records.mimic_cxr_tables = {k: records.mimic_cxr_tables[k] for k in ['mimic_cxr_sectioned']}
1123
+ records.mimic_cxr_tables['mimic_cxr_sectioned'].text_columns = ['indication', 'history']
1124
 
1125
  dataset = StudyIDEDStayIDSubset(
1126
  mimic_iv_duckdb_path=database_path,