mirror of
https://github.com/msberends/AMR.git
synced 2026-11-16 04:20:53 +01:00
Leave EUCAST breakpoints in brackets out of clinical_breakpoints, and document where they are kept (#327)
as.sir() treats them as absent, so it can use PK/PD breakpoints or, for unknown `uti`, UTI breakpoints. The values stay available in data-raw/breakpoints_eucast_raw.csv, to which the manual now points. Organisms that a table excludes stay excluded, since these have their own blocking rows. This also fixes the change for unknown `uti` of the previous commit: a blocking row only gives way to an actual UTI breakpoint, not to a UTI row without breakpoints.
This commit is contained in:
1 parent
4c4a7d4392
commit
fab20c5eaa
5 files changed
+35
-5
No files matched your search
@@ -582,6 +582,16 @@ test_that("microorganisms.codes: unique codes for existing names", {
|
||||
expect_true(all(is.na(microorganisms.codes$source) | grepl("^WHONET \\(.+\\)$", microorganisms.codes$source)))
|
||||
})
|
||||
|
||||
test_that("clinical_breakpoints: no EUCAST breakpoints in brackets (#327)", {
|
||||
skip_on_cran()
|
||||
expect_false(any(grepl("brackets", clinical_breakpoints$note, fixed = TRUE)))
|
||||
expect_false(any(grepl("[( )]", clinical_breakpoints$note, fixed = TRUE)))
|
||||
# e.g., systemic amikacin for Enterobacterales in EUCAST 2026, with only the breakpoint for infections originating from the urinary tract left
|
||||
amk <- subset(clinical_breakpoints, guideline == "EUCAST 2026" & type == "human" & ab == "AMK" & method == "MIC" & mo == "B_[ORD]_ENTRBCTR")
|
||||
expect_identical(nrow(amk), 1L)
|
||||
expect_true(amk$uti)
|
||||
})
|
||||
|
||||
test_that("clinical_breakpoints: EUCAST MIC breakpoints are stored as published (#331)", {
|
||||
skip_on_cran()
|
||||
cb <- as.data.frame(clinical_breakpoints, stringsAsFactors = FALSE)
|
||||
|
||||
@@ -826,10 +826,24 @@ test_that("EUCAST blocking rows prevent falling back to broader breakpoints", {
|
||||
expect_identical(sir(as.mic(0.064), "Haemophilus influenzae", "LVX", "EUCAST 2026"), "S")
|
||||
# high-level gentamicin resistance (screening test given in the notes)
|
||||
expect_identical(sir(as.mic(256), "Enterococcus faecium", "GEH", "EUCAST 2026"), "R")
|
||||
# breakpoints in brackets for systemic infections are not replaced by the UTI breakpoint if uti is unknown
|
||||
expect_identical(sir(as.mic(4), "Acinetobacter baumannii", "AMK", "EUCAST 2026"), NA_character_)
|
||||
# breakpoints in brackets are not in the data set (#327), so a UTI breakpoint is used if uti is unknown and nothing else is available, which is noted every time
|
||||
sir_interpretation_history(clean = TRUE)
|
||||
expect_identical(sir(as.mic(4), "Acinetobacter baumannii", "AMK", "EUCAST 2026"), "S")
|
||||
sir_history <- sir_interpretation_history(clean = TRUE)
|
||||
expect_match(sir_history$notes, "only available for (uncomplicated) urinary tract infections", fixed = TRUE)
|
||||
expect_identical(sir(as.mic(4), "Acinetobacter baumannii", "AMK", "EUCAST 2026", uti = FALSE), NA_character_)
|
||||
expect_identical(sir(as.mic(4), "Acinetobacter baumannii", "AMK", "EUCAST 2026", uti = TRUE), "S")
|
||||
# without a breakpoint in brackets, PK-PD breakpoints apply if EUCAST has these, as in EUCAST 2023 for aminoglycosides
|
||||
sir_interpretation_history(clean = TRUE)
|
||||
expect_identical(sir(as.mic(0.5), "Escherichia coli", "AMK", "EUCAST 2023", uti = FALSE), "S")
|
||||
sir_history <- sir_interpretation_history(clean = TRUE)
|
||||
expect_match(sir_history$ref_table, "PK PD", fixed = TRUE)
|
||||
# and the breakpoints of a broader taxon for another route, of which the site is noted
|
||||
sir_interpretation_history(clean = TRUE)
|
||||
expect_identical(sir(as.mic(4), "Enterococcus faecalis", "AMX", "EUCAST 2026", uti = FALSE), "S")
|
||||
expect_identical(sir_interpretation_history(clean = TRUE)$site, "Intravenous")
|
||||
# an organism that a table excludes stays excluded, also if EUCAST has breakpoints in brackets for it
|
||||
expect_identical(sir(as.mic(1), "Bacillus anthracis", "VAN", "EUCAST 2026"), NA_character_)
|
||||
# UTI breakpoints are only used for unknown uti if there are no non-UTI breakpoints, which is noted every time
|
||||
for (i in 1:2) {
|
||||
sir_interpretation_history(clean = TRUE)
|
||||
|
||||
Reference in new issue
Block a user