Skip to content

Potential issue compute.treatment.episodes and dosage.change.means.new.treatment.episode parameter #206

@SebastianKN1998

Description

@SebastianKN1998

Hi,

Unlike medication.change.means.new.treatment.episode, where if the type of medication supplied changes, the new medication type is considered a new treatment episode (regardless of whether there is overlap between medication supply). dosage.change.means.new.treatment.episode parameter does not appear to start a new treatment episode?

From the documentation it appears like it should start at new treatment episode. Dosage.change.means.new.treatment.episode parameter “Logical, should a change in dosage automatically start a new treatment episode?”, but to me it appears like that is not what happens.

It looks like it does not consider the dosage change as a new treatment episode if there is an overlap of medication supply between the “old” and “new” dosage.

See example where it creates a new treatment episode when the medication type changes, but not if the dosage changes.

For now I rename my medication type each time the dosage changes to achieve the same results with the medication.change.means.new.treatment.episode parameter.


library(data.table)
library(AdhereR)


test_dose <- data.table(
  id3 = c(1, 1, 1),
  eksd = as.Date(c("2023-01-01", "2023-02-01", "2023-04-01")),  # gap before dose change
  dd2 = c(10, 10, 5),
  duration = c(30, 30, 30),
  med.type = c("apixaban", "apixaban", "apixaban")
)
test_med <-data.table(
  id3 = c(1, 1, 1),
  eksd = as.Date(c("2023-01-01", "2023-02-01", "2023-04-01")),  # gap before dose change
  dd2 = c(10, 10, 5),
  duration = c(30, 30, 30),
  med.type = c("apixaban", "apixaban", "drugB")
)
eps <- compute.treatment.episodes(
  data = test_dose,
  ID.colname = "id3",
  event.date.colname = "eksd",
  event.duration.colname = "duration",
  event.daily.dose.colname = "dd2",
  medication.class.colname = "med.type",
  consider.dosage.change = T,
  dosage.change.means.new.treatment.episode = TRUE,
  medication.change.means.new.treatment.episode = TRUE,
  maximum.permissible.gap = 90,
  suppress.warnings = FALSE,
  return.data.table = TRUE
)
print(eps)






eps2 <- compute.treatment.episodes(
  data = test_med,
  ID.colname = "id3",
  event.date.colname = "eksd",
  event.duration.colname = "duration",
  event.daily.dose.colname = "dd2",
  medication.class.colname = "med.type",
  consider.dosage.change = T,
  dosage.change.means.new.treatment.episode = TRUE,
  medication.change.means.new.treatment.episode = TRUE,
  maximum.permissible.gap = 90,
  suppress.warnings = FALSE,
  return.data.table = TRUE
)
eps2

Thanks for the nice package.

Kind regards,
Sebastian

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions