← 返回 Skills 市场
aipoch-ai

Clinical Data Cleaner

作者 AIpoch · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
146
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install clinical-data-cleaner-1
功能描述
Use when cleaning clinical trial data, preparing data for FDA/EMA submission, standardizing SDTM datasets, handling missing values in clinical studies, detec...
使用说明 (SKILL.md)

\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.\r
  • numpy: unspecified. Declared in requirements.txt.\r
  • pandas: unspecified. Declared in requirements.txt.\r
  • scipy: unspecified. Declared in requirements.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
安全使用建议
This package appears internally consistent, but you should: (1) review scripts/main.py (and the remainder of the truncated code) before running to confirm it only writes local outputs and audit logs; (2) run it first on synthetic or de‑identified sample data to verify CLI semantics (the README example and script usage differ for --input); (3) install dependencies in an isolated environment (virtualenv/container); (4) confirm the script will not overwrite raw source files and that audit logs are stored as you expect; and (5) perform a brief code review if you will process regulated/PHI data to ensure compliance with your organization’s policies (21 CFR Part 11, data access controls, and Pinnacle 21 validation steps).
能力评估
Purpose & Capability
Name/description, SKILL.md, references, requirements.txt, and scripts/main.py all consistently implement SDTM-focused cleaning, missing‑value handling, outlier detection, and audit logging. Declared dependencies (numpy, pandas, scipy) are proportionate to the task.
Instruction Scope
Runtime instructions focus on validating inputs, running the packaged Python script, and producing auditable outputs. Minor documentation inconsistency: an example Audit-Ready command passes a free-text --input string while the script usage expects a file path; confirm expected CLI interface before running. No instructions direct reading unrelated system files or exfiltrating data.
Install Mechanism
No install spec included (instruction-only skill with packaged Python script). Dependencies are declared in requirements.txt and are standard data science packages. There are no downloads from external URLs or extract steps in the package.
Credentials
No environment variables, credentials, or config paths are required. The script optionally loads a user-provided JSON config file (local path) which is reasonable for customization and documented in SKILL.md.
Persistence & Privilege
Skill is not always-enabled and uses the normal autonomous-invocation default. It does not request elevated system presence or modify other skills' configs. Any file writes are expected outputs/audit logs for cleaning.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install clinical-data-cleaner-1
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /clinical-data-cleaner-1 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release providing robust tools for clinical trial data cleaning and standardization: - Cleans, validates, and standardizes clinical trial data to meet CDISC SDTM standards. - Handles missing values, detects outliers, standardizes dates, and supports conversion of raw CRF data to CDISC format. - Generates audit trails for regulatory compliance (FDA/EMA submissions). - Includes command-line and Python API usage examples. - Provides documentation and reference materials for regulatory and troubleshooting support.
元数据
Slug clinical-data-cleaner-1
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

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... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 146 次。

如何安装 Clinical Data Cleaner?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install clinical-data-cleaner-1」即可一键安装,无需额外配置。

Clinical Data Cleaner 是免费的吗?

是的,Clinical Data Cleaner 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Clinical Data Cleaner 支持哪些平台?

Clinical Data Cleaner 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Clinical Data Cleaner?

由 AIpoch(@aipoch-ai)开发并维护,当前版本 v1.0.0。

💬 留言讨论