Learn R Programming

PatientLevelPrediction (version 3.0.0)

insertDbPopulation: Insert a population into a database

Description

Insert a population into a database

Usage

insertDbPopulation(population, cohortIds = 1, connectionDetails,
  cohortDatabaseSchema, cohortTable = "cohort", createTable = FALSE,
  dropTableIfExists = TRUE, cdmVersion = "5")

Arguments

population

Either an object of type plpData or a population object generated by functions like createStudyPopulation.

cohortIds

The IDs to be used for the treated and comparator cohort, respectively.

connectionDetails

An R object of typeconnectionDetails created using the function createConnectionDetails in the DatabaseConnector package.

cohortDatabaseSchema

The name of the database schema where the data will be written. Requires write permissions to this database. On SQL Server, this should specifiy both the database and the schema, so for example 'cdm_instance.dbo'.

cohortTable

The name of the table in the database schema where the data will be written.

createTable

Should a new table be created? If not, the data will be inserted into an existing table.

dropTableIfExists

If createTable = TRUE and the table already exists it will be overwritten.

cdmVersion

Define the OMOP CDM version used: currently support "4" and "5".

Details

Inserts a population table into a database. The table in the database will have the same structure as the 'cohort' table in the Common Data Model.