Source profileQuality 91/100

maziyarpanahi/openmed/skills/extracting-dicom-metadata/SKILL.md

extracting-dicom-metadata

Reads DICOM file headers and DICOM-SR (Structured Report) content to pull study/series metadata and embedded report text, and flags PHI carried in header tags. Use before OpenMed processing when ingesting imaging data (CT/MR/CR/US, radiology SR) and you need the report narrative de-identified and analyzed, plus a list of header tags that must be scrubbed. Hand SR/report text to openmed.deidentify and openmed.analyze_text; use pydicom to read tags. Trigger keywords: DICOM, pydicom, DICOM-SR, stru

Source repository stars
5,161
Declared platforms
0
Static risk flags
0
Last source update
2026-08-25
Source checked
2026-08-26

Decision brief

What it does: where it fits

DICOM (Digital Imaging and Communications in Medicine) files carry far more than pixels: a header of tagged attributes (patient, study, series, equipment) and, for DICOM-SR (Structured Reports), a content tree holding the actual radiology/cardiology report text. Two jobs sit her…

Best for

  • You ingest DICOM from PACS/VNA or a research archive and want the SR report
  • You must enumerate PHI-bearing header tags before sharing/exporting images.
  • You have DICOM-SR objects (e.g. radiology measurements + impression) whose

Not for

  • Tasks that require unconfirmed production actions or broad system permissions.
  • Environments where the pinned source and install steps cannot be inspected.

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/maziyarpanahi/openmed --skill "skills/extracting-dicom-metadata"
Safe inspection promptEditorial

Inspect the Agent Skill "extracting-dicom-metadata" from https://github.com/maziyarpanahi/openmed/blob/c5fd81fef4c144624ba691f7cb81f95bf77db85a/skills/extracting-dicom-metadata/SKILL.md at commit c5fd81fef4c144624ba691f7cb81f95bf77db85a. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    Quick start

    Read the header, pull SR report text, flag PHI tags, hand off to OpenMed:

    Read the header, pull SR report text, flag PHI tags, hand off to OpenMed:python import pydicom import openmedds = pydicom.dcmread("study.dcm")
  2. 02

    Workflow

    1. Read the dataset with pydicom.dcmread (use stopbeforepixels=True for header-only/metadata work — faster, avoids loading pixels). 2. Walk the SR content tree. ContentSequence nests CONTAINER, TEXT, CODE, NUM, PNAME nodes; concatenate TEXT.TextValue (and relevant CODE/NUM measu…

    Read the dataset with pydicom.dcmread (use stopbeforepixels=TrueWalk the SR content tree. ContentSequence nests CONTAINER, TEXT,Inventory PHI tags. Flag the standard identifier tags and free-text
  3. 03

    When to use

    You ingest DICOM from PACS/VNA or a research archive and want the SR report

    You ingest DICOM from PACS/VNA or a research archive and want the SR reportYou must enumerate PHI-bearing header tags before sharing/exporting images.You have DICOM-SR objects (e.g. radiology measurements + impression) whose
  4. 04

    DICOM headers in one minute

    Every attribute has a tag (gggg,eeee) (group, element), a VR (value representation, e.g. PN person name, DA date, UI UID), and a value. PHI clusters in well-known tags:

    Every attribute has a tag (gggg,eeee) (group, element), a VR (value representation, e.g. PN person name, DA date, UI UID), and a value. PHI clusters in well-known tags:
  5. 05

    1) Enumerate PHI-bearing header tags (report, do not log values).

    PHITAGS = [ (0x0010, 0x0010), (0x0010, 0x0020), (0x0010, 0x0030), (0x0010, 0x1040), (0x0008, 0x0090), (0x0008, 0x0050), (0x0008, 0x0020), (0x0008, 0x0030), ] presentphi = [hexpair for hexpair in PHITAGS if hexpair in ds]

    PHITAGS = [ (0x0010, 0x0010), (0x0010, 0x0020), (0x0010, 0x0030), (0x0010, 0x1040), (0x0008, 0x0090), (0x0008, 0x0050), (0x0008, 0x0020), (0x0008, 0x0030), ] presentphi = [hexpair for hexpair in PHITAGS if hexpair in ds]

Permission review

Static risk signals and limitations

No configured static risk pattern was detected

This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score91/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars5,161SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
maziyarpanahi/openmed
Skill path
skills/extracting-dicom-metadata/SKILL.md
Commit
c5fd81fef4c144624ba691f7cb81f95bf77db85a
License
Apache-2.0
Collected
2026-08-26
Default branch
master
View the original SKILL.md

Extracting DICOM Metadata & Report Text for OpenMed

DICOM (Digital Imaging and Communications in Medicine) files carry far more than pixels: a header of tagged attributes (patient, study, series, equipment) and, for DICOM-SR (Structured Reports), a content tree holding the actual radiology/cardiology report text. Two jobs sit here: pull the report narrative for NLP, and flag the PHI in the header so it gets scrubbed. This skill does both, then hands narrative to OpenMed. Header tags are read with pydicom (external, MIT-licensed); de-identification of the extracted text is OpenMed's.

When to use

  • You ingest DICOM from PACS/VNA or a research archive and want the SR report text mined with clinical NLP.
  • You must enumerate PHI-bearing header tags before sharing/exporting images.
  • You have DICOM-SR objects (e.g. radiology measurements + impression) whose content tree contains the dictated report.

DICOM headers in one minute

Every attribute has a tag (gggg,eeee) (group, element), a VR (value representation, e.g. PN person name, DA date, UI UID), and a value. PHI clusters in well-known tags:

TagNameVRNotes
(0010,0010)PatientNamePNdirect identifier
(0010,0020)PatientIDLOMRN
(0010,0030)PatientBirthDateDADOB
(0010,1040)PatientAddressLOaddress
(0008,0090)ReferringPhysicianNamePNprovider
(0008,0020/0030)StudyDate / StudyTimeDA/TMdates
(0008,0050)AccessionNumberSHorder id
(0008,103E)SeriesDescriptionLOfree text — may leak PHI
(0020,4000)ImageCommentsLTfree text — may leak PHI
(0040,A730)ContentSequenceSQDICOM-SR report tree

Quick start

Read the header, pull SR report text, flag PHI tags, hand off to OpenMed:

import pydicom
import openmed

ds = pydicom.dcmread("study.dcm")

# 1) Enumerate PHI-bearing header tags (report, do not log values).
PHI_TAGS = [
    (0x0010, 0x0010), (0x0010, 0x0020), (0x0010, 0x0030), (0x0010, 0x1040),
    (0x0008, 0x0090), (0x0008, 0x0050), (0x0008, 0x0020), (0x0008, 0x0030),
]
present_phi = [hex_pair for hex_pair in PHI_TAGS if hex_pair in ds]

# 2) Extract report text from a DICOM-SR content tree (recursively).
def sr_text(dataset):
    chunks = []
    for item in dataset.get("ContentSequence", []):
        vt = item.get("ValueType")
        if vt == "TEXT" and "TextValue" in item:
            chunks.append(item.TextValue)
        if "ContentSequence" in item:          # nested CONTAINER
            chunks.append(sr_text(item))
    return "\n".join(c for c in chunks if c)

report = sr_text(ds)
# Some modalities stash narrative in free-text header tags too:
for tag in ("ImageComments", "SeriesDescription", "StudyDescription"):
    if tag in ds and isinstance(ds.get(tag), str):
        report += "\n" + ds.get(tag)

# 3) De-identify the narrative, then run NER.
if report.strip():
    deid = openmed.deidentify(report, method="replace", policy="hipaa_safe_harbor")
    result = openmed.analyze_text(deid.text, output_format="dict")

pydicom reads tags by keyword (ds.PatientName) or by (group, element). DICOM-SR text lives in the recursive ContentSequence content tree.

Workflow

  1. Read the dataset with pydicom.dcmread (use stop_before_pixels=True for header-only/metadata work — faster, avoids loading pixels).
  2. Walk the SR content tree. ContentSequence nests CONTAINER, TEXT, CODE, NUM, PNAME nodes; concatenate TEXT.TextValue (and relevant CODE/NUM measurements) in document order to reconstruct the report.
  3. Inventory PHI tags. Flag the standard identifier tags and free-text tags (ImageComments, *Description) that frequently leak PHI. Report tag presence — never echo the values into logs.
  4. De-identify → analyze the report narrative with OpenMed.
  5. Scrub the header before any image export using a DICOM de-identification profile (PS3.15 Annex E / Basic Application Level Confidentiality). OpenMed de-identifies the narrative; header scrubbing is a separate DICOM step.

Hand-off to / from OpenMed

  • To OpenMed: SR report text (and free-text header tags) → openmed.deidentifyopenmed.analyze_text.
  • Header de-id is out of scope for OpenMed — OpenMed handles the text narrative; use a DICOM-native de-identifier (pydicom + PS3.15 profile, or a PACS de-id node) to scrub (0010,xxxx) and burned-in-pixel PHI. This skill's job is to flag those tags so they aren't missed.
  • Re-link by UID, not PHI. Carry StudyInstanceUID/SeriesInstanceUID as rejoin keys; these are not identifiers but should be re-mapped consistently if the profile requires UID remapping.

Edge cases & gotchas

  • Pixel-burned PHI. Ultrasound and secondary-capture images often burn name/ MRN/date into the pixels — header scrubbing alone is insufficient; flag modalities (US, SC, XC) for pixel review/OCR. OpenMed's multimodal/OCR intake can read burned-in text for redaction screening.
  • Private tags. Vendor (gggg,eeee) odd-group private tags can hide PHI; PS3.15 requires removing or whitelisting them — don't trust unknown tags.
  • Date shifting must be consistent. If you date-shift StudyDate, shift all related dates by the same offset to preserve temporal relationships.
  • SR value types. Not all SR content is narrative — NUM (measurements), CODE (coded findings), PNAME (person names, PHI!) need different handling; don't dump PNAME into NLP text.
  • Character sets. Honor SpecificCharacterSet (0008,0005); non-Latin patient names need correct decoding before de-id.
  • Read-only intake. Treat source DICOM as immutable; write de-identified copies, never overwrite originals.

Standards & references

Frequently asked questions

What to verify before installation and use

What does the extracting-dicom-metadata source document cover?

DICOM (Digital Imaging and Communications in Medicine) files carry far more than pixels: a header of tagged attributes (patient, study, series, equipment) and, for DICOM-SR (Structured Reports), a content tree holding the actual radiology/cardiology report text. Two jobs sit her…

How do I install extracting-dicom-metadata?

The source record exposes this install command: npx skills add https://github.com/maziyarpanahi/openmed --skill "skills/extracting-dicom-metadata". Inspect the command and pinned source before running it.

Alternatives

Compare before choosing

Computed 10024,975

alirezarezvani/claude-skills

app-store-optimization

App Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklist

Computed 10015,246

wanshuiyin/Auto-claude-code-research-in-sleep

citation-audit

Use it for operations and research tasks; the detail page covers purpose, installation, and practical steps.

Computed 10014,678

prowler-cloud/prowler

postgresql-indexing

PostgreSQL indexing best practices for Prowler: index design, partial indexes, partitioned table indexing, EXPLAIN ANALYZE validation, concurrent operations, monitoring, and maintenance. Trigger: When creating or modifying PostgreSQL indexes, analyzing query performance with EXPLAIN, debugging slow queries, reviewing index usage statistics, reindexing, dropping indexes, or working with partitioned table indexes. Also trigger when discussing index strategies, partial indexes, or index maintenance

Computed 9965

brucesongs/kali-claw

insecure-design

Insecure Design (OWASP A06:2025) focuses on security flaws in system architecture and design phases, rather than code implementation-level bugs.