Map ICD-10 or ICD-10-CM codes by infection types and whether antibiotics are commonly indicated based on definitions set by Hashimoto et al. (2020) .

map_infections_abx_indications(df, icd_column)

Arguments

df

a data frame containing ICD-10 codes

icd_column

a variable name or column number in df containing ICD-10 codes.

Value

The input data frame x with additional variables describing infection type and whether antibiotics are indicated.

Details

For more detail on infection categories and indications for antibiotic therapy, see antibiotic_icd_indications.

This function is designed to be compatible with both ICD-10 and ICD-10-CM versions.

Examples

mock_icd_data <- data.frame(
   list(icd10_code = c("J15", "J15X", "J150")), 
   stringsAsFactors = FALSE)
mock_icd_data <- map_infections_abx_indications(
  mock_icd_data, "icd10_code")
mock_icd_data
#>   icd10_code infection_group1_code             infection_group1_label
#> 1        J15                   u02 Miscellaneous bacterial infections
#> 2       J150                   u02 Miscellaneous bacterial infections
#> 3       J15X                   u02 Miscellaneous bacterial infections
#>   infection_group2_label infection_group2_code antibiotics_indicated
#> 1    Bacterial pneumonia                 u0204               usually
#> 2    Bacterial pneumonia                 u0204               usually
#> 3    Bacterial pneumonia                 u0204               usually