|
PACS System 0.1.0
PACS DICOM system library
|
#include <storage_scp.h>


Public Member Functions | |
| storage_scp (std::shared_ptr< di::ILogger > logger=nullptr) | |
| Construct a Storage SCP with default configuration. | |
| storage_scp (const storage_scp_config &config, std::shared_ptr< di::ILogger > logger=nullptr) | |
| Construct a Storage SCP with custom configuration. | |
| ~storage_scp () override=default | |
| void | set_handler (storage_handler handler) |
| Set the storage handler callback. | |
| void | set_pre_store_handler (pre_store_handler handler) |
| Set the pre-store validation handler. | |
| void | set_post_store_handler (post_store_handler handler) |
| void | set_audit_handler (std::shared_ptr< kcenon::pacs::security::atna_service_auditor > auditor) |
| Set the ATNA audit handler for C-STORE operations. | |
| std::vector< std::string > | supported_sop_classes () const override |
| Get supported SOP Class UIDs. | |
| network::Result< std::monostate > | handle_message (network::association &assoc, uint8_t context_id, const network::dimse::dimse_message &request) override |
| Handle an incoming DIMSE message (C-STORE-RQ) | |
| std::string_view | service_name () const noexcept override |
| Get the service name. | |
| size_t | images_received () const noexcept |
| Get the number of images received since construction. | |
| size_t | bytes_received () const noexcept |
| Get the total bytes received since construction. | |
| void | reset_statistics () noexcept |
| Reset statistics counters to zero. | |
Public Member Functions inherited from kcenon::pacs::services::scp_service | |
| scp_service (std::shared_ptr< di::ILogger > logger=nullptr) | |
| Construct SCP service with optional logger. | |
| virtual | ~scp_service ()=default |
| scp_service (const scp_service &)=delete | |
| scp_service & | operator= (const scp_service &)=delete |
| scp_service (scp_service &&)=default | |
| scp_service & | operator= (scp_service &&)=default |
| void | set_logger (std::shared_ptr< di::ILogger > logger) |
| Set the logger instance. | |
| const std::shared_ptr< di::ILogger > & | logger () const noexcept |
| Get the current logger instance. | |
| bool | supports_sop_class (std::string_view sop_class_uid) const |
| Check if this service supports a specific SOP Class. | |
Private Attributes | |
| storage_scp_config | config_ |
| Configuration. | |
| storage_handler | handler_ |
| Main storage handler. | |
| pre_store_handler | pre_store_handler_ |
| Pre-store validation handler. | |
| post_store_handler | post_store_handler_ |
| Post-store notification handler. | |
| std::shared_ptr< kcenon::pacs::security::atna_service_auditor > | auditor_ |
| ATNA audit handler. | |
| std::atomic< size_t > | images_received_ {0} |
| Statistics: number of images received. | |
| std::atomic< size_t > | bytes_received_ {0} |
| Statistics: total bytes received. | |
Additional Inherited Members | |
Protected Attributes inherited from kcenon::pacs::services::scp_service | |
| std::shared_ptr< di::ILogger > | logger_ |
| Logger instance for service logging. | |
Definition at line 161 of file storage_scp.h.
|
explicit |
Construct a Storage SCP with default configuration.
| logger | Logger instance for service logging (nullptr uses null_logger) |
Definition at line 26 of file storage_scp.cpp.
|
explicit |
Construct a Storage SCP with custom configuration.
| config | Configuration options |
| logger | Logger instance for service logging (nullptr uses null_logger) |
Definition at line 29 of file storage_scp.cpp.
|
overridedefault |
|
nodiscardnoexcept |
Get the total bytes received since construction.
Definition at line 209 of file storage_scp.cpp.
References bytes_received_.
|
nodiscardoverridevirtual |
Handle an incoming DIMSE message (C-STORE-RQ)
Processes the C-STORE request:
| assoc | The association on which the message was received |
| context_id | The presentation context ID for the message |
| request | The incoming C-STORE-RQ message |
Implements kcenon::pacs::services::scp_service.
Definition at line 65 of file storage_scp.cpp.
References kcenon::pacs::network::dimse::dimse_message::affected_sop_class_uid(), kcenon::pacs::network::dimse::dimse_message::affected_sop_instance_uid(), kcenon::pacs::security::atna_service_auditor::audit_instance_stored(), auditor_, bytes_received_, kcenon::pacs::network::association::called_ae(), kcenon::pacs::network::association::calling_ae(), kcenon::pacs::services::cannot_understand, kcenon::pacs::network::dimse::dimse_message::command(), kcenon::pacs::network::dimse::dimse_message::dataset(), handler_, kcenon::pacs::network::dimse::dimse_message::has_dataset(), images_received_, kcenon::pacs::services::is_failure(), kcenon::pacs::network::dimse::dimse_message::message_id(), kcenon::pacs::pacs_void_error(), kcenon::pacs::core::tags::patient_id, post_store_handler_, pre_store_handler_, kcenon::pacs::network::association::send_dimse(), kcenon::pacs::core::tags::series_instance_uid, kcenon::pacs::error_codes::store_unexpected_command, kcenon::pacs::core::tags::study_instance_uid, kcenon::pacs::services::success, and kcenon::pacs::services::to_string().

|
nodiscardnoexcept |
Get the number of images received since construction.
Definition at line 205 of file storage_scp.cpp.
References images_received_.
|
noexcept |
Reset statistics counters to zero.
Definition at line 213 of file storage_scp.cpp.
References bytes_received_, and images_received_.
|
nodiscardoverridevirtualnoexcept |
Get the service name.
Implements kcenon::pacs::services::scp_service.
Definition at line 197 of file storage_scp.cpp.
| void kcenon::pacs::services::storage_scp::set_audit_handler | ( | std::shared_ptr< kcenon::pacs::security::atna_service_auditor > | auditor | ) |
Set the ATNA audit handler for C-STORE operations.
When set, audit events are emitted for each C-STORE operation (both success and failure).
| auditor | Shared pointer to an ATNA service auditor |
Definition at line 49 of file storage_scp.cpp.
References auditor_.
| void kcenon::pacs::services::storage_scp::set_handler | ( | storage_handler | handler | ) |
Set the storage handler callback.
This handler is called for each received C-STORE request after pre-validation passes. It should perform the actual storage operation.
| handler | The storage callback function |
Definition at line 37 of file storage_scp.cpp.
References handler_.
| void kcenon::pacs::services::storage_scp::set_post_store_handler | ( | post_store_handler | handler | ) |
Definition at line 45 of file storage_scp.cpp.
References post_store_handler_.
Referenced by kcenon::pacs::client::routing_manager::attach_to_storage_scp(), and kcenon::pacs::client::routing_manager::detach_from_storage_scp().

| void kcenon::pacs::services::storage_scp::set_pre_store_handler | ( | pre_store_handler | handler | ) |
Set the pre-store validation handler.
This handler is called before the main storage handler to validate incoming datasets. Return false to reject the storage request.
| handler | The pre-validation callback function |
Definition at line 41 of file storage_scp.cpp.
References pre_store_handler_.
|
nodiscardoverridevirtual |
Get supported SOP Class UIDs.
Returns the list of Storage SOP Classes this service accepts. If no specific classes are configured, returns all standard storage classes.
Implements kcenon::pacs::services::scp_service.
Definition at line 58 of file storage_scp.cpp.
References kcenon::pacs::services::storage_scp_config::accepted_sop_classes, config_, and kcenon::pacs::services::get_standard_storage_sop_classes().

|
private |
ATNA audit handler.
Definition at line 328 of file storage_scp.h.
Referenced by handle_message(), and set_audit_handler().
|
private |
Statistics: total bytes received.
Definition at line 334 of file storage_scp.h.
Referenced by bytes_received(), handle_message(), and reset_statistics().
|
private |
|
private |
Main storage handler.
Definition at line 319 of file storage_scp.h.
Referenced by handle_message(), and set_handler().
|
private |
Statistics: number of images received.
Definition at line 331 of file storage_scp.h.
Referenced by handle_message(), images_received(), and reset_statistics().
|
private |
Post-store notification handler.
Definition at line 325 of file storage_scp.h.
Referenced by handle_message(), and set_post_store_handler().
|
private |
Pre-store validation handler.
Definition at line 322 of file storage_scp.h.
Referenced by handle_message(), and set_pre_store_handler().