extracting-sdoh
它能做什么
这项技能在临床记录中找出影响健康的社会因素,例如住房问题、食物不足和交通障碍,并建议对应的 ICD-10 Z 编码。适合需要把这些因素作为数据使用的照护团队和健康公平分析人员。
适用场景
- ✓当记录中描述了缺乏住房、食物或前往就诊的交通工具等社会风险的时候。
- ✓当健康公平分析需要把社会因素记录为结构化数据的时候。
- ✓当已记录的社会需求可能没有出现在已编码问题清单中的时候。
技能链接
https://github.com/maziyarpanahi/openmed/blob/master/skills/extracting-sdoh/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请从这些去标识化记录中找出住房或食物方面的问题,并为编码员建议对应的 Z 编码供审核。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会对去标识化记录运行实体提取,把社会风险片段与 Z55 至 Z65 编码类别进行匹配,并把建议提交给人工确认。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Extracting SDOH and Mapping to ICD-10-CM Z-Codes
Social determinants of health (SDOH) — the conditions in which people live, work, and age — drive an estimated 80% of health outcomes, yet they live almost entirely in free-text narrative. Multiple chart-review studies find SDOH documented in notes but coded with a Z-code under ~2% of the time. The information is there; the structured signal is not. This skill recovers it: run OpenMed NER over de-identified notes, then map the resulting spans to the ICD-10-CM Z55–Z65 family.
When to use
- A note clearly describes a social risk ("lives in her car", "skips meals to afford insulin", "no ride to dialysis") and you want a coded, queryable signal.
- You are building health-equity dashboards, risk stratification, or closed-loop referral feeds and need SDOH as discrete data.
- You want to reconcile what the chart says against what was coded, and flag Z-code gaps for a coder or care team to confirm.
This is a decision-support step. It proposes Z-codes; a human assigns them. SDOH coding is sensitive — never expose individual SDOH inferences outside the care/coding workflow, and never feed them to coverage or pricing decisions.
Quick start
De-identify first, run NER, then map spans to Z-codes:
import openmed
from sdoh_zcode_map import SDOH_ZCODES # see references/sdoh_zcode_map.md
note = (
"62F with CHF. Reports she lost her apartment last month and is "
"staying in a shelter. Often runs out of food before month-end. "
"No car; misses appointments because the bus does not run to clinic."
)
# 1) Strip PHI before any downstream processing or storage.
deid = openmed.deidentify(note, method="replace", policy="hipaa_safe_harbor")
# 2) Run clinical NER. Use an SDOH/clinical model from the registry; discover
# available keys with openmed.get_models_by_category(...).
result = openmed.analyze_text(deid.text, output_format="dict")
# 3) Map each entity span to a candidate Z-code.
for ent in result["entities"]:
code = SDOH_ZCODES.get(ent["label"].lower())
if code:
print(f"{ent['text']!r:40} {ent['label']:18} -> {code}")
analyze_text returns entities shaped as
{"text", "label", "confidence", "start", "end", "metadata"}. The start/end
offsets index into the text you passed in, so you can anchor every suggested
Z-code back to its exact source span for human review.
Workflow
- De-identify the note with
openmed.deidentify(HIPAA Safe Harbor or a stricter policy). SDOH text is dense with PHI (addresses, employer names). - Extract entities with
openmed.analyze_text. Pick a model whose label set covers social concepts; if your model only emits clinical findings, run a second pass with a zero-shot model (openmed zero) using SDOH labels such ashousing_instability,food_insecurity,unemployment,transportation_barrier,social_isolation,financial_strain. - Map spans to Z-codes using a curated lookup keyed by label
(
references/sdoh_zcode_map.md). Keep the span offsets and the modelconfidenceon every suggestion. - Stage for confirmation. Emit
(span, label, suggested_code, confidence)tuples for a coder or the Gravity Project pipeline to accept or reject. Do not auto-bill a Z-code from an inference alone. - Normalize to value sets. Align labels to the Gravity Project SDOH
domains so codes are interoperable with FHIR (
Condition,Observation,Goal) and USCDI v3 SDOH elements.
Z-code families you will hit most (ICD-10-CM Z55–Z65)
| Domain | Range | Example |
|---|---|---|
| Education / literacy | Z55 | Z55.0 illiteracy |
| Employment | Z56 | Z56.0 unemployment |
| Occupational exposure | Z57 | — |
| Housing / economic | Z59 | Z59.0 homelessness, Z59.41 food insecurity, Z59.82 transportation insecurity |
| Social environment | Z60 | Z60.2 living alone, Z60.4 social exclusion |
| Upbringing | Z62 | — |
| Family / support circumstances | Z63 | Z63.4 disappearance/death of family member |
| Psychosocial circumstances | Z64–Z65 | Z65.1 imprisonment |
The full curated label→code table lives in references/sdoh_zcode_map.md.
Hand-off to / from OpenMed
- From OpenMed: this skill consumes
openmed.analyze_text(...)output (PredictionResultdict). Eachentity["start"]/["end"]anchors a Z-code suggestion to source text. - To OpenMed: always run `openmed.de
常见问题
它会自行分配 Z 编码吗?
不会。它只提出编码建议,由人工来确定。
结果可以广泛分享吗?
不可以。这项技能建议将个人社会风险发现限制在照护和编码工作流程之内。
它会用于保险覆盖或定价决定吗?
不会。这项技能建议绝不把这些推断用于保险覆盖或定价决定。
详情
作者的原始描述
Extracts social determinants of health (SDOH) — housing instability, food insecurity, unemployment, transportation barriers, social isolation, financial strain — from clinical narrative and maps the spans to ICD-10-CM Z-codes (Z55–Z65). Use after running OpenMed NER when the user wants SDOH surfacing, Z-code suggestion, health-equity analytics, or to recover SDOH that is documented in free text but not coded. Pairs with OpenMed analyze_text output. Standards: ICD-10-CM Z55–Z65, Gravity Project value sets, n2c2 2022 SDOH track. Trigger keywords: SDOH, social determinants, Z-codes, housing, food
repo: maziyarpanahi/openmed
热度
- GitHub 星标
- 5.8k
- 排名
- #14703
- 许可证
- 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扫描已去标识化的临床文本,查找残留的标识符,例如社会安全号、银行卡号、电子邮件地址和日期,若仍有残留则阻止发布。