socialrisk
PackageThe goal of socialrisk
is to create an efficient way to identify social risk from administrative health care data using ICD-10 diagnosis codes.
We’ve created a sample dataset of ICD-10 administrative data which we can load in.
i10_wide#> # A tibble: 29 × 11
#> patient_id sex date_of_serv dx1 dx2 dx3 dx4 dx5 visit_type hcpcs
#> <fct> <chr> <date> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 1001 male 2020-02-14 E876 Z560 Z6372 Z654 E440 ip E2201
#> 2 1001 male 2021-05-15 J189 Z644 A408 I10 G309 ip E2201
#> 3 1001 male 2021-01-10 I119 Z628 I10 <NA> <NA> ot E2201
#> 4 1001 male 2021-04-02 G309 K731 Z591 <NA> <NA> ot E2201
#> 5 1001 male 2021-05-06 E039 I10 J189 <NA> <NA> ot E2201
#> 6 1001 male 2021-06-04 J189 Z604 F329 <NA> <NA> ot E2201
#> 7 1001 male 2021-10-01 E0800 G309 I10 <NA> <NA> ot E2201
#> 8 1001 male 2021-11-05 I6011 I10 F329 R930 <NA> ot E2201
#> 9 1001 male 2022-02-01 M546 G309 I10 I6011 <NA> ot E2201
#> 10 1001 male 2022-03-15 E0800 I10 J189 F329 <NA> ot E2201
#> # … with 19 more rows, and 1 more variable: icd_version <dbl>
We use the built-in clean_data()
function to specify the: dataset, patient id, current data format (wide or long), and the prefix of the diagnoses variables.
<- clean_data(dat = i10_wide,
data id = patient_id,
style = "wide",
prefix_dx = "dx")
#> # A tibble: 10 × 2
#> patient_id dx
#> <fct> <chr>
#> 1 1001 E876
#> 2 1001 Z560
#> 3 1001 Z6372
#> 4 1001 Z654
#> 5 1001 E440
#> 6 1001 J189
#> 7 1001 Z644
#> 8 1001 A408
#> 9 1001 I10
#> 10 1001 G309
Social Risk
Now, we can run our various social risk functions, with varying taxonomies.
Centers for Medicare and Medicaid Services (CMS)
Missouri Hospital Association
SIREN - UCSF