/install clinical-data-cleaner-1
\r
Clinical Data Cleaner\r
\r Clean, validate, and standardize clinical trial data to meet CDISC SDTM standards for regulatory submissions to FDA or EMA.\r \r
When to Use\r
\r
- Use this skill when the task needs Use when cleaning clinical trial data, preparing data for FDA/EMA submission, standardizing SDTM datasets, handling missing values in clinical studies, detecting outliers in lab results, or converting raw CRF data to CDISC format. Cleans and standardizes clinical trial data for regulatory compliance with audit trails.\r
- Use this skill for data analysis tasks that require explicit assumptions, bounded scope, and a reproducible output format.\r
- Use this skill when you need a documented fallback path for missing inputs, execution errors, or partial evidence.\r \r
Key Features\r
\r
- Scope-focused workflow aligned to: Use when cleaning clinical trial data, preparing data for FDA/EMA submission, standardizing SDTM datasets, handling missing values in clinical studies, detecting outliers in lab results, or converting raw CRF data to CDISC format. Cleans and standardizes clinical trial data for regulatory compliance with audit trails.\r
- Packaged executable path(s):
scripts/main.py.\r - Reference material available in
references/for task-specific guidance.\r - Structured execution path designed to keep outputs consistent and reviewable.\r \r
Dependencies\r
\r
Python:3.10+. Repository baseline for current packaged skills.\rnumpy:unspecified. Declared inrequirements.txt.\rpandas:unspecified. Declared inrequirements.txt.\rscipy:unspecified. Declared inrequirements.txt.\r \r
Example Usage\r
\r
cd "20260318/scientific-skills/Data Analytics/clinical-data-cleaner"\r
python -m py_compile scripts/main.py\r
python scripts/main.py --help\r
```\r
\r
Example run plan:\r
1. Confirm the user input, output path, and any required config values.\r
2. Edit the in-file `CONFIG` block or documented parameters if the script uses fixed settings.\r
3. Run `python scripts/main.py` with the validated inputs.\r
4. Review the generated output and return the final artifact with any assumptions called out.\r
\r
## Implementation Details\r
\r
See `## Workflow` above for related details.\r
\r
- Execution model: validate the request, choose the packaged workflow, and produce a bounded deliverable.\r
- Input controls: confirm the source files, scope limits, output format, and acceptance criteria before running any script.\r
- Primary implementation surface: `scripts/main.py`.\r
- Reference guidance: `references/` contains supporting rules, prompts, or checklists.\r
- Parameters to clarify first: input path, output path, scope filters, thresholds, and any domain-specific constraints.\r
- Output discipline: keep results reproducible, identify assumptions explicitly, and avoid undocumented side effects.\r
\r
## Quick Check\r
\r
Use this command to verify that the packaged script entry point can be parsed before deeper execution.\r
\r
```bash\r
python -m py_compile scripts/main.py\r
```\r
\r
## Audit-Ready Commands\r
\r
Use these concrete commands for validation. They are intentionally self-contained and avoid placeholder paths.\r
\r
```bash\r
python -m py_compile scripts/main.py\r
python scripts/main.py --help\r
python scripts/main.py --input "Audit validation sample with explicit symptoms, history, assessment, and next-step plan."\r
```\r
\r
## Workflow\r
\r
1. Confirm the user objective, required inputs, and non-negotiable constraints before doing detailed work.\r
2. Validate that the request matches the documented scope and stop early if the task would require unsupported assumptions.\r
3. Use the packaged script path or the documented reasoning path with only the inputs that are actually available.\r
4. Return a structured result that separates assumptions, deliverables, risks, and unresolved items.\r
5. If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.\r
\r
## Quick Start\r
\r
```python\r
from scripts.main import ClinicalDataCleaner\r
\r
# Initialize for Demographics domain\r
cleaner = ClinicalDataCleaner(domain='DM')\r
\r
# Clean data with default settings\r
cleaned = cleaner.clean(raw_data)\r
\r
# Save with audit trail\r
cleaner.save_report('output.csv')\r
```\r
\r
## Core Capabilities\r
\r
### 1. SDTM Domain Validation\r
\r
```python\r
cleaner = ClinicalDataCleaner(domain='DM') # or 'LB', 'VS'\r
is_valid, missing = cleaner.validate_domain(data)\r
```\r
\r
**Required Fields:**\r
- **DM**: STUDYID, USUBJID, SUBJID, RFSTDTC, RFENDTC, SITEID, AGE, SEX, RACE\r
- **LB**: STUDYID, USUBJID, LBTESTCD, LBCAT, LBORRES, LBORRESU, LBSTRESC, LBDTC\r
- **VS**: STUDYID, USUBJID, VSTESTCD, VSORRES, VSORRESU, VSSTRESC, VSDTC\r
\r
### 2. Missing Value Handling\r
\r
```python\r
cleaner = ClinicalDataCleaner(\r
domain='DM',\r
missing_strategy='median' # mean, median, mode, forward, drop\r
)\r
cleaned = cleaner.handle_missing_values(data)\r
```\r
\r
### 3. Outlier Detection\r
\r
```python\r
cleaner = ClinicalDataCleaner(\r
domain='LB',\r
outlier_method='domain', # iqr, zscore, domain\r
outlier_action='flag' # flag, remove, cap\r
)\r
flagged = cleaner.detect_outliers(data)\r
```\r
\r
**Clinical Thresholds:**\r
| Parameter | Range | Unit |\r
|-----------|-------|------|\r
| Glucose | 50-500 | mg/dL |\r
| Hemoglobin | 5-20 | g/dL |\r
| Systolic BP | 70-220 | mmHg |\r
\r
### 4. Date Standardization\r
\r
```python\r
standardized = cleaner.standardize_dates(data)\r
\r
# Converts to ISO 8601: 2023-01-15T09:30:00\r
```\r
\r
### 5. Complete Pipeline\r
\r
```python\r
cleaner = ClinicalDataCleaner(\r
domain='DM',\r
missing_strategy='median',\r
outlier_method='iqr',\r
outlier_action='flag'\r
)\r
cleaned_data = cleaner.clean(data)\r
cleaner.save_report('output.csv')\r
```\r
\r
**Output Files:**\r
- `output.csv` - Cleaned SDTM data\r
- `output.report.json` - Audit trail for regulatory submission\r
\r
## CLI Usage\r
\r
```text\r
\r
# Clean demographics\r
python scripts/main.py \\r
--input dm_raw.csv \\r
--domain DM \\r
--output dm_clean.csv \\r
--missing-strategy median \\r
--outlier-method iqr \\r
--outlier-action flag\r
\r
# Clean lab data with clinical thresholds\r
python scripts/main.py \\r
--input lb_raw.csv \\r
--domain LB \\r
--output lb_clean.csv \\r
--outlier-method domain\r
```\r
\r
## Common Patterns\r
\r
See [references/common-patterns.md](references/common-patterns.md) for detailed examples:\r
- Regulatory Submission Preparation\r
- Interim Analysis Data Preparation\r
- Database Migration Cleanup\r
- External Lab Data Integration\r
\r
## Troubleshooting\r
\r
See [references/troubleshooting.md](references/troubleshooting.md) for solutions to:\r
- Validation failures\r
- Date parsing errors\r
- Memory errors with large datasets\r
- Outlier detection issues\r
\r
## Quality Checklist\r
\r
**Pre-Cleaning:**\r
- [ ] IACUC approval obtained (animal studies)\r
- [ ] Sample size adequately powered\r
- [ ] Randomization method documented\r
\r
**Post-Cleaning:**\r
- [ ] Validate against CDISC SDTM IG\r
- [ ] Review all cleaning actions in audit trail\r
- [ ] Test import to analysis software\r
\r
## References\r
\r
- `references/sdtm_ig_guide.md` - CDISC SDTM Implementation Guide\r
- `references/domain_specs.json` - Domain-specific field requirements\r
- `references/outlier_thresholds.json` - Clinical outlier thresholds\r
- `references/common-patterns.md` - Detailed usage patterns\r
- `references/troubleshooting.md` - Problem-solving guide\r
\r
---\r
\r
**Skill ID**: 189 | **Version**: 2.0 | **License**: MIT\r
\r
## Output Requirements\r
\r
Every final response should make these items explicit when they are relevant:\r
\r
- Objective or requested deliverable\r
- Inputs used and assumptions introduced\r
- Workflow or decision path\r
- Core result, recommendation, or artifact\r
- Constraints, risks, caveats, or validation needs\r
- Unresolved items and next-step checks\r
\r
## Error Handling\r
\r
- If required inputs are missing, state exactly which fields are missing and request only the minimum additional information.\r
- If the task goes outside the documented scope, stop instead of guessing or silently widening the assignment.\r
- If `scripts/main.py` fails, report the failure point, summarize what still can be completed safely, and provide a manual fallback.\r
- Do not fabricate files, citations, data, search results, or execution outcomes.\r
\r
## Input Validation\r
\r
This skill accepts requests that match the documented purpose of `clinical-data-cleaner` and include enough context to complete the workflow safely.\r
\r
Do not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:\r
\r
> `clinical-data-cleaner` only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.\r
\r
## Response Template\r
\r
Use the following fixed structure for non-trivial requests:\r
\r
1. Objective\r
2. Inputs Received\r
3. Assumptions\r
4. Workflow\r
5. Deliverable\r
6. Risks and Limits\r
7. Next Checks\r
\r
If the request is simple, you may compress the structure, but still keep assumptions and limits explicit when they affect correctness.\r
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install clinical-data-cleaner-1 - After installation, invoke the skill by name or use
/clinical-data-cleaner-1 - Provide required inputs per the skill's parameter spec and get structured output
What is Clinical Data Cleaner?
Use when cleaning clinical trial data, preparing data for FDA/EMA submission, standardizing SDTM datasets, handling missing values in clinical studies, detec... It is an AI Agent Skill for Claude Code / OpenClaw, with 146 downloads so far.
How do I install Clinical Data Cleaner?
Run "/install clinical-data-cleaner-1" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Clinical Data Cleaner free?
Yes, Clinical Data Cleaner is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Clinical Data Cleaner support?
Clinical Data Cleaner is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Clinical Data Cleaner?
It is built and maintained by AIpoch (@aipoch-ai); the current version is v1.0.0.