From 3a7c0d8c1a3fd1b81ffbd937a60084a919b83c10 Mon Sep 17 00:00:00 2001 From: javier-gracia-tabuenca-tuni Date: Fri, 12 Jun 2026 10:57:00 +0300 Subject: [PATCH 1/3] Add `visitSourceGroupConceptIds` option to `runApiServer` and pass to code counts build --- R/runApiServer.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/runApiServer.R b/R/runApiServer.R index b165d98..a645114 100644 --- a/R/runApiServer.R +++ b/R/runApiServer.R @@ -35,6 +35,7 @@ runApiServer <- function( host = "127.0.0.1", port = 8564, buildCountsTable = FALSE, + visitSourceGroupConceptIds = 0, ...) { # # VALIDATE @@ -62,7 +63,7 @@ runApiServer <- function( if (buildCountsTable == TRUE) { ParallelLogger::logInfo("Building code counts tables") - createCodeCountsTables(CDMdbHandler, codeCountsTable = "code_counts") + createCodeCountsTables(CDMdbHandler, codeCountsTable = "code_counts", visitSourceGroupConceptIds = visitSourceGroupConceptIds) } # Call getConceptsWithCodeCounts, to populate the cache From 3e21b8cbd7f2d867bda244100622956d324b6c90 Mon Sep 17 00:00:00 2001 From: javier-gracia-tabuenca-tuni Date: Fri, 12 Jun 2026 10:57:30 +0300 Subject: [PATCH 2/3] docs: add `visitSourceGroupConceptIds` argument to `runApiServer` Rd usage --- man/runApiServer.Rd | 1 + 1 file changed, 1 insertion(+) diff --git a/man/runApiServer.Rd b/man/runApiServer.Rd index 4e14fb1..47dc978 100644 --- a/man/runApiServer.Rd +++ b/man/runApiServer.Rd @@ -9,6 +9,7 @@ runApiServer( host = "127.0.0.1", port = 8564, buildCountsTable = FALSE, + visitSourceGroupConceptIds = 0, ... ) } From 7b2e431e6985ec894838e7df5078c5d52c8c9310 Mon Sep 17 00:00:00 2001 From: javier-gracia-tabuenca-tuni Date: Fri, 12 Jun 2026 11:36:47 +0300 Subject: [PATCH 3/3] docs: document `visitSourceGroupConceptIds` parameter in `runApiServer` roxygen and Rd --- R/runApiServer.R | 1 + man/runApiServer.Rd | 2 ++ 2 files changed, 3 insertions(+) diff --git a/R/runApiServer.R b/R/runApiServer.R index a645114..bcb2f77 100644 --- a/R/runApiServer.R +++ b/R/runApiServer.R @@ -10,6 +10,7 @@ #' @param host Host address to run the API server on. Defaults to "127.0.0.1" #' @param port Port number to run the API server on. Defaults to 8564 #' @param buildCountsTable Logical indicating whether to build code counts tables. Defaults to FALSE +#' @param visitSourceGroupConceptIds Numeric vector of source concept IDs used to define visit source groups when `buildCountsTable = TRUE`. Defaults to `0`. #' @param ... Additional arguments passed to plumber::pr_run() #' #' @importFrom plumber pr pr_run pr_set_docs pr_set_api_spec diff --git a/man/runApiServer.Rd b/man/runApiServer.Rd index 47dc978..66ec98a 100644 --- a/man/runApiServer.Rd +++ b/man/runApiServer.Rd @@ -23,6 +23,8 @@ If NULL, uses test Eunomia database} \item{buildCountsTable}{Logical indicating whether to build code counts tables. Defaults to FALSE} +\item{visitSourceGroupConceptIds}{Numeric vector of source concept IDs used to define visit source groups when \code{buildCountsTable = TRUE}. Defaults to \code{0}.} + \item{...}{Additional arguments passed to plumber::pr_run()} } \description{