Make anaerobes more specific than a Gram stain in rank_index

Anaerobes now have rank_index 5.5 (5.6 for a blocking row), and a Gram stain stays at 6. They had the same rank, so the order of sites could make the Gram-negative row with site Parenteral (CLSI Table 2B-5) precede the anaerobe row without a site (CLSI Table 2J), e.g., for ceftriaxone in B. fragilis.

A rebuild changes rank_index in 884 rows and nothing else.
This commit is contained in:
dr. M.S. (Matthijs) Berends committed 2026-11-03 08:37:55 +01:00
1 parent e7077081b9
commit 81f5aaa7b8
16 files changed
+900 -890

No files matched your search

+3
View File
@@ -756,6 +756,9 @@ test_that("clinical_breakpoints: consistent and unambiguous", {
expected <- c("subspecies" = 1, "species" = 2, "species group" = 2.5, "genus" = 3, "family" = 4, "order" = 5)[rank]
wrong <- which(!is.na(expected) & floor(cb$rank_index * 2) / 2 != expected & cb$rank_index != expected)
expect_true(length(wrong) == 0, info = paste("rank_index does not match the rank:", describe_mo(unique(cb$mo[wrong]))))
# anaerobes are more specific than a Gram stain, with or without the 0.1 of a blocking row
expect_true(all(cb$rank_index[grepl("^B_ANAER", cb$mo)] %in% c(5.5, 5.6)))
expect_true(all(cb$rank_index[cb$mo %in% c("B_GRAMN", "B_GRAMP")] %in% c(6, 6.1)))
})
test_that("antimicrobials: unique and well-formed", {
+5
View File
@@ -730,6 +730,11 @@ test_that("as.sir() takes the site of a breakpoint into account", {
expect_true(sir_site_rank("Intravenous, Meningitis") < sir_site_rank("Intravenous, Non-meningitis"))
expect_true(sir_site_rank("Intravenous, Non-meningitis") < sir_site_rank("Meningitis"))
# the order of sites does not make a Gram stain precede the more specific anaerobes: CLSI Table 2J, not Table 2B-5
expect_identical(sir(as.mic(16), "Bacteroides fragilis", "CRO", guideline = "CLSI 2022"), "S")
# and it does make a meningitis breakpoint precede a non-meningitis breakpoint of another taxon of the same rank
expect_identical(sir(as.mic(0.25), "Streptococcus agalactiae", "PEN", guideline = "EUCAST 2024"), "R")
# "other" in as.sir(): takes the breakpoint for other infections, or without a site
expect_identical(sir(as.mic(0.25), "Streptococcus pneumoniae", "PEN", site = "other", guideline = "EUCAST 2012"), "I")
expect_identical(sir(as.mic(0.25), "Streptococcus pneumoniae", "PEN", site = "meningitis", guideline = "EUCAST 2012"), "R")