parsing-lab-values
하는 일
이 스킬은 에이전트에게 검사 결과를 참고 범위와 비교하는 방법을 가르칩니다. 각 값에 낮음, 정상, 높음, 위험 중 하나의 라벨을 붙여 결과를 쉽게 훑어볼 수 있게 합니다.
사용하는 경우
- ✓검사 값 목록에서 정상 범위를 벗어난 값을 알고 싶을 때.
- ✓135에서 145처럼 범위를 읽어야 하며, 미만 기호로 쓴 범위도 포함될 때.
- ✓H나 L 같은 검사 표시가 있어서 다시 계산하지 않고 그 표시를 유지하고 싶을 때.
스킬 링크
https://github.com/maziyarpanahi/openmed/blob/master/skills/parsing-lab-values/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 혈액검사 결과 중 참고 범위와 비교해서 높거나 낮은 것이 무엇인지 알려 주실 수 있나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 텍스트에서 범위를 읽고 숫자와 비교한 뒤 라벨을 붙이며, 검사실이 이미 설정한 표시가 있으면 그대로 유지합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
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-entitiessurfaces 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
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
- 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.
- 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. - 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. - Handle
"unknown"explicitly. Non-numeric values, empty/unparseable ranges, or unrecognized explicit flags yield"unknown". Treat it as "needs review," not "normal." - Attach the advisory. Surface
LAB_FLAG_ADVISORYwherever derived flags are shown — derived flags are heuristic and do not replace the originating laboratory's own diagnostic flagging.
Hand-off to / from OpenMed
- From
extracting-clinical-entities:analyze_textlab/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 callingderive_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: acritical/high/lowflag becomes a FHIRObservation.interpretationcode (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 fla
자주 묻는 질문
단위를 변환하나요?
아니요. 주어진 범위 안에서만 숫자를 비교하므로, 다른 단위의 값이 섞이지 않습니다.
검사실이 이미 표시한 값이면 어떻게 하나요?
계산된 값보다 검사실이 설정한 표시를 우선합니다.
표가 아닌 텍스트에서도 작동하나요?
네. 나트륨 132 mmol/L처럼 135에서 145 범위가 있는 임상 텍스트 안의 값도 읽을 수 있습니다.
상세 정보
작성자의 원본 설명
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
repo: maziyarpanahi/openmed
인기도
- GitHub 스타
- 5.8k
- 순위
- #14717
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
annotating-variants
5.8k에이전트가 유전 변이의 효과를 예측하고, HGVS 이름을 게놈 위치로 바꾸고, 무료 공개 주석 도구를 사용해 인구 빈도를 붙이도록 돕습니다.
ask-openmed
5.8k에이전트가 임상 텍스트 요청에 맞는 OpenMed 워크플로를 고르도록 돕되, 환자 데이터가 있을 수 있으면 먼저 개인 정보 확인을 거치게 합니다.
assembling-fhir-bundles
5.8k여러 FHIR 건강 기록을 EHR로 보낼 수 있도록 하나의 트랜잭션 Bundle로 묶고, 내부 참조를 올바르게 연결하도록 에이전트를 돕습니다.
auditing-deid-leakage
5.8k비식별화된 임상 텍스트에 남은 SSN, 카드 번호, 이메일, 날짜 같은 식별자를 검사하고, 남은 것이 있으면 공개를 막도록 돕습니다.
비슷한 스킬
gitcrawl
394k에이전트가 저장된 GitHub 이슈와 풀 리퀘스트 보관본을 검색하고, 중복 항목을 묶고, GitHub에서 현재 상태를 확인하도록 돕습니다.
slacrawl
394k에이전트가 로컬 Slack 보관본에서 메시지를 검색하고 개수를 세며, 보관본이 얼마나 최신인지 확인하고 필요할 때 새로 고치도록 돕습니다.
goplaces
394k에이전트가 Google Places로 장소를 검색하고, 세부 정보와 리뷰를 가져오고, 장소 이름을 확인하며, 스크립트용 JSON을 출력하도록 돕습니다.