Skip to contents

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.

Usage

createOccurrenceDdl(gaiaVersion)

Arguments

cdmVersion

The version of the CDM you are creating, e.g. 5.3, 5.4

Value

A character string containing the OHDSQL DDL

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