check_rs_rsdtc_across_visit {sdtmchecks}R Documentation

Check RS records where the same date occurs across multiple visits

Description

This check identifies records where the same date RSDTC occurs across multiple visits. Only applies to assessments by investigator, selected based on uppercased RSEVAL = "INVESTIGATOR" or missing or RSEVAL variable does not exist.

Usage

check_rs_rsdtc_across_visit(RS, preproc = identity, ...)

Arguments

RS

Disease Response SDTM dataset with variables USUBJID, RSDTC, VISIT, RSEVAL (optional)

preproc

An optional company specific preprocessing script

...

Other arguments passed to methods

Value

boolean value if check failed or passed with 'msg' attribute if the test failed

Author(s)

Will Harris

Examples


# example that will be flagged
RS <- data.frame(
USUBJID = 1,
RSDTC = c(rep("2016-01-01",3), rep("2016-06-01",5), rep("2016-06-24",2)),
VISIT = c(rep("C1D1",3), rep("C1D2",3), rep("C2D1",4)),
RSSPID = "FORMNAME-R:13/L:13XXXX",
stringsAsFactors=FALSE)

check_rs_rsdtc_across_visit(RS)
check_rs_rsdtc_across_visit(RS, preproc=roche_derive_rave_row)

# example that will not be flagged because not Investigator
RS0 <- RS
RS0$RSEVAL <- "INDEPENDENT ASSESSOR"
check_rs_rsdtc_across_visit(RS0)
check_rs_rsdtc_across_visit(RS0, preproc=roche_derive_rave_row)

# example with log line differences in Rave form with records flagged
RS1 <- RS
RS1$RSSPID = c(rep("FORMNAME-R:13/L:13XXXX",4), 
rep("FORMNAME-R:13/L:14XXXX",2), 
rep("FORMNAME-R:03/L:13XXXX",2),
 rep("FORMNAME-R:9/L:13XXXX", 2))
 
check_rs_rsdtc_across_visit(RS1)
check_rs_rsdtc_across_visit(RS1, preproc=roche_derive_rave_row)

# example with RSTESTCD with records flagged
RS2 <- RS1
RS2$RSTESTCD = c(rep("OVRLRESP", 2), rep("OTHER", 2), 
   rep("OVRLRESP", 2), rep("OTHER", 2), rep("OVRLRESP", 2))
check_rs_rsdtc_across_visit(RS2)
check_rs_rsdtc_across_visit(RS2, preproc=roche_derive_rave_row)

# example with records flagged without xxSPID
RS3 <- RS
RS3$RSSPID <- NULL
check_rs_rsdtc_across_visit(RS3)
check_rs_rsdtc_across_visit(RS3, preproc=roche_derive_rave_row)

# example without required variable
RS4 <- RS
RS4$VISIT <- NULL
check_rs_rsdtc_across_visit(RS4)
check_rs_rsdtc_across_visit(RS4, preproc=roche_derive_rave_row)



[Package sdtmchecks version 1.0.0 Index]