Cleans up cohort manifest data at one of three scopes. All destructive
operations require the user to type "yes" at a confirmation prompt
(disable with confirm = FALSE for scripted use).
Arguments
- manifest
A
CohortManifestR6 object. Required forscope = "derived"; optional for other scopes (extracts path and settings automatically when provided).- cohortsFolderPath
Character. Path to the cohorts folder. Inferred from
manifestwhen provided; otherwise defaults tohere::here("inputs/cohorts").- scope
Character. One of
"derived","manifest", or"full". Defaults to"derived".- executionSettings
An
ExecutionSettingsobject. Required forscope = "full"to drop OMOP cohort tables. Ifmanifestis provided and already has settings attached, those are used automatically; this argument overrides them.- archive
Logical. For
scope = "manifest", ifTRUE(default), archives source files injson/andsql/to a timestamped directory instead of deleting them. Set toFALSEto delete without archiving.- confirm
Logical. If
TRUE(default), the user must type"yes"to proceed. Set toFALSEfor non-interactive use.
Scope options
"derived"Removes all derived cohort rows from the SQLite database (union, subset, complement, composite) and deletes the
derived/folder. Base cohorts (circe, custom) and their files are untouched. Use when rebuilding the derived pipeline with new parameters. Requires a livemanifestobject."manifest"Deletes the SQLite database and the
derived/folder. Source files injson/andsql/are archived to a timestamped directory (unlessarchive = FALSE) and can be restored afterinitCohortManifest()using$addCirceCohort()or$addSqlCohort()."full"Deletes the SQLite database,
derived/,json/,sql/, andcohortsLoad.csv. Also drops OMOP cohort tables from the database (requiresexecutionSettings).