Skip to content

Commit ebc354e

Browse files
committed
Enforce lower bound on amount of tracked_vars. Rename mock function for clarity.
1 parent a3904b7 commit ebc354e

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

R/mock_listings.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ mock_listings_mm <- function() {
130130
)
131131
}
132132

133-
mock_cqm <- function() {
133+
mock_review <- function() {
134134
ae <- safetyData::sdtm_ae
135135
dm <- safetyData::sdtm_dm
136136

@@ -247,7 +247,7 @@ mock_cqm <- function() {
247247

248248
# Step 5 - Run app
249249
dv.manager::run_app(
250-
data = list("CQM_AE_list" = data_list),
250+
data = list("AE_list_review" = data_list),
251251
module_list = list(
252252
"Listing" = listing,
253253
"Signal receiver" = mod_receiver(module_id = "papo", sender_id = "listing")

R/mod_listings.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -919,12 +919,12 @@ check_mod_listings <- function(afmm, datasets, module_id, dataset_names,
919919
) &&
920920
CM$assert(
921921
container = err,
922-
cond = (checkmate::test_character(info[["tracked_vars"]], min.chars = 1, unique = TRUE) &&
922+
cond = (checkmate::test_character(info[["tracked_vars"]], min.chars = 1, min.len = 3, unique = TRUE) &&
923923
checkmate::test_subset(info[["tracked_vars"]], names(dataset))),
924924
msg = sprintf(
925925
paste(
926-
"`review$datasets$%s$tracked_vars` should be a character vector listing a subset of the columns",
927-
"available in dataset `%s`"
926+
"`review$datasets$%s$tracked_vars` should be a character vector listing a subset of",
927+
" at least three columns available in dataset `%s`"
928928
), domain, domain
929929
)
930930
)

vignettes/data_review.Rmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ mod_listings(
5555
datasets = list(
5656
dm = list(
5757
id_vars = "USUBJID",
58-
tracked_vars = c("RFSTDTC", "RFENDTC")
58+
tracked_vars = c("DMDTC", "RFSTDTC", "RFENDTC")
5959
),
6060
ae = list(
6161
id_vars = c("USUBJID", "AESEQ"),
@@ -76,7 +76,7 @@ The `review` parameter is itself divided into four subfields:
7676
- `datasets`: A named list of domain configurations. The names refer to datasets with associated listings, i.e. those provided through the `dataset_names` parameter. Each of the elements in that list is itself a list with two elements:
7777

7878
- `id_vars`: `[character(n)]` Immutable variables that uniquely identify each record for a given domain. For example, in the case of the demographics domain, the **U**nique **SUBJ**ect **ID**entifier is enough. In the case of the adverse events domain, both USUBJID and the **A**dverse **E**vent **SEQ**uence number are necessary.
79-
- `tracked_vars`: `[character(n)]` Variables to track across dataset updates. If the contents of one of this columns changes on an already reviewed row, that review will be marked as potentially outdated.
79+
- `tracked_vars`: `[character(3+)]` Variables to track across dataset updates. If the contents of one of this columns changes on an already reviewed row, that review will be marked as potentially outdated. This vector should list at least three variables.
8080
- `choices`: `[character(n)]` Review choices available to assign to each listing row.
8181
- `roles`: `[character(n)]` Names of reviewer roles.
8282
- `store_path`: `[character(1)]` Optional. If specified, files associated to the review process will be stored on this path on the server. If left unspecified, those files will be stored on a folder of the _client_'s computer. The users of the app will have the opportunity to choose the path when they launch it.
@@ -261,7 +261,7 @@ Each of these bytes is computed by:
261261
Informal testing (refer to `tests/testthat/tests-hash_tracked.R` for more details) of this hashing scheme shows the following properties:
262262

263263
- It's capable of identifying up to four modified variables per row (after that, it's preferable to give up and notify the whole row as modified).
264-
- It has a very low **false negative rate** (a variable is modified without it being notified as such) of one for every 16 million row updates.
264+
- It has a very low **false negative rate** (a variable is modified without it being notified as such) of one for every 8 million row updates.
265265
- It has a low **false positive rate** (a variable that retains its value is notified as modified). This only happens when there are actual changes to a row.
266266

267267
False positives are not critical, as they ask reviewers to consider a larger set of variables when re-reviewing a row that has been altered.

0 commit comments

Comments
 (0)