← 返回
未分类 中文

Medical Unit Converter

Convert medical laboratory values between units (mg/dL to mmol/L, etc.) with formula transparency and clinical reference ranges. Supports glucose, cholestero...
在医学实验室数值之间进行单位换算(如 mg/dL 与 mmol/L),提供公式透明度和临床参考范围。支持血糖、胆固醇等指标。
aipoch-ai aipoch-ai 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 354
下载
💾 0
安装
1
版本
#latest

概述

Medical Unit Converter

Convert laboratory values between clinical units with formula transparency and reference range context. Supports glucose, cholesterol, creatinine, and hemoglobin.

When to Use

  • Converting glucose, cholesterol, creatinine, or hemoglobin lab values between unit systems
  • Verifying unit conversions for clinical documentation or research
  • Batch-converting lab result tables between mg/dL and mmol/L conventions
  • Providing reference ranges alongside converted values

Workflow

  1. Confirm the user objective, required inputs, and non-negotiable constraints before doing detailed work.
  2. Validate that the request matches the documented scope and stop early if the task would require unsupported assumptions.
  3. Use the packaged script path or the documented reasoning path with only the inputs that are actually available.
  4. Return a structured result that separates assumptions, deliverables, risks, and unresolved items.
  5. If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.

Supported Conversions

AnalyteFromToFactorReference Range (target unit)
----------------------------------------------------------
Glucosemg/dLmmol/L0.05553.9–5.6 mmol/L (fasting)
Glucosemmol/Lmg/dL18.01870–100 mg/dL (fasting)
Cholesterolmg/dLmmol/L0.02586< 5.2 mmol/L (desirable)
Cholesterolmmol/Lmg/dL38.67< 200 mg/dL (desirable)
Creatininemg/dLμmol/L88.462–115 μmol/L (male)
Creatinineμmol/Lmg/dL0.011310.7–1.3 mg/dL (male)
Hemoglobing/dLg/L10130–175 g/L (male)
Hemoglobing/Lg/dL0.113–17.5 g/dL (male)

Input Parameters

ParameterTypeRequiredDescription
----------------------------------------
--value, -vfloatYesNumeric value to convert
--from-unitstrYesSource unit (e.g., mg_dl, mmol_l, umol_l, g_dl, g_l)
--to-unitstrYesTarget unit
--analyte, -astrNoAnalyte name for reference range lookup (e.g., glucose, cholesterol, creatinine, hemoglobin)

Output Format

{
  "converted_value": 5.55,
  "formula": "100 × 0.0555",
  "from_unit": "mg_dl",
  "to_unit": "mmol_l",
  "analyte": "glucose",
  "reference_range": "3.9–5.6 mmol/L (fasting glucose)"
}

Quick Check

python -m py_compile scripts/main.py
python scripts/main.py --value 100 --from-unit mg_dl --to-unit mmol_l --analyte glucose

Implementation Notes (for script developer)

The script must:

  1. Parse CLI args — use argparse with --value, --from-unit, --to-unit, --analyte. Pass parsed args to conv.convert(). Do not hardcode demo values in main().
  2. CONVERSIONS dict — include all 8 conversion pairs above, each with factor and reference_range fields. Keys must be (analyte, from_unit, to_unit) tuples or equivalent nested structure.
  3. convert() method — return a dict with converted_value, formula, from_unit, to_unit, analyte, reference_range.
  4. Unsupported pair — if the unit pair is not in CONVERSIONS, print the supported conversions list and exit with code 1.
  5. Fallback Partial result — when an unsupported unit pair is requested, always populate the Partial result field in the Fallback Template with: "Manual formula not available for this unit pair".

Input Validation

This skill accepts: numeric laboratory values with a source unit and target unit for conversion between recognized clinical measurement systems.

If the request does not involve converting a specific numeric lab value between units — for example, asking to interpret clinical results, diagnose conditions, or convert non-laboratory quantities — do not proceed. Instead respond:

> "medical-unit-converter is designed to convert medical laboratory values between unit systems. Your request appears to be outside this scope. Please provide a numeric value with source and target units, or use a more appropriate tool for your task."

Error Handling

  • If --value, --from-unit, or --to-unit is missing, state exactly which fields are missing and request only those.
  • If the unit pair is not supported, list the supported conversions and stop.
  • If --value is not a valid number, reject with: Error: --value must be a numeric value.
  • If the task goes outside the documented scope, stop instead of guessing or silently widening the assignment.
  • If scripts/main.py fails, report the failure point and provide the manual conversion formula as fallback.
  • Do not fabricate conversion factors or reference ranges.

Fallback Template

When execution fails or inputs are incomplete, respond with this structure:

FALLBACK REPORT
───────────────────────────────────────
Objective      : [restate the conversion goal]
Blocked by     : [exact missing input or error]
Partial result : [manual formula if conversion factor is known; "Manual formula not available for this unit pair" if unsupported]
Next step      : [minimum action needed to unblock]
───────────────────────────────────────

Response Template

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

Prerequisites

No additional Python packages required beyond the standard library.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 07:26 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

professional

All-Market Financial Data Hub

financial-ai-analyst
基于东方财富数据库,支持自然语言查询金融数据,覆盖A股、港股、美股、基金、债券等资产,提供实时行情、公司信息、估值、财务报表等,适用于投资研究、交易复盘、市场监控、行业分析、信用研究、财报审计、资产配置等场景,满足机构与个人需求。返回结果为
★ 130 📥 42,445
professional

A股量化 AkShare

mbpz
A股量化数据分析工具,基于AkShare库获取A股行情、财务数据、板块信息等。用于回答关于A股股票查询、行情数据、财务分析、选股等问题。
★ 194 📥 63,470
data-analysis

Survival Analysis (KM)

aipoch-ai
生成Kaplan‑Meier生存曲线,计算生存统计量(log‑rank检验、中位生存时间),并估算临床及生物...的 hazard ratios。
★ 2 📥 1,002