PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
Cache

Set the post-store notification handler.

Set the post-store notification handlerThis handler is called after successful storage operations. Use this for cache invalidation, notifications, or other post-processing.

Parameters
handlerThe post-store callback function

invalidation on storage

storage_scp scp{config};
scp.set_post_store_handler([](const auto& dataset,
const auto& patient_id,
const auto& study_uid,
const auto& series_uid,
const auto& sop_uid) {
// Invalidate all cached queries for affected patient/study
auto& cache = global_query_cache();
cache.invalidate_if([&](const auto& key, const auto& result) {
return result.query_level == "PATIENT" ||
result.query_level == "STUDY" ||
result.query_level == "SERIES" ||
result.query_level == "IMAGE";
});
});