Skip to content

switch maintenance drugs #3

Open
@jwu19

Description

@jwu19

according to the definition of switch maintenence drug in rwToT_LoT_functions.py

def is_eligible_switch_maintenance(regimen, cases_maintenance, line_number):
regimen = [x.upper() for x in regimen]
cases_maintenance = pd.DataFrame(data = cases_maintenance)
cases_maintenance = cases_maintenance[cases_maintenance['maintenance_type'] == 'SWITCH']
return all(drug in regimen for drug in cases_maintenance['drug_name']) and (line_number == 1)

My understand to the above code is that to define it as a switch maintenance drug, all the switch maintenenance drugs in the cases_maintenance.csv must be in the regimen of the current line and the line number must be 1. If I understand it correctly, this function can never return True when there are more than one switch maintenance drug in cases_maintenance.csv.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions