mirror of
https://github.com/msberends/AMR.git
synced 2025-07-09 17:02:03 +02:00
correct for high-level abx
This commit is contained in:
2
R/ab.R
2
R/ab.R
@ -645,6 +645,8 @@ generalise_antibiotic_name <- function(x) {
|
||||
x <- gsub("_(MIC|RSI|SIR|DIS[CK])$", "", x, perl = TRUE)
|
||||
# remove disk concentrations, like LVX_NM -> LVX
|
||||
x <- gsub("_[A-Z]{2}[0-9_.]{0,3}$", "", x, perl = TRUE)
|
||||
# correct for 'high level' antibiotics
|
||||
x <- gsub("([^A-Z0-9]+)?(HIGH(.?LEVEL)?|H[^A-Z0-9]?L)([^A-Z0-9]+)?", "-HIGH", x, perl = TRUE)
|
||||
# remove part between brackets if that's followed by another string
|
||||
x <- gsub("(.*)+ [(].*[)]", "\\1", x)
|
||||
# keep only max 1 space
|
||||
|
Reference in New Issue
Block a user