(v3.0.1.9109) Fix WHONET codes SUD and ROX in clinical_breakpoints, and add sulbactam/durlobactam (#308)

This commit is contained in:
dr. M.S. (Matthijs) Berends committed 2026-10-10 09:42:25 +02:00
1 parent 6a778daeb8
commit 16a13ba81f
31 files changed
+78 -31

No files matched your search

@@ -956,7 +956,9 @@ antimicrobials <- antimicrobials |>
mutate(
ab = "FTA",
name = "Cefepime/taniborbactam",
cid = NA_real_
cid = NA_real_,
# the trade names of FPE do not apply
synonyms = list(NA_character_)
),
antimicrobials |>
filter(ab == "TBP") |>
@@ -969,6 +971,26 @@ antimicrobials <- antimicrobials |>
)
)
# add Sulbactam/durlobactam (WHONET code SUD, which is sulfadimethoxine in this package, see #308)
antimicrobials <- antimicrobials |>
mutate(ab = as.character(ab)) |>
bind_rows(
antimicrobials |>
filter(ab == "SUL") |>
mutate(ab = as.character(ab)) |>
mutate(
ab = "SUD1",
name = "Sulbactam/durlobactam",
cid = NA_real_,
atc = list("J01CG30"),
abbreviations = list(NA_character_),
synonyms = list("Xacduro"),
iv_ddd = NA_real_,
iv_units = NA_character_,
loinc = list(NA_character_)
)
)
antimicrobials <- antimicrobials |>
mutate(ab = as.character(ab)) |>
bind_rows(
@@ -277,27 +277,31 @@ breakpoints |>
ab = as.ab(WHONET_ABX_CODE, fast_mode = TRUE),
ab_name = ab_name(ab)
)
# 2025-04-20: these codes are currently: CFC, ROX, FIX, and N/A. All have the right replacements in `antimicrobials`, so we can safely use as.ab() later on
# 2025-04-20: these codes are currently: CFC, ROX, FIX, and N/A. CFC and FIX have the right replacements in `antimicrobials`, so we can safely use as.ab() later on
# 2026-10-09: ROX is not: as.ab("ROX") returns cefuroxime, see `whonet_ab_recode` below
# the NAs are for M. tuberculosis, they are empty breakpoints
breakpoints <- breakpoints |>
filter(!is.na(WHONET_ABX_CODE))
# a WHONET code can also exist in `antimicrobials` as the code of another
# agent, e.g. WHONET "STR" (streptomycin) is "STR" (streptoduocin) here, so
# agent, or not be resolved correctly by as.ab(), so these are recoded (#308):
# - "STR" is streptomycin, but "STR" is streptoduocin here (streptomycin is "STR1")
# - "SUD" is sulbactam/durlobactam, but "SUD" is sulfadimethoxine here (sulbactam/durlobactam is "SUD1")
# - "ROX" is an old WHONET code for roxithromycin, only used for EUCAST 2011 (with the
# same values as "RXT" in EUCAST 2012 and 2013), which as.ab() reads as cefuroxime
whonet_ab_recode <- c(STR = "STR1", SUD = "SUD1", ROX = "RXT")
recode_whonet_ab <- function(x) unname(ifelse(x %in% names(whonet_ab_recode), whonet_ab_recode[x], x))
# compare the code with WHONET's own name of the agent:
whonet_code_check <- breakpoints |>
distinct(WHONET_ABX_CODE) |>
left_join(whonet_antibiotics_raw |> select(WHONET_ABX_CODE, ANTIBIOTIC), by = "WHONET_ABX_CODE") |>
filter(!is.na(ANTIBIOTIC)) |>
mutate(
by_code = as.ab(if_else(WHONET_ABX_CODE == "STR", "STR1", WHONET_ABX_CODE), info = FALSE),
by_code = as.ab(recode_whonet_ab(WHONET_ABX_CODE), info = FALSE),
by_name = as.ab(ANTIBIOTIC, info = FALSE)
) |>
filter(is.na(by_code) | is.na(by_name) | by_code != by_name)
# 2026-10-01: SUD (WHONET: sulbactam-durlobactam, CLSI 2024-2026) is
# sulfadimethoxine here, and sulbactam-durlobactam is not in `antimicrobials`
# yet; this must be resolved before these breakpoints can be used. This
# should otherwise be empty:
# this should be empty:
whonet_code_check
@@ -322,10 +326,8 @@ breakpoints_new <- breakpoints |>
mo_rank(mo, keep_synonyms = TRUE) == "order" ~ 5,
TRUE ~ 6
),
# WHONET code "STR" is streptomycin, but in this package "STR" is
# streptoduocin (streptomycin is "STR1"), so as.ab("STR") would return
# the wrong agent
ab = as.ab(if_else(WHONET_ABX_CODE == "STR", "STR1", WHONET_ABX_CODE)),
# some WHONET codes are another agent here, see `whonet_ab_recode` above
ab = as.ab(recode_whonet_ab(WHONET_ABX_CODE)),
ref_tbl = ifelse(type == "ECOFF" & is.na(REFERENCE_TABLE), "ECOFF", REFERENCE_TABLE),
disk_dose = POTENCY,
breakpoint_S = ifelse(type == "ECOFF" & is.na(S) & !is.na(ECV_ECOFF), ECV_ECOFF, S),