File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
mimic-iv/buildmimic/sqlite Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,10 @@ def main():
6767 '--data_dir' , type = str , default = '.' ,
6868 help = 'Path to the directory containing the MIMIC-IV CSV files.'
6969 )
70+ argparser .add_argument (
71+ '--overwrite' , action = 'store_true' ,
72+ help = 'Overwrite existing mimic4.db file.'
73+ )
7074 args = argparser .parse_args ()
7175
7276 # validate that we can find all the files
@@ -107,9 +111,12 @@ def main():
107111 print (f'Limiting to { len (subjects )} subjects.' )
108112
109113 if os .path .exists (DATABASE_NAME ):
110- msg = "File {} already exists." .format (DATABASE_NAME )
111- print (msg )
112- sys .exit ()
114+ if args .overwrite :
115+ os .remove (DATABASE_NAME )
116+ else :
117+ msg = "File {} already exists." .format (DATABASE_NAME )
118+ print (msg )
119+ sys .exit ()
113120
114121 # For a subset of columns, we specify the data types to ensure
115122 # pandas loads the data correctly.
You can’t perform that action at this time.
0 commit comments