check_ex_extrt_exoccur {sdtmchecks}R Documentation

Check for EX records where EXTRT is missing

Description

This check looks for EX records where EXTRT is missing but EXOCCUR=Y (or EXOCCUR doesn't exist) and returns a data frame

Usage

check_ex_extrt_exoccur(EX)

Arguments

EX

Exposure domain with variables USUBJID, EXSTDTC, EXTRT, EXDOSE

Value

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

Author(s)

Betty Wang

Examples


EX <- data.frame(
USUBJID = 1:10,
EXTRT = 1:10,
EXOCCUR = c(rep("Y",5), rep("",5)),
EXSTDTC = "2016-01-01",
EXDOSE = 1:10,
stringsAsFactors=FALSE
)

EX$EXTRT[1]=""
EX$EXTRT[2]="NA"
EX$EXTRT[3]=NA
EX$EXTRT[6]=""
EX$EXTRT[7]="NA"
EX$EXTRT[8]=NA

check_ex_extrt_exoccur(EX)

EX$EXOCCUR=NULL

check_ex_extrt_exoccur(EX)



[Package sdtmchecks version 1.0.0 Index]