Skip to contents

Add cdm name

Usage

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

Arguments

table

Table in the cdm

cdm

A cdm reference object

Value

Table with an extra column with the cdm names

Examples

# \donttest{
library(PatientProfiles)

cdm <- mockPatientProfiles(source = "duckdb")
#> Warning: There are observation period end dates after the current date: 2026-04-06
#>  The latest max observation period end date found is 2031-06-11

cdm$cohort1 |>
  addCdmName()
#> # Source:   SQL [?? x 5]
#> # Database: DuckDB 1.5.1 [unknown@Linux 6.17.0-1008-azure:R 4.5.3/:memory:]
#>    cohort_definition_id subject_id cohort_start_date cohort_end_date cdm_name
#>                   <int>      <int> <date>            <date>          <chr>   
#>  1                    1          1 1916-07-21        1918-02-05      PP_MOCK 
#>  2                    2          3 1931-04-14        1932-03-12      PP_MOCK 
#>  3                    3          7 1937-02-03        1942-12-23      PP_MOCK 
#>  4                    1          2 2004-05-30        2004-10-05      PP_MOCK 
#>  5                    1          4 1989-10-04        2002-05-28      PP_MOCK 
#>  6                    1         10 1911-04-22        1915-05-27      PP_MOCK 
#>  7                    1          6 1969-09-15        1974-03-31      PP_MOCK 
#>  8                    3          9 1996-09-16        1996-11-07      PP_MOCK 
#>  9                    2          5 1951-02-20        1952-01-24      PP_MOCK 
#> 10                    1          8 1962-05-19        1964-01-04      PP_MOCK 
# }