clinical-data-cleaner

Clean and standardize clinical trial data into CDISC SDTM-compliant datasets with audit trails.

1|Updated Jul 13, 2026
One-click install
npx skills add https://github.com/HalseyYang/Skills-HY --skill clinical-data-cleaner-halseyyang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clinical-data-cleaner
Source: https://github.com/HalseyYang/Skills-HY/tree/main/clinical-data-cleaner
Command: npx skills add https://github.com/HalseyYang/Skills-HY --skill clinical-data-cleaner-halseyyang

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, pandas, scipy, and includes scripts (resource) and references (resource) components.

What problem does it solve? Raw clinical trial data from EDC systems and CRFs often contains missing values, inconsistent date formats, and outliers that block FDA or EMA regulatory submissions. This Skill automates the cleaning and standardization of that data into CDISC SDTM-compliant datasets while generating a complete audit trail for compliance. ## Core Features & Use Cases - SDTM Domain Validation: Checks required fields for DM (Demographics), LB (Laboratory), and VS (Vital Signs) domains against CDISC specifications. - Missing Value Handling & Outlier Detection: Imputes missing values with mean, median, mode, or forward-fill strategies, and detects outliers using IQR, Z-score, or clinical domain thresholds (e.g., glucose 50-500 mg/dL). - Date Standardization & Audit Trail: Converts dates to ISO 8601 format and logs every cleaning action to a JSON report suitable for 21 CFR Part 11 compliance. - Use Case: A clinical data manager preparing an FDA NDA submission runs the cleaner on raw lab data with domain-specific thresholds, producing a flagged SDTM dataset and a documented cleaning report for Pinnacle 21 validation. ## Quick Start Clean my raw demographics CSV file into an SDTM-compliant DM dataset using median imputation and flag any outliers, then save the audit trail report.

Frequently Asked Questions about clinical-data-cleaner

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I clean clinical trial data for FDA submission?

Run the cleaning pipeline on your raw CSV or Excel export by specifying the SDTM domain (DM, LB, or VS), a missing value strategy, and an outlier method. The output is a standardized dataset plus a JSON audit trail documenting every cleaning action for regulatory review.

How to convert raw CRF data to CDISC SDTM format?

Load the CRF export and validate it against the required SDTM domain fields such as STUDYID, USUBJID, and domain-specific test codes. The pipeline then standardizes dates to ISO 8601, handles missing values, and flags outliers to produce submission-ready datasets.

What outlier detection methods work for clinical lab data?

Three methods are supported: IQR for general distributions, Z-score for normally distributed values, and domain-specific clinical thresholds for lab tests like glucose, hemoglobin, and creatinine. The domain method is recommended for LB and VS data since it uses medically plausible ranges.

Should I remove or flag outliers in clinical trial data?

Flagging is the recommended action for regulatory submissions because removing outliers can discard legitimate extreme clinical values. The flag action marks outliers in a dedicated column so statisticians can review them before any removal decision.

Why does date standardization fail on some clinical datasets?

Date parsing fails when source files mix formats, use non-standard strings, or confuse DD/MM with MM/DD conventions. Unparseable values become empty, so standardize formats in the source system first and manually review any dates that fail conversion.

What are the limitations of median imputation for missing clinical data?

Median imputation can bias analysis when data is missing not at random or when subgroups like treatment arms have different distributions. Analyze missingness patterns first and consult a statistician before choosing an imputation strategy for submission data.