Commit 4d4bc761 authored by Venkat Malladi's avatar Venkat Malladi
Browse files

Linted coded.

parent b9b0587e
......@@ -40,7 +40,8 @@ def filter_table(demographics, tumor_registry):
'''Filter demographics and tumor_registry columns'''
# Column filters
demo_filter_col = ["MRN", "GENDER", "ETHNICITY", "RACE", "BIRTH_DATE", "DEATH_DATE", "DEATH_SOURCE"]
demo_filter_col = ["MRN", "GENDER", "ETHNICITY", "RACE", "BIRTH_DATE",
"DEATH_DATE", "DEATH_SOURCE"]
tumor_filter_col = ["Medical Record Number", "Date of Last Contact-Date", "Vital Status"]
# Filter
......@@ -51,7 +52,8 @@ def filter_table(demographics, tumor_registry):
tumor_dead = tumor_filter[tumor_filter["Vital Status"] == 0]
# merge
df_merged = demo_filter.merge(tumor_dead, left_on='MRN', right_on='Medical Record Number', how='left')
df_merged = demo_filter.merge(tumor_dead, left_on='MRN',
right_on='Medical Record Number', how='left')
return df_merged
......@@ -145,7 +147,8 @@ def main():
shifted_df = calculate_shift(fix_race)
# Write out patients table
shifted_filtered = shifted_df[["MRN", "GENDER", "ETHNICITY", "RACE", 'DEATH_DATE', 'DEATH_SOURCE']]
shifted_filtered = shifted_df[["MRN", "GENDER", "ETHNICITY", "RACE",
'DEATH_DATE', 'DEATH_SOURCE']]
shifted_filtered.columns = ['mrn', 'gender', 'ethnicity', 'race', 'death_date', 'death_source']
shifted_filtered.to_csv(patients, index=False)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment