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

createOccurrencePrimaryKeys(gaiaVersion)

createOccurrenceForeignKeys(gaiaVersion)

createDdl(gaiaVersion)

createPrimaryKeys(gaiaVersion)

createForeignKeys(gaiaVersion)

Arguments

gaiaVersion

The version of gaiaDB you are creating, e.g. 001

Value

A character string containing postgresql 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.

Functions

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

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

  • 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.

Examples

ddl <- createDdl("001")
pk <- createPrimaryKeys("001")
fk <- createForeignKeys("001")