coreval: check SDTM, SEND and USDM data against CDISC's conformance rules, inside R

Hi all,

I'd like to share coreval, a package I've been building for people who program clinical trial data in R. It's now on CRAN.

If you work with SDTM, you know the usual cycle: write the datasets, send them to a separate validation tool near the end, then go back and fix a long list of problems. coreval runs CDISC's own published conformance rules (the CDISC Open Rules) from R, so you can check a dataset right after you build it.

install.packages("coreval")
library(coreval)

dm <- data.frame(
  STUDYID = "STUDY1",
  DOMAIN  = "DM",
  USUBJID = c("STUDY1-001", "STUDY1-002", "STUDY1-003"),
  RFSTDTC = c("2024-01-15", "2024-13-01", "2024-02-03"),
  AGE     = c(34, 51, 47),
  AGEU    = c("YEARS", "YEARS", "")
)

check_dataset(dm)
โ”€โ”€ coreval โ€” DM โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

6 problems across 4 records  (164 checks ran)

  wrong value         3   the data breaks the rule - start here
  missing required    1   the standard requires it
  missing optional    2   often legitimate: not collected, screen failure, ...

[wrong value]
AGEU is missing when AGE is provided.
  1 record ยท AGE, AGEU
    row 3     AGE = "47", AGEU = (empty)

Each finding says what is wrong, which row, and the values involved.

A few things about it:

  • check_study() checks a whole folder of .xpt, .sas7bdat or Dataset-JSON files, including the links between datasets (for example, an AE subject missing from DM)
  • It runs offline, with no API key, and the data stays on your machine
  • write_findings() saves everything to Excel, including the checks it couldn't run and the reason
  • Runtime dependencies are only data.table and haven

To see whether it can be trusted, I ran it on CDISC's own pilot submission (22 datasets, 294,677 records) and compared every finding, rule by rule, with CDISC's reference engine. The full comparison is published in the repository.

It's meant as a first check while you code, not a replacement for your validated tool.

Website: coreval: check clinical trial data against CDISC Open Rules โ€ข coreval
GitHub: GitHub - hrach-gevorgyan/coreval: coreval is an R package that evaluates CDISC Open Rules (CORE) conformance rules against clinical trial datasets, returning findings as a tidy data frame. ยท GitHub

I'd welcome feedback, especially from anyone who tries it on a real study: what it finds, what it misses, and what gets in the way.

1 Like