R Under development (unstable) (2025-11-16 r89026 ucrt) -- "Unsuffered Consequences" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(testthat) > library(CohortGenerator) Loading required package: DatabaseConnector Loading required package: R6 > > test_check("CohortGenerator") attempting to download GiBleed trying URL 'https://raw.githubusercontent.com/OHDSI/EunomiaDatasets/main/datasets/GiBleed/GiBleed_5.3.zip' Content type 'application/zip' length 6861852 bytes (6.5 MB) ================================================== downloaded 6.5 MB attempting to extract and load: D:\temp\2025_11_17_19_40_16_20920\RtmpW0Ne9E/GiBleed_5.3.zip to: D:\temp\2025_11_17_19_40_16_20920\RtmpW0Ne9E/GiBleed_5.3.sqlite Initiating cluster consisting only of main thread Generating cohort set took 0.57 secs Initiating cluster consisting only of main thread Generating cohort set took 0.65 secs Skipping cohorts already generated: Initiating cluster consisting only of main thread Generating cohort set took 0.64 secs Skipping cohorts already generated: 1, 2, 3, 4 Initiating cluster consisting only of main thread Generating cohort set took 0.06 secs Initiating cluster consisting only of main thread Generating cohort set took 0.48 secs Skipping cohorts already generated: Initiating cluster consisting only of main thread Generating cohort set took 0.54 secs Skipping cohorts already generated: 1, 2, 3, 4 Initiating cluster consisting only of main thread Generating cohort set took 0.07 secs Initiating cluster consisting only of main thread An error occurred while generating cohortName = Fail Cohort. Error: Error in `.createErrorReport()`: ! Error executing SQL: no such table: main.non_existant_table An error report has been created at d:/RCompile/CRANincoming/R-devel/CohortGenerator.Rcheck/tests/testthat/errorReportSql.txt [1] "Create cohorts with stopOnError = FALSE" Initiating cluster consisting only of main thread An error occurred while generating cohortName = Fail Cohort. Error: Error in `.createErrorReport()`: ! Error executing SQL: no such table: main.non_existant_table An error report has been created at d:/RCompile/CRANincoming/R-devel/CohortGenerator.Rcheck/tests/testthat/errorReportSql.txt Generating cohort set took 0.62 secs Skipping cohorts already generated: Initiating cluster consisting only of main thread An error occurred while generating cohortName = Fail Cohort. Error: Error in `.createErrorReport()`: ! Error executing SQL: no such table: main.non_existant_table An error report has been created at d:/RCompile/CRANincoming/R-devel/CohortGenerator.Rcheck/tests/testthat/errorReportSql.txt Generating cohort set took 0.62 secs Skipping cohorts already generated: 1, 2, 3, 4 Initiating cluster consisting only of main thread Generating cohort set took 0.13 secs Cohorts created in table main.cohort Skipping cohorts already generated: Initiating cluster consisting only of main thread Generating cohort set took 0.52 secs Generating sample set took 0.47 secs Generating sample set took 0.04 secs Generating sample set took 0.51 secs Generating sample set took 0.13 secs Initiating cluster consisting only of main thread Generating cohort set took 0.59 secs Initiating cluster consisting only of main thread Generating cohort set took 0.59 secs Initiating cluster consisting only of main thread Generating cohort set took 0.59 secs Initiating cluster consisting only of main thread Generating cohort set took 0.61 secs Initiating cluster consisting only of main thread Generating cohort set took 0.58 secs Initiating cluster consisting only of main thread Generating cohort set took 0.57 secs | | | 0% | |==== | 6% | |========= | 12% | |============= | 19% | |================== | 25% | |====================== | 31% | |========================== | 38% | |=============================== | 44% | |=================================== | 50% | |======================================= | 56% | |============================================ | 62% | |================================================ | 69% | |==================================================== | 75% | |========================================================= | 81% | |============================================================= | 88% | |================================================================== | 94% | |======================================================================| 100% | | | 0% | |==== | 6% | |========= | 12% | |============= | 19% | |================== | 25% | |====================== | 31% | |========================== | 38% | |=============================== | 44% | |=================================== | 50% | |======================================= | 56% | |============================================ | 62% | |================================================ | 69% | |==================================================== | 75% | |========================================================= | 81% | |============================================================= | 88% | |================================================================== | 94% | |======================================================================| 100% Generating negative control outcomes set took 0.18 secs | | | 0% | |==== | 6% | |========= | 12% | |============= | 19% | |================== | 25% | |====================== | 31% | |========================== | 38% | |=============================== | 44% | |=================================== | 50% | |======================================= | 56% | |============================================ | 62% | |================================================ | 69% | |==================================================== | 75% | |========================================================= | 81% | |============================================================= | 88% | |================================================================== | 94% | |======================================================================| 100% | | | 0% | |==== | 6% | |========= | 12% | |============= | 19% | |================== | 25% | |====================== | 31% | |========================== | 38% | |=============================== | 44% | |=================================== | 50% | |======================================= | 56% | |============================================ | 62% | |================================================ | 69% | |==================================================== | 75% | |========================================================= | 81% | |============================================================= | 88% | |================================================================== | 94% | |======================================================================| 100% Generating negative control outcomes set took 0.16 secs | | | 0% | |==== | 6% | |========= | 12% | |============= | 19% | |================== | 25% | |====================== | 31% | |========================== | 38% | |=============================== | 44% | |=================================== | 50% | |======================================= | 56% | |============================================ | 62% | |================================================ | 69% | |==================================================== | 75% | |========================================================= | 81% | |============================================================= | 88% | |================================================================== | 94% | |======================================================================| 100% | | | 0% | |==== | 6% | |========= | 12% | |============= | 19% | |================== | 25% | |====================== | 31% | |========================== | 38% | |=============================== | 44% | |=================================== | 50% | |======================================= | 56% | |============================================ | 62% | |================================================ | 69% | |==================================================== | 75% | |========================================================= | 81% | |============================================================= | 88% | |================================================================== | 94% | |======================================================================| 100% Generating negative control outcomes set took 0.19 secs Negative control set generation skipped | | | 0% | |==== | 6% | |========= | 12% | |============= | 19% | |================== | 25% | |====================== | 31% | |========================== | 38% | |=============================== | 44% | |=================================== | 50% | |======================================= | 56% | |============================================ | 62% | |================================================ | 69% | |==================================================== | 75% | |========================================================= | 81% | |============================================================= | 88% | |================================================================== | 94% | |======================================================================| 100% | | | 0% | |==== | 6% | |========= | 12% | |============= | 19% | |================== | 25% | |====================== | 31% | |========================== | 38% | |=============================== | 44% | |=================================== | 50% | |======================================= | 56% | |============================================ | 62% | |================================================ | 69% | |==================================================== | 75% | |========================================================= | 81% | |============================================================= | 88% | |================================================================== | 94% | |======================================================================| 100% Generating negative control outcomes set took 0.18 secs Negative control set generation skipped | | | 0% | |==== | 6% | |========= | 12% | |============= | 19% | |================== | 25% | |====================== | 31% | |========================== | 38% | |=============================== | 44% | |=================================== | 50% | |======================================= | 56% | |============================================ | 62% | |================================================ | 69% | |==================================================== | 75% | |========================================================= | 81% | |============================================================= | 88% | |================================================================== | 94% | |======================================================================| 100% | | | 0% | |==== | 6% | |========= | 12% | |============= | 19% | |================== | 25% | |====================== | 31% | |========================== | 38% | |=============================== | 44% | |=================================== | 50% | |======================================= | 56% | |============================================ | 62% | |================================================ | 69% | |==================================================== | 75% | |========================================================= | 81% | |============================================================= | 88% | |================================================================== | 94% | |======================================================================| 100% Generating negative control outcomes set took 0.18 secs Negative control set generation skipped Initiating cluster consisting only of main thread Generating cohort set took 0.6 secs | | | 0% | |==== | 6% | |========= | 12% | |============= | 19% | |================== | 25% | |====================== | 31% | |========================== | 38% | |=============================== | 44% | |=================================== | 50% | |======================================= | 56% | |============================================ | 62% | |================================================ | 69% | |==================================================== | 75% | |========================================================= | 81% | |============================================================= | 88% | |================================================================== | 94% | |======================================================================| 100% | | | 0% | |==== | 6% | |========= | 12% | |============= | 19% | |================== | 25% | |====================== | 31% | |========================== | 38% | |=============================== | 44% | |=================================== | 50% | |======================================= | 56% | |============================================ | 62% | |================================================ | 69% | |==================================================== | 75% | |========================================================= | 81% | |============================================================= | 88% | |================================================================== | 94% | |======================================================================| 100% Generating negative control outcomes set took 0.2 secs Initiating cluster consisting only of main thread Generating cohort set took 0.61 secs | | | 0% | |==== | 6% | |========= | 12% | |============= | 19% | |================== | 25% | |====================== | 31% | |========================== | 38% | |=============================== | 44% | |=================================== | 50% | |======================================= | 56% | |============================================ | 62% | |================================================ | 69% | |==================================================== | 75% | |========================================================= | 81% | |============================================================= | 88% | |================================================================== | 94% | |======================================================================| 100% | | | 0% | |==== | 6% | |========= | 12% | |============= | 19% | |================== | 25% | |====================== | 31% | |========================== | 38% | |=============================== | 44% | |=================================== | 50% | |======================================= | 56% | |============================================ | 62% | |================================================ | 69% | |==================================================== | 75% | |========================================================= | 81% | |============================================================= | 88% | |================================================================== | 94% | |======================================================================| 100% Generating negative control outcomes set took 0.16 secs Initiating cluster consisting only of main thread Generating cohort set took 0.64 secs | | | 0% | |==== | 6% | |========= | 12% | |============= | 19% | |================== | 25% | |====================== | 31% | |========================== | 38% | |=============================== | 44% | |=================================== | 50% | |======================================= | 56% | |============================================ | 62% | |================================================ | 69% | |==================================================== | 75% | |========================================================= | 81% | |============================================================= | 88% | |================================================================== | 94% | |======================================================================| 100% | | | 0% | |==== | 6% | |========= | 12% | |============= | 19% | |================== | 25% | |====================== | 31% | |========================== | 38% | |=============================== | 44% | |=================================== | 50% | |======================================= | 56% | |============================================ | 62% | |================================================ | 69% | |==================================================== | 75% | |========================================================= | 81% | |============================================================= | 88% | |================================================================== | 94% | |======================================================================| 100% Generating negative control outcomes set took 0.17 secs Initiating cluster consisting only of main thread Generating cohort set took 0.59 secs | | | 0% | |==== | 6% | |========= | 12% | |============= | 19% | |================== | 25% | |====================== | 31% | |========================== | 38% | |=============================== | 44% | |=================================== | 50% | |======================================= | 56% | |============================================ | 62% | |================================================ | 69% | |==================================================== | 75% | |========================================================= | 81% | |============================================================= | 88% | |================================================================== | 94% | |======================================================================| 100% | | | 0% | |==== | 6% | |========= | 12% | |============= | 19% | |================== | 25% | |====================== | 31% | |========================== | 38% | |=============================== | 44% | |=================================== | 50% | |======================================= | 56% | |============================================ | 62% | |================================================ | 69% | |==================================================== | 75% | |========================================================= | 81% | |============================================================= | 88% | |================================================================== | 94% | |======================================================================| 100% Generating negative control outcomes set took 0.16 secs Identifier expression: "targetId * 1000 + definitionId" Naming template: "@baseCohortName - @subsetDefinitionName" Contains 3 operations: *** CohortSubsetOperator *** Cohort Subset in cohorts: (11) where subset cohort start is within D: -99999 - D: 99999 of target cohort start and subset cohort start is within D: -99999 - D: 99999 of target cohort end SQL: CohortSubsetQb DROP TABLE IF EXISTS #S_1; SELECT A.subject_id, A.cohort_start_date, A.cohort_end_date INTO #S_1 FROM ( SELECT T.subject_id, T.cohort_start_date, T.cohort_end_date FROM @target_table T JOIN @cohort_database_schema.@cohort_table S ON T.subject_id = S.subject_id WHERE S.cohort_definition_id in (11) -- AND Cohort lies within window criteria AND (S.cohort_start_date >= DATEADD(d, -99999, T.cohort_start_date) AND S.cohort_start_date <= DATEADD(d, 99999, T.cohort_start_date)) AND (S.cohort_start_date >= DATEADD(d, -99999, T.cohort_end_date) AND S.cohort_start_date <= DATEADD(d, 99999, T.cohort_end_date)) GROUP BY T.subject_id, T.cohort_start_date, T.cohort_end_date HAVING COUNT (DISTINCT S.COHORT_DEFINITION_ID) >= 1 ) A ; *** LimitSubsetOperator *** Observation Criteria first ever occurence with at least 365 days prior observation SQL: LimitSubsetQb DROP TABLE IF EXISTS #S_1; SELECT c.subject_id, c.cohort_start_date, c.cohort_end_date INTO #S_1 FROM ( SELECT subject_id, cohort_start_date, cohort_end_date, row_number() over (partition by subject_id order by cohort_start_date ASC) ordinal FROM @target_table t ) c JOIN @cdm_database_schema.observation_period op ON c.subject_id = op.person_id AND c.cohort_start_date >= op.observation_period_start_date AND c.cohort_start_date <= op.observation_period_end_date WHERE c.ordinal = 1 AND DATEDIFF(day, op.observation_period_start_date, c.cohort_start_date) >= 365 AND DATEDIFF(day, c.cohort_start_date, op.observation_period_end_date) >= 0 ; *** DemographicSubsetOperator *** Demographic Criteria aged 18 - 64 SQL: DemographicSubsetQb DROP TABLE IF EXISTS #S_1; SELECT T.subject_id, T.cohort_start_date, T.cohort_end_date INTO #S_1 FROM @target_table T JOIN @cdm_database_schema.person p ON T.subject_id = p.person_id WHERE 1 = 1-- simplifies ternary logic AND YEAR(T.cohort_start_date) - p.year_of_birth >= 18 AND YEAR(T.cohort_start_date) - p.year_of_birth <= 64 ; Skipping cohorts already generated: Initiating cluster consisting only of main thread Generating cohort set took 0.82 secs Skipping cohorts already generated: 1, 2, 3, 4, 1001, 2001, 3001, 4001 Initiating cluster consisting only of main thread Generating cohort set took 0.08 secs Initiating cluster consisting only of main thread Generating cohort set took 1.41 secs Generating Template Cohort: test template Template Cohort complete: test template Skipping Template Cohort: test template Generating Template Cohort: my BAD cohort Error in `.createErrorReport()`: ! Error executing SQL: near "SOME": syntax error An error report has been created at d:/RCompile/CRANincoming/R-devel/CohortGenerator.Rcheck/tests/testthat/errorReportSql.txt Generating Template Cohort: my BAD cohort Error in `.createErrorReport()`: ! Error executing SQL: near "SOME": syntax error An error report has been created at d:/RCompile/CRANincoming/R-devel/CohortGenerator.Rcheck/tests/testthat/errorReportSql.txt Generating Template Cohort: All SNOMED Conditions (365 days po) Template Cohort complete: All SNOMED Conditions (365 days po) Generating Template Cohort: All RxNorm ingredient exposures Template Cohort complete: All RxNorm ingredient exposures Generating Template Cohort: All ATC class exposures (merged eras) Template Cohort complete: All ATC class exposures (merged eras) Generating Template Cohort: All ATC class exposures Template Cohort complete: All ATC class exposures Computing cohort validation checks Computed validation checks for 5 cohorts Generating validation check set took 0.02 secs [ FAIL 0 | WARN 1 | SKIP 3 | PASS 421 ] ══ Skipped tests (3) ═══════════════════════════════════════════════════════════ • On CRAN (3): 'test-ResultsDataModel.R:120:3', 'test-ResultsDataModel.R:162:3', 'test-dbms-platforms.R:101:3' [ FAIL 0 | WARN 1 | SKIP 3 | PASS 421 ] Warning message: call dbDisconnect() when finished working with a connection > > proc.time() user system elapsed 65.29 9.03 65.50