omopr_init {omopr}R Documentation

Initialise connection to an 'OMOP' 'CDM' database and get list of table references

Description

This function checks a connection to an 'OMOP' 'CDM' database and creates and returns a list of lazy 'dbplyr' table references corresponding to the available 'CDM' tables.

Usage

omopr_init(con, schema = NULL)

Arguments

con

A database connection, such as returned by the function dbConnect.

schema

Optional string name of a database schema in which the 'OMOP' 'CDM' tables are stored. Potential examples include "public", "dbo", "omop", "cdm", "data", etc.

Value

A named list with elements corresponding to dbplyr lazy tibble references.

See Also

concept_names, row_counts

Examples

# con = DBI::dbConnect(RPostgres::Postgres(), dbname = "omopdb")
con = omopr:::dummy_con() # dummy connection to allow example to run

tRefs = omopr_init(con)
tRefs[["person"]]
row_counts(tRefs)

[Package omopr version 0.3 Index]