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

adding in function to have separate cohorts or combine them together for package #64

Open
daniellenewby opened this issue Jan 29, 2024 · 3 comments
Assignees

Comments

@daniellenewby
Copy link
Collaborator

At the moment a user has to instanstiate each drug of interest for cohort symmetry but what if a user wants to combine different drugs cohorts together in one cohort as well as test them individually. Example is dementia medications there are two types 1) Ache inhibitors (three ingrediants) and 2) memantine. I want to run cohortsymmetry with Ache inhibitors with all three ingrediants together as well as them indivdually against my marker drugs of choice. @xihang-chen suggested including an argument in the getSequenceRatio() which gives the user flexibility to do this.

@daniellenewby
Copy link
Collaborator Author

Also does the package make sure that we have unique entries when combining cohorts? ie one record per person when combining cohorts otherwise there might a patient might contribute multiple times?

@daniellenewby
Copy link
Collaborator Author

daniellenewby commented Feb 12, 2024

Regarding point above when you create a cohort with multiple ingredients it will take the first one of all the ingredients combined - therefore only 1 person contributes. However when you run each ingredient there is a chance if a person has been prescribed different ingredients from the same class meaning that a person could contribute to multiple times. @xihang-chen and I discussed this and think if users want to make sure each cohort of ingredients only have 1 person per class of ingredients but to then run PSSA at the ingredient level then users can group_by and add a filter to only keep the first ingredient they are prescribed from a class/group of user specfied ingredients. So meaning this is a user problem not a package problem

@daniellenewby
Copy link
Collaborator Author

@catalamarti if i use generateIngredientCohortSet this creates a cohort but there are 3 cohort_definition_ids one for each anti-dementia drug but what i want is a cohort with these specific ingrediants in them..but i dont think binding them will work because what if i have patients who are taking two of the medications then they would be duplicated(?)

cdm <- generateIngredientCohortSet(
  cdm = cdm,
  name = "ache_inhibitors",
  ingredient = c("donepezil", "rivastigmine", "galantamine"),
  durationRange = c(1, Inf),
  imputeDuration = "none",
  gapEra = 0,
  priorUseWashout = 0,
  priorObservation = 0,
  cohortDateRange = as.Date(c(starting_date, ending_date)),
  limit = "all",
  doseForm = NULL,
  ingredientRange = c(1, Inf)
)

so the only thing i think that works is this:

druglist <- getDrugIngredientCodes(cdm, c("donepezil", "rivastigmine", "galantamine"))
druglist1 <- list(ache_inhibitors_comb = unname(unlist(druglist)))

cdm <- generateDrugUtilisationCohortSet(
  cdm = cdm,
  name = "ache_inhibitors_comb",
  conceptSet = druglist1
)

Would you do it this way? any other suggestions would be greatly appreciated :) on the plus side as payment there are some sweets on my desk by Marta she will show you :)

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