Create the OHDSI-SQL Common Data Model DDL code
createOccurrenceDdl.Rd
The createDdl, createForeignKeys, and createPrimaryKeys functions each return a character string containing their respective DDL SQL code in OHDSQL dialect for a specific CDM version. The SQL they generate needs to be rendered and translated before it can be executed.
Details
The DDL SQL code is created from a two csv files that detail the OMOP CDM Specifications. These files also form the basis of the CDM documentation and the Data Quality Dashboard.
Examples
ddl <- createDdl("5.4")
#> Error in system.file(file.path("csv", paste0("gaia", gaiaVersion, "tableLevel.csv")), package = "gaiaCore", mustWork = TRUE): no file found
pk <- createPrimaryKeys("5.4")
#> Error in createPrimaryKeys("5.4"): gaiaVersion %in% c("001") is not TRUE
fk <- createForeignKeys("5.4")
#> Error in createForeignKeys("5.4"): gaiaVersion %in% c("001") is not TRUE