Skip to content

Commit

Permalink
Add parameters to limit concept count
Browse files Browse the repository at this point in the history
  • Loading branch information
gowthamrao committed May 9, 2024
1 parent 4cb90ea commit f3de058
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ Remotes:
ohdsi/CirceR,
ohdsi/SqlRender
License: Apache License (>= 2)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
Encoding: UTF-8
Language: en-US
36 changes: 36 additions & 0 deletions R/GetConceptRecordCount.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ getConceptRecordCount <- function(conceptIds = NULL,
cohortDatabaseSchema = NULL,
cohortTableName = NULL,
cohortDefinitionId = NULL,
stratifyByGender = FALSE,
stratifyByYear = FALSE,
stratifyByYearQuarter = FALSE,
stratifyByYearMonth = FALSE,
stratifyByAgeGroup = FALSE,
stratifyByIncidence = FALSE,
domainTableName = c(
"drug_exposure",
"condition_occurrence",
Expand Down Expand Up @@ -238,6 +244,36 @@ getConceptRecordCount <- function(conceptIds = NULL,
dplyr::arrange() |>
dplyr::mutate(combination = dplyr::row_number())

if (!stratifyByGender) {
iterations <- iterations |>
dplyr::filter(!genderConceptId %in% c(8507, 8532))
}

if (!stratifyByYear) {
iterations <- iterations |>
dplyr::filter(calendarType != 'Y')
}

if (!stratifyByYearQuarter) {
iterations <- iterations |>
dplyr::filter(calendarType != 'Q')
}

if (!stratifyByYearMonth) {
iterations <- iterations |>
dplyr::filter(calendarType != 'M')
}

if (!stratifyByAgeGroup) {
iterations <- iterations |>
dplyr::filter(useAgeGroup != 'Y')
}

if (!stratifyByIncidence) {
iterations <- iterations |>
dplyr::filter(incidence != 'Y')
}

existingOutput <- c()

for (i in (1:nrow(iterations))) {
Expand Down
6 changes: 6 additions & 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 f3de058

Please sign in to comment.