reasonhub-snomed-semantic
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSNOMED Semantic Query
SNOMED 语义查询
Overview
概述
SNOMED CT is unique among clinical terminologies: every fully-defined concept
carries explicit attribute relationships encoded as FHIR properties. These
let you answer questions like "all disorders of the cardiovascular system" or
"all conditions with infarct morphology" using structured queries rather than
keyword search.
This skill walks through the full workflow: find the pivot concept, inspect its
relationships, choose the right attribute type, and build a
filter that returns exactly the right set of codes.
valueset_expandSNOMED CT在临床术语体系中独树一帜:每个完整定义的概念都带有以FHIR属性编码的明确属性关系。借助这些关系,您无需使用关键词搜索,而是通过结构化查询就能解答诸如“所有心血管系统疾病”或“所有具有梗死形态的病症”这类问题。
本技能将引导您完成完整工作流程:找到核心概念,检查其关系,选择合适的属性类型,并构建能精准返回对应编码集的过滤器。
valueset_expandOutput
输出
Every query produces two deliverables.
每个查询会生成两个交付成果。
1. FHIR ValueSet JSON (always deliver this)
1. FHIR ValueSet JSON(必须交付)
Return a complete resource with , , , and a
populated . This is the primary artifact — useful whether or
not expansion succeeds.
ValueSetnametitlestatuscompose.includejson
{
"resourceType": "ValueSet",
"name": "AllInfarctDisorders",
"title": "All Infarct Disorders",
"status": "draft",
"compose": {
"include": [
{
"system": "http://snomed.info/sct",
"version": "<from list_available_codesystem_versions>",
"filter": [
{ "property": "116676008", "op": "=", "value": "55641003" },
{ "property": "inactive", "op": "=", "value": "false" }
]
}
]
}
}返回包含、、以及已填充的完整资源。这是核心产物——无论扩展是否成功都具有实用价值。
nametitlestatuscompose.includeValueSetjson
{
"resourceType": "ValueSet",
"name": "AllInfarctDisorders",
"title": "All Infarct Disorders",
"status": "draft",
"compose": {
"include": [
{
"system": "http://snomed.info/sct",
"version": "<from list_available_codesystem_versions>",
"filter": [
{ "property": "116676008", "op": "=", "value": "55641003" },
{ "property": "inactive", "op": "=", "value": "false" }
]
}
]
}
}2. Expansion (ask the user)
2. 扩展结果(询问用户)
After delivering the ValueSet JSON, ask:
"Would you like me to expand this and show the matching codes? I can format the results as a markdown table or CSV."
If the user says yes, attempt once. On failure (see pi
limitation below), explain they can run the ValueSet JSON against any FHIR
terminology server or the ReasonHub API directly.
valueset_expandIf expansion succeeds, check the response for a count. The MCP
transport layer truncates returned rows regardless of the parameter,
and -based paging is unreliable. If rows returned are fewer than
, label the output explicitly and stop:
totalcountoffsettotal⚠️ Partial result — {n} of {total} codes shown. The full set is defined by the ValueSet JSON above; run it against any FHIR terminology server for the complete expansion.
Do not retry with different or values — this will not
retrieve additional rows.
countoffsetIf expansion succeeds, use the requested format:
Markdown table (default):
| Code | Display |
|---|---|
| Myocardial infarction |
| Cerebral infarction |
CSV (when the user asks to download, import, or use in a spreadsheet):
csv
code,display
22298006,"Myocardial infarction"
432504007,"Cerebral infarction"For SNOMED results, adding as a third column is useful when
the expansion mixes disorders, findings, and procedures:
semanticTagcsv
code,display,semanticTag
22298006,"Myocardial infarction",disorder
432504007,"Cerebral infarction",disorder交付ValueSet JSON后,询问用户:
“是否需要我扩展该集合并展示匹配的编码? 我可以将结果格式化为Markdown表格或CSV。”
如果用户同意,尝试执行一次。若失败(见下方pi限制说明),告知用户可将ValueSet JSON在任意FHIR术语服务器或ReasonHub API上直接运行。
valueset_expand若扩展成功,检查响应中的计数。MCP传输层会忽略参数截断返回的行数,且基于的分页不可靠。若返回行数少于,需明确标记输出并停止:
totalcountoffsettotal⚠️ 部分结果 — 显示{total}个编码中的{n}个。完整集合由上方的ValueSet JSON定义;可在任意FHIR术语服务器上运行以获取完整扩展结果。
请勿尝试使用不同的或值重试——这无法获取更多行数。
countoffset若扩展成功,按照用户要求的格式输出:
Markdown表格(默认):
| Code | Display |
|---|---|
| Myocardial infarction |
| Cerebral infarction |
CSV(当用户要求下载、导入或用于电子表格时):
csv
code,display
22298006,"Myocardial infarction"
432504007,"Cerebral infarction"对于SNOMED结果,当扩展结果混合了疾病、症状和手术时,添加作为第三列会更实用:
semanticTagcsv
code,display,semanticTag
22298006,"Myocardial infarction",disorder
432504007,"Cerebral infarction",disorderSNOMED's Semantic Model
SNOMED的语义模型
Common relationship attributes
常见关系属性
This table lists frequently encountered attributes. It is not exhaustive —
SNOMED CT defines hundreds of attribute types, and the exact set on any concept
depends on its definition. Always use on a representative
concept to discover the actual attributes present (see
Discovering Attributes by Lookup below).
codesystem_lookup| Attribute typeId | Name | Applies to | Example |
|---|---|---|---|
| Finding site | Disorders, findings | Finding site = Heart structure ( |
| Causative agent | Disorders, infections | Causative agent = Staphylococcus ( |
| Associated morphology | Disorders, findings | Associated morphology = Infarct ( |
| Procedure site - Direct | Procedures | The structure directly incised/excised. Kidney biopsy uses |
| Procedure site - Indirect | Procedures | The target organ reached through another structure. Often used where |
| Pathological process | Disorders | Pathological process = Inflammatory ( |
| Associated with | Findings, disorders | Associated with = Hypertension ( |
| Due to | Disorders, findings | Due to = Type 2 diabetes mellitus ( |
| Interprets | Findings | Interprets = Blood pressure ( |
| Has interpretation | Findings | Has interpretation = Increased ( |
| After | Procedures | After = General anaesthesia |
下表列出了常用属性,但并非详尽无遗——SNOMED CT定义了数百种属性类型,具体概念上的属性集取决于其定义。请始终对代表性概念使用来发现实际存在的属性(见下文通过查询发现属性)。
codesystem_lookup| 属性typeId | 名称 | 适用对象 | 示例 |
|---|---|---|---|
| 发病部位 | 疾病、症状 | 发病部位 = 心脏结构 ( |
| 致病因子 | 疾病、感染 | 致病因子 = 葡萄球菌 ( |
| 相关形态 | 疾病、症状 | 相关形态 = 梗死 ( |
| 手术部位-直接 | 手术 | 直接切开/切除的结构。肾活检使用的是 |
| 手术部位-间接 | 手术 | 通过其他结构到达的目标器官。常用于预期使用 |
| 病理过程 | 疾病 | 病理过程 = 炎症 ( |
| 相关联 | 症状、疾病 | 相关联 = 高血压 ( |
| 由...引起 | 疾病、症状 | 由...引起 = 2型糖尿病 ( |
| 对应指标 | 症状 | 对应指标 = 血压 ( |
| 指标解读 | 症状 | 指标解读 = 升高 ( |
| 术后 | 手术 | 术后 = 全身麻醉 |
How the filter works
过滤器工作原理
Relationship filters are outbound: they find concepts where a given
attribute points to a target concept.
concept --[363698007 Finding site]--> 80891009 Heart structureSo returns all concepts
whose "finding site" attribute equals "Heart structure".
filter: property=363698007, op==, value=80891009关系过滤器是向外指向的:它们会查找指定属性指向目标概念的所有概念。
concept --[363698007 发病部位]--> 80891009 心脏结构因此会返回所有“发病部位”属性等于“心脏结构”的概念。
filter: property=363698007, op==, value=80891009⚠️ =
is exact match, not subsumption
=⚠️ =
是精确匹配,而非包含关系
=The operator matches only concepts that store exactly the specified
concept ID as their attribute value. It does not apply subsumption to the
value side — filtering by (respiratory tract) will
not automatically include concepts coded to (lung structure) or
(lung parenchyma), even though both are subtypes of respiratory tract.
=363698007 = 32166700139607008113255004SNOMED concepts are coded to specific anatomical sites, not to tidy ancestor
concepts. For example:
| Concept | |
|---|---|
Bacterial pneumonia ( | |
Bacterial respiratory infection ( | |
Pneumoconiosis ( | |
A query for (respiratory tract) matches none of
these, because none are coded to that exact concept ID.
363698007 = 321667001Practical rule: always call on a few representative
concepts in your target clinical domain first. Read the actual value stored for
your attribute, then use that concept ID — or its closest common ancestor that
concepts in that domain actually share — as your filter value.
codesystem_lookupWhat you cannot do directly: reverse lookups ("find all concepts that hypertension causes"). SNOMED doesn't have aattribute. Use the IS-A hierarchy or causative-agent filter instead.has-symptom
=363698007 = 32166700139607008113255004SNOMED概念会编码至特定的解剖部位,而非通用的父类概念。例如:
| 概念 | |
|---|---|
细菌性肺炎 ( | |
细菌性呼吸道感染 ( | |
尘肺病 ( | |
查询(呼吸道)不会匹配上述任何一个概念,因为没有概念精确编码到该ID。
363698007 = 321667001实用规则: 始终先对目标临床领域中的几个代表性概念调用。查看属性实际存储的值,然后使用该概念ID——或该领域概念实际共享的最近公共父类ID——作为过滤值。
codesystem_lookup无法直接实现的操作: 反向查询(“查找所有由高血压引起的概念”)。SNOMED没有属性。请改用IS-A层级结构或致病因子过滤器。has-symptom
Workflow
工作流程
Step 1 — Identify the pivot concept
步骤1 — 确定核心概念
The pivot is the concept you want to filter by (the attribute value).
Use with a descriptive query:
search_snomedsearch_snomed(query="heart structure anatomy")
search_snomed(query="infarct morphology")
search_snomed(query="staphylococcus aureus organism")Pick the best match. Body structures usually have semantic tag ,
organisms have , morphologies have .
(body structure)(organism)(morphologic abnormality)核心概念是您要依据其进行过滤的概念(即属性值)。
使用进行描述性查询:
search_snomedsearch_snomed(query="heart structure anatomy")
search_snomed(query="infarct morphology")
search_snomed(query="staphylococcus aureus organism")选择最匹配的结果。身体结构通常带有语义标签,生物带有,形态异常带有。
(body structure)(organism)(morphologic abnormality)Step 2 — Confirm with codesystem_lookup
codesystem_lookup步骤2 — 用codesystem_lookup
确认
codesystem_lookupcodesystem_lookup(code="80891009", system="http://snomed.info/sct")Check:
- matches what you expect
display - confirms the concept type
semanticTag - is
inactivefalse
codesystem_lookup(code="80891009", system="http://snomed.info/sct")检查:
- 是否符合预期
display - 是否确认了概念类型
semanticTag - 是否为
inactivefalse
Step 3 — Discover the attribute type via lookup
步骤3 — 通过查询发现属性类型
Do not rely solely on the table above. Always look up a representative
concept in the target domain to see which attribute typeIds are actually
present:
codesystem_lookup(code="22298006", system="http://snomed.info/sct")不要仅依赖上表。始终查询目标领域中的一个代表性概念,查看实际存在的属性typeId:
codesystem_lookup(code="22298006", system="http://snomed.info/sct")Returns properties including:
返回的属性包括:
363698007 (Finding site) = 74281007 (Myocardium structure)
363698007 (发病部位) = 74281007 (心肌结构)
116676008 (Associated morphology) = 55641003 (Infarct)
116676008 (相关形态) = 55641003 (梗死)
Properties whose `code` is a bare numeric SNOMED ID are attribute
relationships. Named properties (`parent`, `inactive`, `semanticTag`, etc.)
are metadata, not clinical attributes.
**Example — discovering hypertension's attributes:**codesystem_lookup(code="38341003", system="http://snomed.info/sct")
`code`为纯数字SNOMED ID的属性是关系属性。命名属性(`parent`、`inactive`、`semanticTag`等)是元数据,而非临床属性。
**示例 — 发现高血压的属性:**codesystem_lookup(code="38341003", system="http://snomed.info/sct")
Reveals:
显示:
363698007 (Finding site) = 51840005 (Systemic circulatory system)
363698007 (发病部位) = 51840005 (全身循环系统)
363713009 (Interprets) = 35105006 (Increased)
363713009 (对应指标) = 35105006 (升高)
363714003 (Has interpretation)= 75367002 (Blood pressure)
363714003 (指标解读)= 75367002 (血压)
Note: sufficientlyDefined=false — primitive concept, sparse attributes
注意:sufficientlyDefined=false —— 基础概念,属性稀疏
Hypertension's attributes describe *what it is* (elevated BP in the
circulatory system), not its clinical associations. This is why the
`associated with` filter for "symptoms of hypertension" returns sparse
results — see [Translating Clinical Questions](#translating-clinical-questions).
高血压的属性描述的是**它是什么**(循环系统中的血压升高),而非其临床关联。这就是为什么使用`相关联`过滤器查询“高血压的症状”返回结果稀疏的原因——见[临床问题转换](#临床问题转换)。Step 4 — Expand with a property filter
步骤4 — 使用属性过滤器扩展
json
{
"resourceType": "ValueSet",
"compose": {
"include": [{
"system": "http://snomed.info/sct",
"version": "<use list_available_codesystem_versions>",
"filter": [
{
"property": "363698007",
"op": "=",
"value": "80891009"
}
]
}]
}
}Pass this to .
valueset_expand⚠️ pi limitation: In the pi agent theparameter is always received as a string due tovaluesettype serialization, causing$ref. Retrying or removing optional parameters will not fix this. Stop after one attempt and usevalueset: must be objectinstead (seereasonhub-skills expandskill). If the CLI is not installed (valueset-propertiesdoes not install it), run:npx skills addcurl -fsSL https://raw.githubusercontent.com/reason-healthcare/reasonhub-skills/main/bin/reasonhub-skills -o ~/.local/bin/reasonhub-skills && chmod +x ~/.local/bin/reasonhub-skills
json
{
"resourceType": "ValueSet",
"compose": {
"include": [{
"system": "http://snomed.info/sct",
"version": "<use list_available_codesystem_versions>",
"filter": [
{
"property": "363698007",
"op": "=",
"value": "80891009"
}
]
}]
}
}将此传递给。
valueset_expand⚠️ pi限制: 在pi agent中,由于类型序列化,$ref参数始终以字符串形式接收,导致报错valueset。重试或移除可选参数无法解决此问题。尝试一次后停止,改用valueset: must be object(见reasonhub-skills expand技能)。如果未安装CLI(valueset-properties未安装),运行:npx skills addcurl -fsSL https://raw.githubusercontent.com/reason-healthcare/reasonhub-skills/main/bin/reasonhub-skills -o ~/.local/bin/reasonhub-skills && chmod +x ~/.local/bin/reasonhub-skills
Step 5 — Refine with stacked filters
步骤5 — 叠加过滤器优化
Filters in the same are combined with AND:
includejson
"filter": [
{ "property": "concept", "op": "is-a", "value": "64572001" },
{ "property": "363698007", "op": "=", "value": "80891009" },
{ "property": "inactive", "op": "=", "value": "false" }
]→ Active disorders () whose finding site is the heart.
is-a 64572001同一中的过滤器会通过AND组合:
includejson
"filter": [
{ "property": "concept", "op": "is-a", "value": "64572001" },
{ "property": "363698007", "op": "=", "value": "80891009" },
{ "property": "inactive", "op": "=", "value": "false" }
]→ 发病部位为心脏的活动性疾病()。
is-a 64572001Common Clinical Patterns
常见临床模式
All disorders of a body structure
某身体结构的所有疾病
json
{ "property": "363698007", "op": "=", "value": "<body_structure_id>" }json
{ "property": "363698007", "op": "=", "value": "<body_structure_id>" }All disorders caused by an agent
某因子引起的所有疾病
json
{ "property": "246075003", "op": "=", "value": "<organism_or_substance_id>" }json
{ "property": "246075003", "op": "=", "value": "<organism_or_substance_id>" }All disorders with a morphology
具有某形态的所有疾病
json
{ "property": "116676008", "op": "=", "value": "<morphology_id>" }json
{ "property": "116676008", "op": "=", "value": "<morphology_id>" }All procedures on a body site
某身体部位的所有手术
json
{ "property": "363704007", "op": "=", "value": "<body_structure_id>" }Check withwhether the procedure usescodesystem_lookup(Direct) or363704007(Indirect) — kidney biopsy, for example, uses Indirect.405813007
json
{ "property": "363704007", "op": "=", "value": "<body_structure_id>" }使用确认手术使用的是codesystem_lookup(直接)还是363704007(间接)——例如肾活检使用的是间接。405813007
All subtypes of a condition (hierarchy)
某病症的所有子类型(层级结构)
json
{ "property": "concept", "op": "is-a", "value": "<parent_concept_id>" }⚠️captures clinical subtypes only, NOT complications. Concepts like "retinopathy due to T2DM" are NOT IS-A children of T2DM — they link viais-a(Due to). Use the two-include compose pattern below for complete eCQM sets.42752001
json
{ "property": "concept", "op": "is-a", "value": "<parent_concept_id>" }⚠️仅捕获临床子类型,不包括并发症。 例如“2型糖尿病引起的视网膜病变”这类概念并非2型糖尿病的IS-A子类——它们通过is-a(由...引起)关联。如需完整的eCQM集合,请使用下文的双include组合模式。42752001
Strict descendants only (exclude the parent itself)
仅严格子类(排除父类本身)
json
{ "property": "concept", "op": "descendent-of", "value": "<parent_concept_id>" }json
{ "property": "concept", "op": "descendent-of", "value": "<parent_concept_id>" }All disorders caused by / due to a condition
某病症引起的所有疾病
json
{ "property": "42752001", "op": "=", "value": "<condition_id>" }Captures complication concepts encoded with "Due to" (e.g., retinopathy/neuropathy due to T2DM).
json
{ "property": "42752001", "op": "=", "value": "<condition_id>" }捕获以“由...引起”编码的并发症概念(例如2型糖尿病引起的视网膜病变/神经病变)。
Complete eCQM ValueSet: condition subtypes + their complications (two-include compose)
完整eCQM ValueSet:病症子类型+并发症(双include组合)
json
{
"compose": {
"include": [
{
"system": "http://snomed.info/sct",
"filter": [{ "property": "concept", "op": "is-a", "value": "<condition_id>" }]
},
{
"system": "http://snomed.info/sct",
"filter": [{ "property": "42752001", "op": "=", "value": "<condition_id>" }]
}
]
}
}json
{
"compose": {
"include": [
{
"system": "http://snomed.info/sct",
"filter": [{ "property": "concept", "op": "is-a", "value": "<condition_id>" }]
},
{
"system": "http://snomed.info/sct",
"filter": [{ "property": "42752001", "op": "=", "value": "<condition_id>" }]
}
]
}
}Active concepts only (add to any filter set)
临床问题转换
json
{ "property": "inactive", "op": "=", "value": "false" }自然语言的临床问题通常无法直接映射到单一SNOMED属性。使用下表选择最佳策略,当属性覆盖不足时使用备选方案。
| 临床问题 | 最佳策略 | 覆盖范围 | 备选方案 |
|---|---|---|---|
| “[身体部位]的所有疾病” | | ⚠️ | 基于身体部位疾病父类的 |
| “[因子]引起的所有病症” | | ✅ 良好——感染建模完善 | 基于感染病层级的 |
| “[身体部位]的所有手术” | | ⚠️ 先查询确认——许多手术使用 | 基于手术层级的 |
| “[病症]的子类型” | | ✅ 始终有效 | — |
| “与[病症]相关的症状/体征” | | ⚠️ 稀疏——仅返回明确编码关联的概念 | 见下方说明 |
| “[病症]的并发症” | | ✅ 良好——完整定义的并发症概念会编码此关系 | |
| “[病症]的风险因素” | | ⚠️ 稀疏 | 语义搜索 |
Translating Clinical Questions
“相关联”模式及其局限性
Natural language clinical questions often don't map cleanly to a single
SNOMED attribute. Use this table to pick the best strategy, with fallbacks
when attribute coverage is thin.
| Clinical question | Best strategy | Coverage | Fallback |
|---|---|---|---|
| "All disorders of [body part]" | | ⚠️ | |
| "All conditions caused by [agent]" | | ✅ Good — infections well-modelled | |
| "All procedures on [body part]" | | ⚠️ Look up first — many procedures use | |
| "Subtypes of [condition]" | | ✅ Always works | — |
| "Symptoms / findings associated with [condition]" | | ⚠️ Sparse — only explicitly encoded associations | See note below |
| "Complications of [condition]" | | ✅ Good — fully-defined complication concepts encode this | |
| "Risk factors for [condition]" | | ⚠️ Sparse | Semantic search |
查询“与X相关的症状/体征”的过滤器为:
json
"filter": [
{ "property": "47429007", "op": "=", "value": "<condition_id>" },
{ "property": "concept", "op": "is-a", "value": "404684003" }
]这仅返回将关联明确编码为向外属性的概念。覆盖范围完全取决于该病症在SNOMED中的建模完善程度:
- 建模完善的病症(有许多完整定义的子类):返回有用结果。例如:特定传染病、代谢疾病。
- 基础病症(,如高血压):病症本身的向外属性很少,且很少有概念将高血压编码为其“相关联”值。扩展结果可能为空或非常少。
sufficientlyDefined = false
当“相关联”返回结果稀疏时,改用以下策略:
-
子类型——病症的子类通常就是其更具体的表现:json
{ "property": "concept", "op": "is-a", "value": "<condition_id>" } -
发病部位——查找同一解剖部位的所有体征:json
{ "property": "363698007", "op": "=", "value": "<site_from_lookup>" }先对病症使用提取其发病部位。codesystem_lookup -
语义搜索——使用,结合病症名称和上下文术语(如“hypertension complication”、“elevated blood pressure finding”)查找单个概念,然后构建明确列表。
search_snomed
The associated with
pattern and its limits
associated with示例:“所有梗死疾病”——发现相关形态
The filter for "symptoms/findings associated with X" is:
json
"filter": [
{ "property": "47429007", "op": "=", "value": "<condition_id>" },
{ "property": "concept", "op": "is-a", "value": "404684003" }
]This returns only concepts that explicitly encode the association as an
outbound attribute. Coverage depends entirely on how well that condition is
modelled in SNOMED:
- Well-modelled conditions (many fully-defined descendants): returns useful results. Example: specific infectious diseases, metabolic disorders.
- Primitive conditions (, e.g., hypertension): the condition itself has few outbound attributes, and few concepts encode hypertension as their
sufficientlyDefined = falsevalue. The expansion will likely be empty or very small.associated with
When returns thin results, use these strategies instead:
associated with-
Subtypes — the condition's descendants often are its more specific presentations:json
{ "property": "concept", "op": "is-a", "value": "<condition_id>" } -
Finding site — find all findings at the same anatomical site:json
{ "property": "363698007", "op": "=", "value": "<site_from_lookup>" }Useon the condition first to extract its finding site.codesystem_lookup -
Semantic search — usewith the condition name plus context terms (
search_snomed,"hypertension complication") to find individual concepts, then build an explicit list."elevated blood pressure finding"
此示例展示了单一非层级属性过滤器如何跨所有器官系统返回临床精准、全面的结果集——这是SNOMED区别于ICD-10或文本搜索的核心能力。
undefinedWorked example: "All infarct disorders" — discovering associated morphology
步骤1 — 查询已知的完整定义梗死疾病以发现属性
This example shows how a single non-hierarchy attribute filter crosses every
organ system to return a clinically precise, exhaustive result set — the
capability that most distinguishes SNOMED from ICD-10 or text search.
undefinedcodesystem_lookup("22298006") # 心肌梗死
→ 116676008 (相关形态) = 55641003 (梗死)
→ 363698007 (发病部位) = 74281007 (心肌结构)
→ sufficientlyDefined = true ← 完整定义,属性集齐全
Step 1 — look up a known, fully-defined infarct disorder to discover the attribute
步骤2 — 确认形态概念处于激活状态且类型正确
codesystem_lookup("22298006") # Myocardial infarction
→ 116676008 (Associated morphology) = 55641003 (Infarct)
→ 363698007 (Finding site) = 74281007 (Myocardium structure)
→ sufficientlyDefined = true ← fully defined, complete attribute set
codesystem_lookup("55641003") # 梗死
→ semanticTag = "morphologic abnormality" ← 符合116676008值的正确类型
→ inactive = false
Step 2 — confirm the morphology concept is active and correctly typed
步骤3 — 验证同一形态值出现在不同器官的概念上
codesystem_lookup("55641003") # Infarct
→ semanticTag = "morphologic abnormality" ← correct type for 116676008 values
→ inactive = false
codesystem_lookup("432504007") # 脑梗死
→ 116676008 (相关形态) = 55641003 (梗死) ← 相同值
→ 363698007 (发病部位) = 83678007 (大脑) ← 不同部位
Step 3 — verify the same morphology value appears on a different organ
步骤4 — 确认普通中风使用的是不同形态
codesystem_lookup("432504007") # Cerebral infarction
→ 116676008 (Associated morphology) = 55641003 (Infarct) ← same value
→ 363698007 (Finding site) = 83678007 (Cerebrum) ← different site
codesystem_lookup("230690007") # 脑血管意外(中风,CVA)
→ 116676008 (相关形态) = 37782003 (损伤) ← 不是梗死
→ 过滤器会正确排除出血性中风和普通CVA
**步骤5 — 扩展所有器官的梗死疾病**
```json
{
"filter": [
{ "property": "116676008", "op": "=", "value": "55641003" },
{ "property": "inactive", "op": "=", "value": "false" }
]
}→ 心肌梗死、脑梗死、肾梗死、肺梗死、脾梗死、肠系膜梗死、骨梗死……
一个过滤器,覆盖所有器官,无需文本匹配。
步骤6 — 仅缩小至缺血性中风(叠加过滤器)
json
{
"filter": [
{ "property": "116676008", "op": "=", "value": "55641003" },
{ "property": "363698007", "op": "=", "value": "83678007" },
{ "property": "inactive", "op": "=", "value": "false" }
]
}→ 脑梗死及其子类型(血栓性、栓塞性、腔隙性、桥脑梗死)——仅缺血性中风,出血性中风被主动排除。
Step 4 — confirm generic stroke uses a DIFFERENT morphology
示例实践
—
“所有器官的梗死疾病”
codesystem_lookup("230690007") # Cerebrovascular accident (stroke, CVA)
→ 116676008 (Associated morphology) = 37782003 (Damage) ← NOT Infarct
→ the filter will correctly exclude hemorrhagic stroke and generic CVA
**Step 5 — expand all infarct disorders (cross-organ)**
```json
{
"filter": [
{ "property": "116676008", "op": "=", "value": "55641003" },
{ "property": "inactive", "op": "=", "value": "false" }
]
}→ Myocardial infarction, cerebral infarction, renal infarction, pulmonary
infarction, splenic infarction, mesenteric infarction, bone infarction…
One filter. Every organ. No text matching.
Step 6 — narrow to ischemic stroke only (stacked filters)
json
{
"filter": [
{ "property": "116676008", "op": "=", "value": "55641003" },
{ "property": "363698007", "op": "=", "value": "83678007" },
{ "property": "inactive", "op": "=", "value": "false" }
]
}→ Cerebral infarction and its subtypes (thrombotic, embolic, lacunar,
pontine) — ischemic stroke only, hemorrhagic stroke excluded by design.
- 查询:→
codesystem_lookup("22298006")(形态=梗死)116676008 = 55641003 - 验证:→ 脑梗死具有相同形态
codesystem_lookup("432504007") - 对比:→ CVA的形态为
codesystem_lookup("230690007")(损伤),而非梗死37782003 - 过滤:→ 心肌梗死、脑梗死、肾梗死、肺梗死……
116676008 = 55641003 - 叠加:添加(大脑)以缩小至仅缺血性中风子类型
363698007 = 83678007
Worked Examples
“所有心脏疾病”
"All infarct disorders across every organ"
—
- Lookup: →
codesystem_lookup("22298006")(morphology = Infarct)116676008 = 55641003 - Verify: → same morphology on cerebral infarction
codesystem_lookup("432504007") - Contrast: → CVA has morphology =
codesystem_lookup("230690007")(Damage), not Infarct37782003 - Filter: → MI, cerebral infarction, renal infarction, pulmonary infarction…
116676008 = 55641003 - Stack: add (Cerebrum) to narrow to ischemic stroke subtypes only
363698007 = 83678007
- 查询:→ 确认
codesystem_lookup("22298006")(心肌)——注意这是心肌而非心脏。查询多个概念以找到最常用的宽泛部位。363698007 = 74281007 - 搜索:→
search_snomed("heart structure body structure")心脏结构80891009 - 过滤:在(疾病)范围内使用
is-a 64572001363698007 = 80891009是精确匹配。编码为=(心肌)或74281007(左心室)的概念会被遗漏。若覆盖不足,可使用致病因子或40527003作为更宽泛的筛选方式。is-a
"All cardiac disorders"
“所有细菌感染”
- Lookup: → confirms
codesystem_lookup("22298006")(Myocardium) — note this is the myocardium, not heart. Check several concepts to find the broadest commonly-used site.363698007 = 74281007 - Search: →
search_snomed("heart structure body structure")Heart structure80891009 - Filter: inside
363698007 = 80891009(Disorder)is-a 64572001is exact match. Concepts coded to=(Myocardium) or74281007(Left ventricle) are missed. Use causative-agent or40527003as a broader net if coverage is thin.is-a
- 搜索:→
search_snomed("bacteria organism")细菌409822003 - 过滤:在(传染病)范围内使用
is-a 40733004246075003 = 409822003
"All bacterial infections"
“所有缺血性病症”
- Search: →
search_snomed("bacteria organism")Bacterium409822003 - Filter: inside
246075003 = 409822003(Infectious disease)is-a 40733004
- 搜索:→
search_snomed("ischemic process pathological")255426005 - 过滤:
370135005 = 255426005
"All ischemic conditions"
“所有肾脏手术”
- Search: →
search_snomed("ischemic process pathological")255426005 - Filter:
370135005 = 255426005
- 查询:(肾活检)→
codesystem_lookup("7246002")—— 使用间接部位,而非直接405813007 = 64033007 - 搜索:→
search_snomed("kidney structure body structure")64033007 - 过滤:尝试和
363704007 = 64033007;两者均在405813007 = 64033007(手术)范围内is-a 71388002
"All renal procedures"
eCQM分母/分子:所有2型糖尿病概念(子类型+并发症)
- Lookup: (Kidney biopsy) →
codesystem_lookup("7246002")— uses Indirect site, not Direct405813007 = 64033007 - Search: →
search_snomed("kidney structure body structure")64033007 - Filter: try both and
363704007 = 64033007; use405813007 = 64033007(Procedure) in bothis-a 71388002
这是构建全面eCQM标准的典型示例。
步骤1 — 验证根概念
codesystem_lookup("44054006") → display = "Type 2 diabetes mellitus"
sufficientlyDefined = false ← 基础概念
parent = 73211009 (Diabetes mellitus)步骤2 — 检查哪些概念是IS-A子类与并发症关联
| 概念 | 编码 | 是否属于 | 关联方式 |
|---|---|---|---|
| 肥胖型2型糖尿病 | | ✅ 是 | 直接 |
| 胰岛素治疗的2型糖尿病 | | ✅ 是 | 直接 |
| 2型糖尿病引起的视网膜病变 | | ❌ 否 | |
| 2型糖尿病引起的神经病变 | | ❌ 否 | |
| 2型糖尿病引起的冠心病 | | ❌ 否 | |
仅使用会遗漏所有并发症概念。如需完整的eCQM集合,请使用合并两个树结构的双include ValueSet。is-a
步骤3 — 构建完整ValueSet
json
{
"resourceType": "ValueSet",
"compose": {
"include": [
{
"system": "http://snomed.info/sct",
"version": "<see list_available_codesystem_versions>",
"filter": [
{ "property": "concept", "op": "is-a", "value": "44054006" },
{ "property": "inactive", "op": "=", "value": "false" }
]
},
{
"system": "http://snomed.info/sct",
"version": "<see list_available_codesystem_versions>",
"filter": [
{ "property": "42752001", "op": "=", "value": "44054006" },
{ "property": "inactive", "op": "=", "value": "false" }
]
}
]
}
}- Include 1 捕获根编码及其所有IS-A子类型(2型糖尿病的临床变体)
44054006 - Include 2 捕获所有以“由2型糖尿病引起”编码的并发症(视网膜病变、神经病变、肾病、外周血管疾病等)
- 两者共同构成大多数eCQM所需的完整分母或分子集合
范围说明: 如果指标明确排除根编码(在预协调IG中少见但可能),请在include 1中使用替代。
descendent-ofis-aeCQM denominator/numerator: all T2DM concepts (subtypes + complications)
通过查询发现属性
This is the canonical example for building exhaustive eCQM criteria.
Step 1 — Verify the root concept
codesystem_lookup("44054006") → display = "Type 2 diabetes mellitus"
sufficientlyDefined = false ← primitive
parent = 73211009 (Diabetes mellitus)Step 2 — Check which concepts are IS-A children vs. complication-linked
| Concept | Code | In | Link |
|---|---|---|---|
| T2DM in obese | | ✅ Yes | direct |
| Insulin-treated T2DM | | ✅ Yes | direct |
| Retinopathy due to T2DM | | ❌ No | |
| Neuropathy due to T2DM | | ❌ No | |
| CAD due to T2DM | | ❌ No | |
alone misses all complication concepts. For a complete eCQM set, use a two-include ValueSet that unions both trees.is-a
Step 3 — Build the complete ValueSet
json
{
"resourceType": "ValueSet",
"compose": {
"include": [
{
"system": "http://snomed.info/sct",
"version": "<see list_available_codesystem_versions>",
"filter": [
{ "property": "concept", "op": "is-a", "value": "44054006" },
{ "property": "inactive", "op": "=", "value": "false" }
]
},
{
"system": "http://snomed.info/sct",
"version": "<see list_available_codesystem_versions>",
"filter": [
{ "property": "42752001", "op": "=", "value": "44054006" },
{ "property": "inactive", "op": "=", "value": "false" }
]
}
]
}
}- Include 1 captures the root code plus all IS-A subtypes (clinical variants of T2DM)
44054006 - Include 2 captures all complications encoded with "Due to = T2DM" (retinopathy, neuropathy, nephropathy, peripheral vascular disease, etc.)
- Together they form the exhaustive denominator or numerator set most eCQMs require
Scope note: use instead of in include 1 if the measure
exclicitly excludes the root code (uncommon but possible in pre-coordinated IGs).
descendent-ofis-a前文的属性表只是起点,而非完整列表。权威来源是概念数据本身。
流程:
- 从目标临床领域中选择一个知名的、完整定义的()示例概念。
sufficientlyDefined = true - 对其调用。
codesystem_lookup - 在响应中,找到为纯数字SNOMED概念ID的
code条目——这些是关系属性。property - 字段是属性的名称(例如
description)。要获取属性类型名称,请对typeId本身调用"Myocardium structure"(例如codesystem_lookup→codesystem_lookup("363698007"))。"Finding site" - 在过滤器中使用这些typeId。
valueset_expand
优先选择完整定义的概念进行发现。 基础概念()的关系属性较少或没有,无法揭示其临床类别使用的完整属性集。
sufficientlyDefined = falseundefinedDiscovering Attributes by Lookup
优质发现目标:心肌梗死(sufficientlyDefined=true)
The attribute table earlier is a starting point, not a complete list. The
authoritative source is the concept data itself.
Protocol:
- Pick a well-known, fully-defined () example concept from the target clinical domain.
sufficientlyDefined = true - Call on it.
codesystem_lookup - In the response, find entries whose
propertyis a bare numeric SNOMED concept ID — those are attribute relationships.code - The field names the attribute (e.g.,
description). To get the attribute type name, call"Myocardium structure"on the typeId itself (e.g.,codesystem_lookup→codesystem_lookup("363698007"))."Finding site" - Use those typeIds in your filter.
valueset_expand
Prefer fully-defined concepts for discovery. Primitive concepts
() have fewer or no attribute relationships and
will not reveal the full attribute set used by their clinical class.
sufficientlyDefined = falseundefinedcodesystem_lookup("22298006") → 363698007、116676008存在
Good discovery target: Myocardial infarction (sufficientlyDefined=true)
劣质发现目标:高血压疾病(sufficientlyDefined=false)
codesystem_lookup("22298006") → 363698007, 116676008 present
codesystem_lookup("38341003") → 仅存在363698007、363713009、363714003
(疾病属性的不完整呈现)
---Poor discovery target: Hypertensive disorder (sufficientlyDefined=false)
层级检查
codesystem_lookup("38341003") → only 363698007, 363713009, 363714003
(incomplete picture of disorder attributes)
---构建层级过滤器前,验证关系:
codesystem_subsumes(
code_a="64572001", # 疾病
code_b="22298006", # 心肌梗死
system="http://snomed.info/sct"
)Hierarchy Checks
预期结果:subsumed-by(心肌梗死是疾病的子类型)
Before building a hierarchy filter, verify the relationship:
codesystem_subsumes(
code_a="64572001", # Disease
code_b="22298006", # Myocardial infarction
system="http://snomed.info/sct"
)
---Expected: subsumed-by (MI is a subtype of Disease)
获取完整属性参考
---codesystem_filter_properties(system="http://snomed.info/sct")Getting the Full Property Reference
重要限制
codesystem_filter_properties(system="http://snomed.info/sct")- 仅存储激活状态的关系。已停用概念的属性会被排除。
- 基础概念()可能没有或只有少量关系属性——它们仅通过IS-A定义。
sufficientlyDefined = false - 导入时会扁平化关系角色组。单个角色组内的组合属性(例如“发病部位+相关形态”)在过滤器中不会被强制组合。
- SNOMED中不存在属性。请使用临床问题转换部分的推荐策略,包括“相关联”过滤器、发病部位核心查询和层级遍历。
has-symptom
Important Constraints
—
- Only active relationships are stored. Inactive concept attributes are excluded.
- Primitive concepts () may have no or fewer attribute relationships — they're defined only by IS-A.
sufficientlyDefined = false - Relationship role groups are flattened during import. Combined attributes within a single role group (e.g., "finding site + associated morphology") are not enforced together in filters.
- No attribute exists in SNOMED. Use the Translating Clinical Questions section for the recommended strategies, including
has-symptomfilters, finding-site pivots, and hierarchy traversal.associated with
—