1
0
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:
2024-04-24 09:50:32 +02:00
parent 0d8a91db49
commit 25089e811e
4 changed files with 17 additions and 1 deletions

2
R/ab.R
View File

@ -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