Skip to contents

Same as addSex(), except query is not computed to a table.

Usage

addSexQuery(x, sexName = "sex", missingSexValue = "None")

Arguments

x

Table with individuals in the cdm.

sexName

Sex variable name.

missingSexValue

Value to include if missing sex.

Value

table x with the added column with sex information.

Examples

# \donttest{
library(PatientProfiles)

cdm <- mockPatientProfiles(source = "duckdb")

cdm$cohort1 |>
  addSexQuery()
#> # 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 sex   
#>                   <int>      <int> <date>            <date>          <chr> 
#>  1                    3          1 1994-02-10        1999-06-18      Female
#>  2                    1          2 1935-07-26        1935-08-08      Male  
#>  3                    3          3 1932-10-16        1937-12-07      Male  
#>  4                    1          4 1930-11-20        1933-12-26      Male  
#>  5                    3          5 1929-12-29        1936-04-08      Male  
#>  6                    1          6 1991-06-12        1995-06-18      Male  
#>  7                    1          7 1930-07-24        1949-11-06      Male  
#>  8                    3          8 1916-12-26        1920-06-06      Male  
#>  9                    2          9 1993-07-23        1994-11-23      Female
#> 10                    2         10 1948-05-19        1954-10-23      Male  

# }