Skip to contents

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

Usage

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

Arguments

x

A table containing individuals in a CDM reference.

sexName

Name of the sex column to add.

missingSexValue

Value to use when sex is missing.

Value

table x with the added column with sex information.

Examples

# \donttest{
library(PatientProfiles)

cdm <- mockPatientProfiles(source = "duckdb")

cdm$cohort1 |>
  addSexQuery()
#> # 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 sex   
#>                   <int>      <int> <date>            <date>          <chr> 
#>  1                    1          1 1951-03-12        1968-11-15      Female
#>  2                    1          2 1946-12-30        1953-03-03      Female
#>  3                    1          3 1959-05-26        1959-09-18      Female
#>  4                    1          4 1922-08-25        1937-11-19      Male  
#>  5                    3          5 1980-06-26        1981-05-19      Male  
#>  6                    3          6 1953-08-01        1962-10-15      Female
#>  7                    2          7 1929-11-09        1932-11-03      Male  
#>  8                    2          8 1938-02-15        1938-02-17      Female
#>  9                    1          9 1941-07-30        1957-03-25      Female
#> 10                    3         10 2005-04-24        2008-04-16      Male  

# }