Lab result interpretation

From aipoch/medical-research-skills · View interactive version

Lab result interpretation is an AI agent skill from the GitHub repository aipoch/medical-research-skills. Transforms biochemical lab test results into clear, patient-friendly explanations. Covers blood routine, lipid panel, liver/kidney function, thyroid, electrolytes, and inflammation markers. Flags critical values, classifies severity, and generates structured interpretation rep...

How to use this skill

Skill file

Source: https://github.com/aipoch/medical-research-skills

Lab Result Interpretation Skill

A medical assistant tool that transforms complex biochemical laboratory test results into clear, patient-friendly explanations.

Quick Check

Use this command to verify that the packaged script entry point can be parsed before deeper execution.

python -m py_compile scripts/main.py

Audit-Ready Commands

Use these concrete commands for validation. They are intentionally self-contained and avoid placeholder paths.

python -m py_compile scripts/main.py
python scripts/main.py --help

When to Use

Workflow

  1. Parse lab report — Input: lab result text or file (--file/--input) → extract test names, values, units, reference ranges using regex patterns → Output: structured test data array
  2. Compare to reference ranges — Match each test against references/lab_reference_ranges.json → determine status (normal/high/low) → Output: status classification per test
  3. Assess severity — Classify: mild (slightly outside range), moderate (clinically significant deviation), critical (requires immediate attention) → Output: severity rating per abnormal value
  4. Generate explanations — For each abnormal value: explain what the test measures, what the deviation means, contextual health information → ⛔ Checkpoint: Flag critical values to user with "Seek immediate medical attention" warning before continuing → Output: patient-friendly explanation per test
  5. Format output — Combine all results into structured JSON with test_name, value, status, explanation, severity, recommendation → include medical disclaimer → Output: final interpretation report

Features

Supported Test Types

| Category | Tests |

|----------|-------|

| Blood Routine | WBC, RBC, Hemoglobin, Platelets, Hematocrit |

| Lipid Panel | Total Cholesterol, LDL, HDL, Triglycerides |

| Liver Function | ALT, AST, ALP, GGT, Bilirubin, Total Protein, Albumin |

| Kidney Function | Creatinine, BUN, eGFR, Uric Acid |

| Blood Sugar | Fasting Glucose, HbA1c |

| Thyroid | TSH, T3, T4, FT3, FT4 |

| Electrolytes | Sodium, Potassium, Chloride, Calcium, Magnesium |

| Inflammation | CRP, ESR |

Usage

As Module

from scripts.main import LabResultInterpreter

interpreter = LabResultInterpreter()
result = interpreter.interpret("Total Cholesterol: 5.8 mmol/L (Reference: 3.1-5.7)")
print(result.explanation)

CLI

python scripts/main.py --file lab_report.txt
python scripts/main.py --interactive

Parameters

| Name | Type | Default | Required | Description |

|------|------|---------|----------|-------------|

| file | string | "" | No | Path to lab report file to process |

| interactive | boolean | false | No | Enable interactive mode for manual input |

| input | string | "" | No | Direct lab test input string for interpretation |

Input Format

Accepts flexible formats:

Test Name: Value Unit (Reference: Min-Max)
Test Name Value Unit Ref: Min-Max
Test Name: Value (Min-Max)

Output Format

{
  "test_name": "Total Cholesterol",
  "value": 5.8,
  "unit": "mmol/L",
  "reference_min": 3.1,
  "reference_max": 5.7,
  "status": "high",
  "explanation": "Your total cholesterol is slightly above the normal range...",
  "severity": "mild",
  "recommendation": "Consider reducing saturated fat intake..."
}

Technical Details

Difficulty: Medium

Key Components:

Safety:

References

Medical Disclaimer

This tool provides educational information only and is not a substitute for professional medical advice, diagnosis, or treatment. Always consult with a qualified healthcare provider for interpretation of lab results.

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

Prerequisites

# Python dependencies
pip install -r requirements.txt

Evaluation Criteria

Success Metrics

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

Output Requirements

Every final response should make these items explicit when they are relevant:

Error Handling

Input Validation

This skill accepts requests that match the documented purpose of lab-result-interpretation and include enough context to complete the workflow safely.

Do not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:

lab-result-interpretation only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.

Response Template

Use the following fixed structure for non-trivial requests:

  1. Objective
  2. Inputs Received
  3. Assumptions
  4. Workflow
  5. Deliverable
  6. Risks and Limits
  7. Next Checks

If the request is simple, you may compress the structure, but still keep assumptions and limits explicit when they affect correctness.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.