This vignette contains some example data used in the other vignettes.

Patients

ex_people contains 100 patients (with random names from the randomNames package) who received total hip arthroplasty (THA) surgery at given (random) dates (surgery column). This data represent a sample from a national quality register.

See also ?ex_people.

ex_people
#> # A tibble: 100 x 2
#>    name              surgery   
#>    <chr>             <date>    
#>  1 Chen, Trevor      2021-01-19
#>  2 Graves, Acineth   2020-10-11
#>  3 Trujillo, Yanelly 2020-09-28
#>  4 Simpson, Kenneth  2020-12-31
#>  5 Chin, Nelson      2020-12-14
#>  6 Le, Christina     2020-07-18
#>  7 Kang, Xuan        2020-10-20
#>  8 Shuemaker, Lauren 2020-07-19
#>  9 Boucher, Teresa   2020-12-25
#> 10 Le, Soraiya       2020-11-29
#> # … with 90 more rows

Diagnoses data

We are interested in comorbidity for the patients above and have collected some synthesized diagnostics data (ex_icd10) from a national patient register (we can at least assume that for now). Patients have one entry for every combination of recorded diagnoses codes according to the International classification of diseases version 10, icd10, and corresponding dates of hospital admissions for which those codes were recorded. (Column hdia is TRUE for main diagnoses and FALSE for underlying/less relevant codes).

See also ?ex_icd10.

ex_icd10
#> # A tibble: 2,376 x 4
#>    name                 admission  icd10 hdia 
#>    <chr>                <date>     <chr> <lgl>
#>  1 Tran, Kenneth        2020-08-02 S134A FALSE
#>  2 Tran, Kenneth        2021-01-16 W3319 FALSE
#>  3 Tran, Kenneth        2020-12-26 Y0262 TRUE 
#>  4 Tran, Kenneth        2020-11-18 X0488 FALSE
#>  5 Sommerville, Dominic 2021-01-07 V8104 FALSE
#>  6 Sommerville, Dominic 2020-08-18 B853  FALSE
#>  7 Sommerville, Dominic 2021-01-02 Q174  FALSE
#>  8 Sommerville, Dominic 2020-08-23 A227  FALSE
#>  9 Sommerville, Dominic 2020-12-28 H702  FALSE
#> 10 Sommerville, Dominic 2020-04-21 X6051 TRUE 
#> # … with 2,366 more rows

Medical data

Assume we have some external code data from a national prescription register. Such register would likely cover additional patients but let’s just consider a small sample with ATC codes for patients above, such that each patient can have zero, one, or several codes prescribed at different dates.

ex_atc
#> # A tibble: 10,000 x 3
#>    name                 atc      prescription
#>    <chr>                <chr>    <date>      
#>  1 Le, Soraiya          L03AA16  2018-10-23  
#>  2 Cleveland, Mark      J07CA01  2016-07-02  
#>  3 Santistevan, Charlie QJ57EA06 2011-12-12  
#>  4 Meier, Hayden        R03DB04  2017-04-13  
#>  5 Hill, Audrey         V09IA01  2014-09-26  
#>  6 Thumma, Phillip      L02AE02  2010-11-04  
#>  7 Yost, Rebecca        S01EB06  2015-03-29  
#>  8 Mandakh, Joseph      A03DA01  2016-10-30  
#>  9 Meier, Hayden        C09AA13  2019-04-21  
#> 10 Trinh, Schuyler      A07EA03  2021-02-18  
#> # … with 9,990 more rows