1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 10:31:53 +02:00

(v1.7.1.9063) not_intrinsic_resistant

This commit is contained in:
2021-12-09 10:48:25 +01:00
parent e63defe324
commit e18c49ed93
32 changed files with 275 additions and 185 deletions

View File

@ -96,6 +96,7 @@
#' mo_ref("E. coli") # "Castellani et al., 1919"
#' mo_authors("E. coli") # "Castellani et al."
#' mo_year("E. coli") # 1919
#' mo_lpsn("E. coli") # 776057 (LPSN record ID)
#'
#' # abbreviations known in the field -----------------------------------------
#' mo_genus("MRSA") # "Staphylococcus"
@ -538,6 +539,19 @@ mo_year <- function(x, language = get_locale(), ...) {
suppressWarnings(as.integer(x))
}
#' @rdname mo_property
#' @export
mo_lpsn <- function(x, language = get_locale(), ...) {
if (missing(x)) {
# this tries to find the data and an <mo> column
x <- find_mo_col(fn = "mo_rank")
}
meet_criteria(x, allow_NA = TRUE)
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
mo_validate(x = x, property = "species_id", language = language, ...)
}
#' @rdname mo_property
#' @export
mo_rank <- function(x, language = get_locale(), ...) {
@ -724,6 +738,8 @@ mo_validate <- function(x, property, language, ...) {
if (property == "mo") {
return(set_clean_class(x, new_class = c("mo", "character")))
} else if (property == "species_id") {
return(as.double(x))
} else if (property == "snomed") {
return(as.double(eval(parse(text = x))))
} else {