R/double_query_mrconso.R

Defines functions double_query_mrconso

Documented in double_query_mrconso

#' Searching mrconso with 2 LIKE phrases
#' @import mySeagull
#' @export
#' 
double_query_mrconso <-
        function(search_word_01, search_word_02, limit_1 = FALSE) {
                                        if (limit_1 == TRUE) {
                                                sql_statement <- paste0("SELECT CUI, STR FROM MRCONSO WHERE STR LIKE '%", search_word_01, "%' AND STR LIKE '%", search_word_02, "%' AND LAT = 'ENG' AND ISPREF = 'Y' 
                                                                LIMIT 1;")
                                                cohort <- mySeagull::get_query("umls", sql_statement)
                                                return(cohort)
                                        } else {
                                                sql_statement <- paste0("SELECT CUI, STR FROM MRCONSO WHERE STR LIKE '%", search_word_01, "%' AND STR LIKE '%", search_word_02, "%' AND LAT = 'ENG' AND ISPREF = 'Y';")
                                                cohort <- mySeagull::get_query("umls", sql_statement)
                                                return(cohort)
                                        }
                                }
patelm9/cartographR documentation built on Dec. 18, 2019, 5:54 a.m.