check_mi_mispec {sdtmchecks}R Documentation

Check for missing values in the MISPEC variable

Description

This check looks for missing values in the MISPEC variable, which is required. This will be flagged in P21. This may reflect a mapping issue.

Usage

check_mi_mispec(MI)

Arguments

MI

Microscopic Findings with variables USUBJID, MISPEC, MITESTCD, MIDTC

Value

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

Author(s)

Stella Banjo (HackR 2021)

Examples


MI <- data.frame(
  USUBJID = c("1","2", "3"),
  DOMAIN = "MI",
  MISEQ = c(1, 2, 1),
  MISPEC = c("","BLOCK SLIDE",NA),
  MITESTCD = "TESTCD1",
  MIDTC = "2020-01-01",
stringAsFactors = FALSE
)

 check_mi_mispec(MI)

## No errors, MISPEC values present
MI2 <- data.frame(
 USUBJID = c("1","2", "3"),
 DOMAIN = "MI",
 MISEQ = 1,
 MISPEC = c("SLIDE", "TUMOR TISSUE", "BLOCK SLIDE"),
 MITESTCD = "TESTCD1",
 MIDTC = "",
 stringsAsFactors = FALSE
)

 check_mi_mispec(MI2)


[Package sdtmchecks version 1.0.0 Index]