annotating-variants
Annotates VCF variants and normalizes HGVS nomenclature with public, license-free annotators (Ensembl VEP REST,…
De-identify selected free-text columns in a local CSV, JSONL, or Parquet dataset with OpenMed and produce a separate redacted dataset plus a PHI-free aggregate summary. Use when an agent must prepare a clinical dataset for analysis or sharing without overwriting the source or
Claude Code
$ npx -y skills add maziyarpanahi/openmed --skill deidentify-a-dataset --agent claude-code
Codex
$ npx skills add maziyarpanahi/openmed --skill deidentify-a-dataset -a codex -y
Cursor
$ npx skills add maziyarpanahi/openmed --skill deidentify-a-dataset -a cursor -y
Gemini CLI
$ npx skills add maziyarpanahi/openmed --skill deidentify-a-dataset -a gemini-cli -y
GitHub Copilot
$ npx skills add maziyarpanahi/openmed --skill deidentify-a-dataset -a github-copilot -y
OpenCode
$ npx skills add maziyarpanahi/openmed --skill deidentify-a-dataset -a opencode -y
Windsurf
$ npx skills add maziyarpanahi/openmed --skill deidentify-a-dataset -a windsurf -y
name: deidentify-a-dataset description: "De-identify selected free-text columns in a local CSV, JSONL, or Parquet dataset with OpenMed and produce a separate redacted dataset plus a PHI-free aggregate summary. Use when an agent must prepare a clinical dataset for analysis or sharing without overwriting the source or exposing cell values in logs."
Keep the source local, name the free-text columns explicitly, and write to a different destination. Never infer columns or print source and redacted cell values.
1. Confirm that the input is CSV, JSONL/NDJSON, or Parquet. 2. Confirm which columns contain free text. Do not scan or log values to guess. 3. Choose a policy and language. Prefer `strict_no_leak` when recall is the governing safety requirement. 4. Write to a new path; never overwrite the input. 5. Inspect only `result.summary`, which contains aggregate counts and rates. 6. Validate recall and residual leakage on representative synthetic or approved evaluation fixtures before releasing the output.
Install the model runtime first with `python -m pip install "openmed[hf]"`.
import csv
from pathlib import Path
from openmed import redact_dataset
source = Path("synthetic-notes.csv")
destination = Path("synthetic-notes.redacted.csv")
with source.open("w", newline="", encoding="utf-8") as handle:
writer = csv.DictWriter(handle, fieldnames=["record_id", "note"])
writer.writeheader()
writer.writerows(
[
{
"record_id": "SYNTH-001",
"note": (
"Taylor Example called 212-555-0198 about a "
"metformin refill."
),
},
{
"record_id": "SYNTH-002",
"note": (
"Send the synthetic follow-up to "
"demo.patient@example.test."
),
},
]
)
result = redact_dataset(
source,
text_columns=["note"],
output_path=destination,
policy="strict_no_leak",
lang="en",
)
print(result.output_path)
print(result.summary.to_dict()) # Aggregate counts only; no cell contents.Use the equivalent CLI for an existing dataset:
openmed redact-dataset notes.csv \ --text-columns note,comment \ --policy strict_no_leak \ --output notes.redacted.csv
exception payloads that may contain source text.
Read and run [the offline dataset walkthrough](../../examples/datasets_walkthrough.py) when you need a bundled synthetic fixture and first-run download controls.
Local-first healthcare AI: clinical NER and HIPAA PII de-identification on hardware you control. 2,200+ medical models, 35 model-backed PII languages, and Python, MLX, Android and browser runtimes. Apache-2.0 SDK.
Annotates VCF variants and normalizes HGVS nomenclature with public, license-free annotators (Ensembl VEP REST,…
Choose the first OpenMed workflow skill for an intake, privacy, extraction, exchange, or verification request using deterministic…
Package multiple FHIR R4 resources produced from OpenMed output into a single valid transaction Bundle ready to POST to an EHR,…
Adversarially scan already-de-identified clinical text for residual identifiers and emit a leakage report that blocks release on…
Produce a signed, reproducible, no-PHI audit trail for an OpenMed de-identification run via deidentify(audit=True). Use when the…
Generates and verifies 21 CFR Part 11-style audit trails — who/what/when, electronic signatures, and tamper-evidence — for…
Use for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication,…
Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys)…
Clean and finalize authorized natural-language text intended for readers by auditing suspicious invisible Unicode and rewriting…