Skip to content

Commit

Permalink
use cdmDisconnect instead of dbDisconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
xihang-chen committed Jan 26, 2024
1 parent 7c9fd46 commit 0775e78
Show file tree
Hide file tree
Showing 33 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion R/achillesCodeUse.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' oa <- getCandidateCodes(cdm = cdm, keywords = "osteoarthritis")
#' result_achilles <- achillesCodeUse(list(oa = oa$concept_id), cdm = cdm)
#' result_achilles
#' DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE)
#' CDMConnector::cdmDisconnect(cdm)
#' }

achillesCodeUse <- function(x,

Check warning on line 23 in R/achillesCodeUse.R

View workflow job for this annotation

GitHub Actions / lint

file=R/achillesCodeUse.R,line=23,col=1,[object_name_linter] Variable and function name style should match snake_case or symbols.
Expand Down
2 changes: 1 addition & 1 deletion R/codesFromConceptSet.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#' path = system.file(package = "CodelistGenerator",
#' "concepts_for_mock"))
#' x
#' DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE)
#' CDMConnector::cdmDisconnect(cdm)
#' }
codesFromConceptSet <- function(path, cdm, withConceptDetails = FALSE) {
# initial checks
Expand Down
6 changes: 3 additions & 3 deletions R/codesInUse.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#' cdm = cdm)
#'
#' x
#' DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE)
#' CDMConnector::cdmDisconnect(cdm)
#' }
restrictToCodesInUse <- function(x,
cdm,
Expand Down Expand Up @@ -71,7 +71,7 @@ x
#' cdm <- mockVocabRef("database")
#' x <- codesInUse(cdm = cdm)
#' x
#' DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE)
#' CDMConnector::cdmDisconnect(cdm)
#' }
codesInUse <- function(cdm,
table = c("condition_occurrence",
Expand Down Expand Up @@ -128,7 +128,7 @@ if(!is.null(cdm[["achilles_results"]])){
#' cdm <- mockVocabRef("database")
#' x <- sourceCodesInUse(cdm = cdm)
#' x
#' DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE)
#' CDMConnector::cdmDisconnect(cdm)
#' }
sourceCodesInUse <- function(cdm,
table = c("condition_occurrence",
Expand Down
2 changes: 1 addition & 1 deletion R/compareCodelists.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#' codelist1 = codes1,
#' codelist2 = codes2
#' )
#' DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE)
#' CDMConnector::cdmDisconnect(cdm)
#' }
compareCodelists <- function(codelist1,
codelist2) {
Expand Down
4 changes: 2 additions & 2 deletions R/drugCodes.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#' \dontrun{
#' cdm <- mockVocabRef()
#' getATCCodes(cdm = cdm, level = "ATC 1st")
#' DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE)
#' CDMConnector::cdmDisconnect(cdm)
#' }
getATCCodes <- function(cdm,
level = c("ATC 1st"),
Expand Down Expand Up @@ -184,7 +184,7 @@ getATCCodes <- function(cdm,
#' \dontrun{
#'cdm <- mockVocabRef()
#'getDrugIngredientCodes(cdm = cdm, name = "Adalimumab")
#'DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE)
#'CDMConnector::cdmDisconnect(cdm)
#'}
getDrugIngredientCodes <- function(cdm,
name = NULL,
Expand Down
2 changes: 1 addition & 1 deletion R/findOrphanCodes.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#' includeAncestor = FALSE)
#'
#' orphan_codes
#' DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE)
#' CDMConnector::cdmDisconnect(cdm)
#' }
findOrphanCodes <- function(x,
cdm,
Expand Down
2 changes: 1 addition & 1 deletion R/getCandidateCodes.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
#' cdm = cdm,
#' keywords = "osteoarthritis"
#' )
#' DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE)
#' CDMConnector::cdmDisconnect(cdm)
#' }
getCandidateCodes <- function(cdm,
keywords,
Expand Down
2 changes: 1 addition & 1 deletion R/getICD10StandardCodes.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#' "ICD10 Chapter",
#' "ICD10 SubChapter"
#' ))
#' DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE)
#' CDMConnector::cdmDisconnect(cdm)
#' }
getICD10StandardCodes <- function(cdm,
level = c(
Expand Down
2 changes: 1 addition & 1 deletion R/getMappings.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#' candidateCodelist = codes,
#' nonStandardVocabularies = "READ"
#')
#'DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE)
#'CDMConnector::cdmDisconnect(cdm)
#'}
getMappings <- function(candidateCodelist,
cdm = NULL,
Expand Down
2 changes: 1 addition & 1 deletion R/mockVocabRef.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#' \dontrun{
#' cdm <- mockVocabRef()
#' cdm
#' DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE)
#' CDMConnector::cdmDisconnect(cdm)
#' }
mockVocabRef <- function(backend = "database") {
errorMessage <- checkmate::makeAssertCollection()
Expand Down
4 changes: 2 additions & 2 deletions R/summariseCodeUse.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#' poliovirus_vaccine = poliovirus_vaccine)
#'results <- summariseCodeUse(cs,cdm = cdm)
#'results
#'DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE)
#'CDMConnector::cdmDisconnect(cdm)
#'}
#'
summariseCodeUse <- function(x,
Expand Down Expand Up @@ -116,7 +116,7 @@ summariseCodeUse <- function(x,
#' minCellCount = 0)
#'
#'results_cohort_mult
#'DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE)
#'CDMConnector::cdmDisconnect(cdm)
#'}
summariseCohortCodeUse <- function(x,
cdm,
Expand Down
12 changes: 6 additions & 6 deletions R/vocabUtilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#' \dontrun{
#' cdm <- mockVocabRef()
#' getVocabVersion(cdm = cdm)
#' DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE)
#' CDMConnector::cdmDisconnect(cdm)
#' }
getVocabVersion <- function(cdm) {
errorMessage <- checkmate::makeAssertCollection()
Expand Down Expand Up @@ -62,7 +62,7 @@ getVocabVersion <- function(cdm) {
#' \dontrun{
#' cdm <- mockVocabRef()
#' getDomains(cdm = cdm)
#' DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE)
#' CDMConnector::cdmDisconnect(cdm)
#' }
getDomains <- function(cdm,
standardConcept = "Standard") {
Expand Down Expand Up @@ -134,7 +134,7 @@ getDomains <- function(cdm,
#' \dontrun{
#' cdm <- mockVocabRef()
#' getVocabularies(cdm = cdm)
#' DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE)
#' CDMConnector::cdmDisconnect(cdm)
#' }

getVocabularies <- function(cdm) {
Expand Down Expand Up @@ -174,7 +174,7 @@ getVocabularies <- function(cdm) {
#' \dontrun{
#' cdm <- mockVocabRef()
#' getConceptClassId(cdm = cdm, domain = "drug")
#' DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE)
#' CDMConnector::cdmDisconnect(cdm)
#' }

getConceptClassId <- function(cdm,
Expand Down Expand Up @@ -256,7 +256,7 @@ getConceptClassId <- function(cdm,
#' \dontrun{
#' cdm <- mockVocabRef()
#' getDoseForm(cdm = cdm)
#' DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE)
#' CDMConnector::cdmDisconnect(cdm)
#' }

getDoseForm <- function(cdm) {
Expand Down Expand Up @@ -313,7 +313,7 @@ getDoseForm <- function(cdm) {
#' \dontrun{
#' cdm <- mockVocabRef()
#' getDescendants(cdm = cdm, conceptId = 1)
#' DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE)
#' CDMConnector::cdmDisconnect(cdm)
#' }

getDescendants <- function(cdm,
Expand Down
2 changes: 1 addition & 1 deletion man/achillesCodeUse.Rd

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

2 changes: 1 addition & 1 deletion man/codesFromConceptSet.Rd

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

2 changes: 1 addition & 1 deletion man/codesInUse.Rd

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

2 changes: 1 addition & 1 deletion man/compareCodelists.Rd

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

2 changes: 1 addition & 1 deletion man/findOrphanCodes.Rd

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

2 changes: 1 addition & 1 deletion man/getATCCodes.Rd

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

2 changes: 1 addition & 1 deletion man/getCandidateCodes.Rd

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

2 changes: 1 addition & 1 deletion man/getDescendants.Rd

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

2 changes: 1 addition & 1 deletion man/getDomains.Rd

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

2 changes: 1 addition & 1 deletion man/getDoseForm.Rd

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

2 changes: 1 addition & 1 deletion man/getDrugIngredientCodes.Rd

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

2 changes: 1 addition & 1 deletion man/getICD10StandardCodes.Rd

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

2 changes: 1 addition & 1 deletion man/getMappings.Rd

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

2 changes: 1 addition & 1 deletion man/getVocabVersion.Rd

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

2 changes: 1 addition & 1 deletion man/getVocabularies.Rd

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

2 changes: 1 addition & 1 deletion man/getconceptClassId.Rd

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

2 changes: 1 addition & 1 deletion man/mockVocabRef.Rd

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

2 changes: 1 addition & 1 deletion man/restrictToCodesInUse.Rd

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

2 changes: 1 addition & 1 deletion man/sourceCodesInUse.Rd

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

2 changes: 1 addition & 1 deletion man/summariseCodeUse.Rd

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

2 changes: 1 addition & 1 deletion man/summariseCohortCodeUse.Rd

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

0 comments on commit 0775e78

Please sign in to comment.