Skip to contents

Add cdm name

Usage

addCdmName(table, cdm = omopgenerics::cdmReference(table))

Arguments

table

A table to process.

cdm

A cdm_reference object.

Value

Table with an extra column with the cdm names

Examples

# \donttest{
library(PatientProfiles)

cdm <- mockPatientProfiles(source = "duckdb")

cdm$cohort1 |>
  addCdmName()
#> # A query:  ?? x 5
#> # Database: DuckDB 1.5.4 [unknown@Linux 6.17.0-1020-azure:R 4.6.1/:memory:]
#>    cohort_definition_id subject_id cohort_start_date cohort_end_date cdm_name
#>                   <int>      <int> <date>            <date>          <chr>   
#>  1                    2          7 1920-11-12        1924-02-12      PP_MOCK 
#>  2                    1          5 1975-11-24        1975-12-06      PP_MOCK 
#>  3                    1         10 1944-02-06        1953-01-30      PP_MOCK 
#>  4                    3          9 1951-02-15        1954-08-05      PP_MOCK 
#>  5                    2          2 1964-08-06        1967-09-19      PP_MOCK 
#>  6                    1          1 1941-08-13        1942-11-03      PP_MOCK 
#>  7                    1          8 1947-06-26        1956-05-29      PP_MOCK 
#>  8                    1          3 1934-06-02        1935-09-23      PP_MOCK 
#>  9                    2          6 1911-01-05        1916-02-29      PP_MOCK 
#> 10                    2          4 1949-10-26        1950-06-20      PP_MOCK 
# }