Skip to content

Commit

Permalink
Update to string search
Browse files Browse the repository at this point in the history
  • Loading branch information
gowthamrao committed Jun 19, 2024
1 parent 6f5de62 commit 4a8ec6d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
15 changes: 14 additions & 1 deletion R/PerformStringSearchForConcepts.R
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ performStringSearchForConcepts <-
connection = connection,
snakeCaseToCamelCase = TRUE
) |>
dplyr::tibble()
dplyr::tibble() |>
dplyr::mutate(searchString = eligibleToBeSearched[[i]]) |>
dplyr::relocate(searchString)
}

if (!hasData(data)) {
Expand All @@ -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,
Expand Down
1 change: 1 addition & 0 deletions man/getConceptRecordCount.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4a8ec6d

Please sign in to comment.