insertCohortDefinitionSetInPackage: Insert a set of cohort definitions into package

View source: R/StudyPackage.R

insertCohortDefinitionSetInPackageR Documentation

Insert a set of cohort definitions into package

Description

Insert a set of cohort definitions into package

Usage

insertCohortDefinitionSetInPackage(
  fileName = "inst/settings/CohortsToCreate.csv",
  baseUrl,
  jsonFolder = "inst/cohorts",
  sqlFolder = "inst/sql/sql_server",
  rFileName = "R/CreateCohorts.R",
  insertTableSql = TRUE,
  insertCohortCreationR = TRUE,
  generateStats = FALSE,
  packageName
)

Arguments

fileName

Name of a CSV file specifying the cohorts to insert. See details for the expected file format.

baseUrl

The base URL for the WebApi instance, for example: "http://server.org:80/WebAPI".

jsonFolder

Path to the folder where the JSON representations will be saved.

sqlFolder

Path to the folder where the SQL representations will be saved.

rFileName

Name of R file to generate when insertCohortCreationR = TRUE.

insertTableSql

Should the SQL for creating the cohort table be inserted into the package as well? This file will be called CreateCohortTable.sql.

insertCohortCreationR

Insert R code that will create the cohort table and instantiate the cohorts? This will create a file called R/CreateCohorts.R containing a function called .createCohorts.

generateStats

Should cohort inclusion rule statistics be created?

packageName

The name of the package (only needed when inserting the R code as well).

Details

The CSV file should have at least the following fields:

atlasId

The cohort ID in ATLAS.

cohortId

The cohort ID that will be used when instantiating the cohort (can be different from atlasId).

name

The name to be used for the cohort. This name will be used to generate file names, so please use letters and numbers only (no spaces).


OHDSI/ROhdsiWebApi documentation built on March 15, 2023, 1:23 p.m.