R/getRxCuiViaMayTreat.R

Defines functions getRxCuiViaMayTreat

Documented in getRxCuiViaMayTreat

#' @rdname getRxCuiViaMayTreat
#' @export

getRxCuiViaMayTreat <- function(strmaytreat){

  strmaytreat <- tolower(gsub(" ","",strmaytreat))
  resMaytreat[,t := grepl(strmaytreat, maytreat)]
  resMaytreat <- resMaytreat %>%
    filter(t == TRUE) %>%
    select(RxCui, Name, rxclassMinConceptItem.classId, rxclassMinConceptItem.className) %>%
    arrange(rxclassMinConceptItem.className) %>% unique()
  colnames(resMaytreat)[3:4] <- c("MinConcept.Id", "MinConcept.Name")
  resMaytreat

}
DHLab-CGU/pharm documentation built on July 2, 2022, 7:16 a.m.