Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch maintenance drugs #3

Open
jwu19 opened this issue Apr 25, 2024 · 2 comments
Open

switch maintenance drugs #3

jwu19 opened this issue Apr 25, 2024 · 2 comments

Comments

@jwu19
Copy link

jwu19 commented Apr 25, 2024

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.

@Weilin37
Copy link
Contributor

That is probably correct. This algorithm was developed some time ago around NSCLC where we assumed maintenance drugs only happened after the first line of treatment. I think this was the standard at the time.

I am happy to merge code that allows for flexibility for all the lines. Perhaps you can open up a branch and make a pull request once you're done?

@jwu19
Copy link
Author

jwu19 commented Apr 25, 2024

Thank you for your reply. To understand switch maintenance drug better, I used an example in NSCLC as below

patient_id = 4444 takes two drugs, pembrolizumab and pemetrexed(listed as switch maintenance drug in the cases_maintenance.csv). pembrolizumab started on 1/1/2020 and ended on 2/1/2020. Then he started pemetrexed on 3/2/2020 and ended on 5/8/2020.

So, both drugs are in L1, and IS_MAINTENANCE flag for pemetrexed is True for pembrolizumab is False. Not sure if it is correct or not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants