Skip to contents

This function creates the required CDM tables using the executeDdl function from the OHDSI/CommonDataModel package.

Usage

create_cdm_tables(use_cdm_package = FALSE)

Arguments

use_cdm_package

Specifies whether the OHDSI CommonDataModel::executeDdl function will be used to execute the DDL (Data Definition Language) or the internal functions that use SQL code that that allow conditional creation of the tables. Default: FALSE

Details

This function requires a configured config.yaml file created using amstel::create_config(). It will use the connection configuration specified in the cdm section to create the Common Data Model tables using either the amstel::create_data_tables and amstel::create_vocabulary_tables functions or the executeDdl function from the OHDSI/CommonDataModel package.

Examples

create_cdm_tables()
#> Using github PAT from envvar GITHUB_PAT. Use `gitcreds::gitcreds_set()` and unset GITHUB_PAT in .Renviron (or elsewhere) if you want to use the more secure git credential store instead.
#> Downloading GitHub repo OHDSI/CommonDataModel@HEAD
#> xfun      (0.42         -> 0.43        ) [CRAN]
#> htmltools (0.5.7        -> 0.5.8.1     ) [CRAN]
#> fs        (1.6.3        -> 1.6.4       ) [CRAN]
#> stringi   (1.8.3        -> 1.8.4       ) [CRAN]
#> tinytex   (0.50         -> 0.51        ) [CRAN]
#> knitr     (1.45         -> 1.46        ) [CRAN]
#> bslib     (0.6.1        -> 0.7.0       ) [CRAN]
#> SqlRender (bd72fb4b5... -> a1d4ab994...) [GitHub]
#> Installing 7 packages: xfun, htmltools, fs, stringi, tinytex, knitr, bslib
#> Installing packages into ‘/tmp/RtmpLdO5ln/temp_libpath15c0b4a159e’
#> (as ‘lib’ is unspecified)
#> Downloading GitHub repo OHDSI/SqlRender@HEAD
#> 
#> ── R CMD build ─────────────────────────────────────────────────────────────────
#> * checking for file ‘/tmp/RtmpoiAnMg/remotes3db6267b56818d/OHDSI-SqlRender-a1d4ab9/DESCRIPTION’ ... OK
#> * preparing ‘SqlRender’:
#> * checking DESCRIPTION meta-information ... OK
#> * checking for LF line-endings in source and make files and shell scripts
#> * checking for empty or unneeded directories
#> * building ‘SqlRender_1.17.0.tar.gz’
#> 
#> Installing package into ‘/tmp/RtmpLdO5ln/temp_libpath15c0b4a159e’
#> (as ‘lib’ is unspecified)
#> ── R CMD build ─────────────────────────────────────────────────────────────────
#> * checking for file ‘/tmp/RtmpoiAnMg/remotes3db626269d2791/OHDSI-CommonDataModel-3b84ef6/DESCRIPTION’ ... OK
#> * preparing ‘CommonDataModel’:
#> * checking DESCRIPTION meta-information ... OK
#> * checking for LF line-endings in source and make files and shell scripts
#> * checking for empty or unneeded directories
#> Omitted ‘LazyData’ from DESCRIPTION
#> * building ‘CommonDataModel_0.2.0.tar.gz’
#> 
#> Installing package into ‘/tmp/RtmpLdO5ln/temp_libpath15c0b4a159e’
#> (as ‘lib’ is unspecified)
#> Connecting using PostgreSQL driver
#> Executing SQL took 0.00528 secs
#> Creating CDM data tables...
#> Connecting using PostgreSQL driver
#> Executing SQL took 0.0337 secs
#> Creating CDM vocabulary tables...
#> Connecting using PostgreSQL driver
#> Executing SQL took 0.0147 secs