cdm_from_environment {CDMConnector}R Documentation

Create a CDM object from a pre-defined set of environment variables

Description

This function is intended to be used with the Darwin execution engine. The execution engine runs OHDSI studies in a pre-defined runtime environment and makes several environment variables available for connecting to a CDM database. Programmer writing code to run on the execution engine and simply use cdm <- cdm_from_environment() to create a cdm reference object to use for their analysis and the database connection and cdm object should be automatically created. This obviates the need for site specific code for connecting to the database and creating the cdm reference object.

Usage

cdm_from_environment(write_prefix = "")

Arguments

write_prefix

(string) An optional prefix to use for all tables written to the CDM.

Details

The environment variables used by this function and provided by the execution engine are listed below.

Value

A cdm_reference object

Examples

## Not run: 

library(CDMConnector)

# This will only work in an evironment where the proper variables are present.
cdm <- cdm_from_environment()

# Proceed with analysis using the cdm object.

# Close the database connection when done.
cdm_disconnect(cdm)

## End(Not run)

[Package CDMConnector version 1.4.0 Index]