← Back to Skills Marketplace
aipoch-ai

Ehr Semantic Compressor

by AIpoch · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ⚠ suspicious
232
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install ehr-semantic-compressor
Description
AI-powered EHR summarization using Transformer architecture to extract key clinical information from lengthy medical records
README (SKILL.md)

EHR Semantic Compressor

Overview

AI-powered EHR summarization using Transformer architecture to extract key clinical information from lengthy medical records. This skill processes lengthy Electronic Health Record (EHR) documents and generates structured, clinically accurate summaries.

Technical Difficulty: High

When to Use

  • Input contains lengthy EHR documents (1600+ words) requiring summarization
  • Clinical records need structured extraction of key information
  • Quick review of patient history, medications, allergies, or diagnoses is needed
  • Medical documentation requires compression while maintaining accuracy

Core Features

  1. Fast Processing: Process lengthy EHR documents (1600+ words) in 10-20 seconds
  2. Structured Summaries: Generate bullet-point summaries (200-300 words)
  3. Critical Information Extraction:
    • Patient allergies and adverse reactions
    • Family medical history
    • Current and past medications
    • Diagnoses and conditions
    • Vital signs and lab results
    • Procedures and surgeries
  4. Clinical Accuracy: Maintains completeness of medical information

Usage

Basic Usage

python scripts/main.py --input ehr_document.txt --output summary.json

Input Format

{
  "ehr_text": "Full EHR document text...",
  "max_length": 300,
  "extract_sections": ["allergies", "medications", "diagnoses", "family_history"]
}

Output Format

{
  "status": "success",
  "data": {
    "summary": "Structured bullet-point summary...",
    "extracted_sections": {
      "allergies": [...],
      "medications": [...],
      "diagnoses": [...],
      "family_history": [...]
    },
    "metadata": {
      "original_length": 2500,
      "summary_length": 280,
      "compression_ratio": 0.89
    }
  }
}

Parameters

Parameter Type Default Required Description
--input, -i string - Yes Input EHR document text file path
--output, -o string - No Output JSON file path
--max-length int 300 No Maximum summary length in words
--extract-sections string all No Comma-separated sections to extract
--format string json No Output format (json, markdown, text)

Technical Details

Architecture

  • Base Model: Transformer-based encoder-decoder architecture
  • Medical Domain Adaptation: Fine-tuned on clinical text corpora
  • Section Extraction: Rule-based + ML hybrid approach for structured data
  • Processing Pipeline: Text segmentation -> Summarization -> Section extraction -> Output formatting

Dependencies

See references/requirements.txt for complete list.

Key dependencies:

  • transformers >= 4.30.0
  • torch >= 2.0.0
  • spacy >= 3.6.0
  • scispacy >= 0.5.3

Performance

  • Processing Time: 10-20 seconds for 1600+ word documents
  • Memory: Requires ~2GB RAM
  • Output Length: 200-300 words (configurable)
  • Compression Ratio: ~85-90%

References

  • references/requirements.txt - Python dependencies
  • references/guidelines.md - Clinical summarization guidelines
  • references/sample_input.json - Example input format
  • references/sample_output.json - Example output format

Safety & Compliance

  • No external API calls or service dependencies
  • All processing performed locally
  • No patient data transmitted outside the system
  • Error messages are semantic and do not expose technical details

Testing

Run unit tests:

cd scripts
python test_main.py

Error Handling

All errors return semantic messages:

{
  "status": "error",
  "error": {
    "type": "input_validation_error",
    "message": "EHR text is empty or too short",
    "suggestion": "Provide EHR text with at least 100 words"
  }
}

Risk Assessment

Risk Indicator Assessment Level
Code Execution Python/R scripts executed locally Medium
Network Access No external API calls Low
File System Access Read input files, write output files Medium
Instruction Tampering Standard prompt guidelines Low
Data Exposure Output files saved to workspace Low

Security Checklist

  • No hardcoded credentials or API keys
  • No unauthorized file system access (../)
  • Output does not expose sensitive information
  • Prompt injection protections in place
  • Input file paths validated (no ../ traversal)
  • Output directory restricted to workspace
  • Script execution in sandboxed environment
  • Error messages sanitized (no stack traces exposed)
  • Dependencies audited

Prerequisites

# Python dependencies
pip install -r requirements.txt

Evaluation Criteria

Success Metrics

  • Successfully executes main functionality
  • Output meets quality standards
  • Handles edge cases gracefully
  • Performance is acceptable

Test Cases

  1. Basic Functionality: Standard input → Expected output
  2. Edge Case: Invalid input → Graceful error handling
  3. Performance: Large dataset → Acceptable processing time

Lifecycle Status

  • Current Stage: Draft
  • Next Review Date: 2026-03-06
  • Known Issues: None
  • Planned Improvements:
    • Performance optimization
    • Additional feature support
Usage Guidance
This package contains contradictions and incomplete packaging rather than obvious malicious code, but treat it cautiously: - Don't assume the 'Transformer / fine-tuned model' claims are true — the included script is extractive and does not use heavy ML libraries. Ask the author which implementation is intended and request the actual model code if you expect a Transformer-based summarizer. - Verify dependencies before installing: the top-level requirements.txt ('main') is invalid while references/requirements.txt lists large ML packages. Installing unnecessary ML libs could be costly and expose you to additional attack surface. - Confirm missing tests and files: SKILL.md references test_main.py (not present). Ask for a complete test suite and a reproducible install/run guide. - Check input-file handling and path validation: the README/checklist mentions protection against ../ traversal, but the code does not show explicit path-sanitization. If you will run this on real PHI, run it in an isolated/sandboxed environment and audit file-path handling to prevent reading unintended files. - Validate that no network activity occurs at runtime: although SKILL.md states processing is local and visible code appears local, confirm there are no hidden calls or optional code paths that contact external endpoints (search dynamically for subprocess, urllib/requests, socket usage in the remainder of scripts/main.py or other files). - If you plan to process Protected Health Information (PHI), perform a security and compliance review (logging, data retention, access controls) and consider running the skill in an isolated environment with non-production data first. If you need a higher-confidence assessment, provide the full (untruncated) scripts/main.py and any additional files or a clarification from the author about intended model usage and expected dependencies.
Capability Analysis
Type: OpenClaw Skill Name: ehr-semantic-compressor Version: 0.1.0 The EHR Semantic Compressor is a clinical text summarization tool that processes medical records locally. While the documentation in SKILL.md claims to use a Transformer-based architecture, the actual implementation in scripts/main.py is a simple rule-based extractive summarizer using keyword scoring and regex. The script handles local file I/O for input and output as described, lacks any network connectivity or shell execution capabilities, and shows no signs of data exfiltration or malicious intent. The discrepancy between the claimed and actual technology appears to be a functional limitation rather than a security threat.
Capability Assessment
Purpose & Capability
The SKILL.md and references claim a Transformer encoder‑decoder, fine‑tuning on clinical corpora, and heavy ML deps (transformers, torch, scispacy), but the provided scripts/main.py implements a purely extractive, keyword-and-frequency based summarizer with no imports or code using transformers/torch/scispacy. This is a substantive mismatch between claimed capability and actual implementation and could indicate inaccurate documentation or incomplete/placeholder packaging.
Instruction Scope
SKILL.md instructs local processing and explicitly states no external API calls — the visible code appears to operate locally on supplied text. However SKILL.md's testing section refers to running python test_main.py but no test_main.py is present in the package. Also SKILL.md lists many security checklist items (path traversal protection, prompt injection protections) but there's no clear evidence the CLI enforces all of those protections; the script validates input text length and JSON shape, but file-path validation and sandboxing are not shown in the visible code.
Install Mechanism
There is no install spec (instruction-only) — lowest install risk — but the packaging is inconsistent: references/requirements.txt lists heavy ML libs (transformers, torch, numpy) while the top-level requirements.txt contains the single line 'main' (nonsensical). If users install the referenced heavy dependencies they may pull large ML toolchains unnecessarily. The project either ships inaccurate dependency metadata or is incomplete.
Credentials
The skill declares no required environment variables, no credentials, and the code does not attempt to read secrets or network credentials. There is no evidence of unrelated credential requests.
Persistence & Privilege
The skill is not always-enabled and has no reported privilege to persist beyond its own files. It reads input files and writes output files (expected for a CLI summarizer). There is no indication it modifies other skills or global agent configs.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install ehr-semantic-compressor
  3. After installation, invoke the skill by name or use /ehr-semantic-compressor
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v0.1.0
Initial release of ehr-semantic-compressor—an AI-powered tool for generating structured summaries from lengthy EHRs. - Summarizes 1600+ word EHR documents in 10–20 seconds with Transformer-based models - Extracts key clinical information: allergies, medications, diagnoses, family history, lab results, and more - Outputs 200–300 word bullet summaries with detailed section extraction - Supports JSON, Markdown, and text output formats; configurable via command-line arguments - Emphasizes clinical accuracy, local processing (no external API calls), and strict security controls - Provides comprehensive error handling and test coverage for robust usage
Metadata
Slug ehr-semantic-compressor
Version 0.1.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Ehr Semantic Compressor?

AI-powered EHR summarization using Transformer architecture to extract key clinical information from lengthy medical records. It is an AI Agent Skill for Claude Code / OpenClaw, with 232 downloads so far.

How do I install Ehr Semantic Compressor?

Run "/install ehr-semantic-compressor" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Ehr Semantic Compressor free?

Yes, Ehr Semantic Compressor is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Ehr Semantic Compressor support?

Ehr Semantic Compressor is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Ehr Semantic Compressor?

It is built and maintained by AIpoch (@aipoch-ai); the current version is v0.1.0.

💬 Comments