diff --git a/R/PerformStringSearchForConcepts.R b/R/PerformStringSearchForConcepts.R index a839b8e..0056a17 100644 --- a/R/PerformStringSearchForConcepts.R +++ b/R/PerformStringSearchForConcepts.R @@ -116,7 +116,9 @@ performStringSearchForConcepts <- connection = connection, snakeCaseToCamelCase = TRUE ) |> - dplyr::tibble() + dplyr::tibble() |> + dplyr::mutate(searchString = eligibleToBeSearched[[i]]) |> + dplyr::relocate(searchString) } if (!hasData(data)) { @@ -126,10 +128,21 @@ performStringSearchForConcepts <- data <- data |> dplyr::bind_rows() |> dplyr::distinct() + + missingInResults <- + setdiff(searchPhrases, data$searchString |> unique()) + + if (length(missingInResults) > 0) { + warning(paste0( + "The following search phrases did not yield any results: ", + paste0(missingInResults, collapse = ", ") + )) + } if (all(nrow(data) > 0, "rank" %in% colnames(data))) { data <- data |> dplyr::group_by( + .data$searchString, .data$conceptId, .data$conceptName, .data$vocabularyId, diff --git a/man/getConceptRecordCount.Rd b/man/getConceptRecordCount.Rd index ee59fe9..dd6f068 100644 --- a/man/getConceptRecordCount.Rd +++ b/man/getConceptRecordCount.Rd @@ -21,6 +21,7 @@ getConceptRecordCount( stratifyByYearMonth = FALSE, stratifyByAgeGroup = FALSE, stratifyByIncidence = FALSE, + getOverallCounts = FALSE, domainTableName = c("drug_exposure", "condition_occurrence", "procedure_occurrence", "mesaurement", "observation") )