foryourhealth111-pixel/Vibe-Skills / bundled/skills/clinical-reports
clinical-reports
VerifiedWrite comprehensive clinical reports including case reports (CARE guidelines), diagnostic reports (radiology/pathology/lab), clinical trial reports (ICH-E3, SAE, CSR), and patient documentation (SOAP, H&P, discharge summaries). Full support with templates, regulatory compliance (HIPAA, FDA, ICH-GCP), and validation tools.
scripts/extract_clinical_data.py
View on GitHub#!/usr/bin/env python3
"""
Extract structured clinical data from reports.
Usage:
python extract_clinical_data.py <report_file>
"""
import argparse
import json
import re
def extract_vital_signs(content: str) -> dict:
"""Extract vital signs."""
vitals = {}
patterns = {
"temperature": r"(?i)temp(?:erature)?[:]\s*([\d.]+)\s*°?F",
"bp": r"(?i)BP[:]\s*(\d+/\d+)",
"hr": r"(?i)HR[:]\s*(\d+)",
"rr": r"(?i)RR[:]\s*(\d+)",
"spo2": r"(?i)SpO2[:]\s*([\d.]+)%",
}
for vital, pattern in patterns.items():
match = re.search(pattern, content)
if match:
vitals[vital] = match.group(1)
return vitals
def extract_demographics(content: str) -> dict:
"""Extract patient demographics."""
demographics = {}
patterns = {
"age": r"(?i)(\d+)[\s-]year[\s-]old",
"sex": r"(?i)(male|female|M|F)",
}
for demo, pattern in patterns.items():
match = re.search(pattern, content)
if match:
demographics[demo] = match.group(1)
return demographics
def extract_medications(content: str) -> list:
"""Extract medication list."""
meds = []
# Simple pattern for common medication format
pattern = r"(?i)(\w+)\s+(\d+\s*mg)\s+(PO|IV|SC)\s+(daily|BID|TID|QID)"
matches = re.findall(pattern, content)
for match in matches:
meds.append({
"drug": match[0],
"dose": match[1],
"route": match[2],
"frequency": match[3]
})
return meds
def main():
"""Main entry point."""
parser = argparse.ArgumentParser(description="Extract clinical data")
parser.add_argument("input_file", help="Path to clinical report")
parser.add_argument("--output", "-o", help="Output JSON file")
args = parser.parse_args()
try:
with open(args.input_file, 'r', encoding='utf-8') as f:
content = f.read()
extracted_data = {
"demographics": extract_demographics(content),
"vital_signs": extract_vital_signs(content),
"medications": extract_medications(content),
}
if args.output:
with open(args.output, 'w') as f:
json.dump(extracted_data, f, indent=2)
print(f"✓ Data extracted to: {args.output}")
else:
print(json.dumps(extracted_data, indent=2))
return 0
except Exception as e:
print(f"Error: {e}")
return 1
if __name__ == "__main__":
import sys
sys.exit(main())
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |