# AI use cases for Openmed (maziyarpanahi/openmed)

Repo: [maziyarpanahi/openmed](https://github.com/maziyarpanahi/openmed) | Use cases: 3 | Page: https://dedupedai.com/use-cases/maziyarpanahi-openmed/

OpenMed is a local-first healthcare AI toolkit that turns clinical text into structured, de-identified data on hardware you control. Its Python package runs clinical NER (drugs, diseases, conditions) and PII de-identification, with a REST service, batch processing, MLX acceleration on Apple Silicon, ONNX models for Android and the browser, and Agent Skills for Claude Code and Codex.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Extract drugs and conditions from clinical notes on your own machine: https://dedupedai.com/use-cases/maziyarpanahi-openmed/extract-drugs-and-conditions-from-clinical-notes-locally/
- Run a local REST API that de-identifies clinical text: https://dedupedai.com/use-cases/maziyarpanahi-openmed/run-a-local-pii-de-identification-api-for-clinical-text/
- Have your coding agent build a de-identification pipeline with OpenMed skills: https://dedupedai.com/use-cases/maziyarpanahi-openmed/build-a-de-identification-pipeline-with-openmed-agent-skills/

## How to extract drugs and conditions from clinical notes on your own machine with Openmed

Repo: [maziyarpanahi/openmed](https://github.com/maziyarpanahi/openmed) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Install OpenMed and run clinical NER on text without a cloud API.

**Who it is for:** A health data engineer who needs structured medication and condition fields from free-text notes.

**The problem:** Clinical notes are unstructured, and sending them to a hosted API raises privacy and compliance questions.

**The outcome:** Entities such as DRUG and CONDITION extracted locally from clinical text.

### Steps

1. Run `pip install --upgrade "openmed[hf]"` (or `openmed[mlx]` on Apple Silicon)
2. Call analyze_text with a model such as pharma_detection_superclinical or disease_detection_superclinical
3. Print each entity's label and text
4. For many notes, use BatchProcessor with group_entities=True
5. For air-gapped use, point model_id at a local model directory

### Prompt to paste into your agent

```text
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.

Risk, health-data: Test with synthetic notes; real patient data needs your organization's approval and compliance review.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/maziyarpanahi-openmed/extract-drugs-and-conditions-from-clinical-notes-locally/

## How to run a local REST API that de-identifies clinical text with Openmed

Repo: [maziyarpanahi/openmed](https://github.com/maziyarpanahi/openmed) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Start the OpenMed REST service and call its PII extract and de-identify endpoints from your app.

**Who it is for:** A backend developer who must strip names, addresses and IDs from notes before they reach other systems.

**The problem:** De-identification inside each app duplicates work and is hard to audit.

**The outcome:** A local service on port 8080 with /pii/extract and /pii/deidentify endpoints.

### Steps

1. Run `pip install --upgrade "openmed[hf,service]"`
2. Start it with `python -m openmed.service.logging` plus `--host 0.0.0.0 --port 8080`
3. Check GET /health returns 200 OK
4. POST text to /pii/extract to see detected PII, and to /pii/deidentify to get redacted text
5. Review a sample of outputs by hand before trusting it in a pipeline

### Prompt to paste into your agent

```text
Start the maziyarpanahi/openmed REST service on port 8080 and write a client that sends <synthetic notes> to /pii/deidentify and saves the redacted text. Show me 3 before and after examples.
```

### 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.

Risk, health-data: Automated de-identification can miss identifiers; it is not a compliance guarantee on its own.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/maziyarpanahi-openmed/run-a-local-pii-de-identification-api-for-clinical-text/

## How to have your coding agent build a de-identification pipeline with OpenMed skills with Openmed

Repo: [maziyarpanahi/openmed](https://github.com/maziyarpanahi/openmed) | Difficulty: Beginner | Time: 20 minutes | Basis: From the README

Install OpenMed's Agent Skills and ask Claude Code or Codex for an on-device pipeline.

**Who it is for:** A developer new to clinical NLP who wants a working pipeline without learning every model name.

**The problem:** Picking models, chaining de-identification and NER, and wiring outputs takes research time.

**The outcome:** An on-device pipeline that de-identifies a note and then extracts medication entities.

### Steps

1. Run `git clone https://github.com/maziyarpanahi/openmed && cd openmed`
2. Run `./install-skills.sh` to install the skills for Claude Code, Codex and OpenCode
3. Ask: Build a local OpenMed pipeline that de-identifies a synthetic discharge note and extracts medication entities
4. Let the agent produce the Openmed.deidentify then Openmed.analyze_text pipeline
5. Run it once to download the models, then run it offline

### Prompt to paste into your agent

```text
Using the maziyarpanahi/openmed Agent Skills, build a local pipeline that de-identifies <synthetic note> and extracts medication entities, then show the output and the models it used.
```

### 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.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/maziyarpanahi-openmed/build-a-de-identification-pipeline-with-openmed-agent-skills/
