{
 "schema_version": 1,
 "generated": "2026-10-31",
 "id": "maziyarpanahi-openmed--extract-drugs-and-conditions-from-clinical-notes-locally",
 "repo": "maziyarpanahi/openmed",
 "repo_url": "https://github.com/maziyarpanahi/openmed",
 "repo_slug": "maziyarpanahi-openmed",
 "title": "Extract drugs and conditions from clinical notes on your own machine",
 "page_title": "How to extract drugs and conditions from clinical notes on your own machine with Openmed",
 "summary": "Install OpenMed and run clinical NER on text without a cloud API.",
 "who": "A health data engineer who needs structured medication and condition fields from free-text notes.",
 "problem": "Clinical notes are unstructured, and sending them to a hosted API raises privacy and compliance questions.",
 "outcome": "Entities such as DRUG and CONDITION extracted locally from clinical text.",
 "steps": [
  "Run `pip install --upgrade \"openmed[hf]\"` (or `openmed[mlx]` on Apple Silicon)",
  "Call analyze_text with a model such as pharma_detection_superclinical or disease_detection_superclinical",
  "Print each entity's label and text",
  "For many notes, use BatchProcessor with group_entities=True",
  "For air-gapped use, point model_id at a local model directory"
 ],
 "agent_prompt": "Install maziyarpanahi/openmed and write a script that runs pharma_detection_superclinical over the notes in <folder> with BatchProcessor and writes drug and condition entities to a CSV. Use synthetic notes only for testing.",
 "agents": [
  "claude-code",
  "codex",
  "cursor"
 ],
 "difficulty": "Intermediate",
 "time": "30 minutes",
 "basis": "readme",
 "caveat": "This card is written from the maziyarpanahi/openmed README, not from a test run by Deduped. Before you start, make sure you have Python 3.10+ and pip. Check the repo for newer instructions before you rely on these steps.",
 "category": "Research",
 "tags": [
  "Research"
 ],
 "lang": "python",
 "requirements": [
  "Python 3.10+ and pip",
  "Optional: Apple Silicon for MLX, Android with ONNX Runtime Mobile, or a browser with WebGPU",
  "Model downloads from the Hugging Face Hub, or local model folders for offline use"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "health-data",
   "notice": "Test with synthetic notes; real patient data needs your organization's approval and compliance review."
  }
 ],
 "best": true,
 "score": 1.0,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/maziyarpanahi-openmed/extract-drugs-and-conditions-from-clinical-notes-locally/",
 "md": "https://dedupedai.com/use-cases/maziyarpanahi-openmed/extract-drugs-and-conditions-from-clinical-notes-locally/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/maziyarpanahi-openmed--extract-drugs-and-conditions-from-clinical-notes-locally.json",
 "api_version": "v1"
}
