validate_cdisc: Validate CDISC Compliance

View source: R/cdisc_validate.R

validate_cdiscR Documentation

Validate CDISC Compliance

Description

Main validation entry point that checks whether a data frame conforms to CDISC standards. If domain and standard are not provided, they are automatically detected via detect_cdisc_domain(). Dispatches to validate_sdtm() or validate_adam() as appropriate.

Usage

validate_cdisc(df, domain = NULL, standard = NULL)

Arguments

df

A data frame to validate.

domain

Optional character string specifying the CDISC domain code (e.g., "DM", "AE") or ADaM dataset name (e.g., "ADSL", "ADAE"). If NULL, auto-detected.

standard

Optional character string: "SDTM" or "ADaM". If NULL, auto-detected.

Value

A data frame with columns:

category

Character: type of validation issue ("Missing Required Variable", "Missing Expected Variable", "Type Mismatch", "Non-Standard Variable", "Variable Info")

variable

Character: variable name

message

Character: description of the issue

severity

Character: "ERROR", "WARNING", or "INFO"

Examples


# Auto-detect domain
dm <- data.frame(
  STUDYID = "STUDY001",
  USUBJID = "SUBJ001",
  DMSEQ = 1,
  RACE = "WHITE",
  stringsAsFactors = FALSE
)
results <- validate_cdisc(dm)
print(results)

# Validate with explicit domain specification
results <- validate_cdisc(dm, domain = "DM", standard = "SDTM")


clinCompare documentation built on Feb. 19, 2026, 1:07 a.m.