{"data":{"slug":"github-aipoch-medical-research-skills-scientific-skills-other-medical-unit-converter-23420b7c08da","title":"Medical Unit Converter for Lab Values","summary":"Convert glucose, cholesterol, creatinine, and hemoglobin lab values between units (mg\/dL to mmol\/L, etc.) with formula transparency and clinical reference ranges.","url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-other-medical-unit-converter-23420b7c08da","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-aipoch-medical-research-skills-scientific-skills-other-medical-unit-converter-23420b7c08da","markdown_url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-other-medical-unit-converter-23420b7c08da.md","download_url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-other-medical-unit-converter-23420b7c08da\/download","category":{"slug":"data-research","name":"Data & Research"},"editor_note":"Provide the numeric value, source unit, and target unit as required inputs. Specify the analyte name (e.g., glucose, cholesterol) to include reference ranges in the output.","instructions":"---\nname: medical-unit-converter\ndescription: Convert medical laboratory values between units (mg\/dL to mmol\/L, etc.) with formula transparency and clinical reference ranges. Supports glucose, cholesterol, creatinine, and hemoglobin conversions.\nlicense: MIT\nauthor: AIPOCH\n---\n> **Source**: [https:\/\/github.com\/aipoch\/medical-research-skills](https:\/\/github.com\/aipoch\/medical-research-skills)\n\n# Medical Unit Converter\n\nConvert laboratory values between clinical units with formula transparency and reference range context. Supports glucose, cholesterol, creatinine, and hemoglobin.\n\n## When to Use\n\n- Converting glucose, cholesterol, creatinine, or hemoglobin lab values between unit systems\n- Verifying unit conversions for clinical documentation or research\n- Batch-converting lab result tables between mg\/dL and mmol\/L conventions\n- Providing reference ranges alongside converted values\n\n## Workflow\n\n1. Confirm the user objective, required inputs, and non-negotiable constraints before doing detailed work.\n2. Validate that the request matches the documented scope and stop early if the task would require unsupported assumptions.\n3. Use the packaged script path or the documented reasoning path with only the inputs that are actually available.\n4. Return a structured result that separates assumptions, deliverables, risks, and unresolved items.\n5. If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.\n\n## Supported Conversions\n\n| Analyte | From | To | Factor | Reference Range (target unit) |\n|---------|------|----|--------|-------------------------------|\n| Glucose | mg\/dL | mmol\/L | 0.0555 | 3.9\u20135.6 mmol\/L (fasting) |\n| Glucose | mmol\/L | mg\/dL | 18.018 | 70\u2013100 mg\/dL (fasting) |\n| Cholesterol | mg\/dL | mmol\/L | 0.02586 | < 5.2 mmol\/L (desirable) |\n| Cholesterol | mmol\/L | mg\/dL | 38.67 | < 200 mg\/dL (desirable) |\n| Creatinine | mg\/dL | \u03bcmol\/L | 88.4 | 62\u2013115 \u03bcmol\/L (male) |\n| Creatinine | \u03bcmol\/L | mg\/dL | 0.01131 | 0.7\u20131.3 mg\/dL (male) |\n| Hemoglobin | g\/dL | g\/L | 10 | 130\u2013175 g\/L (male) |\n| Hemoglobin | g\/L | g\/dL | 0.1 | 13\u201317.5 g\/dL (male) |\n\n## Input Parameters\n\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `--value`, `-v` | float | Yes | Numeric value to convert |\n| `--from-unit` | str | Yes | Source unit (e.g., `mg_dl`, `mmol_l`, `umol_l`, `g_dl`, `g_l`) |\n| `--to-unit` | str | Yes | Target unit |\n| `--analyte`, `-a` | str | No | Analyte name for reference range lookup (e.g., `glucose`, `cholesterol`, `creatinine`, `hemoglobin`) |\n\n## Output Format\n\n```json\n{\n  \"converted_value\": 5.55,\n  \"formula\": \"100 \u00d7 0.0555\",\n  \"from_unit\": \"mg_dl\",\n  \"to_unit\": \"mmol_l\",\n  \"analyte\": \"glucose\",\n  \"reference_range\": \"3.9\u20135.6 mmol\/L (fasting glucose)\"\n}\n```\n\n## Quick Check\n\n```bash\npython -m py_compile scripts\/main.py\npython scripts\/main.py --value 100 --from-unit mg_dl --to-unit mmol_l --analyte glucose\n```\n\n## Implementation Notes (for script developer)\n\nThe script must:\n\n1. **Parse CLI args** \u2014 use argparse with `--value`, `--from-unit`, `--to-unit`, `--analyte`. Pass parsed args to `conv.convert()`. Do not hardcode demo values in `main()`.\n2. **CONVERSIONS dict** \u2014 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.\n3. **convert() method** \u2014 return a dict with `converted_value`, `formula`, `from_unit`, `to_unit`, `analyte`, `reference_range`.\n4. **Unsupported pair** \u2014 if the unit pair is not in CONVERSIONS, print the supported conversions list and exit with code 1.\n5. **Fallback Partial result** \u2014 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\"`.\n\n## Input Validation\n\nThis skill accepts: numeric laboratory values with a source unit and target unit for conversion between recognized clinical measurement systems.\n\nIf the request does not involve converting a specific numeric lab value between units \u2014 for example, asking to interpret clinical results, diagnose conditions, or convert non-laboratory quantities \u2014 do not proceed. Instead respond:\n\n> \"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.\"\n\n## Error Handling\n\n- If `--value`, `--from-unit`, or `--to-unit` is missing, state exactly which fields are missing and request only those.\n- If the unit pair is not supported, list the supported conversions and stop.\n- If `--value` is not a valid number, reject with: `Error: --value must be a numeric value.`\n- If the task goes outside the documented scope, stop instead of guessing or silently widening the assignment.\n- If `scripts\/main.py` fails, report the failure point and provide the manual conversion formula as fallback.\n- Do not fabricate conversion factors or reference ranges.\n\n## Fallback Template\n\nWhen execution fails or inputs are incomplete, respond with this structure:\n\n```\nFALLBACK REPORT\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nObjective      : [restate the conversion goal]\nBlocked by     : [exact missing input or error]\nPartial result : [manual formula if conversion factor is known; \"Manual formula not available for this unit pair\" if unsupported]\nNext step      : [minimum action needed to unblock]\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n```\n\n## Response Template\n\n1. Objective\n2. Inputs Received\n3. Assumptions\n4. Workflow\n5. Deliverable\n6. Risks and Limits\n7. Next Checks\n\n## Prerequisites\n\nNo additional Python packages required beyond the standard library.\n","use_cases":["Convert glucose levels from mg\/dL to mmol\/L for international reporting","Verify cholesterol unit conversions for clinical documentation","Batch convert lab results between mg\/dL and mmol\/L conventions"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/aipoch\/medical-research-skills\/blob\/686e09dfdb45d9fa1a08664f06bb93769b3c9d91\/scientific-skills\/Other\/medical-unit-converter\/SKILL.md","source_commit":"686e09dfdb45d9fa1a08664f06bb93769b3c9d91","license":"MIT","version":null,"listing_approved_at":"2026-11-26","created_at":"2026-11-24T15:24:21.000000Z","updated_at":"2026-11-26T09:25:03.000000Z","seo_title":"Medical Unit Converter for Lab Values","seo_description":"Convert glucose, cholesterol, creatinine, and hemoglobin lab values between units with reference ranges and formula transparency.","seo_keywords":["medical unit converter","lab value conversion","clinical unit conversion","glucose unit conversion","cholesterol unit conversion"]}}