Commit 8c3643b5 authored by Venkat Malladi's avatar Venkat Malladi
Browse files

Fix cancer medication mapping

parent 1930da4f
......@@ -179,12 +179,14 @@ def calculate_regime(meds):
onco_meds_reformated.loc[onco_meds_reformated.Duration == 0, 'End_date'] = None
onco_meds_reformated.loc[onco_meds_reformated.Duration == 0, 'Duration'] = None
# If End Date > thatn current pull reset to null
onco_meds_reformated.loc[onco_meds_reformated.End_date > datetime.datetime(2019, 1, 1), 'End_date'] = None
onco_meds_reformated.loc[onco_meds_reformated.End_date > datetime.datetime(2019, 1, 1), 'Duration'] = None
# If End Date > that current pull reset to null
onco_meds_reformated.loc[onco_meds_reformated.End_date > datetime.datetime(2020, 3, 1), 'End_date'] = None
onco_meds_reformated.loc[onco_meds_reformated.End_date > datetime.datetime(2020, 3, 1), 'Duration'] = None
# If End_date is null
onco_meds_reformated.loc[onco_meds_reformated.End_date.isnull(), 'Duration'] = None
#onco_meds_reformated.loc[onco_meds_reformated.End_date.isnull(), 'Duration'] = None
onco_meds_reformated.loc[onco_meds_reformated.End_date.isnull(), 'End_date'] = datetime.datetime(2020, 3, 1)
onco_meds_reformated['Duration'] = (onco_meds_reformated['End_date'] - onco_meds_reformated['Start_date']).dt.days
onco_meds_reformated = onco_meds_reformated.reset_index(drop=True)
......@@ -252,7 +254,7 @@ def main():
# Write out meds tables
supp_meds_regime_shifted_df.to_csv(suppmeds_table, index=False)
onco_meds_shifted_df.to_csv(meds_table, index=False)
onco_meds_regime.to_csv(meds_table, index=False)
missing_meds.to_csv(unmapped_table, index=False)
filtered_supp_meds.to_csv(not_given_suppmeds_table, index=False)
......
......@@ -119,6 +119,7 @@ Nivolumab,MED:853030
Nivolumab,MED:853140
Nivolumab,MED:853167
Nivolumab,MED:853250
Nivolumab,MED:853316
NKTR-214,MED:853361
NKTR-262,MED:853372
Pazopanib,MED:237450
......
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