Skip to content

Commit

Permalink
d
Browse files Browse the repository at this point in the history
  • Loading branch information
gowthamrao committed Jul 25, 2024
1 parent 4a8ec6d commit cec7f1e
Show file tree
Hide file tree
Showing 2 changed files with 155 additions and 93 deletions.
24 changes: 12 additions & 12 deletions R/ConvertConceptSetDataFrameToExpression.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,6 @@ convertConceptSetDataFrameToExpression <-
conceptSetExpressionDataFrame$conceptClassId <- as.character("")
}

if (selectAllDescendants) {
conceptSetExpressionDataFrame <-
dplyr::bind_rows(
conceptSetExpressionDataFrame |>
dplyr::filter(.data$standardConcept == "S") |>
dplyr::mutate(includeDescendants = TRUE),
conceptSetExpressionDataFrame |>
dplyr::filter(!.data$standardConcept == "S") |>
dplyr::mutate(includeDescendants = FALSE)
)
}

if (updateVocabularyFields) {
if (is.null(vocabularyDatabaseSchema)) {
stop(
Expand Down Expand Up @@ -152,6 +140,18 @@ convertConceptSetDataFrameToExpression <-
)
)
}

if (selectAllDescendants) {
conceptSetExpressionDataFrame <-
dplyr::bind_rows(
conceptSetExpressionDataFrame |>
dplyr::filter(.data$standardConcept == "S") |>
dplyr::mutate(includeDescendants = TRUE),
conceptSetExpressionDataFrame |>
dplyr::filter(!.data$standardConcept == "S") |>
dplyr::mutate(includeDescendants = FALSE)
)
}

# note: r dataframe objects are always expected to have variables in camel case.
# so the case conversion below should always be valid, if convention is followed
Expand Down
Loading

0 comments on commit cec7f1e

Please sign in to comment.