Skip to content

Commit

Permalink
Fix styler issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rammprasad committed Jun 18, 2024
1 parent 1332197 commit 2de0eb7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 30 deletions.
6 changes: 4 additions & 2 deletions R/globals.R
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
utils::globalVariables(c("USUBJID", "VISIT", "dom_dt", "dom_tm", "ref_dt",
"ref_tm"))
utils::globalVariables(c(
"USUBJID", "VISIT", "dom_dt", "dom_tm", "ref_dt",
"ref_tm"
))
52 changes: 24 additions & 28 deletions tests/testthat/test-derive_blfl.R
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
dm <- tibble::tribble(
~USUBJID, ~RFSTDTC, ~RFXSTDTC,
"test_study-375", "2020-09-28T10:10", "2020-09-28T10:10",
"test_study-376", "2020-09-21T11:00", "2020-09-21T11:00",
"test_study-377", NA, NA,
"test_study-378", "2020-01-20T10:00", "2020-01-20T10:00",
"test_study-379", NA, NA
dm <- tibble::tribble(
~USUBJID, ~RFSTDTC, ~RFXSTDTC,
"test_study-375", "2020-09-28T10:10", "2020-09-28T10:10",
"test_study-376", "2020-09-21T11:00", "2020-09-21T11:00",
"test_study-377", NA, NA,
"test_study-378", "2020-01-20T10:00", "2020-01-20T10:00",
"test_study-379", NA, NA
)

sdtm_in <-
tibble::tribble(
~DOMAIN, ~oak_id, ~raw_source, ~patient_number, ~USUBJID, ~VSDTC, ~VSTESTCD, ~VSORRES, ~VSSTAT, ~VISIT,
"VS", 1L, "VTLS1", 375L, "test_study-375", "2020-09-01T13:31", "DIABP", "90", NA, "SCREENING",
"VS", 2L, "VTLS1", 375L, "test_study-375", "2020-10-01T11:20", "DIABP", "90", NA, "SCREENING",
"VS", 1L, "VTLS1", 375L, "test_study-375", "2020-09-28T10:10", "PULSE", "ND", NA, "SCREENING",
"VS", 2L, "VTLS1", 375L, "test_study-375", "2020-10-01T13:31", "PULSE", "85", NA, "SCREENING",
"VS", 1L, "VTLS2", 375L, "test_study-375", "2020-09-28T10:10", "SYSBP", "120", NA, "SCREENING",
"VS", 2L, "VTLS2", 375L, "test_study-375", "2020-09-28T10:05", "SYSBP", "120", NA, "SCREENING",
"VS", 1L, "VTLS1", 376L, "test_study-376", "2020-09-20", "DIABP", "75", NA, "SCREENING",
"VS", 1L, "VTLS1", 376L, "test_study-376", "2020-09-20", "PULSE", NA, "NOT DONE", "SCREENING", # nolint
"VS", 2L, "VTLS1", 376L, "test_study-376", "2020-09-20", "PULSE", "110", NA, "SCREENING",
"VS", 2L, "VTLS1", 378L, "test_study-378", "2020-01-20T10:00", "PULSE", "110", NA, "SCREENING",
"VS", 3L, "VTLS1", 378L, "test_study-378", "2020-01-21T11:00", "PULSE", "105", NA, "SCREENING"
)

sdtm_in <-
tibble::tribble(
~DOMAIN, ~oak_id, ~raw_source, ~patient_number, ~USUBJID, ~VSDTC, ~VSTESTCD, ~VSORRES, ~VSSTAT, ~VISIT,
"VS", 1L, "VTLS1", 375L, "test_study-375", "2020-09-01T13:31", "DIABP", "90", NA, "SCREENING",
"VS", 2L, "VTLS1", 375L, "test_study-375", "2020-10-01T11:20", "DIABP", "90", NA, "SCREENING",
"VS", 1L, "VTLS1", 375L, "test_study-375", "2020-09-28T10:10", "PULSE", "ND", NA, "SCREENING",
"VS", 2L, "VTLS1", 375L, "test_study-375", "2020-10-01T13:31", "PULSE", "85", NA, "SCREENING",
"VS", 1L, "VTLS2", 375L, "test_study-375", "2020-09-28T10:10", "SYSBP", "120", NA, "SCREENING",
"VS", 2L, "VTLS2", 375L, "test_study-375", "2020-09-28T10:05", "SYSBP", "120", NA, "SCREENING",
"VS", 1L, "VTLS1", 376L, "test_study-376", "2020-09-20", "DIABP", "75", NA, "SCREENING",
"VS", 1L, "VTLS1", 376L, "test_study-376", "2020-09-20", "PULSE", NA, "NOT DONE", "SCREENING", # nolint
"VS", 2L, "VTLS1", 376L, "test_study-376", "2020-09-20", "PULSE", "110", NA, "SCREENING",
"VS", 2L, "VTLS1", 378L, "test_study-378", "2020-01-20T10:00", "PULSE", "110", NA, "SCREENING",
"VS", 3L, "VTLS1", 378L, "test_study-378", "2020-01-21T11:00", "PULSE", "105", NA, "SCREENING"
)

d <- list(sdtm_in = sdtm_in, dm = dm)
d <- list(sdtm_in = sdtm_in, dm = dm)


test_that("derive_blfl example works", {

observed_output <- derive_blfl(
sdtm_in = d$sdtm_in,
dm_domain = d$dm,
Expand Down Expand Up @@ -81,7 +80,6 @@ test_that("derive_blfl sdmt_in validations work", {
})

test_that("derive_blfl dm_domain validations work", {

dm_no_vars <-
d$dm |>
dplyr::select(-c(RFXSTDTC, USUBJID))
Expand All @@ -95,7 +93,6 @@ test_that("derive_blfl dm_domain validations work", {
})

test_that("derive_blfl tgt_var and ref_var validations work", {

expect_snapshot_error(derive_blfl(
sdtm_in = d$sdtm_in,
dm_domain = d$dm,
Expand All @@ -119,7 +116,6 @@ test_that("derive_blfl tgt_var and ref_var validations work", {
})

test_that("derive_blfl DOMAIN validation works", {

sdtm_in_bad_domain <-
d$sdtm_in |>
dplyr::mutate(DOMAIN = 4L)
Expand Down

0 comments on commit 2de0eb7

Please sign in to comment.