Skip to content

[under development] OHDSI tool to build treatment history of population and derive summary statistics of patterns of treatment

License

Notifications You must be signed in to change notification settings

OHDSI/TxPathways

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TxPathways

The goal of TxPathways is to provide a module to run drug utilization. This includes calculating:

  • enumeration of treatment patterns (i.e. switch, single line, combination)
  • time to pattern
  • sankey diagram of pattern sequences
  • calculation of daily dose and dose changes

More to come.....

Installation

Users can install the current development version of TxPathways from GitHub with:

# install.packages("devtools")
devtools::install_github("ohdsi/TxPathways")

Example

This is a basic example of the availabe functionality in TxPathways:

library(TxPathways)


connectionDetails <- DatabaseConnector::createConnectionDetails(
  dbms = "redshift",
  connectionString = "<jdbc_string>",
  user = "<user>",
  password = "<password>"
)
connection <- DatabaseConnector::connect(connectionDetails)

# call atlas results 
workDatabaseSchema <- "<scratch_johndoe>" # your scratch schema, or the ATLAS results schema
cohortTable <- "cohort"
targetCohortId <- 1
eventCohortIds <- c(2, 3)

# Make the treatment history table
createTxHistoryTable(
  connection = connection,
  workDatabaseSchema = workDatabaseSchema,
  cohortTable = cohortTable,
  targetCohortId = targetCohortId,
  eventCohortIds = eventCohortIds
)

targetCohortKey <- tibble::tibble(
  target_cohort_id = 1,
  target_cohort_name = "cohort"
)

eventCohortKey <- tibble::tibble(
  event_cohort_id = c(2, 3),
  event_cohort_name = c("drugA", "drugB")
)


th <- getTxHistoryTable(connection = connection,
                        targetCohortKey = targetCohortKey,
                        eventCohortKey = eventCohortKey)


viewSankey(th, maxPathLength = 2)

# check how many of each event

howManyHaveSingleTreatment(th)
howManyHaveMultipleTreatments(th)
howManyHaveComboTreatments(th)

# check denominator - currently all
howManySwitchedFromAtoB(th, depth = 2)
# check denominator - currently all
howManyHadInterruption(th, seqGap = '1-2', interruption = "30-60")
howManyHadInterruption(th, seqGap = '1-2', interruption = "60-9999")
howManyStoppedBefore(th, days = 365)


# check how long til event
howLongUntilFirstTreatment(th)
howLongUntilNextTreatment(th, seqGap = '1-2')
howLongAreDrugEras(th)

About

[under development] OHDSI tool to build treatment history of population and derive summary statistics of patterns of treatment

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages