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()
cdm$cohort1 %>%
  addCdmName()
#> # Source:   SQL [10 x 5]
#> # Database: DuckDB v1.1.1 [unknown@Linux 6.5.0-1025-azure:R 4.4.1/:memory:]
#>    cohort_definition_id subject_id cohort_start_date cohort_end_date cdm_name
#>                   <int>      <int> <date>            <date>          <chr>   
#>  1                    1          9 1940-08-13        1942-10-23      PP_MOCK 
#>  2                    2          4 1981-11-14        1993-01-11      PP_MOCK 
#>  3                    3          1 1942-08-05        1944-10-21      PP_MOCK 
#>  4                    3          7 1980-08-05        1983-05-19      PP_MOCK 
#>  5                    1          5 1974-08-24        1980-12-25      PP_MOCK 
#>  6                    1          8 1929-04-01        1931-10-28      PP_MOCK 
#>  7                    3          6 1981-02-19        1994-09-10      PP_MOCK 
#>  8                    3          2 1958-04-14        1959-09-10      PP_MOCK 
#>  9                    3         10 1938-06-17        1939-10-08      PP_MOCK 
#> 10                    1          3 1945-08-22        1948-07-24      PP_MOCK 
# }