% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/TreatmentPatternsQueries.R
\name{getTreatmentPathways}
\alias{getTreatmentPathways}
\title{Extracts treatment pathways}
\usage{
getTreatmentPathways(
  connectionHandler,
  schema,
  tpTablePrefix = "tp_",
  databaseTable = "database_meta_data",
  age = "all",
  sex = "all",
  indexYear = "all",
  analysisIds = NULL,
  databaseIds = NULL,
  databaseNames = NULL,
  targetIds = NULL
)
}
\arguments{
\item{connectionHandler}{A connection handler that connects to the database and extracts sql queries.  Create a connection handler via `ResultModelManager::ConnectionHandler$new()`.}

\item{schema}{The result database schema (e.g., 'main' for sqlite)}

\item{tpTablePrefix}{The prefix used for the cohort generator results tables}

\item{databaseTable}{The name of the table with the database details (default 'database_meta_data')}

\item{age}{(optional) a string representing an age bucket to restrict (e.g., "0-17", "18-34", "65+")}

\item{sex}{(optional) A string "male" or "female" to restrict}

\item{indexYear}{(optional) A string with a four-digit year to restrict}

\item{analysisIds}{(optional) A vector of analysis ids to restrict to}

\item{databaseIds}{(optional) A vector of database ids to restrict to}

\item{databaseNames}{(optional) A vector of database Names to restrict to}

\item{targetIds}{(optional) A vector of target cohort ids to restrict to}
}
\value{
Returns a data.frame with the columns:
\itemize{
 \item{databaseName the name of the database}
 \item{databaseId the unique identifier of the database}
 \item{analysisId the unique identifier of a treament patterns run}
 \item{targetCohortName the target cohort name}
 \item{targetCohortId the target cohort unique identifier}
 \item{pathway a string representing the progression of events for a target. Use '-' to separate sequential steps and '+' for combination of events at that step}
 \item{freq the count of pathway occurance}
 \item{age the stratifyed pathways for age}
 \item{indexYear the stratifyed pathways for index year}
 \item{sex the stratifyed pathways for sex}
 }
}
\description{
This function extracts results pathways for specified analysis ids and target cohorts
}
\details{
Specify the connectionHandler and the schema
}
\examples{
conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

tp <- getTreatmentPathways(
  connectionHandler = connectionHandler,
  schema = "main"
)
}
\seealso{
Other TreatmentPatterns: 
\code{\link{getAnalysisCohorts}()},
\code{\link{getEventDuration}()}
}
\concept{TreatmentPatterns}
