Commit 656170c6 authored by Venkat Malladi's avatar Venkat Malladi
Browse files

Update logic for tumor registry data.

parent 4d4bc761
......@@ -79,6 +79,7 @@ def convert_race(merged):
merged.loc[merged['RACE'] == 'AmIndAN', 'RACE'] = 'American Indian'
merged.loc[merged['RACE'] == 'HawPacIs', 'RACE'] = 'Hawaiian Pacific Islander'
merged.loc[merged['RACE'] == 'Unknown', 'RACE'] = 'Other'
return merged
......@@ -102,9 +103,9 @@ def calculate_shift(merged):
# Update death source
merged.loc[pd.notna(merged['DEATH_DATE']), 'DEATH_SOURCE'] = 'UTSouthwestern Hospital'
# Update death date if from tumor registry
merged.loc[pd.notna(merged['Vital Status']), 'DEATH_SOURCE'] = 'Tumor Registry'
merged.loc[pd.notna(merged['Vital Status']), 'DEATH_DATE'] = merged['Date of Last Contact-Date']
# Update death date if from tumor registry and not from EPIC
merged.loc[(pd.notna(merged['Vital Status' ]) & pd.isna(merged['DEATH_DATE'])), 'DEATH_SOURCE'] = 'Tumor Registry'
merged.loc[(pd.notna(merged['Vital Status']) & pd.isna(merged['DEATH_DATE'])), 'DEATH_DATE'] = merged['Date of Last Contact-Date']
# Calculate date Shift for death date
merged['DEATH_DATE'] = merged['DEATH_DATE'] + merged['Shift']
......
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