Learn R Programming

sdtmchecks (version 1.0.0)

check_ce_missing_month: Check for clinical events dates with year and day known but month unknown

Description

Check for missing month when clinical events dates (CESTDTC, CEENDTC, CEDTC) have a known year and day

Usage

check_ce_missing_month(CE, preproc = identity, ...)

Value

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

Arguments

CE

Clinical Events SDTM dataset with variables USUBJID, CETERM, and at least one of the following date variables: CESTDTC, CEENDTC, CEDTC

preproc

An optional company specific preprocessing script

...

Other arguments passed to methods

Author

Ryan Marinelli

Examples

Run this code

CE <- data.frame(
 USUBJID = c(1, 2, 3, 4),
 CETERM = c("Headache", "Nausea", "Dizziness", "Fever"),
 CESTDTC = c("2023---01", "2023-01-15", "2023-02-01", "2023-02-10"),
 CEENDTC = c("2023-01-02", "2023---01", "2023-02-02", "2023-02-12"),
 CEDTC = c("2023--01", "", "", ""),
 CESEV = c("Mild", "Moderate", "Mild", "Severe"),
 CESPID = "FORMNAME-R:13/L:13XXXX",
 stringsAsFactors=FALSE
 )

check_ce_missing_month(CE)
check_ce_missing_month(CE,preproc=roche_derive_rave_row)

CE <- data.frame(
 USUBJID = c(1, 2, 3, 4),
 CETERM = c("Headache", "Nausea", "Dizziness", "Fever"),
 CESTDTC = c("2023-01-01", "2023-01-15", "2023-02-01", "2023-02-10"),
 CEENDTC = c("2023-01-02", "2023-01-16", "2023-02-02", "2023-02-12"),
 CEENDTC = "",
 CESEV = c("Mild", "Moderate", "Mild", "Severe"),
 CESPID = "FORMNAME-R:13/L:13XXXX",
 stringsAsFactors=FALSE
 )

check_ce_missing_month(CE)

CE$CETERM = NULL

check_ce_missing_month(CE)

Run the code above in your browser using DataLab