correct for high-level abx

This commit is contained in:
dr. M.S. (Matthijs) Berends committed 2024-04-24 09:50:32 +02:00
1 parent 0d8a91db49
commit 25089e811e
4 files changed
+17 -1

No files matched your search

+2
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