R/CohortDefinitionSet.R
saveCohortDefinitionSet.Rd
This function saves a cohortDefinitionSet to the file system and provides options for specifying where to write the individual elements: the settings file will contain the cohort information as a CSV specified by the settingsFileName, the cohort JSON is written to the jsonFolder and the SQL is written to the sqlFolder. We also provide a way to specify the json/sql file name format using the cohortFileNameFormat and cohortFileNameValue parameters.
saveCohortDefinitionSet(
cohortDefinitionSet,
settingsFileName = "inst/Cohorts.csv",
jsonFolder = "inst/cohorts",
sqlFolder = "inst/sql/sql_server",
cohortFileNameFormat = "%s",
cohortFileNameValue = c("cohortId"),
subsetJsonFolder = "inst/cohort_subset_definitions/",
verbose = FALSE
)
The cohortDefinitionSet
argument must be a data frame with
the following columns:
The unique integer identifier of the cohort
The cohort's name
The OHDSI-SQL used to generate the cohort
Optionally, this data frame may contain:
The Circe JSON representation of the cohort
The name of the CSV file that will hold the cohort information including the cohortId and cohortName
The name of the folder that will hold the JSON representation of the cohort if it is available in the cohortDefinitionSet
The name of the folder that will hold the SQL representation of the cohort.
Defines the format string for naming the cohort JSON and SQL files. The format string follows the standard defined in the base sprintf function.
Defines the columns in the cohortDefinitionSet to use in conjunction with the cohortFileNameFormat parameter.
Defines the folder to store the subset JSON
When TRUE, logging messages are emitted to indicate export progress.