your_data %>% mutate_if(is.disk, as.sir)
@@ -574,197 +585,31 @@ A microorganism is categorised as "Resistant" when there is a high likelihood of
#> 'microorganism', EUCAST 2024...
#> NOTE
#> • Multiple breakpoints available for ciprofloxacin (CIP) in Escherichia coli - assuming body site 'Non-meningitis'.
-#>
-#> ℹ Run sir_interpretation_history() afterwards to retrieve a logbook with
-#> all the details of the breakpoint interpretations.
-#>
-#> Interpreting MIC values: 'amoxicillin' (AMX) based on column
-#> 'microorganism', EUCAST 2024...
-#> NOTE
-#> • Breakpoints for UTI and non-UTI available for amoxicillin (AMX) in Escherichia coli - assuming body site 'Intravenous'. Use argument uti to set which isolates are from urine. See ?as.sir.
-#> Interpreting MIC values: 'cipro' (CIP, ciprofloxacin) based on column
-#> 'microorganism', EUCAST 2024...
-#> NOTE
-#> • Multiple breakpoints available for ciprofloxacin (CIP) in Escherichia coli - assuming body site 'Non-meningitis'.
-#> Interpreting disk diffusion zones: 'tobra' (TOB, tobramycin) based on
-#> column 'microorganism', EUCAST 2024...
-#> NOTE
-#> • Breakpoints for UTI and non-UTI available for tobramycin (TOB) in Escherichia coli - assuming an unspecified body site. Use argument uti to set which isolates are from urine. See ?as.sir.
-#> Interpreting disk diffusion zones: 'genta' (GEN, gentamicin) based on
-#> column 'microorganism', EUCAST 2024...
-#> NOTE
-#> • Breakpoints for UTI and non-UTI available for gentamicin (GEN) in Escherichia coli - assuming an unspecified body site. Use argument uti to set which isolates are from urine. See ?as.sir.
-#>
-#> ℹ Run sir_interpretation_history() afterwards to retrieve a logbook with
-#> all the details of the breakpoint interpretations.
-#>
-#> Interpreting MIC values: 'amoxicillin' (AMX) based on column
-#> 'microorganism', EUCAST 2024...
-#> NOTE
-#> • Breakpoints for UTI and non-UTI available for amoxicillin (AMX) in Escherichia coli - assuming body site 'Intravenous'. Use argument uti to set which isolates are from urine. See ?as.sir.
-#> Interpreting MIC values: 'cipro' (CIP, ciprofloxacin) based on column
-#> 'microorganism', EUCAST 2024...
-#> NOTE
-#> • Multiple breakpoints available for ciprofloxacin (CIP) in Escherichia coli - assuming body site 'Non-meningitis'.
-#>
-#> ℹ Run sir_interpretation_history() afterwards to retrieve a logbook with
-#> all the details of the breakpoint interpretations.
-#>
-#> Interpreting MIC values: 'amoxicillin' (AMX) based on column
-#> 'microorganism', EUCAST 2024...
-#> NOTE
-#> • Breakpoints for UTI and non-UTI available for amoxicillin (AMX) in Escherichia coli - assuming body site 'Intravenous'. Use argument uti to set which isolates are from urine. See ?as.sir.
-#> Interpreting MIC values: 'cipro' (CIP, ciprofloxacin) based on column
-#> 'microorganism', EUCAST 2024...
-#> NOTE
-#> • Multiple breakpoints available for ciprofloxacin (CIP) in Escherichia coli - assuming body site 'Non-meningitis'.
-#> Interpreting disk diffusion zones: 'tobra' (TOB, tobramycin) based on
-#> column 'microorganism', EUCAST 2024...
-#> NOTE
-#> • Breakpoints for UTI and non-UTI available for tobramycin (TOB) in Escherichia coli - assuming an unspecified body site. Use argument uti to set which isolates are from urine. See ?as.sir.
-#>
-#> ℹ Run sir_interpretation_history() afterwards to retrieve a logbook with
-#> all the details of the breakpoint interpretations.
-#>
-#> Interpreting MIC values: 'amoxicillin' (AMX) based on column
-#> 'microorganism', EUCAST 2024...
-#> NOTE
-#> • Breakpoints for UTI and non-UTI available for amoxicillin (AMX) in Escherichia coli - assuming body site 'Intravenous'. Use argument uti to set which isolates are from urine. See ?as.sir.
-#> Interpreting MIC values: 'cipro' (CIP, ciprofloxacin) based on column
-#> 'microorganism', EUCAST 2024...
-#> NOTE
-#> • Multiple breakpoints available for ciprofloxacin (CIP) in Escherichia coli - assuming body site 'Non-meningitis'.
-#> Interpreting disk diffusion zones: 'tobra' (TOB, tobramycin) based on
-#> column 'microorganism', EUCAST 2024...
-#> NOTE
-#> • Breakpoints for UTI and non-UTI available for tobramycin (TOB) in Escherichia coli - assuming an unspecified body site. Use argument uti to set which isolates are from urine. See ?as.sir.
-#>
-#> ℹ Run sir_interpretation_history() afterwards to retrieve a logbook with
-#> all the details of the breakpoint interpretations.
-#>
-#> Interpreting MIC values: 'amoxicillin' (AMX), 'cipro' (CIP, ciprofloxacin),
-#> 'tobra' (TOB, tobramycin), and 'genta' (GEN, gentamicin) based on column
-#> 'bacteria', CLSI 2024...
-#> OK
-#>
-#> ℹ Run sir_interpretation_history() afterwards to retrieve a logbook with
-#> all the details of the breakpoint interpretations.
-#>
-#> Interpreting MIC values: 'amoxicillin' (AMX), 'cipro' (CIP, ciprofloxacin),
-#> 'tobra' (TOB, tobramycin), and 'genta' (GEN, gentamicin) based on column
-#> 'bacteria', CLSI 2024...
-#> OK
-#>
-#> ℹ Run sir_interpretation_history() afterwards to retrieve a logbook with
-#> all the details of the breakpoint interpretations.
-#>
-#> Interpreting MIC values: 'cipro' (CIP, ciprofloxacin), CLSI 2024...
-#> OK
-#> Interpreting disk diffusion zones: 'tobra' (TOB, tobramycin), CLSI 2024...
-#> OK
-#> Interpreting disk diffusion zones: 'genta' (GEN, gentamicin), CLSI 2024...
-#> OK
-#>
-#> ℹ Run sir_interpretation_history() afterwards to retrieve a logbook with
-#> all the details of the breakpoint interpretations.
-#>
-#> Interpreting MIC values: 'cipro' (CIP, ciprofloxacin), CLSI 2024...
-#> OK
-#> Interpreting disk diffusion zones: 'tobra' (TOB, tobramycin), CLSI 2024...
-#> OK
-#> Interpreting disk diffusion zones: 'genta' (GEN, gentamicin), CLSI 2024...
-#> OK
-#>
-#> ℹ Run sir_interpretation_history() afterwards to retrieve a logbook with
-#> all the details of the breakpoint interpretations.
-#>
-#> ℹ Assuming breakpoint_type = "animal", since host is set.
-#>
-#> Interpreting MIC values: 'amoxicillin' (AMX), 'cipro' (CIP, ciprofloxacin),
-#> 'tobra' (TOB, tobramycin), and 'genta' (GEN, gentamicin) based on column
-#> 'bacteria', CLSI 2024...
-#> OK
-#>
-#> ℹ Run sir_interpretation_history() afterwards to retrieve a logbook with
-#> all the details of the breakpoint interpretations.
-#>
-#> ℹ Assuming breakpoint_type = "animal", since host is set.
-#>
-#> Interpreting MIC values: 'amoxicillin' (AMX), 'cipro' (CIP, ciprofloxacin),
-#> 'tobra' (TOB, tobramycin), and 'genta' (GEN, gentamicin) based on column
-#> 'bacteria', CLSI 2024...
-#> OK
-#>
-#> ℹ Run sir_interpretation_history() afterwards to retrieve a logbook with
-#> all the details of the breakpoint interpretations.
-#>
-#> ℹ Assuming breakpoint_type = "animal", since host is set.
-#>
-#>
-#> Interpreting MIC values: 'antibiotic' (TESTAB, test Antibiotic), CLSI
-#> 2024...
-#> WARNING
-#> • No CLSI 2024 MIC breakpoints available for test Antibiotic (TESTAB).
-#> Interpreting disk diffusion zones: 'antibiotic' (TESTAB, test Antibiotic),
-#> CLSI 2024...
-#> WARNING
-#> • No CLSI 2024 DISK breakpoints available for test Antibiotic (TESTAB).
-#> Interpreting disk diffusion zones: 'antibiotic' (TESTAB, test Antibiotic),
-#> CLSI 2024...
-#> WARNING
-#> • No CLSI 2024 DISK breakpoints available for test Antibiotic (TESTAB).
-#> Warning: There was 1 warning in `mutate()`.
-#> ℹ In argument: `cipro = (function (x, ...) ...`.
+#> Warning: There were 2 warnings in `mutate()`.
+#> The first warning was:
+#> ℹ In argument: `amoxicillin = (function (x, ...) ...`.
#> Caused by warning:
-#> ! The following animal host(s) could not be coerced: "animal_species"
+#> ! invalid microorganism code, NA generated
+#> ℹ Run `dplyr::last_dplyr_warnings()` to see the 1 remaining warning.
#>
#> ℹ Run sir_interpretation_history() afterwards to retrieve a logbook with
#> all the details of the breakpoint interpretations.
#>
-#> ℹ Assuming breakpoint_type = "animal", since host is set.
-#>
-#>
-#> Interpreting MIC values: 'cipro' (CIP, ciprofloxacin), CLSI 2024...
-#> OK
-#> Interpreting disk diffusion zones: 'tobra' (TOB, tobramycin), CLSI 2024...
-#> OK
-#> Interpreting disk diffusion zones: 'genta' (GEN, gentamicin), CLSI 2024...
-#> OK
-#> Warning: There was 1 warning in `mutate()`.
-#> ℹ In argument: `across(...)`.
-#> Caused by warning:
-#> ! The following animal host(s) could not be coerced: "animal_species"
-#>
-#> ℹ Run sir_interpretation_history() afterwards to retrieve a logbook with
-#> all the details of the breakpoint interpretations.
-#>
-#> Interpreting disk diffusion zones: column 'nitrofuratoin' (NIT,
-#> nitrofurantoin), EUCAST 2024...
-#> OK
-#> ℹ Assuming value "urine" in column 'specimen' reflects a urinary tract
-#> infection.
-#> Use as.sir(uti = FALSE) to prevent this.
-#>
-#> ℹ Run sir_interpretation_history() afterwards to retrieve a logbook with
-#> all the details of the breakpoint interpretations.
-#>
-#> Interpreting disk diffusion zones: column 'nitrofuratoin' (NIT,
-#> nitrofurantoin), EUCAST 2024...
-#> OK
-#>
-#> ℹ Run sir_interpretation_history() afterwards to retrieve a logbook with
-#> all the details of the breakpoint interpretations.
-#>
-#> Interpreting MIC values: 'cipro' (CIP, ciprofloxacin), EUCAST 2024...
-#> OK
-#> Interpreting disk diffusion zones: 'tobra' (TOB, tobramycin), EUCAST
-#> 2024...
-#> OK
-#> Interpreting disk diffusion zones: 'genta' (GEN, gentamicin), EUCAST
-#> 2024...
-#> OK
-#> microorganism amoxicillin cipro tobra genta ERY
-#> 1 Escherichia coli 8 <NA> S S R
+#> Interpreting MIC values: 'amoxicillin' (AMX) based on column
+#> 'microorganism', EUCAST 2024...
+#> NOTE
+#> • Breakpoints for UTI and non-UTI available for amoxicillin (AMX) in Escherichia coli - assuming body site 'Intravenous'. Use argument uti to set which isolates are from urine. See ?as.sir.
+#> Interpreting MIC values: 'cipro' (CIP, ciprofloxacin) based on column
+#> 'microorganism', EUCAST 2024...
+#> NOTE
+#> • Multiple breakpoints available for ciprofloxacin (CIP) in Escherichia coli - assuming body site 'Non-meningitis'.
+#> Error in mutate(.tbl, !!!funs): ℹ In argument: `tobra = (function (x, ...) ...`.
+#> Caused by error:
+#> ! in function (x, ...)
+#> {
+#> UseMethod("as.sir")
+#> }(): argument capped_mic_handling must be a text string, i.e. not be TRUE or
+#> FALSE
## Using base R ------------------------------------------------
@@ -775,43 +620,35 @@ A microorganism is categorised as "Resistant" when there is a high likelihood of
#> all the details of the breakpoint interpretations.
#>
#> Interpreting MIC values: column 'amoxicillin' (AMX), EUCAST 2024...
+#> Warning: invalid microorganism code, NA generated
#> NOTE
#> • Breakpoints for UTI and non-UTI available for amoxicillin (AMX) in Escherichia coli - assuming body site 'Intravenous'. Use argument uti to set which isolates are from urine. See ?as.sir.
#> Interpreting MIC values: column 'cipro' (CIP, ciprofloxacin), EUCAST
#> 2024...
+#> Warning: invalid microorganism code, NA generated
#> NOTE
#> • Multiple breakpoints available for ciprofloxacin (CIP) in Escherichia coli - assuming body site 'Non-meningitis'.
-#> Interpreting disk diffusion zones: column 'tobra' (TOB, tobramycin), EUCAST
-#> 2024...
-#> NOTE
-#> • Breakpoints for UTI and non-UTI available for tobramycin (TOB) in Escherichia coli - assuming an unspecified body site. Use argument uti to set which isolates are from urine. See ?as.sir.
-#> Interpreting disk diffusion zones: column 'genta' (GEN, gentamicin), EUCAST
-#> 2024...
-#> NOTE
-#> • Breakpoints for UTI and non-UTI available for gentamicin (GEN) in Escherichia coli - assuming an unspecified body site. Use argument uti to set which isolates are from urine. See ?as.sir.
-#> Assigning class 'sir' to already clean column 'ERY' (erythromycin)...
-#> OK
-#> microorganism amoxicillin cipro tobra genta ERY
-#> 1 Escherichia coli S I S S R
+#> Error: in as.sir(): argument capped_mic_handling must be a text string, i.e. not be TRUE or
+#> FALSE
# return a 'logbook' about the results:
sir_interpretation_history()
-#> # A tibble: 55 × 16
-#> datetime index ab_given mo_given host_given ab mo
-#> <dttm> <int> <chr> <chr> <chr> <ab> <mo>
-#> 1 2025-03-14 09:17:30 4 AMX B_STRPT… human AMX B_STRPT_PNMN
-#> 2 2025-03-14 09:17:39 4 genta Escheri… human GEN B_[ORD]_ENTRBCTR
-#> 3 2025-03-14 09:17:40 4 genta Escheri… human GEN B_[ORD]_ENTRBCTR
-#> 4 2025-03-14 09:17:41 4 genta Escheri… cattle GEN B_ESCHR_COLI
-#> 5 2025-03-14 09:17:42 4 genta Escheri… cattle GEN B_ESCHR_COLI
-#> 6 2025-03-14 09:17:30 3 AMX B_STRPT… human AMX B_STRPT_PNMN
-#> 7 2025-03-14 09:17:39 3 tobra Escheri… human TOB B_[ORD]_ENTRBCTR
-#> 8 2025-03-14 09:17:40 3 tobra Escheri… human TOB B_[ORD]_ENTRBCTR
-#> 9 2025-03-14 09:17:41 3 tobra Escheri… horses TOB B_ESCHR_COLI
-#> 10 2025-03-14 09:17:42 3 tobra Escheri… horses TOB B_ESCHR_COLI
-#> # ℹ 45 more rows
-#> # ℹ 9 more variables: host <chr>, method <chr>, input <chr>, outcome <sir>,
-#> # notes <chr>, guideline <chr>, ref_table <chr>, uti <lgl>,
+#> # A tibble: 11 × 16
+#> datetime index ab_given mo_given host_given ab
+#> <dttm> <int> <chr> <mo> <chr> <ab>
+#> 1 2025-03-14 16:07:42 1 AMX B_STRPT_PNMN human AMX
+#> 2 2025-03-14 16:07:42 1 AMX B_STRPT_PNMN human AMX
+#> 3 2025-03-14 16:07:42 2 AMX B_STRPT_PNMN human AMX
+#> 4 2025-03-14 16:07:42 3 AMX B_STRPT_PNMN human AMX
+#> 5 2025-03-14 16:07:42 4 AMX B_STRPT_PNMN human AMX
+#> 6 2025-03-14 16:07:47 1 amoxicillin NA human AMX
+#> 7 2025-03-14 16:07:47 1 cipro NA human CIP
+#> 8 2025-03-14 16:07:48 1 amoxicillin NA human AMX
+#> 9 2025-03-14 16:07:48 1 cipro NA human CIP
+#> 10 2025-03-14 16:07:48 1 amoxicillin NA human AMX
+#> 11 2025-03-14 16:07:49 1 cipro NA human CIP
+#> # ℹ 10 more variables: mo <mo>, host <chr>, method <chr>, input <chr>,
+#> # outcome <sir>, notes <chr>, guideline <chr>, ref_table <chr>, uti <lgl>,
#> # breakpoint_S_R <chr>
# for single values
@@ -837,14 +674,8 @@ A microorganism is categorised as "Resistant" when there is a high likelihood of
ab = "ampicillin", # and `ab` with as.ab()
guideline = "EUCAST"
)
-#>
-#> ℹ Run sir_interpretation_history() afterwards to retrieve a logbook with
-#> all the details of the breakpoint interpretations.
-#>
-#> Interpreting disk diffusion zones: 'ampicillin' (AMP), EUCAST 2024...
-#> OK
-#> Class 'sir'
-#> [1] R
+#> Error: in as.sir(): argument capped_mic_handling must be a text string, i.e. not be TRUE or
+#> FALSE
# For CLEANING existing SIR values ------------------------------------
@@ -884,26 +715,7 @@ A microorganism is categorised as "Resistant" when there is a high likelihood of
# example_isolates %>%
# mutate(across(where(is_sir_eligible), as.sir))
}
-#> # A tibble: 2,000 × 46
-#> date patient age gender ward mo PEN OXA FLC AMX
-#> <date> <chr> <dbl> <chr> <chr> <mo> <sir> <sir> <sir> <sir>
-#> 1 2002-01-02 A77334 65 F Clinical B_ESCHR_COLI R NA NA NA
-#> 2 2002-01-03 A77334 65 F Clinical B_ESCHR_COLI R NA NA NA
-#> 3 2002-01-07 067927 45 F ICU B_STPHY_EPDR R NA R NA
-#> 4 2002-01-07 067927 45 F ICU B_STPHY_EPDR R NA R NA
-#> 5 2002-01-13 067927 45 F ICU B_STPHY_EPDR R NA R NA
-#> 6 2002-01-13 067927 45 F ICU B_STPHY_EPDR R NA R NA
-#> 7 2002-01-14 462729 78 M Clinical B_STPHY_AURS R NA S R
-#> 8 2002-01-14 462729 78 M Clinical B_STPHY_AURS R NA S R
-#> 9 2002-01-16 067927 45 F ICU B_STPHY_EPDR R NA R NA
-#> 10 2002-01-17 858515 79 F ICU B_STPHY_EPDR R NA S NA
-#> # ℹ 1,990 more rows
-#> # ℹ 36 more variables: AMC <sir>, AMP <sir>, TZP <sir>, CZO <sir>, FEP <sir>,
-#> # CXM <sir>, FOX <sir>, CTX <sir>, CAZ <sir>, CRO <sir>, GEN <sir>,
-#> # TOB <sir>, AMK <sir>, KAN <sir>, TMP <sir>, SXT <sir>, NIT <sir>,
-#> # FOS <sir>, LNZ <sir>, CIP <sir>, MFX <sir>, VAN <sir>, TEC <sir>,
-#> # TCY <sir>, TGC <sir>, DOX <sir>, ERY <sir>, CLI <sir>, AZM <sir>,
-#> # IPM <sir>, MEM <sir>, MTR <sir>, CHL <sir>, COL <sir>, MUP <sir>, …
+#> Error: object 'PEN' not found
# }
diff --git a/reference/atc_online.html b/reference/atc_online.html
index d3e930465..7917ee94a 100644
--- a/reference/atc_online.html
+++ b/reference/atc_online.html
@@ -7,7 +7,7 @@