Skip to content

Commit

Permalink
Fix #15
Browse files Browse the repository at this point in the history
Fix #15
  • Loading branch information
pradeeban authored Apr 3, 2021
2 parents 92e0d59 + 4e1a602 commit d4478fe
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions modules/cold-extraction/ColdDataRetriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,23 +131,28 @@ def initialize():
reader = csv.reader(f)
next(f)
for row in reader:
row = [x.strip() for x in row]
if (extraction_type == 'empi_date'):
patients.append(row[patient_index])
temp_date = row[date_index]
dt_stamp = datetime.datetime.strptime(temp_date, date_format)
date_str = dt_stamp.strftime('%Y%m%d')
dates.append(date_str)
length = len(patients)
if not ((row[patient_index] == "") or (row[date_index] == "")):
patients.append(row[patient_index])
temp_date = row[date_index]
dt_stamp = datetime.datetime.strptime(temp_date, date_format)
date_str = dt_stamp.strftime('%Y%m%d')
dates.append(date_str)
length = len(patients)
elif (extraction_type == 'empi'):
patients.append(row[patient_index])
length = len(patients)
if not ((row[patient_index] == "")):
patients.append(row[patient_index])
length = len(patients)
elif (extraction_type == 'accession'):
accessions.append(row[accession_index])
length = len(accessions)
if not ((row[accession_index] == "")):
accessions.append(row[accession_index])
length = len(accessions)
elif (extraction_type == 'empi_accession'):
patients.append(row[patient_index])
accessions.append(row[accession_index])
length = len(accessions)
if not ((row[patient_index] == "") or (row[accession_index] == "")):
patients.append(row[patient_index])
accessions.append(row[accession_index])
length = len(accessions)


# Run the retrieval only once, when the extraction script starts, and keep it running in a separate thread.
Expand Down Expand Up @@ -277,4 +282,4 @@ def run_threaded(job_func):
time.sleep(1)
except KeyboardInterrupt:
check_kill_process()
sys.exit(0)
sys.exit(0)

0 comments on commit d4478fe

Please sign in to comment.