20#ifndef PACS_SERVICES_STORAGE_SCU_HPP
21#define PACS_SERVICES_STORAGE_SCU_HPP
60 return (
status & 0xF000) == 0xB000;
178 explicit storage_scu(std::shared_ptr<di::ILogger> logger =
nullptr);
187 std::shared_ptr<di::ILogger> logger =
nullptr);
230 [[nodiscard]] std::vector<store_result>
store_batch(
232 const std::vector<core::dicom_dataset>& datasets,
250 const std::filesystem::path& file_path);
264 [[nodiscard]] std::vector<store_result>
store_files(
266 const std::vector<std::filesystem::path>& file_paths,
282 const std::filesystem::path& directory,
283 bool recursive =
true,
300 [[nodiscard]]
size_t failures() const noexcept;
306 [[nodiscard]]
size_t bytes_sent() const noexcept;
322 network::association& assoc,
323 const core::dicom_dataset& dataset,
324 uint16_t message_id);
335 const std::filesystem::path& directory,
336 bool recursive) const;
DICOM Association management per PS3.8.
std::atomic< size_t > failures_
Statistics: number of failed operations.
size_t bytes_sent() const noexcept
Get the total bytes sent since construction.
std::atomic< uint16_t > message_id_counter_
Message ID counter.
storage_scu & operator=(storage_scu &&)=delete
network::Result< store_result > store_file(network::association &assoc, const std::filesystem::path &file_path)
Store a DICOM file.
std::atomic< size_t > images_sent_
Statistics: number of images sent successfully.
storage_scu(std::shared_ptr< di::ILogger > logger=nullptr)
Construct a Storage SCU with default configuration.
std::vector< store_result > store_batch(network::association &assoc, const std::vector< core::dicom_dataset > &datasets, store_progress_callback progress_callback=nullptr)
Store multiple DICOM datasets.
size_t images_sent() const noexcept
Get the number of images sent since construction.
network::Result< store_result > store(network::association &assoc, const core::dicom_dataset &dataset)
Store a single DICOM dataset.
size_t failures() const noexcept
Get the number of failed store operations since construction.
storage_scu & operator=(const storage_scu &)=delete
storage_scu_config config_
Configuration.
void reset_statistics() noexcept
Reset statistics counters to zero.
std::atomic< size_t > bytes_sent_
Statistics: total bytes sent.
std::vector< std::filesystem::path > collect_dicom_files(const std::filesystem::path &directory, bool recursive) const
Collect DICOM files from a directory.
std::vector< store_result > store_directory(network::association &assoc, const std::filesystem::path &directory, bool recursive=true, store_progress_callback progress_callback=nullptr)
Store all DICOM files in a directory.
uint16_t next_message_id() noexcept
Get the next message ID for DIMSE operations.
storage_scu(storage_scu &&)=delete
std::shared_ptr< di::ILogger > logger_
Logger instance for service logging.
network::Result< store_result > store_impl(network::association &assoc, const core::dicom_dataset &dataset, uint16_t message_id)
Internal implementation of single store operation.
std::vector< store_result > store_files(network::association &assoc, const std::vector< std::filesystem::path > &file_paths, store_progress_callback progress_callback=nullptr)
Store multiple DICOM files.
storage_scu(const storage_scu &)=delete
DICOM Dataset - ordered collection of Data Elements.
DIMSE message encoding and decoding.
Logger interface for dependency injection.
@ completed
Procedure completed successfully.
std::function< void(size_t completed, size_t total)> store_progress_callback
Progress callback type for batch operations.
Storage SCP status codes for C-STORE operations.
Configuration for Storage SCU service.
std::chrono::milliseconds response_timeout
Timeout for receiving C-STORE response (milliseconds)
bool continue_on_error
Continue batch operation on error (true) or stop on first error (false)
uint16_t default_priority
Default priority for C-STORE requests (0=medium, 1=high, 2=low)
Result of a C-STORE operation.
uint16_t status
DIMSE status code (0x0000 = success)
bool is_warning() const noexcept
Check if this was a warning status.
bool is_error() const noexcept
Check if this was an error status.
std::string error_comment
Error comment from the SCP (if any)
std::string sop_instance_uid
SOP Instance UID of the stored instance.
bool is_success() const noexcept
Check if the store operation was successful.