Opens a PostgreSQL connection via RPostgres and validates that the required
clinical tables (person, observation_period, condition_occurrence,
drug_exposure, measurement, visit_occurrence, death) exist in
cdm_schema and the vocabulary tables (concept, concept_ancestor) exist
in vocab_schema before returning. For split-schema CDMs (clinical and
vocabulary in different schemas) pass vocab_schema; it defaults to
cdm_schema for single-schema builds.
Usage
cdm_connect(
host = "localhost",
port = 5432,
dbname,
user,
password,
cdm_schema,
vocab_schema = cdm_schema
)Examples
if (FALSE) { # \dontrun{
# Requires a live PostgreSQL OMOP CDM server and real credentials, so this
# cannot be executed during checks. For a runnable, database-free demo of
# the package, see example_cdm() and validate_cohort().
con <- cdm_connect(
dbname = "omop", user = "me", password = "secret",
cdm_schema = "mimiciv_omop", vocab_schema = "vocab"
)
cdm_disconnect(con)
} # }