Commit d455ebe4 authored by Venkat Malladi's avatar Venkat Malladi
Browse files

Add in old radiation history data.

parent 09331567
......@@ -25,6 +25,10 @@ def get_args():
help="Radiation History File (csv format).",
required=True)
parser.add_argument('-a', '--additional',
help="Radiation History addtiional File (csv format).",
required=False)
parser.add_argument('-s', '--sites',
help="Site Map File (csv format).",
required=True)
......@@ -134,11 +138,12 @@ def calculate_shift(radiation, date_shift):
# Int MRN
merged.MRN = merged.MRN.astype(int)
#TODO: Add radiation units
merged['dose_units'] = 'cGy'
# Rename columns
radiation_columns = ["mrn", "site_specific", "site_general",
"dose", "fractions", 'start_date', 'end_date', 'treatment_intention']
"dose", "fractions", 'start_date', 'end_date',
'treatment_intention', "dose_units"]
merged.columns = radiation_columns
return merged
......@@ -147,6 +152,7 @@ def calculate_shift(radiation, date_shift):
def main():
args = get_args()
rthistory = args.file
additional_rthistory = args.additional
sites = args.sites
icd = args.icd
date = args.date
......@@ -158,6 +164,7 @@ def main():
# Read in files
radiation = pd.read_csv(rthistory)
site_map = pd.read_csv(sites)
icd_filter = pd.read_csv(icd, sep='\t')
date_shift = pd.read_csv(date)
......@@ -171,6 +178,14 @@ def main():
# Map Specific Sites to General Sites
fix_sites, unmapped_sites = convert_sites(fix_icd, site_map)
# Merge sites with additional data
if additional_rthistory:
radiation_add = pd.read_csv(additional_rthistory)
radiation_add.drop(['DIAGNOSIS'], inplace=True, axis=1)
merge_sites = pd.concat([fix_sites, radiation_add])
fix_sites = merge_sites
# Convert missing Treatment
fix_treatment = convert_treatment(fix_sites)
......
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