% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/TreatmentPatternsQueries.R
\name{getAnalysisCohorts}
\alias{getAnalysisCohorts}
\title{Extracts the different analyses ran for each target and event cohorts}
\usage{
getAnalysisCohorts(connectionHandler, schema, tpTablePrefix = "tp_")
}
\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}
}
\value{
Returns a data.frame with the columns:
\itemize{
 \item{databaseName a concatinated string of all the database names ran for that analysis}
 \item{databaseId a concatinated string of all the database ids ran for that analysis}
 \item{analysisId the analysis ids for the treament patterns run}
 \item{targetCohortName the target cohort name}
 \item{targetCohortId the target cohort unique identifier}
 \item{eventCohortList a concatinated string of all the event cohort names ran for that target}
 \item{exitCohortList a concatinated string of all the exit cohort names ran for that target}
 }
}
\description{
This function extracts analysis ids, events cohorts, and databases per target from treatment patterns
}
\details{
Specify the connectionHandler and the schema
}
\examples{
conDet <- getExampleConnectionDetails()

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

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