Skip to content

Commit 29d91ea

Browse files
committed
Update 4_map_ons.py
1 parent e5af7dc commit 29d91ea

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

4_map_ons.py

+14-14
Original file line numberDiff line numberDiff line change
@@ -100,22 +100,23 @@ def main():
100100
# ---------------------------------------------------------
101101
# mapping ONS_death to CDM Death_ONS
102102
# ---------------------------------------------------------
103-
qa = input('Do you want to map the ' + database_type.upper() + ' data to OMOP CDM (y/n):')
104-
while qa.lower() not in ['y', 'n', 'yes', 'no']:
105-
qa = input('I did not understand that. Are you sure you want to map the ' + database_type.upper() + ' data to OMOP CDM (y/n):')
106-
if qa.lower() in ['y', 'yes']:
107-
fname = dir_sql + '4c_ons_map_tbl_death_ons.sql'
108-
print('Calling ' + fname + ' ...')
109-
ret = mapping_util.execute_sql_file_parallel(db_conf, fname, False)
103+
if ret == True:
104+
qa = input('Do you want to map the ' + database_type.upper() + ' data to OMOP CDM (y/n):')
105+
while qa.lower() not in ['y', 'n', 'yes', 'no']:
106+
qa = input('I did not understand that. Are you sure you want to map the ' + database_type.upper() + ' data to OMOP CDM (y/n):')
107+
if qa.lower() in ['y', 'yes']:
108+
fname = dir_sql + '4c_ons_map_tbl_death_ons.sql'
109+
print('Calling ' + fname + ' ...')
110+
ret = mapping_util.execute_sql_file_parallel(db_conf, fname, False)
110111
# ---------------------------------------------------------
111112
# Update Death from Death_ONS
112113
# ---------------------------------------------------------
113-
# if ret == True:
114-
qa = input('Do you want to update Death and Observation Period from Death_ONS (y/n):')
115-
while qa.lower() not in ['y', 'n', 'yes', 'no']:
116-
qa = input('I did not understand that. Are you sure you want to update Death and Observation Period from Death_ONS (y/n):')
117-
if qa.lower() in ['y', 'yes']:
118-
ret = updatefromDeathONS()
114+
if ret == True:
115+
qa = input('Do you want to update Death and Observation Period from Death_ONS (y/n):')
116+
while qa.lower() not in ['y', 'n', 'yes', 'no']:
117+
qa = input('I did not understand that. Are you sure you want to update Death and Observation Period from Death_ONS (y/n):')
118+
if qa.lower() in ['y', 'yes']:
119+
ret = updatefromDeathONS()
119120
# ---------------------------------------------------------
120121
# Report total time
121122
# ---------------------------------------------------------
@@ -125,7 +126,6 @@ def main():
125126
# ---------------------------------------------------------
126127
# Move CODE to the processed directory?
127128
# ---------------------------------------------------------
128-
if ret == True:
129129
qa = input('Are you sure you want to MOVE all the vocabulary CODE in the "processed" folder (y/n):')
130130
while qa.lower() not in ['y', 'n', 'yes', 'no']:
131131
qa = input('I did not understand that. Are you sure you want to MOVE all the vocabulary CODE in the "processed" folder (y/n):')

0 commit comments

Comments
 (0)