Skip to content

Cache and Retention ​

Every DICOM7 service keeps its working state in a cache folder on disk: messages or objects waiting for delivery, items queued for retry, and records of what was already processed. Persisted retry records let services resume queued work after a restart or a downstream outage. When a service writes each item depends on the service; see the layout below.

By default the cache is %ProgramData%\Flux Inc\DICOM7\<SERVICE>\cache\. Change it with Cache.Folder in the service's config.yaml. A relative path is resolved against the service's data folder.

Layout by service ​

ServiceLayoutContents
DICOM2ORMcache\<StudyInstanceUID>.hl7
cache\<StudyInstanceUID>.pending, .attempts
One file per study whose ORM was delivered; while it exists, that study is not sent again. Orders that failed delivery wait in .pending files (with an attempt counter) for the next retry.
DICOM2ORUcache\outgoing\<SOPInstanceUID>.oru
cache\<SOPInstanceUID>.pending, .attempts
cache\sent\<SOPInstanceUID>.dcm
cache\error\
Generated ORUs waiting to be sent; ORUs that failed delivery and wait for a retry; one marker per converted instance holding its ORU, written when the ORU is queued (before it is delivered), which stops the instance being converted again; and outgoing files that could not be read.
ORM2DICOMcache\active\<id>.hl7Received orders, served as worklist entries until they expire.
ORU2DICOMcache\incoming\, cache\outgoing\
cache\<id>.pending, .attempts
cache\error\
Received ORU messages and generated DICOM files; messages waiting for a delivery retry (the .pending file holds the full HL7, so a retry can rebuild the DICOM files); and messages that failed permanently, with a .meta file giving the reason. Delivered items move to a sent folder below incoming and outgoing.
ORU2REPORTcache\incoming\, cache\error\, working folder, output folderReceived ORU messages, failed messages, intermediate render files, and finished reports. See ORU2REPORT.
HL72HL7cache\staging\, active\, completed\, rejected\, quarantine\, receipts\One directory per captured message with the exact payload, a manifest, and per-destination delivery state. See HL72HL7.

Sent items ​

ORU2DICOM and ORU2REPORT retain processed artifacts in sent folders when KeepSentItems is true. DICOM2ORU writes its sent marker at conversion time, before downstream delivery. These records also support duplicate suppression. When KeepSentItems is false, these services delete processed artifacts instead. DICOM2ORM keeps successful-study records in the cache root regardless of this setting; HL72HL7 requires it to be true. See each service's configuration page for details.

Retention ​

Retention cleanup removes files whose last-modified time is older than the retention period. Apart from ORM2DICOM order expiry and HL72HL7, it runs once, when the service starts. Restart a service to apply a retention change.

ServiceSettingWhenWhat is removed
DICOM2ORMCache.RetentionDaysAt startDelivered-study .hl7 files (not .pending retry files). A study still on the worklist after its file is removed is sent again at the next poll
DICOM2ORUCache.RetentionDaysAt startNothing in the current layout; sent\ markers and .pending files are kept
ORM2DICOMOrder.ExpiryHours
Cache.AutoCleanup
Cache.CleanupIntervalMinutes
At startup, then every CleanupIntervalMinutes while AutoCleanup is trueOrders older than ExpiryHours, which then stop appearing in the worklist
ORU2DICOMCache.RetentionDaysAt start.hl7 files directly in incoming\ and .dcm files directly in outgoing\, and files in a top-level cache\sent\ folder. .pending retry files are kept
ORU2REPORTCache.RetentionDays
Cache.OutboxRetentionHours
At start.hl7 files directly in incoming\ and in incoming\sent\, files in the working folder, and reports in the output folder older than OutboxRetentionHours
HL72HL7Cache.RetentionDays
Cache.ReceiptRetentionDays (unreleased; not in 2.5.1)
Cache.AutoCleanup
Cache.CleanupIntervalMinutes
Every CleanupIntervalMinutes while AutoCleanup is trueCompleted records and, from 2.5.2, their receipts (2.5.1 keeps receipts indefinitely). Active, rejected, quarantined, and unrouted records are never removed automatically

Sent folders are not trimmed automatically

Except where the table says otherwise, the sent folders are not cleaned by the services and grow over time. If you keep sent items, remove old files from the sent folders periodically (for example with a scheduled task), or set KeepSentItems: false. With KeepSentItems: false, DICOM2ORU no longer remembers delivered instances, so an instance stored twice is converted and sent twice.

Retry queues are kept

Retention cleanup does not remove .pending retry files. For ORU2DICOM, cleanup can remove the received message and generated DICOM files of an item that is still waiting for a retry; the retry rebuilds them from the .pending file.

For ORU2DICOM and ORU2REPORT, the Cache.AutoCleanup and Cache.CleanupIntervalMinutes settings are accepted but have no effect.

Working with the cache ​

  • Stop the service first. Moving or deleting files while the service is running can leave a message half-processed.
  • Resending. DICOM2ORM does not resend a study while its <StudyInstanceUID>.hl7 file exists, and DICOM2ORU does not convert an instance again while its sent marker or .pending file exists. To force a resend, stop the service, delete that file, start the service, and (for DICOM2ORU) send the instance again.
  • Retrying. Items that failed delivery stay in the cache and are retried automatically on the service's retry interval. Look in the service log for the reason before changing anything.
  • Error folders. Items in an error folder are not retried. Fix the cause, then resend from the source system.
  • HL72HL7. Do not edit or move HL72HL7 record directories by hand. See HL72HL7 for how records move between folders.

Protected health information

Cached files contain the full content of HL7 messages and DICOM objects, including patient data. Keep the cache on a protected local disk, and set retention to meet your data-retention policy.