Skip to contents

The function icd_history takes the result of icd_expand, specified for a particular year, and returns a data.frame containing all corresponding codes for the specified years (from 2003). To do this, it applies the ICD-10-GM transition tables to map codes between successive ICD-10-GM versions. Only automatic transitions are followed.

Usage

icd_history(icd_expand, years, custom_transitions = NULL)

Arguments

icd_expand

A data.frame (e.g. as generated by the function icd_expand)

years

Years to historize (e.g. 2005:2014)

custom_transitions

(Optional) A data.frame containing custom transitions to complement the official transitions provided by icd_meta_transition.

Value

data.frame with columns YEAR, ICD_CODE, ICD_COMPRESSED, ICD_LABEL and, if specified, DIAG_GROUP #' @seealso icd_expand() to generate the necessary input

Examples

# Between 2018 and 2019, causalgia (G56.4) was reclassified
# under G90 as a complex regional pain syndrome
icd_meta <- data.frame(ICD = "G56.4", ICD_LABEL = "Causalgia")
icd_meta_expanded <- icd_expand(icd_meta, year = 2018, col_meta = "ICD_LABEL")
icd_history(icd_meta_expanded, years = 2018:2019)
#> # A tibble: 2 × 8
#>   icd_spec ICD_LABEL  year icd3  icd_code icd_normcode icd_sub label            
#>   <chr>    <chr>     <int> <chr> <chr>    <chr>        <chr>   <chr>            
#> 1 G564     Causalgia  2018 G56   G56.4    G56.4        G564    Kausalgie        
#> 2 G564     Causalgia  2019 G90   G90.60   G90.60       G9060   Komplexes region…