Add variable kategori_afli_aryt_i48 for AFLI-procedures, based on ICD codes.

utlede_kateg_afli_aryt_i48(df)

Arguments

df

data.frame with Ablanor-data. Must contain variables forlopstype, aryt_i48_0, aryt_i48_1 and aryt_i48_1_underkat.

Value

returns df with one new column.

Examples

df <- data.frame(
   forlopstype = rep(1, 4),
   aryt_i48_0 = c(0, 1, 0, 0),
   aryt_i48_1 =  c(0, 0, 1, 2),
   aryt_i48_1_underkat = c(NA, NA, 1, 2))
ablanor::utlede_kateg_afli_aryt_i48(df)
#>   forlopstype aryt_i48_0 aryt_i48_1 aryt_i48_1_underkat
#> 1           1          0          0                  NA
#> 2           1          1          0                  NA
#> 3           1          0          1                   1
#> 4           1          0          2                   2
#>                     kategori_afli_aryt_i48
#> 1                                     <NA>
#> 2    AFLI-ICD 48.0 Paroksymal atrieflimmer
#> 3 AFLI-ICD 48.1 Persisterende atrieflimmer
#> 4                                     <NA>