Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Regulatory Compliance Overview

xportrs is designed to produce XPT files that meet the requirements of major regulatory agencies for clinical trial data submissions.

Supported Agencies

AgencyRegionStandardsxportrs Support
FDAUnited StatesCDISC SDTM/ADaMFull validation
PMDAJapanCDISC + J-SDTM extensionsFull validation
NMPAChinaCDISC + local requirementsFull validation
EMAEuropeCDISC SDTM/ADaMFull validation

Key Requirements

All agencies require XPT V5 format files that conform to the SAS Transport specification (TS-140). The key requirements are:

Variable Requirements

graph LR
subgraph "Variable Constraints"
A[Name ≤8 bytes] --> B[Uppercase A-Z, 0-9, _]
B --> C[Must start with letter]
D[Label ≤40 bytes] --> E[ASCII only for FDA]
F[Char length ≤200] --> G[Numeric = 8 bytes]
end

Dataset Requirements

  • Dataset name: 1-8 bytes, uppercase alphanumeric
  • Dataset label: 0-40 bytes (recommended for reviewer clarity)
  • File size: ≤5GB per file (auto-split supported)

Format Requirements

XPT files must use:

Validation Levels

xportrs provides three severity levels for validation issues:

SeverityMeaningExample
ErrorFile will not be acceptedVariable name >8 bytes
WarningReview recommendedMissing variable label
InfoBest practice suggestionNon-standard format

[!IMPORTANT] Only Error severity issues block file writing. Warnings and info messages are advisory.

Agency-Specific Rules

FDA (United States)

The FDA requires strict ASCII compliance for all text:

#![allow(unused)]
fn main() {
use xportrs::{Agency, Xpt};

let validated = Xpt::writer(dataset)
.agency(Agency::FDA)
.finalize() ?;

// Check for FDA-specific issues
for issue in validated.issues() {
println ! ("[{}] {}", issue.severity(), issue);
}
}

PMDA (Japan)

PMDA allows Shift-JIS encoding for Japanese text in certain fields:

#![allow(unused)]
fn main() {
use xportrs::{Agency, TextMode, Xpt};

let validated = Xpt::writer(dataset)
.agency(Agency::PMDA)
.text_mode(TextMode::Latin1)  // Extended character support
.finalize() ?;
}

NMPA (China)

NMPA follows CDISC standards with additional local requirements:

#![allow(unused)]
fn main() {
use xportrs::{Agency, Xpt};

let validated = Xpt::writer(dataset)
.agency(Agency::NMPA)
.finalize() ?;
}

Compliance Verification

Using xportrs Validation

#![allow(unused)]
fn main() {
let validated = Xpt::writer(dataset)
.agency(Agency::FDA)
.finalize() ?;

// Count issues by severity
let errors = validated.issues().iter()
.filter( | i| i.severity() == Severity::Error)
.count();

if errors > 0 {
eprintln ! ("{} blocking errors found", errors);
}
}

External Validation (Pinnacle 21)

After generating XPT files, we recommend validation with Pinnacle 21 Community:

  1. Download from Pinnacle 21
  2. Run validation against your XPT files and define.xml
  3. Review any SD (Study Data) rule violations

[!NOTE] xportrs handles XPT-level compliance. Dataset content validation (controlled terminology, required variables) requires external tools like Pinnacle 21.

Official Sources