parsing-lab-values
O que ela faz
Esta skill ensina um agente a comparar resultados de exames com suas faixas de referência. Ela classifica cada valor como baixo, normal, alto ou crítico, para que os resultados sejam fáceis de examinar.
Quando usar
- ✓Quando um usuário tem uma lista de valores de exames e quer saber quais estão fora da faixa normal.
- ✓Quando um usuário quer que uma faixa de referência, como 135 a 145, seja lida corretamente, inclusive faixas escritas com sinal de menor que.
- ✓Quando um usuário tem um marcador do laboratório, como H ou L, e quer que esse marcador seja mantido em vez de recalculado.
Link da skill
https://github.com/maziyarpanahi/openmed/blob/master/skills/parsing-lab-values/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Você pode me dizer quais dos meus resultados de exame de sangue estão altos ou baixos em comparação com as faixas de referência?”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
O agente lê a faixa no texto e compara o número com ela. Devolve um rótulo e mantém qualquer marcador que o laboratório já tenha definido.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do 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
Perguntas frequentes
Ele converte unidades entre medidas?
Não. Compara números apenas dentro da faixa informada, para que valores em unidades diferentes não sejam misturados.
E se o laboratório já tiver marcado um valor?
O marcador próprio do laboratório prevalece sobre um valor calculado pelo agente.
Funciona com texto que não é tabela?
Sim. Pode ler valores escritos dentro de textos clínicos, como sódio 132 mmol/L com faixa de 135 a 145.
Detalhes
Descrição original do autor
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
Popularidade
- Estrelas no GitHub
- 5,8 mil
- Posição no ranking
- #14717
- Licença
- Apache-2.0
- Atualizada em
- 02/11/2026
Comentários
- …
Mais skills deste repositório
annotating-variants
5,8 milAjuda seu agente a prever o efeito de variantes genéticas, converter nomes HGVS em posições do genoma e incluir frequências populacionais, com anotadores gratuitos.
ask-openmed
5,8 milAjuda seu agente a escolher o fluxo de trabalho certo do OpenMed para um pedido de texto clínico, começando por uma verificação de privacidade sempre que houver dados de pacientes.
assembling-fhir-bundles
5,8 milAgrupa vários registros de saúde FHIR em um único Bundle de transação pronto para ser enviado a um prontuário eletrônico, com as referências internas ligadas corretamente.
auditing-deid-leakage
5,8 milProcura em textos clínicos desidentificados identificadores que sobraram, como SSN, números de cartão, e-mails e datas, e bloqueia a liberação se restar algum.
Skills parecidas
gitcrawl
394 milPermite que seu agente pesquise um arquivo salvo de issues e pull requests do GitHub, agrupe os duplicados e verifique o status atual deles no GitHub.
slacrawl
394 milPermite que seu agente pesquise e conte mensagens em um arquivo local do Slack, verifique quão atualizado ele está e o atualize quando necessário.
goplaces
394 milAjuda seu agente a buscar lugares, obter detalhes e avaliações e identificar nomes de lugares usando o Google Places, com saída em JSON para scripts.