Learn R Programming

CommonDataModel (version 1.0.1)

createDdl: Create the OHDSI-SQL Common Data Model DDL code

Description

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

createDdl(cdmVersion)

createPrimaryKeys(cdmVersion)

createForeignKeys(cdmVersion)

Value

A character string containing the OHDSQL DDL

A string containing the OHDSQL for creation of primary keys in the OMOP CDM.

A string containing the OHDSQL for creation of foreign keys in the OMOP CDM.

Arguments

cdmVersion

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

Functions

  • createPrimaryKeys(): createPrimaryKeys Returns a string containing the OHDSQL for creation of primary keys in the OMOP CDM.

  • createForeignKeys(): createForeignKeys Returns a string containing the OHDSQL for creation of foreign keys in the OMOP CDM.

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

Run this code
if (FALSE) {
ddl <- createDdl("5.4")
pk <- createPrimaryKeys("5.4")
fk <- createForeignKeys("5.4")
}

Run the code above in your browser using DataLab