diff --git a/R/achillesCodeUse.R b/R/achillesCodeUse.R index ae7fe65..bcda29a 100644 --- a/R/achillesCodeUse.R +++ b/R/achillesCodeUse.R @@ -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, diff --git a/R/codesFromConceptSet.R b/R/codesFromConceptSet.R index b68d739..5154d29 100644 --- a/R/codesFromConceptSet.R +++ b/R/codesFromConceptSet.R @@ -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 diff --git a/R/codesInUse.R b/R/codesInUse.R index ce95f5f..0282ed8 100644 --- a/R/codesInUse.R +++ b/R/codesInUse.R @@ -19,7 +19,7 @@ #' cdm = cdm) #' #' x -#' DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE) +#' CDMConnector::cdmDisconnect(cdm) #' } restrictToCodesInUse <- function(x, cdm, @@ -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", @@ -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", diff --git a/R/compareCodelists.R b/R/compareCodelists.R index f255518..dcc1717 100644 --- a/R/compareCodelists.R +++ b/R/compareCodelists.R @@ -42,7 +42,7 @@ #' codelist1 = codes1, #' codelist2 = codes2 #' ) -#' DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE) +#' CDMConnector::cdmDisconnect(cdm) #' } compareCodelists <- function(codelist1, codelist2) { diff --git a/R/drugCodes.R b/R/drugCodes.R index 48ce4a7..efc937b 100644 --- a/R/drugCodes.R +++ b/R/drugCodes.R @@ -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"), @@ -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, diff --git a/R/findOrphanCodes.R b/R/findOrphanCodes.R index 456e2cb..d0d064d 100644 --- a/R/findOrphanCodes.R +++ b/R/findOrphanCodes.R @@ -44,7 +44,7 @@ #' includeAncestor = FALSE) #' #' orphan_codes -#' DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE) +#' CDMConnector::cdmDisconnect(cdm) #' } findOrphanCodes <- function(x, cdm, diff --git a/R/getCandidateCodes.R b/R/getCandidateCodes.R index 72c4dcd..ebd994b 100644 --- a/R/getCandidateCodes.R +++ b/R/getCandidateCodes.R @@ -58,7 +58,7 @@ #' cdm = cdm, #' keywords = "osteoarthritis" #' ) -#' DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE) +#' CDMConnector::cdmDisconnect(cdm) #' } getCandidateCodes <- function(cdm, keywords, diff --git a/R/getICD10StandardCodes.R b/R/getICD10StandardCodes.R index f61d7c2..11e9f83 100644 --- a/R/getICD10StandardCodes.R +++ b/R/getICD10StandardCodes.R @@ -22,7 +22,7 @@ #' "ICD10 Chapter", #' "ICD10 SubChapter" #' )) -#' DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE) +#' CDMConnector::cdmDisconnect(cdm) #' } getICD10StandardCodes <- function(cdm, level = c( diff --git a/R/getMappings.R b/R/getMappings.R index 31e5567..a0a55ba 100644 --- a/R/getMappings.R +++ b/R/getMappings.R @@ -36,7 +36,7 @@ #' candidateCodelist = codes, #' nonStandardVocabularies = "READ" #') -#'DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE) +#'CDMConnector::cdmDisconnect(cdm) #'} getMappings <- function(candidateCodelist, cdm = NULL, diff --git a/R/mockVocabRef.R b/R/mockVocabRef.R index 06ed74e..dc47443 100644 --- a/R/mockVocabRef.R +++ b/R/mockVocabRef.R @@ -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() diff --git a/R/summariseCodeUse.R b/R/summariseCodeUse.R index 123c06d..67ef5b7 100644 --- a/R/summariseCodeUse.R +++ b/R/summariseCodeUse.R @@ -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, @@ -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, diff --git a/R/vocabUtilities.R b/R/vocabUtilities.R index f67d697..a41f584 100644 --- a/R/vocabUtilities.R +++ b/R/vocabUtilities.R @@ -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() @@ -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") { @@ -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) { @@ -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, @@ -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) { @@ -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, diff --git a/man/achillesCodeUse.Rd b/man/achillesCodeUse.Rd index b53b8fd..adcc11a 100644 --- a/man/achillesCodeUse.Rd +++ b/man/achillesCodeUse.Rd @@ -29,6 +29,6 @@ cdm <- mockVocabRef("database") 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) } } diff --git a/man/codesFromConceptSet.Rd b/man/codesFromConceptSet.Rd index 521709b..59bfb1a 100644 --- a/man/codesFromConceptSet.Rd +++ b/man/codesFromConceptSet.Rd @@ -28,6 +28,6 @@ x <- codesFromConceptSet(cdm = cdm, path = system.file(package = "CodelistGenerator", "concepts_for_mock")) x -DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE) +CDMConnector::cdmDisconnect(cdm) } } diff --git a/man/codesInUse.Rd b/man/codesInUse.Rd index 7570c94..6c4bb92 100644 --- a/man/codesInUse.Rd +++ b/man/codesInUse.Rd @@ -26,6 +26,6 @@ Get codes used in the database cdm <- mockVocabRef("database") x <- codesInUse(cdm = cdm) x -DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE) +CDMConnector::cdmDisconnect(cdm) } } diff --git a/man/compareCodelists.Rd b/man/compareCodelists.Rd index 531a6e0..a3ee7b9 100644 --- a/man/compareCodelists.Rd +++ b/man/compareCodelists.Rd @@ -36,6 +36,6 @@ compareCodelists( codelist1 = codes1, codelist2 = codes2 ) -DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE) +CDMConnector::cdmDisconnect(cdm) } } diff --git a/man/findOrphanCodes.Rd b/man/findOrphanCodes.Rd index dbea8b6..9cb7b5f 100644 --- a/man/findOrphanCodes.Rd +++ b/man/findOrphanCodes.Rd @@ -71,6 +71,6 @@ includeDescendants = TRUE, includeAncestor = FALSE) orphan_codes -DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE) +CDMConnector::cdmDisconnect(cdm) } } diff --git a/man/getATCCodes.Rd b/man/getATCCodes.Rd index 50d870a..f7413ac 100644 --- a/man/getATCCodes.Rd +++ b/man/getATCCodes.Rd @@ -44,6 +44,6 @@ Get descendant codes for ATC levels \dontrun{ cdm <- mockVocabRef() getATCCodes(cdm = cdm, level = "ATC 1st") -DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE) +CDMConnector::cdmDisconnect(cdm) } } diff --git a/man/getCandidateCodes.Rd b/man/getCandidateCodes.Rd index 98c055c..a340fa0 100644 --- a/man/getCandidateCodes.Rd +++ b/man/getCandidateCodes.Rd @@ -63,6 +63,6 @@ CodelistGenerator::getCandidateCodes( cdm = cdm, keywords = "osteoarthritis" ) -DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE) +CDMConnector::cdmDisconnect(cdm) } } diff --git a/man/getDescendants.Rd b/man/getDescendants.Rd index 01244c2..a2312d0 100644 --- a/man/getDescendants.Rd +++ b/man/getDescendants.Rd @@ -40,6 +40,6 @@ getDescendants \dontrun{ cdm <- mockVocabRef() getDescendants(cdm = cdm, conceptId = 1) -DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE) +CDMConnector::cdmDisconnect(cdm) } } diff --git a/man/getDomains.Rd b/man/getDomains.Rd index 068ee29..80abd44 100644 --- a/man/getDomains.Rd +++ b/man/getDomains.Rd @@ -23,6 +23,6 @@ getDomains \dontrun{ cdm <- mockVocabRef() getDomains(cdm = cdm) -DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE) +CDMConnector::cdmDisconnect(cdm) } } diff --git a/man/getDoseForm.Rd b/man/getDoseForm.Rd index 472a984..f59982d 100644 --- a/man/getDoseForm.Rd +++ b/man/getDoseForm.Rd @@ -19,6 +19,6 @@ getDoseForm \dontrun{ cdm <- mockVocabRef() getDoseForm(cdm = cdm) -DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE) +CDMConnector::cdmDisconnect(cdm) } } diff --git a/man/getDrugIngredientCodes.Rd b/man/getDrugIngredientCodes.Rd index 84233d3..8068c93 100644 --- a/man/getDrugIngredientCodes.Rd +++ b/man/getDrugIngredientCodes.Rd @@ -47,6 +47,6 @@ Get descendant codes for drug ingredients \dontrun{ cdm <- mockVocabRef() getDrugIngredientCodes(cdm = cdm, name = "Adalimumab") -DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE) +CDMConnector::cdmDisconnect(cdm) } } diff --git a/man/getICD10StandardCodes.Rd b/man/getICD10StandardCodes.Rd index f64091e..fb570a2 100644 --- a/man/getICD10StandardCodes.Rd +++ b/man/getICD10StandardCodes.Rd @@ -42,6 +42,6 @@ getICD10StandardCodes(cdm = cdm, level = c( "ICD10 Chapter", "ICD10 SubChapter" )) -DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE) +CDMConnector::cdmDisconnect(cdm) } } diff --git a/man/getMappings.Rd b/man/getMappings.Rd index 51ef633..65365c2 100644 --- a/man/getMappings.Rd +++ b/man/getMappings.Rd @@ -36,6 +36,6 @@ CodelistGenerator::getMappings( candidateCodelist = codes, nonStandardVocabularies = "READ" ) -DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE) +CDMConnector::cdmDisconnect(cdm) } } diff --git a/man/getVocabVersion.Rd b/man/getVocabVersion.Rd index aaa25c8..547b687 100644 --- a/man/getVocabVersion.Rd +++ b/man/getVocabVersion.Rd @@ -19,6 +19,6 @@ getVocabVersion \dontrun{ cdm <- mockVocabRef() getVocabVersion(cdm = cdm) -DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE) +CDMConnector::cdmDisconnect(cdm) } } diff --git a/man/getVocabularies.Rd b/man/getVocabularies.Rd index a7ffd82..cad4690 100644 --- a/man/getVocabularies.Rd +++ b/man/getVocabularies.Rd @@ -19,6 +19,6 @@ getVocabularies \dontrun{ cdm <- mockVocabRef() getVocabularies(cdm = cdm) -DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE) +CDMConnector::cdmDisconnect(cdm) } } diff --git a/man/getconceptClassId.Rd b/man/getconceptClassId.Rd index 7f10051..2f567e9 100644 --- a/man/getconceptClassId.Rd +++ b/man/getconceptClassId.Rd @@ -25,6 +25,6 @@ getConceptClassId \dontrun{ cdm <- mockVocabRef() getConceptClassId(cdm = cdm, domain = "drug") -DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE) +CDMConnector::cdmDisconnect(cdm) } } diff --git a/man/mockVocabRef.Rd b/man/mockVocabRef.Rd index ca32cae..62d0665 100644 --- a/man/mockVocabRef.Rd +++ b/man/mockVocabRef.Rd @@ -19,6 +19,6 @@ Generate example vocabulary database \dontrun{ cdm <- mockVocabRef() cdm -DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE) +CDMConnector::cdmDisconnect(cdm) } } diff --git a/man/restrictToCodesInUse.Rd b/man/restrictToCodesInUse.Rd index 0b3679a..8d720be 100644 --- a/man/restrictToCodesInUse.Rd +++ b/man/restrictToCodesInUse.Rd @@ -36,6 +36,6 @@ x <- restrictToCodesInUse(list("cs1" = codes$concept_id, cdm = cdm) x -DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE) +CDMConnector::cdmDisconnect(cdm) } } diff --git a/man/sourceCodesInUse.Rd b/man/sourceCodesInUse.Rd index b6ca2eb..d50140d 100644 --- a/man/sourceCodesInUse.Rd +++ b/man/sourceCodesInUse.Rd @@ -26,6 +26,6 @@ Get source codes used in the database cdm <- mockVocabRef("database") x <- sourceCodesInUse(cdm = cdm) x -DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE) +CDMConnector::cdmDisconnect(cdm) } } diff --git a/man/summariseCodeUse.Rd b/man/summariseCodeUse.Rd index 70cf178..cf7b811 100644 --- a/man/summariseCodeUse.Rd +++ b/man/summariseCodeUse.Rd @@ -54,7 +54,7 @@ cs <- list(acetiminophen = acetiminophen, poliovirus_vaccine = poliovirus_vaccine) results <- summariseCodeUse(cs,cdm = cdm) results -DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE) +CDMConnector::cdmDisconnect(cdm) } } diff --git a/man/summariseCohortCodeUse.Rd b/man/summariseCohortCodeUse.Rd index 877391e..5630cf4 100644 --- a/man/summariseCohortCodeUse.Rd +++ b/man/summariseCohortCodeUse.Rd @@ -73,6 +73,6 @@ summariseCohortCodeUse(list(cs = c(260139,19133873)), minCellCount = 0) results_cohort_mult -DBI::dbDisconnect(attr(cdm, "dbcon"), shutdown = TRUE) +CDMConnector::cdmDisconnect(cdm) } }