cdmFromTables: Create a cdm object from local tables

View source: R/cdmFromTables.R

cdmFromTablesR Documentation

Create a cdm object from local tables

Description

Create a cdm object from local tables

Usage

cdmFromTables(tables, cdmName, cohortTables = list(), cdmVersion = NULL)

Arguments

tables

List of tables that are part of the cdm object.

cdmName

Name of the ⁠<cdm_reference>⁠ object.

cohortTables

List of tables that contain cohort, cohort_set and cohort_attrition attributes.

cdmVersion

Version of the OMOP Common Data Model. Supported versions are "5.3" and "5.4".

Value

A cdm_reference object.

Examples


library(omopgenerics)
library(dplyr, warn.conflicts = FALSE)

person <- tibble(
  person_id = 1, gender_concept_id = 0, year_of_birth = 1990,
  race_concept_id = 0, ethnicity_concept_id = 0
)
observation_period <- tibble(
  observation_period_id = 1, person_id = 1,
  observation_period_start_date = as.Date("2000-01-01"),
  observation_period_end_date = as.Date("2023-12-31"),
  period_type_concept_id = 0
)
cdm <- cdmFromTables(
  tables = list("person" = person, "observation_period" = observation_period),
  cdmName = "test"
)



omopgenerics documentation built on June 17, 2026, 5:07 p.m.