Skip to content

Dicom Router: rule kind that watches a folder for DICOM files - #205

Merged
arnoutpro merged 1 commit into
mainfrom
claude/great-thompson-plz9z8
Nov 26, 2026
Merged

arnoutpro merged 1 commit into
mainfrom
claude/great-thompson-plz9z8

Conversation

@arnoutpro

Copy link
Copy Markdown
Owner

Summary

A new rule Kind, Watch a folder for DICOM files, next to Watch a folder for PDFs.

  • Each item directly in the watch folder is one unit: a loose DICOM file, a sub-folder (a study, with sub-folders in it), or a .zip / .7z file.
  • An item with anything changed in the last 30 seconds waits for the next run.
  • The settled items are scanned and sent in one association with the Dicom Import engine. An item whose images were all stored moves, as a whole, into a Sent sub-folder.
  • An item the PACS does not fully take stays and is sent again next run. An item with no DICOM in it is left alone. A failed move is flagged and the item is not sent again.
  • A 7z is unpacked to router_tmp in the data folder for the run only (removed after the run and when the app starts); links inside it are never followed.
  • Shares the folder, Send to and Present as fields with the PDF kind; the PDF-only boxes are hidden (and not required) for this kind. Same schedule, Start/Pause/Stop, Run now, status dashboard (counted in items), and settings export/import.
  • No file or folder names are stored or logged; counts only. No edits are applied on the way (Dicom Import is for that).
  • dicom_import.scan_folder gets skip_top and SendOptions.record_paths (used by the watch); the Import page is unaffected.
  • README, Help, SECURITY.md and CHANGELOG (Unreleased) updated.

Testing

  • Full suite passes. 13 new tests (tests/test_dicom_watch.py) against a simulated PACS: study folders, loose files, ZIP and 7z, waiting items, PACS refusals and retry, one bad study not blocking others, items without DICOM, failed move, names never on disk, missing folder, the form and its errors, the dashboard unit and the settings export.
  • The Router form was checked in a browser for all three kinds (fields show/hide, saving works, no JS errors).

Not tested

  • A real PACS, very large folders, a real Windows or macOS service (folder permissions for the service account are the usual risk).

Generated by Claude Code

Each item in the folder (loose file, study folder, .zip or .7z) is sent with the Dicom Import engine and moved as a whole to Sent when every image was stored. A 7z is unpacked to router_tmp for the run only. Counts only; no names stored.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vpoz9s3ghEVHXSjnLFH7ed
@arnoutpro
arnoutpro merged commit 195e528 into main Nov 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants