1
- library(SqlRender )
2
1
library(dplyr )
3
- library(readr )
4
2
5
3
6
4
for (nm in names(testServers )) {
@@ -291,7 +289,9 @@ if ("sqlite" %in% names(testServers)) {
291
289
292
290
test_that(paste(" test that the subject counts per cohort, visit concept and visit context are correct" ), {
293
291
294
- cohortDataFilePath <- system.file(" test_cases/runVisitContext/testSubjectCounts/test_getVisitContext_cohort.xlsx" , package = " CohortDiagnostics" )
292
+ cohortDataFilePath <- system.file(" test_cases/runVisitContext/testSubjectCounts/test_getVisitContext_cohort.csv" ,
293
+ package = " CohortDiagnostics" ,
294
+ mustWork = TRUE )
295
295
296
296
patientDataFilePath <- " test_cases/runVisitContext/testSubjectCounts/test_getVisitContext_patientData.json"
297
297
@@ -313,7 +313,9 @@ test_that(paste("test that the subject counts per cohort, visit concept and visi
313
313
cdmVersion = 5
314
314
)
315
315
316
- resultPath <- system.file(" test_cases/runVisitContext/testSubjectCounts/expectedResult.csv" , package = " CohortDiagnostics" )
316
+ resultPath <- system.file(" test_cases/runVisitContext/testSubjectCounts/expectedResult.csv" ,
317
+ package = " CohortDiagnostics" ,
318
+ mustWork = TRUE )
317
319
318
320
resultData <- readr :: read_csv(resultPath , col_types = c(" ddcd" ))
319
321
@@ -355,7 +357,7 @@ test_that(paste("test that only the new visit_concept_id are inserted into the #
355
357
356
358
sql <- " select * from #concept_ids"
357
359
358
- translatedSQL <- translate(sql , targetDialect = " sqlite" )
360
+ translatedSQL <- SqlRender :: translate(sql , targetDialect = " sqlite" )
359
361
360
362
res1 <- querySql(connection = connection , sql = translatedSQL )
361
363
@@ -398,7 +400,7 @@ test_that(paste("test that only the new visit_concept_id are inserted into the #
398
400
399
401
sql <- " select * from #concept_ids"
400
402
401
- translatedSQL <- translate(sql , targetDialect = " sqlite" )
403
+ translatedSQL <- SqlRender :: translate(sql , targetDialect = " sqlite" )
402
404
403
405
res2 <- querySql(connection = connection , sql = translatedSQL )
404
406
@@ -411,7 +413,9 @@ test_that(paste("test that only the new visit_concept_id are inserted into the #
411
413
412
414
test_that(paste(" test that to infer subject counts per cohort, visit concept, and visit context, visits within 30 days before or after cohort creation are considered" ), {
413
415
414
- cohortDataFilePath <- system.file(" test_cases/runVisitContext/testSubjectCountsDates/test_getVisitContext_cohort.xlsx" , package = " CohortDiagnostics" )
416
+ cohortDataFilePath <- system.file(" test_cases/runVisitContext/testSubjectCountsDates/test_getVisitContext_cohort.csv" ,
417
+ package = " CohortDiagnostics" ,
418
+ mustWork = TRUE )
415
419
416
420
patientDataFilePath <- " test_cases/runVisitContext/testSubjectCountsDates/test_getVisitContext_patientData.json"
417
421
@@ -494,7 +498,7 @@ test_that(paste("test that when the subjects in the cohort have no visits an emp
494
498
495
499
sql <- " delete from visit_occurrence;"
496
500
497
- translatedSQL <- translate(sql = sql , targetDialect = " sqlite" )
501
+ translatedSQL <- SqlRender :: translate(sql = sql , targetDialect = " sqlite" )
498
502
499
503
executeSql(connection = connection , sql = translatedSQL )
500
504
0 commit comments