Agent skill

Parsing Lab Values

by maziyarpanahi in maziyarpanahi/openmed

Parse laboratory values and reference ranges from clinical text and flag results as low, normal, high, or critical with OpenMed.

Apache-2.0Auto-check passed

Install Parsing Lab Values

skills CLI
$ npx skills add maziyarpanahi/openmed --skill parsing-lab-values -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install maziyarpanahi/openmed parsing-lab-values --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/maziyarpanahi/openmed.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/parsing-lab-values .claude/skills/parsing-lab-values && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
parsing-lab-values
GitHub stars
5.5k
Token cost
~1.6k tokens
SKILL.md length
588 words
Files
1
Skills in repo
74
Repo updated
First seen
Licence
Apache-2.0

At a glance

Parse laboratory values and reference ranges from clinical text and flag results as low, normal, high, or critical with OpenMed.

  • Works in 5 steps: Get value + range + (optional) lab flag… → Parse the reference range with… → Derive the flag with… → …
  • The user needs to interpret lab results
  • SKILL.md covers When to use, Quick start, Workflow and Hand-off to / from OpenMed, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Parsing Lab Values is an agent skill from maziyarpanahi/openmed. Parse laboratory values and reference ranges from clinical text and flag results as low, normal, high, or critical with OpenMed. Use when the user needs to interpret lab results, compute abnormal flags, parse reference ranges like "135-145" or "<5", honor an originating-lab flag (H/L/critical), or turn extracted lab entities into structured high/low/critical signals. Covers openmed.clinical.parsereferencerange, deriveabnormalflag, ReferenceRange, and AbnormalFlag, with UCUM/LOINC framing. Unit-agnostic — it does…

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: Local-first healthcare AI: clinical NER and HIPAA PII de-identification on hardware you control. 2,200+ medical models, 35 model-backed PII languages, and Python, MLX, Android… The licence is Apache-2.0.

When your agent uses it

  • The user needs to interpret lab results
  • Compute abnormal flags
  • Parse reference ranges like 135-145
  • Honor an originating-lab flag (H/L/critical)

Example prompts

  • “/parsing-lab-values”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Get value + range + (optional) lab flag from extracted lab entities. The
  2. Parse the reference range with parse_reference_range. It handles closed
  3. Derive the flag with derive_abnormal_flag(value, range, explicit_flag=).
  4. Handle "unknown" explicitly. Non-numeric values, empty/unparseable
  5. Attach the advisory. Surface LAB_FLAG_ADVISORY wherever derived flags

What it can do on your machine

Read from SKILL.md and the folder at commit 34d7b8c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • loinc.org
    • ucum.org
    • terminology.hl7.org
    • hl7.org

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Parsing Lab Values loads about 1.6k tokens when it runs. Until then it costs about 159 tokens; SKILL.md has 588 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~159
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from maziyarpanahi/openmed at commit 34d7b8c, republished under its Apache-2.0 licence (© maziyarpanahi). 588 words, ~1,636 tokens.

Download SKILL.mdSave it as .claude/skills/parsing-lab-values/SKILL.md (or your agent's skills folder).
name
parsing-lab-values
description
Parse laboratory values and reference ranges from clinical text and flag results as low, normal, high, or critical with OpenMed. Use when the user needs to interpret lab results, compute abnormal flags, parse reference ranges like "135-145" or "<5", honor an originating-lab flag (H/L/critical), or turn extracted lab entities into structured high/low/critical signals. Covers openmed.clinical.parse_reference_range, derive_abnormal_flag, ReferenceRange, and AbnormalFlag, with UCUM/LOINC framing. Unit-agnostic — it does not convert units. Pairs after extracting-clinical-entities (lab entities from analyze_text).
license
Apache-2.0
metadata.project
OpenMed
metadata.category
clinical-nlp
metadata.pairs
after
metadata.version
1.0

Parsing lab values

Lab results in clinical text arrive as a value, a unit, and a reference range ("Sodium 132 mmol/L (135–145)"). To act on them you need a structured abnormal flag — is 132 low, normal, high, or critical? OpenMed's openmed.clinical lab helpers parse the reference range deterministically and derive the flag, honoring any explicit flag the originating lab already supplied. The helpers are unit-agnostic by design: they compare numbers within a stated range and never convert units, so a mmol/L value is never silently compared against a mg/dL range.

When to use

  • After extracting-clinical-entities surfaces lab/measurement entities and you need to classify each as low / normal / high / critical.
  • The user asks to parse reference ranges, flag abnormal labs, build a flagged labs table, or interpret values like <5, >=10, 0.5 - 1.2.
  • You have an originating-lab flag (H, L, C, HH) and want it honored over a derived comparison.

Quick start

python
from openmed.clinical import (
    parse_reference_range, derive_abnormal_flag, LAB_FLAG_ADVISORY,
)

# Closed range
rng = parse_reference_range("135-145")
# -> {"low": 135.0, "high": 145.0, "low_inclusive": True, "high_inclusive": True}

derive_abnormal_flag(132, rng)            # "low"
derive_abnormal_flag(140, "135-145")      # "normal"  (raw range string accepted)
derive_abnormal_flag(150, "135 to 145")   # "high"

# One-sided bounds
derive_abnormal_flag(7, parse_reference_range("<5"))    # "high" (above the cap)
derive_abnormal_flag(3, parse_reference_range(">=10"))  # "low"

# Honor the lab's own explicit flag (takes precedence over derived comparison)
derive_abnormal_flag(132, "135-145", explicit_flag="C")   # "critical"
derive_abnormal_flag(132, "135-145", explicit_flag="HH")  # "critical"

# Unparseable / non-numeric inputs fail safe rather than guessing
derive_abnormal_flag("pending", "135-145")  # "unknown"
derive_abnormal_flag(132, "see report")     # "unknown"

print(LAB_FLAG_ADVISORY)  # surface this disclaimer with derived flags

AbnormalFlag is one of "low" | "normal" | "high" | "critical" | "unknown". ReferenceRange is a typed mapping of low, high, low_inclusive, high_inclusive.

Workflow

  1. Get value + range + (optional) lab flag from extracted lab entities. The value should be numeric; the range may be a raw string or a parsed mapping.
  2. Parse the reference range with parse_reference_range. It handles closed ranges ("135-145", "0.5 - 1.2", "135 to 145", en/em dashes) and one-sided bounds ("<5", "<=5", ">10", ">=10"). Contradictory or unparseable ranges return empty bounds rather than a guess — by design.
  3. Derive the flag with derive_abnormal_flag(value, range, explicit_flag=). Resolution order: an explicit lab flag wins first (H/HIGH, L/LOW, C/CRIT/CRITICAL, HH/LL → critical, N/NORMAL); an unknown explicit flag returns "unknown" instead of being silently ignored. With no explicit flag, it compares the numeric value against the parsed bounds, respecting inclusive vs. exclusive edges.
  4. Handle "unknown" explicitly. Non-numeric values, empty/unparseable ranges, or unrecognized explicit flags yield "unknown". Treat it as "needs review," not "normal."
  5. Attach the advisory. Surface LAB_FLAG_ADVISORY wherever derived flags are shown — derived flags are heuristic and do not replace the originating laboratory's own diagnostic flagging.
Show full SKILL.md (254 more words)Show less

Hand-off to / from OpenMed

  • From extracting-clinical-entities: analyze_text lab/measurement entities give you the value text, unit, and often the reference range; this skill turns them into structured flags. Parse the numeric value out of the entity surface before calling derive_abnormal_flag.
  • OpenMed calls: from openmed.clinical import parse_reference_range, derive_abnormal_flag, ReferenceRange, AbnormalFlag, LAB_FLAG_ADVISORY.
  • To reconciling-problem-lists / FHIR grounding: a critical/high/low flag becomes a FHIR Observation.interpretation code (HL7 v3 ObservationInterpretation: H, L, HH, LL, N). Ground the LOINC code and UCUM unit out-of-process; OpenMed emits the flag, not the terminology binding.

Edge cases & gotchas

  • Unit-agnostic — convert before comparing. The helpers ignore units entirely. If the value and the range are in different units (mg/dL vs mmol/L), the flag is wrong. Normalize units before calling, or only compare value and range that share a unit.
  • Inclusive vs. exclusive edges. "<5" makes 5 the high bound exclusive; a value of exactly 5 flags high. parse_reference_range records high_inclusive=False for < and True for <= — respect it.
  • Critical needs an explicit flag. Derived comparison yields only low/normal/ high. "critical" comes from the lab's explicit flag (C, HH, LL); the helpers do not infer critical thresholds beyond the reference range.
  • Empty bounds are intentional. A range with both bounds missing returns "unknown" from derive_abnormal_flag, not "normal". Don't treat unknown as in-range.
  • Local-first, advisory-only. Runs on-device; flags are decision support, not a diagnosis. Always carry LAB_FLAG_ADVISORY.

Standards & references

© maziyarpanahi, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/parsing-lab-values of maziyarpanahi/openmed.

Open the folder on GitHubat commit 34d7b8c

Compare with similar skills

Parsing Lab Values next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Parsing Lab Values compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Parsing Lab Values this skillmaziyarpanahi/openmed5.5k—~1.6kAutomated safety check: PassApache-2.0
Clinical Reportsdavila7/claude-code-templates33k11 repos~9.9kAutomated safety check: NotesMIT
Clinical Researchalirezarezvani/claude-skills28k—~2.7kAutomated safety check: PassMIT
Clinical Decision SupportK-Dense-AI/scientific-agent-skills48k1 repos~3.5kAutomated safety check: PassMIT
Clinical Data Cleaneraipoch/medical-research-skills1.9k—~2.4kAutomated safety check: PassMIT
Clinical Case Reportnexu-io/open-design100k—~2.2kAutomated safety check: PassApache-2.0

Similar skills

  • Clinical Reports

    davila7/claude-code-templates

    Write comprehensive clinical reports including case reports (CARE guidelines), diagnostic reports (radiology/pathology/lab), clinical trial reports (ICH-E3, SAE, CSR), and patient documentation…

    33k GitHub starsUsed in 11 repos~9.9k tokens
    Legal & ComplianceAuto-check: notes
  • Clinical Research

    alirezarezvani/claude-skills

    A skill your agent uses when designing a prospective clinical study before submission — selecting and classifying endpoints (primary / key-secondary / exploratory, with surrogate-endpoint flagging)…

    28k GitHub stars~2.7k tokensUpdated 1 mo ago
    Research & ScienceAuto-check passed
  • Clinical Decision Support

    K-Dense-AI/scientific-agent-skills

    Prepares and validates research-only clinical decision-support evaluation, evidence-profile, cohort, survival, biomarker/model, privacy, and governance artifacts.

    48k GitHub starsUsed in 1 repo~3.5k tokens
    Research & ScienceAuto-check passed
  • Clinical Data Cleaner

    aipoch/medical-research-skills

    A skill your agent uses when cleaning clinical trial data, preparing data for FDA/EMA submission, standardizing SDTM datasets, handling missing values in clinical studies, detecting outliers in lab…

    1.9k GitHub stars~2.4k tokensUpdated 24 days ago
    Data & AnalyticsAuto-check passed
  • Clinical Case Report

    nexu-io/open-design

    Structured medical case presentation for clinical rounds, conferences, and documentation.

    100k GitHub stars~2.2k tokensUpdated yesterday
    Auto-check passed
  • Value Proposition

    phuryn/pm-skills

    Design a detailed value proposition using a 6-part JTBD template — Who, Why, What before, How, What after, Alternatives.

    27k GitHub stars~1.5k tokensUpdated yesterday
    Marketing & SEOAuto-check passed

More from maziyarpanahi/openmed

All 74 skills in this repo
  • Checks OpenMed de-identified clinical text against the 18 HIPAA Safe Harbor identifier categories and reports gaps and residual re-identification risk.

    5.5k GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • OpenMed Model Card Writer

    maziyarpanahi/openmed

    Fills in a model card for an OpenMed clinical NER or de-identification model from its evaluation reports: intended use, metrics, subgroups and limitations.

    5.5k GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Walks a data pipeline against the HIPAA Privacy and Security Rule checklist and produces a gap report before it processes patient data.

    5.5k GitHub stars~2k tokensUpdated today
    Auto-check passed
  • ICD-10 Coding Assistant

    maziyarpanahi/openmed

    Suggests candidate ICD-10-CM diagnosis and ICD-10-PCS procedure codes for clinical text extracted by OpenMed, with rationale for a certified coder to review.

    5.5k GitHub stars~2k tokensUpdated today
    Auto-check passed
  • OpenMed ETL to OMOP CDM

    maziyarpanahi/openmed

    Maps OpenMed-extracted, terminology-coded conditions, drugs and measurements into OMOP CDM v5.4 tables for OHDSI and ATLAS analytics.

    5.5k GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Extracting SDOH and Z-Codes

    maziyarpanahi/openmed

    Finds social risks such as housing instability or food insecurity in clinical notes and proposes matching ICD-10-CM Z-codes for a coder to confirm.

    5.5k GitHub stars~1.9k tokensUpdated today
    Auto-check passed

Questions about Parsing Lab Values

What does Parsing Lab Values do?

Parse laboratory values and reference ranges from clinical text and flag results as low, normal, high, or critical with OpenMed. Parsing Lab Values is an agent skill from maziyarpanahi/openmed. Parse laboratory values and reference ranges from clinical text and flag results as low, normal, high, or critical with OpenMed.

When should I use Parsing Lab Values?

Parsing Lab Values fits situations like: the user needs to interpret lab results; compute abnormal flags; parse reference ranges like 135-145; honor an originating-lab flag (H/L/critical).

How do I install Parsing Lab Values in Claude Code?

Run `npx skills add maziyarpanahi/openmed --skill parsing-lab-values -a claude-code`. Or copy the skill folder (skills/parsing-lab-values in maziyarpanahi/openmed) into .claude/skills/parsing-lab-values in your project. Claude Code loads it when a task matches its description.

How do I install Parsing Lab Values in Codex?

Run `npx skills add maziyarpanahi/openmed --skill parsing-lab-values -a codex`. Or copy the skill folder (skills/parsing-lab-values in maziyarpanahi/openmed) into .agents/skills/parsing-lab-values in your project. Codex loads it when a task matches its description.

Can I use Parsing Lab Values in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add maziyarpanahi/openmed --skill parsing-lab-values -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/parsing-lab-values, .gemini/skills/parsing-lab-values, .github/skills/parsing-lab-values and .opencode/skills/parsing-lab-values in your project.

What does Parsing Lab Values need to run?

SKILL.md names no scripts, command-line tools or credentials: Parsing Lab Values is instructions for the agent only. Our summary lists: Python 3.

Does Parsing Lab Values access the network?

SKILL.md names 4 domains. As links in the text: loinc.org, ucum.org, terminology.hl7.org and hl7.org. This is read from the text; nothing was executed.

Is Parsing Lab Values safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Parsing Lab Values use?

Parsing Lab Values is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Parsing Lab Values use?

About 1.6k tokens (SKILL.md is roughly 6.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Parsing Lab Values?

Skills that share tags, products or a category with Parsing Lab Values: Clinical Reports (davila7/claude-code-templates, 33k stars), Clinical Research (alirezarezvani/claude-skills, 28k stars), Clinical Decision Support (K-Dense-AI/scientific-agent-skills, 48k stars) and Clinical Data Cleaner (aipoch/medical-research-skills, 1.9k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Parsing Lab Values?

maziyarpanahi (a GitHub user) maintains it in maziyarpanahi/openmed, which has 5,506 GitHub stars. The repository holds 74 skills in this directory. The repository was last updated on October 11, 2026.

Source: maziyarpanahi/openmed on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.