run_setup: Run Athena Setup

View source: R/run_setup.R

run_setupR Documentation

Run Athena Setup

Description

Stepwise process of instantiating the Athena Vocabularies. Steps can be skipped using the steps argument though the order cannot be changed.

Usage

run_setup(
  conn,
  conn_fun = "pg13::local_connect()",
  target_schema = "omop_athena",
  steps = c("drop_tables", "copy", "log", "indices", "constraints"),
  postprocessing = c("omop_atc_classification"),
  path_to_csvs,
  release_version,
  umls_api_key = Sys.getenv("UMLS_API_KEY"),
  verbose = TRUE,
  render_sql = TRUE,
  render_only = FALSE,
  checks = ""
)

Arguments

conn

A Postgres connection object from the DatabaseConnector package. The user must either be a superuser or a member of the pg_read_server_files role.

conn_fun

Character string of the expression used to connect to the target database for the setup. The user must either be a superuser or a member of the pg_read_server_files role.This option automatically closes the connection on exit.

target_schema

Schema where the OMOP Vocabulary Tables will be written to.

steps

Options include c("prepare_cpt4", "drop_tables","copy", "indices", "constraints", "log"). Each step corresponds to the function used and may be independently executed.

path_to_csvs

Path to folder containing the unpacked vocabularies as csv files, downloaded as a zip from athena.ohdsi.org.

release_version

Release version as an exact string provided vocabulary download link delivery via email.

umls_api_key

UMLS API Key for CPT4 reconstitution.

verbose

If TRUE, prints back activity in the R console as it is occurring.

render_sql

If TRUE, the SQL statement is printed back in the R console for reference.

Value

Updated OMOP Vocabulary (Athena) CONCEPT_ANCESTOR, C ONCEPT_CLASS, CONCEPT_RELATIONSHIP, CONCEPT_SYNONYM, CONCEPT, DOMAIN, DRUG_STRENGTH, RELATIONSHIP, and VOCABULARY Tables in the given target schema.


patelm9/setupAthena documentation built on June 11, 2024, 4:23 a.m.