extracting-sdoh
Skill5.4k starsChanged 4 months agoApache-2.0View on GitHub
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 insecurity, health equity, Gravity Project.
Trending
Quiet since September.about the whole repository
Who's talking about maziyarpanahi/openmed
- @yug1224.com“医療テキストの解析や個人情報の匿名化を端末内で完結できるヘルスケアAIツールっぽい 機密データを扱う医療関連の開発現場でかなり使えそう yug1224 starred maziyarpanahi/openmed…”Bluesky · Jun 11, 2026 · 3 likes
- @qdrddr.bsky.social“Local #PII #HIPAA data #anonymizer based on #OpenMed and runs on #Nvidia and Apple #MLX - entirely …”Bluesky · Jul 10, 2026 · 2 likes
- @technews4869.bsky.social“github.com/maziyarpanahi/o... GitHub - maziyarpanahi/openmed: Local-first healthcare AI: clinical NER & …”Bluesky · Jun 22, 2026 · 1 likes
- @dailygithubtrends.bsky.social“今日のGitHubトレンド maziyarpanahi/openmed デバイス上で完結して動作するヘルスケアAIの提供を目的としています。 …”Bluesky · Jun 11, 2026 · 1 likes
- sudosubin/agents.nix“agent-skills.github.maziyarpanahi.openmed: init at 2.5.0”GitHub · Sep 29, 2026
The biggest 5 of 33 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 33
Talked about on GitHub and Bluesky (33 times).
On GitHub · 28
- Sep 29, 2026agent-skills.github.maziyarpanahi.openmed: init at 2.5.0 — sudosubin/agents.nix0 reactions
- Sep 22, 2026build(deps): update openmed requirement from >=1.5.2 to >=2.5.0 in /healthadvocate — simongonzalezdc/healthadvocate0 reactions · 1 comment
- Sep 8, 2026build(deps): update openmed requirement from >=1.5.2 to >=2.3.0 in /healthadvocate — simongonzalezdc/healthadvocate0 reactions · 1 comment
- Sep 1, 2026chore(deps): update openmed requirement from <2,>=1.9.1 to >=1.9.1,<3 — seiba-ai/seiba-risk-scanner0 reactions
- Aug 29, 2026[Argus] CVE-2026-47117: OpenMed 1.5.2 미만 버전의 PII 모델 로딩을 통한 원격 코드 실행 — LEEKIYOON-SEC/Argus-DEV0 reactions
23 more on GitHub
- Aug 25, 2026build(deps): update openmed requirement from >=1.5.2 to >=2.2.0 in /healthadvocate — simongonzalezdc/healthadvocate0 reactions · 1 comment
- Aug 18, 2026build(deps): update openmed requirement from >=1.5.2 to >=2.1.0 in /healthadvocate — simongonzalezdc/healthadvocate0 reactions · 1 comment
- Aug 4, 2026build(deps): update openmed requirement from >=1.5.2 to >=2.0.0 in /healthadvocate — simongonzalezdc/healthadvocate0 reactions · 1 comment
- Jul 30, 2026Bump openmed from 0.6.4 to 1.5.2 — Liberate-Labs/openmed_modal_hosting0 reactions
- Jul 21, 2026build(deps): update openmed requirement from >=1.5.2 to >=1.9.1 in /healthadvocate — simongonzalezdc/healthadvocate0 reactions · 1 comment
- Jul 14, 2026build(deps): update openmed requirement from >=1.5.2 to >=1.9.0 in /healthadvocate — simongonzalezdc/healthadvocate0 reactions · 1 comment
- Jul 14, 2026build(deps): update openmed requirement from >=1.5.2 to >=1.8.1 in /healthadvocate — simongonzalezdc/healthadvocate0 reactions · 1 comment
- Jul 11, 2026cron: curadoria 11/07/2026 - DynamiCare, PhysAssistBench, OpenMed, MedAgentGym, AIME 2026 — fabianofilho/awesome-medical-ai0 reactions
- Jul 7, 2026build(deps): update openmed requirement from >=1.5.2 to >=1.7.0 in /healthadvocate — simongonzalezdc/healthadvocate0 reactions · 1 comment
- Jun 23, 2026build(deps): update openmed requirement from >=1.5.2 to >=1.6.0 in /healthadvocate — simongonzalezdc/healthadvocate0 reactions · 1 comment
- Jun 19, 2026Add affected range to GHSA-m3v4-v5gx-7wf5 (openmed) — github/advisory-database0 reactions · 1 comment
- Jun 13, 2026feat: add openmed template — Phala-Network/phala-cloud0 reactions · 1 comment
- Jun 12, 2026Add OpenMed to healthcare AI section — alvinreal/awesome-opensource-ai0 reactions
- Jun 9, 2026build(deps): update openmed requirement from >=1.5.2 to >=1.5.5 in /healthadvocate — simongonzalezdc/healthadvocate0 reactions · 1 comment
- Jun 9, 2026Healthcare Vitals Toolkit — OpenMed Integration Proposal — nvdigitalsolutions/mcp-ai-wpoos0 reactions
- Jun 9, 2026[jules] Port OpenMed quality gates: quality_gates.dart (threshold config) — iberi22/OrionHealth0 reactions · 3 comments
- Jun 9, 2026[jules] Port OpenMed locale validators: i18n_validators.dart (CPF, DNI, CURP) — iberi22/OrionHealth0 reactions · 3 comments
- Jun 8, 2026[jules] Expand PromptScrubber with PiiDetector integration — iberi22/OrionHealth0 reactions · 3 comments
- Jun 8, 2026[jules] Port OpenMed text processor to Dart: text_processor.dart — iberi22/OrionHealth0 reactions · 3 comments
- Jun 8, 2026[jules] Port OpenMed PII detector to Dart: pii_detector.dart (30+ patterns) — iberi22/OrionHealth0 reactions · 2 comments
- Jun 8, 2026[jules] Port OpenMed EntitySpan to Dart: pii_entity.dart — iberi22/OrionHealth0 reactions · 2 comments
- Jun 8, 2026[jules] Port OpenMed labels.py to Dart: pii_labels.dart — iberi22/OrionHealth0 reactions · 2 comments
- May 29, 2026build(deps): update openmed requirement from >=1.4.0 to >=1.5.2 in /healthadvocate — simongonzalezdc/healthadvocate0 reactions · 1 comment
On Bluesky · 5
- Jun 11, 2026医療テキストの解析や個人情報の匿名化を端末内で完結できるヘルスケアAIツールっぽい 機密データを扱う医療関連の開発現場でかなり使えそう yug1224 starred maziyarpanahi/openmed… — @yug1224.com3 likes and reposts
- Jul 10, 2026Local #PII #HIPAA data #anonymizer based on #OpenMed and runs on #Nvidia and Apple #MLX - entirely #offline. #OpenSource Apache 2.0… — @qdrddr.bsky.social2 likes and reposts
- Jun 22, 2026github.com/maziyarpanahi/o... GitHub - maziyarpanahi/openmed: Local-first healthcare AI: clinical NER & HIPAA PII de-identific... — @technews4869.bsky.social1 likes and repost
- Jun 11, 2026今日のGitHubトレンド maziyarpanahi/openmed デバイス上で完結して動作するヘルスケアAIの提供を目的としています。 クラウドにデータを送らずに、臨床テキストからのエンティティ抽出や個人情報の匿名化をローカル環境で実現します。… — @dailygithubtrends.bsky.social1 likes and repost
- Jul 16, 2026Did you have a look to OpenMed ? It gives a similar toolkit unified in a python / Swift API specialised in health use cases.… — @aminesaboni.bsky.social0 likes and reposts · 2 replies
In this repository74 other files it gives its agents.
- AGENTS.mdAGENTS.md
- annotating-variantsSkill
- ask-openmedSkill
- assembling-fhir-bundlesSkill
- auditing-deidentification-runsSkill
- auditing-deid-leakageSkill
- auditing-part11-trailsSkill
- auditing-safe-harbor-checklistSkill
- auditing-subgroup-fairnessSkill
- authoring-model-cardsSkill
- batch-processing-clinical-textSkill
- benchmarking-clinical-nerSkill
- benchmark-pii-recallSkill
- bridging-presidio-and-spacySkill
- building-gold-corpusSkill
- building-patient-timelinesSkill
- building-with-openmedSkill
- checking-hipaa-complianceSkill
- choosing-openmed-modelsSkill
- coding-hcc-risk-adjustmentSkill
- coding-icd10Skill
- computing-ecqmsSkill
- configuring-privacy-policiesSkill
- defining-cohort-phenotypesSkill
- deidentify-a-datasetSkill
- deidentifying-clinical-textSkill
- deidentifying-multilingual-textSkill
- deploying-openmed-mcpSkill
- detecting-pv-signalsSkill
- enforcing-nophi-loggingSkill
- etl-to-omop-cdmSkill
- evaluating-with-leakage-gatesSkill
- exporting-bulk-fhirSkill
- exporting-to-fhirSkill
- extract-clinical-entities-to-fhirSkill
- extracting-clinical-entitiesSkill
- extracting-dicom-metadataSkill
- extracting-lab-tablesSkill
- extracting-pii-entitiesSkill
- fetching-fhir-resourcesSkill
- gating-deid-leakageSkill
- generating-synthea-dataSkill
- generating-synthetic-surrogatesSkill
- ingesting-clinical-documentsSkill
- linking-umls-conceptsSkill
- loading-openmed-modelsSkill
- mapping-loincSkill
- mapping-to-snomedSkill
- mining-pubmed-literatureSkill
- normalizing-rxnormSkill
- parsing-ccda-documentsSkill
- parsing-hl7v2-messagesSkill
- parsing-lab-valuesSkill
- parsing-trial-eligibilitySkill
- pick-a-pii-modelSkill
- pseudonymizing-for-gdprSkill
- querying-openfda-labelsSkill
- querying-terminology-serviceSkill
- reconciling-problem-listsSkill
- reidentifying-textSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 108
To OpenMed: always run openmed.deidentify upstream so no raw PHI reaches the SDOH store, logs, or coder queue.
- Distinctive: line 123
One span, one domain: Do not stack multiple Z-codes onto one phrase.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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.deidentifyupstream so no raw PHI reaches the SDOH store, logs, or coder queue. - Onward: emit suggestions into a FHIR
Condition/Observationwith the Z-code ascode.coding(systemhttp://hl7.org/fhir/sid/icd-10-cm). OpenMed'sopenmed.clinical.exporters.fhirhelpers (to_bundle,to_operation_outcome) assemble the envelope; ICD-10-CM itself is public-domain in the US release.
Edge cases & gotchas
- Negation and history. "Denies food insecurity" or "previously homeless,
now housed" must not produce an active Z-code. Run negation/temporality
resolution (
openmed.clinical,resolving-clinical-context) before mapping. - Hypotheticals and screening prompts. Template text ("Do you have stable housing?") and family-member SDOH ("his mother is unhoused") are common false positives — check the subject and modality.
- One span, one domain. Do not stack multiple Z-codes onto one phrase; map to the most specific single code and let the coder add others.
- Granularity drift. ICD-10-CM adds SDOH codes most fiscal years (e.g. Z59.4x food, Z59.82 transportation). Pin your code set to a release year and re-validate annually.
- Do not infer protected attributes. Surface only what the note states; never derive race, immigration status, or income bracket as an SDOH "finding".
- Restricted terminology. SNOMED CT SDOH refsets and LOINC SDOH panels are licensed separately — OpenMed does not bundle them; load the user's own copy out-of-process if you cross-map beyond ICD-10-CM.
Standards & references
- ICD-10-CM official guidelines, Z55–Z65 SDOH codes (CDC/CMS, public domain): https://www.cdc.gov/nchs/icd/icd-10-cm.htm
- Gravity Project (HL7 SDOH Clinical Care value sets & FHIR IG): https://www.hl7.org/gravity/ and https://confluence.hl7.org/display/GRAV
- n2c2 2022 Track 2 — SDOH extraction shared task (Social History Annotation Corpus): https://n2c2.dbmi.hms.harvard.edu/
- CMS ICD-10-CM Z-code SDOH resources: https://www.cms.gov/files/document/zcodes-infographic.pdf
- USCDI SDOH data classes: https://www.healthit.gov/isa/uscdi-data-class/sdoh
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

