R/metadata.R
map_infections_abx_indications.Rd
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)
a data frame containing ICD-10 codes
a variable name or column number in df
containing ICD-10 codes.
The input data frame x
with additional variables
describing infection type and whether antibiotics are indicated.
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.
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