% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/patients.R
\name{patientsCDM}
\alias{patientsCDM}
\title{Pushes test population into a blank CDM.}
\usage{
patientsCDM(
  pathJson = NULL,
  testName = NULL,
  cdmVersion = "5.4",
  cdmName = NULL,
  dbms = "duckdb",
  writeSchema = NULL
)
}
\arguments{
\item{pathJson}{Directory where the sample populations in json are located. If NULL, gets the default inst/testCases directory.}

\item{testName}{Name of the sample population JSON file. If NULL it will push the first sample population in the testCases directory.}

\item{cdmVersion}{cdm version, default "5.4".}

\item{cdmName}{Name of the cdm, default NULL.}

\item{dbms}{Database management system to use. One of "duckdb", "databricks",
"sqlserver" or "postgresql". Default is "duckdb" which creates a local
DuckDB CDM. For remote databases the function creates the CDM locally,
trims the vocabulary, uploads to a new schema on the remote database,
and returns the remote CDM reference. Remote databases require
environment variables to be set. Call \code{usethis::edit_r_environ()}
to set them.}

\item{writeSchema}{Optional schema name to use on the remote database.
If NULL (default), a unique schema is created automatically. Only used
when \code{dbms} is not "duckdb".}
}
\value{
A CDM reference object with a sample population.
}
\description{
Pushes test population into a blank CDM.
}
\examples{
\donttest{
filePath <- system.file("extdata", "testPatientsRSV.xlsx", package = "TestGenerator")
TestGenerator::readPatients(filePath = filePath, outputPath = tempdir())
cdm <- TestGenerator::patientsCDM(pathJson = tempdir(), testName = "test")
duckdb::duckdb_shutdown(duckdb::duckdb())
}
}
