health-data. Test with synthetic notes; real patient data needs your organization's approval and compliance review.
Who it is forA health data engineer who needs structured medication and condition fields from free-text notes.
The problemClinical notes are unstructured, and sending them to a hosted API raises privacy and compliance questions.
The outcomeEntities such as DRUG and CONDITION extracted locally from clinical text.
What you need first
- 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
Steps
- Run
pip install --upgrade "openmed[hf]"(oropenmed[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
Prompt for your agent
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.
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.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for maziyarpanahi/openmed and "Extract drugs and conditions from clinical notes on your own machine"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer