The problem
Clinical data standards are usually shown one at a time: a CRF here, an SDTM mapping there, a table shell somewhere else. The hard part of the work sits between them. A variable defined in the protocol has to arrive in the analysis with its meaning, its codelist and its derivation intact, and a reviewer has to be able to follow it back.
This project takes one study the whole way, end to end, in the visitor's browser. The study, DEMO-301, is fictional and every subject is synthetic. It is a demonstration of the practices, not a production submission workflow, and the page says so wherever data appear. Run the pipeline to see every stage, change the seed or the number of subjects, and download the package.
How it works
One definition. The study design (arms, epochs, visits, activities and the schedule of assessments) is a USDM study definition. The same reader accepts the USDM export from CRF Studio, so a study built there can be run here, with any activity the pipeline cannot tabulate listed before the run.
Seeded synthetic collection. One seeded generator draws every value, keyed by subject, domain, visit and variable, so adding a subject never rerolls the others. The generator also plants a few realistic problems on purpose: late visits, out-of-range labs, partial adverse event dates and events before first dose.
SDTM, then conformance. The trial design domains (TA, TE, TV, TI, TS) and the subject domains (DM, SV, EX, AE, VS, LB, DS, with SUPPDM) are built from typed mapping specifications. A conformance stage checks controlled terminology and a subset of published rules, each finding citing the rule it models. It is not a validator of record and links to CDISC CORE for that.
ADaM and metadata from one source. ADSL, ADVS, ADLB, ADAE and ADTTE are derived from SDTM only. Every variable carries its label, type, origin, codelist and derivation method, so Define-XML 2.1, Dataset-JSON, CSV and XPT are serialisers over the same structure and cannot drift from the data.
Outputs linked through ARS. Demographics, systolic blood pressure by visit, treatment-emergent adverse events by system organ class and preferred term, and a Kaplan-Meier figure are defined as Analysis Results Standard analyses. Each cell knows the ADaM records it was computed from, and each of those knows its SDTM and collected predecessors.
Reviewer guides from the run. A cSDRG-lite and an ADRG-lite are written from the run itself: data flow, standards and versions, datasets, every conformance finding with the reason it occurs, derivations and the analysis output index. They ship inside the package beside the datasets they describe.
How the pieces connect
flowchart LR
A[USDM study definition] --> B[Seeded synthetic collection]
B --> C[SDTM trial design and subject domains]
C --> D[Conformance findings]
C --> E[ADaM: ADSL, ADVS, ADLB, ADAE, ADTTE]
E --> F[ARS analyses: tables and figure]
C & E --> G[Define-XML 2.1]
C & E --> H[Dataset-JSON, CSV, XPT, hashed manifest]
D & E & F --> I[cSDRG-lite and ADRG-lite]
F -->|lineage| E -->|lineage| C -->|lineage| B
Practices it demonstrates
- Reproducibility: the same definition, seed and subject count give byte-identical packages. A manifest records the inputs and a SHA-256 of every file, and golden tests pin the hashes.
- Independent QC: the key derivations are programmed a second time from their specifications, without reusing pipeline code, and compared row for row across 200 seeds.
- Traceability: a lineage explorer walks from a table cell to the analysis records, the SDTM rows and the collected values behind it, and from a scheduled activity forward to every result it feeds.
- Pinned standards: every standard version is declared once and appears in the trial summary, Define-XML and the manifest.
- Honest scope: the conformance stage models a subset of rules, the controlled terminology is a local subset aligned to one NCI EVS package, and expected findings are explained rather than hidden.
- No server cost: the run happens in a Web Worker in the visitor's browser, so it touches no database and no provider quota.
Tradeoffs and lessons
- Encoding by hand: every variable and rule is written out and cited by id rather than loaded from CDISC Library. That is slower, and coverage is a deliberate subset, but it keeps the site free of API keys and licensed content.
- Columns with metadata attached: one column-oriented dataset shape for every layer made Define-XML and the datasets a single source, at the cost of more careful typing than row records need.
- Planted problems are part of the test: because the generator plants specific issues at known rates, any other conformance finding is a defect, and the reviewer guides say which is which.