@@ -671,30 +671,31 @@ executeDiagnostics <- function(cohortDefinitionSet,
671
671
name = conceptCountsTable ,
672
672
databaseSchema = cdmDatabaseSchema )
673
673
674
-
675
- if (substr(conceptCountsTable , 1 , 1 ) == " #" ) {
676
- conceptCountsTableIsTemp <- TRUE
677
- } else {
678
- conceptCountsTableIsTemp <- FALSE
679
- conceptCountsTable <- conceptCountsTable
680
- dataSourceInfo <- getCdmDataSourceInformation(connection = connection ,
681
- cdmDatabaseSchema = cdmDatabaseSchema )
682
- vocabVersion <- dataSourceInfo $ vocabularyVersion
683
- vocabVersionExternalConceptCountsTable <- renderTranslateQuerySql(
684
- connection = connection ,
685
- sql = " SELECT DISTINCT vocabulary_version FROM @work_database_schema.@concept_counts_table;" ,
686
- work_database_schema = cohortDatabaseSchema ,
687
- concept_counts_table = conceptCountsTable ,
688
- snakeCaseToCamelCase = TRUE ,
689
- tempEmulationSchema = getOption(" sqlRenderTempEmulationSchena" )
690
- )
691
- if (! identical(vocabVersion , vocabVersionExternalConceptCountsTable [1 ,1 ])) {
692
- stop(paste0(" External concept counts table (" ,
693
- vocabVersionExternalConceptCountsTable ,
694
- " ) does not match database (" ,
695
- vocabVersion ,
696
- " ). Update concept_counts with createConceptCountsTable()" ))
697
- }
674
+ if (checkConceptCountsTableExists ) {
675
+ if (substr(conceptCountsTable , 1 , 1 ) == " #" ) {
676
+ conceptCountsTableIsTemp <- TRUE
677
+ } else {
678
+ conceptCountsTableIsTemp <- FALSE
679
+ conceptCountsTable <- conceptCountsTable
680
+ dataSourceInfo <- getCdmDataSourceInformation(connection = connection ,
681
+ cdmDatabaseSchema = cdmDatabaseSchema )
682
+ vocabVersion <- dataSourceInfo $ vocabularyVersion
683
+ vocabVersionExternalConceptCountsTable <- renderTranslateQuerySql(
684
+ connection = connection ,
685
+ sql = " SELECT DISTINCT vocabulary_version FROM @work_database_schema.@concept_counts_table;" ,
686
+ work_database_schema = cohortDatabaseSchema ,
687
+ concept_counts_table = conceptCountsTable ,
688
+ snakeCaseToCamelCase = TRUE ,
689
+ tempEmulationSchema = getOption(" sqlRenderTempEmulationSchena" )
690
+ )
691
+ if (! identical(vocabVersion , vocabVersionExternalConceptCountsTable [1 ,1 ])) {
692
+ stop(paste0(" External concept counts table (" ,
693
+ vocabVersionExternalConceptCountsTable ,
694
+ " ) does not match database (" ,
695
+ vocabVersion ,
696
+ " ). Update concept_counts with createConceptCountsTable()" ))
697
+ }
698
+ }
698
699
}
699
700
700
701
# Always export concept sets to csv
@@ -720,9 +721,6 @@ executeDiagnostics <- function(cohortDefinitionSet,
720
721
vocabularyDatabaseSchema = vocabularyDatabaseSchema ,
721
722
databaseId = databaseId ,
722
723
cohorts = cohortDefinitionSet ,
723
- runIncludedSourceConcepts = runIncludedSourceConcepts ,
724
- runOrphanConcepts = runOrphanConcepts ,
725
- runBreakdownIndexEvents = runBreakdownIndexEvents ,
726
724
exportFolder = exportFolder ,
727
725
minCellCount = minCellCount ,
728
726
conceptCountsDatabaseSchema = NULL ,
@@ -734,7 +732,6 @@ executeDiagnostics <- function(cohortDefinitionSet,
734
732
incremental = incremental ,
735
733
conceptIdTable = " #concept_ids" ,
736
734
recordKeepingFile = recordKeepingFile ,
737
- useAchilles = useAchilles ,
738
735
resultsDatabaseSchema = resultsDatabaseSchema
739
736
)
740
737
}
0 commit comments