R/has_trn.R

Defines functions has_trn

Documented in has_trn

#' Check whether each element of input includes a trial registration number

#' @param x A character vector.

#' @return Boolean, length of input
#' @export
#' @examples
#' has_trn(c("NCT00312962", "hello", "euctr2020-001808-42", NA))

has_trn <- function(x) {
  stringr::str_detect(x, paste0(ctregistries::registries$trn_regex,
                                collapse = "|")
  )
}
maia-sh/ctregistries documentation built on July 20, 2024, 8:08 p.m.