1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 09:51:48 +02:00

prepare for CRAN

This commit is contained in:
2023-10-20 14:51:48 +02:00
parent 7dc96794be
commit 7cda9e575b
46 changed files with 7863 additions and 5663 deletions

View File

@ -63,7 +63,7 @@ expect_stdout(print(ab_name("amox", language = NULL)))
expect_equal(ab_name("21066-6", language = NULL), "Ampicillin")
expect_equal(
ab_loinc("ampicillin"),
c("21066-6", "3355-5", "33562-0", "33919-2", "43883-8", "43884-6", "87604-5")
c("101477-8", "101478-6", "18864-9", "18865-6", "20374-5", "21066-6", "23618-2", "27-3", "28-1", "29-9", "30-7", "31-5", "32-3", "33-1", "3355-5", "33562-0", "33919-2", "34-9", "43883-8", "43884-6", "6979-9", "6980-7", "87604-5")
)
expect_true(ab_url("AMX") %like% "whocc.no")

View File

@ -78,19 +78,19 @@ ab6 <- antibiogram(example_isolates,
syndromic_group = "ward")
# with a custom language, though this will be determined automatically
# (i.e., this table will be in Spanish on Spanish systems)
# (i.e., this table will be in Dutch on Dutch systems)
ex1 <- example_isolates[which(mo_genus() == "Escherichia"), ]
ab7 <- antibiogram(ex1,
antibiotics = aminoglycosides(),
ab_transform = "name",
syndromic_group = ifelse(ex1$ward == "ICU",
"UCI", "No UCI"),
language = "es")
"IC", "Geen IC"),
language = "nl")
expect_inherits(ab6, "antibiogram")
expect_inherits(ab7, "antibiogram")
expect_equal(colnames(ab6), c("Syndromic Group", "Pathogen (N min-max)", "AMK", "GEN", "IPM", "KAN", "MEM", "TOB"))
expect_equal(colnames(ab7), c("Grupo sindrómico", "Patógeno (N min-max)", "Amikacina", "Gentamicina", "Tobramicina"))
expect_equal(colnames(ab7), c("Syndroomgroep", "Pathogeen (N min-max)", "Amikacine", "Gentamicine", "Tobramycine"))
# Weighted-incidence syndromic combination antibiogram (WISCA) ---------

View File

@ -42,7 +42,7 @@ expect_equal(
)
expect_equal(
sum(first_isolate(x = example_isolates, method = "phenotype-based", info = TRUE), na.rm = TRUE),
1379
1373
)
# Phenotype-based, using key antimicrobials
@ -53,7 +53,7 @@ expect_equal(
type = "keyantimicrobials",
antifungal = NULL, info = TRUE
), na.rm = TRUE),
1395
1376
)
expect_equal(
sum(first_isolate(
@ -62,7 +62,7 @@ expect_equal(
type = "keyantimicrobials",
antifungal = NULL, info = TRUE, ignore_I = FALSE
), na.rm = TRUE),
1418
1396
)
@ -93,7 +93,7 @@ expect_true(
col_specimen = "specimen",
filter_specimen = "Urine",
info = TRUE
), na.rm = TRUE) < 1501
), na.rm = TRUE) < 1400
)
# same, but now exclude ICU
expect_true(
@ -107,7 +107,7 @@ expect_true(
col_icu = x$ward == "ICU",
icu_exclude = TRUE,
info = TRUE
), na.rm = TRUE) < 1501
), na.rm = TRUE) < 1000
)
# "No isolates found"
@ -193,7 +193,7 @@ expect_equal(
),
na.rm = TRUE
),
1382
1376
)
# unknown MOs
@ -201,23 +201,23 @@ test_unknown <- example_isolates
test_unknown$mo <- ifelse(test_unknown$mo == "B_ESCHR_COLI", "UNKNOWN", test_unknown$mo)
expect_equal(
sum(first_isolate(test_unknown, include_unknown = FALSE)),
1108
1106
)
expect_equal(
sum(first_isolate(test_unknown, include_unknown = TRUE)),
1591
1589
)
test_unknown$mo <- ifelse(test_unknown$mo == "UNKNOWN", NA, test_unknown$mo)
expect_equal(
sum(first_isolate(test_unknown)),
1108
1106
)
# empty sir results
expect_equal(
sum(first_isolate(example_isolates, include_untested_sir = FALSE)),
1366
1360
)
# shortcuts