Skip to content

cdm database

Defines the destination database for the OMOP CDM. This database also holds the OMOP vocabulary used to resolve concept IDs from the source data.

Valid driver values: csv, postgresql, psql-odbc, mariadb, sqlserver. (CSV is mostly useful as a target for one-shot exports; the RDBMS drivers are the typical production choice. postgresql is the native libpq path and is preferred over psql-odbc unless your environment requires ODBC.)

Connection strings

mariadb and postgresql

Both drivers use the same key=value space-separated format:

Key Meaning
user Username used to connect.
password Password for user.
host Resolvable hostname or IP address.
port Connection port.
dbname Database name.
options (PostgreSQL only) e.g. --search_path=omop_cdm.
cdm database {
  driver: "postgresql"
  connection string: "user=postgres host=<hostname> port=5432
dbname=postgres options='--search_path=omop_cdm'
password=<password>"
}

MariaDB has no options key — it lacks the schema / search-path concept.

sqlserver

The SQL Server driver uses an ODBC connection string in the standard semicolon-separated format. The shipped container bundles Microsoft's ODBC Driver 18 for SQL Server.

cdm database {
  driver: "sqlserver"
  connection string: "Driver={ODBC Driver 18 for SQL Server};Server=sqlserver.example.com,1433;Database=omop;UID=etl;PWD=secret;TrustServerCertificate=yes"
}

csv

The CSV driver writes one file per CDM table:

cdm database {
  driver: "csv"
  connection string: "/etc/etl-engine.d/cdm-out/"
}

Additional properties

vocabulary cache size

How many records the engine caches from the OMOP vocabulary. Optional; defaults to 1000. Increasing it may help on machines with plenty of memory and large mapping workloads.

max database connections

Caps the number of concurrent connections the engine opens to the destination database. Optional; the engine picks a sensible default based on worker threads. Set this lower if the database has a tight connection-limit, or higher if the database can handle more load than the engine is currently giving it.

cdm database {
  driver: "postgresql"
  connection string: "..."
  max database connections: 4
}

limit tables

A block listing CDM tables to include in this run. Only the tables named here are loaded. Useful when debugging a single CDM table, but if a dependent table is excluded from the list, all the dependents that need it will fail to load.

cdm database {
  driver: "postgresql"
  connection string: "..."
  limit tables {
    table: person
    table: condition_occurrence
  }
}

limit tables interacts with clean omop data

If automation.pre.clean omop data is true, only the tables named in limit tables are cleaned. This works well when adding new data to independent tables (e.g. drug_exposure while person is already loaded), but does not work in reverse.