linking-umls-concepts
できること
このスキルは、医学用語をUMLSのコンセプト識別子に結びつけます。UMLSは多くの医学の語彙の同義語をまとめるものです。UMLSのコンテンツにはライセンスの制限があるため、利用者自身のUMLSの用語サービスのキーを使います。複数の語彙にまたがって一つのコンセプトIDが必要なチーム向けです。
使う場面
- ✓SNOMED、ICD-10、RxNormなどの語彙をまたいで、一つの共有のコンセプトIDが必要なとき。
- ✓MI と heart attack のような同義語を、同じコンセプトに対応づけたいとき。
- ✓意味の型、たとえば疾患や薬でコンセプトを絞りたいとき。
スキルのリンク
https://github.com/maziyarpanahi/openmed/blob/master/skills/linking-umls-concepts/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“これらのノートの用語を、私のUTSキーを使ってUMLSのコンセプトIDに結びつけ、同義語をまとめてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、各用語を利用者自身のキーでNLMの用語サービスに送り、サービスが返したコンセプトの識別子と名前だけを残します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Linking OpenMed entities to UMLS CUIs
Resolve concept spans that OpenMed extracts to UMLS Metathesaurus concepts.
The atom is the CUI (Concept Unique Identifier, e.g. C0011860): one CUI
unifies synonyms from many source vocabularies (SNOMED CT, ICD-10-CM, RxNorm,
MeSH, LOINC), making the CUI the natural hub for cross-vocabulary normalization.
Every concept also carries one or more semantic types (TUIs, e.g. Disease or
Syndrome T047) for type-based filtering.
Hard licensing boundary — read first. The UMLS Metathesaurus is license-restricted. OpenMed and this skill never bundle, ship, or cache Metathesaurus content. Concept linking runs out-of-process against the NLM UTS (UMLS Terminology Services) REST API using the user's own UTS API key. A free UTS account + API key is required (request at uts.nlm.nih.gov and accept the UMLS license). The Metathesaurus stays user-supplied: your code holds only the key (from the environment) and stores only returned CUIs/strings.
When to use
- You need one canonical id across vocabularies — e.g. to unify a SNOMED CT disorder, an ICD-10 code, and a free-text mention onto a single CUI.
- You want synonym normalization ("MI", "myocardial infarction", "heart
attack" →
C0027051). - You need semantic-type filtering to keep only, say, Pharmacologic Substance or Disease or Syndrome entities.
- You are cross-walking codes and need the CUI as the join key before pivoting to
RxNorm (
normalizing-rxnorm) or SNOMED (mapping-to-snomed).
Quick start (user-supplied UTS API key)
The UTS REST API base is https://uts-ws.nlm.nih.gov/rest. Authentication uses
your API key as the apiKey query parameter (the modern, simplest method).
import os, requests
UTS = "https://uts-ws.nlm.nih.gov/rest"
API_KEY = os.environ["UTS_API_KEY"] # USER's own key — never hardcoded
VERSION = "current" # or a fixed release like 2024AB
def search(term: str, sabs: str | None = None, count: int = 10) -> list[dict]:
"""Search the Metathesaurus for a term; optionally restrict source vocabs."""
params = {"string": term, "apiKey": API_KEY, "pageSize": count}
if sabs: # e.g. "SNOMEDCT_US,RXNORM,ICD10CM"
params["sabs"] = sabs
r = requests.get(f"{UTS}/search/{VERSION}", params=params, timeout=15)
r.raise_for_status()
return r.json().get("result", {}).get("results", [])
def concept(cui: str) -> dict:
"""Pull a concept's preferred name and semantic types."""
r = requests.get(f"{UTS}/content/{VERSION}/CUI/{cui}",
params={"apiKey": API_KEY}, timeout=15)
r.raise_for_status()
return r.json().get("result", {})
def crosswalk(cui: str, target_sab: str) -> list[dict]:
"""Atoms of a CUI in a target vocabulary (the cross-walk)."""
r = requests.get(f"{UTS}/content/{VERSION}/CUI/{cui}/atoms",
params={"apiKey": API_KEY, "sabs": target_sab,
"pageSize": 50}, timeout=20)
r.raise_for_status()
return r.json().get("result", [])
hits = search("type 2 diabetes") # -> [{ui: 'C0011860', name: ...}, ...]
sct = crosswalk("C0011860", "SNOMEDCT_US") # CUI -> SNOMED CT codes
Workflow
- Extract spans with OpenMed (Disease, Pharmaceutical, Chemical, Anatomy).
- Search each span via
/search/{version}for candidate CUIs. - Filter by semantic type (TUI) so a drug span resolves to a substance
concept, not a same-named disease. Pull semantic types from
/content/.../CUI/{cui}and keep only the expected group. - Rank candidates (exact preferred-name match > synonym match) and combine
with OpenMed's
confidenceto choose one CUI. - Cross-walk the chosen CUI to whatever target you actually store —
SNOMEDCT_US, ICD10CM, RXNORM, MSH — via
/CUI/{cui}/atoms?sabs=. - Emit the CUI plus the target code(s) and OpenMed source offsets.
Hand-off from OpenMed
openmed.analyze_text(..., output_format="dict") returns entities, each a dict
with text, label, confidence, start, end. Use the label to pick the
semantic-type group you keep:
import openmed
note = "History of myocardial infarction; started on lisinopril."
result = openmed.analyze_text(
note,
model_name="disease_detection_superclinical", # Disease category
output_format="dict",
)
# OpenMed label -> acceptab
よくある質問
スキルにUMLSのコンテンツが含まれますか?
いいえ。UMLSのコンテンツを同梱もキャッシュもしません。利用者はそれぞれ無料のアカウントとキーを用意する必要があります。
キーはどこから得ますか?
環境変数から読み込むので、コードがキーを保存することはありません。
コンセプトの種類で絞れますか?
はい。意味の型でコンセプトを絞り込めます。
詳細
作者による元の説明
Links entities extracted by OpenMed to UMLS Metathesaurus CUIs using the USER'S OWN UTS API key, with nothing from the Metathesaurus bundled or cached. Use when the user wants to normalize concepts across vocabularies to a single CUI, resolve synonyms via the UMLS, filter by semantic type, or cross-walk between SNOMED CT, ICD-10, RxNorm and MeSH through their shared CUI. Trigger keywords: UMLS, CUI, Metathesaurus, UTS API key, semantic type, TUI, MetaMap, QuickUMLS, concept normalization, cross-vocabulary. Pairs after OpenMed NER: consume Disease/Pharmaceutical/Chemical/Anatomy entities from o
repo: maziyarpanahi/openmed
人気
- GitHubのスター
- 5.8k
- ランキング
- #14709
- ライセンス
- Apache-2.0
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
annotating-variants
5.8kエージェントが、無料の公開アノテーターを使って、遺伝子バリアントの作用を予測し、HGVS名をゲノム上の位置に変換し、集団の頻度を付与できるよう支援します。
ask-openmed
5.8kエージェントが、臨床テキストの依頼に合ったOpenMedのワークフローを選べるよう支援します。患者データが含まれる可能性がある場合は、必ずプライバシーの確認から始めます。
assembling-fhir-bundles
5.8kエージェントが、複数のFHIR健康記録を、内部の参照を正しくつないだ一つのトランザクションBundleにまとめ、EHRに送れる状態にします。
auditing-deid-leakage
5.8kエージェントが、匿名化済みの臨床テキストに残っている識別子(SSN、カード番号、メール、日付など)をスキャンし、残っていれば公開を止めます。
似ているスキル
discrawl
394k保存済みのローカルなDiscordメッセージのアーカイブを検索して要約し、その新しさを確認し、ダイレクトメッセージを読めるようエージェントを支援します。
clickhouse-io
280kエージェントがClickHouseデータベースのクエリとスキーマを最適化できるようにします。高性能な分析処理向けのベストプラクティスを適用します。分析クエリが遅すぎるときに使います。
scientific-db-pubmed-database
280kエージェントが生物医学分野の科学論文を検索するのに役立ちます。特定の医療情報が必要な研究に便利です。