% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RunAnalyses.R
\name{runCmAnalyses}
\alias{runCmAnalyses}
\title{Run a list of analyses}
\usage{
runCmAnalyses(
  connectionDetails,
  cdmDatabaseSchema,
  tempEmulationSchema = getOption("sqlRenderTempEmulationSchema"),
  exposureDatabaseSchema = cdmDatabaseSchema,
  exposureTable = "drug_era",
  outcomeDatabaseSchema = cdmDatabaseSchema,
  outcomeTable = "condition_occurrence",
  nestingCohortDatabaseSchema = cdmDatabaseSchema,
  nestingCohortTable = "cohort",
  outputFolder = "./CohortMethodOutput",
  multiThreadingSettings = createMultiThreadingSettings(),
  cmAnalysesSpecifications
)
}
\arguments{
\item{connectionDetails}{An R object of type \code{connectionDetails} created using the
\code{\link[DatabaseConnector:createConnectionDetails]{DatabaseConnector::createConnectionDetails()}} function.}

\item{cdmDatabaseSchema}{The name of the database schema that contains the OMOP CDM
instance. Requires read permissions to this database. On SQL
Server, this should specify both the database and the schema,
so for example 'cdm_instance.dbo'.}

\item{tempEmulationSchema}{Some database platforms like Oracle and Impala do not truly support temp tables. To
emulate temp tables, provide a schema with write privileges where temp tables
can be created.}

\item{exposureDatabaseSchema}{The name of the database schema that is the location where the
exposure data used to define the exposure cohorts is
available. If exposureTable = DRUG_ERA, exposureDatabaseSchema
is not used by assumed to be cdmSchema.  Requires read
permissions to this database.}

\item{exposureTable}{The tablename that contains the exposure cohorts.  If
exposureTable <> DRUG_ERA, then expectation is exposureTable
has format of COHORT table: COHORT_DEFINITION_ID, SUBJECT_ID,
COHORT_START_DATE, COHORT_END_DATE.}

\item{outcomeDatabaseSchema}{The name of the database schema that is the location where the
data used to define the outcome cohorts is available. If
exposureTable = CONDITION_ERA, exposureDatabaseSchema is not
used by assumed to be cdmSchema.  Requires read permissions to
this database.}

\item{outcomeTable}{The tablename that contains the outcome cohorts.  If
outcomeTable <> CONDITION_OCCURRENCE, then expectation is
outcomeTable has format of COHORT table: COHORT_DEFINITION_ID,
SUBJECT_ID, COHORT_START_DATE, COHORT_END_DATE.}

\item{nestingCohortDatabaseSchema}{The name of the database schema that is the location where the
data used to define the nesting cohorts is available.}

\item{nestingCohortTable}{The tablename that contains the nesting cohorts. Must have
the format of COHORT table: COHORT_DEFINITION_ID, SUBJECT_ID,
COHORT_START_DATE, COHORT_END_DATE.}

\item{outputFolder}{Name of the folder where all the outputs will written to.}

\item{multiThreadingSettings}{An object of type \code{CmMultiThreadingSettings} as created using
the \code{\link[=createMultiThreadingSettings]{createMultiThreadingSettings()}} or
\code{\link[=createDefaultMultiThreadingSettings]{createDefaultMultiThreadingSettings()}} functions.}

\item{cmAnalysesSpecifications}{An object of type \code{CmAnalysesSpecifications} as created using
the \code{createCmAnalysesSpecifications()}.}
}
\value{
A tibble describing for each target-comparator-outcome-analysisId combination where the intermediary and
outcome model files can be found, relative to the \code{outputFolder}.
}
\description{
Run a list of analyses
}
\details{
Run a list of analyses for the target-comparator-outcomes of interest. This function will run all
specified analyses against all hypotheses of interest, meaning that the total number of outcome
models is \code{length(cmAnalysisList) * length(targetComparatorOutcomesList)} (if all analyses specify an
outcome model should be fitted). When you provide several analyses it will determine whether any of
the analyses have anything in common, and will take advantage of this fact. For example, if we
specify several analyses that only differ in the way the outcome model is fitted, then this
function will extract the data and fit the propensity model only once, and re-use this in all the
analysis.

After completion, a tibble containing references to all generated files can be obtained using the
\code{\link[=getFileReference]{getFileReference()}} function. A summary of the analysis results can be obtained using the
\code{\link[=getResultsSummary]{getResultsSummary()}} function. Diagnostics can be loaded using the \code{\link[=getDiagnosticsSummary]{getDiagnosticsSummary()}}
function.
}
