Update Mimic4Dataset.py
Browse files- Mimic4Dataset.py +17 -12
Mimic4Dataset.py
CHANGED
@@ -136,18 +136,23 @@ class Mimic4Dataset(datasets.GeneratorBasedBuilder):
|
|
136 |
if self.config.name == 'Length of Stay' and self.config_path is None : self.config_path = _CONFIG_URLS['los']
|
137 |
if self.config.name == 'Mortality' and self.config_path is None : self.config_path = _CONFIG_URLS['mortality']
|
138 |
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
|
|
|
|
|
|
|
|
|
|
151 |
|
152 |
#clone git repo if doesnt exists
|
153 |
repo_url='https://github.com/healthylaife/MIMIC-IV-Data-Pipeline'
|
|
|
136 |
if self.config.name == 'Length of Stay' and self.config_path is None : self.config_path = _CONFIG_URLS['los']
|
137 |
if self.config.name == 'Mortality' and self.config_path is None : self.config_path = _CONFIG_URLS['mortality']
|
138 |
|
139 |
+
current_directory = os.getcwd()
|
140 |
+
if os.path.exists(os.path.dirname(current_directory)+'/MIMIC-IV-Data-Pipeline-main'):
|
141 |
+
dir =os.path.dirname(current_directory)
|
142 |
+
os.chdir(dir)
|
143 |
+
else:
|
144 |
+
#move to parent directory of mimic data
|
145 |
+
version = self.mimic_path.split('/')[-1]
|
146 |
+
m = self.mimic_path.split('/')[-2]
|
147 |
+
s='/'+m+'/'+version
|
148 |
+
dir = self.mimic_path.replace(s,'')
|
149 |
+
if dir[-1]!='/':
|
150 |
+
dir=dir+'/'
|
151 |
+
elif dir=='':
|
152 |
+
dir="./"
|
153 |
+
print(os.getcwd())
|
154 |
+
parent_dir = os.path.dirname(self.mimic_path)
|
155 |
+
os.chdir(parent_dir)
|
156 |
|
157 |
#clone git repo if doesnt exists
|
158 |
repo_url='https://github.com/healthylaife/MIMIC-IV-Data-Pipeline'
|