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


Public Member Functions | |
| retrieve_scp (std::shared_ptr< di::ILogger > logger=nullptr) | |
| Construct a Retrieve SCP with optional logger. | |
| ~retrieve_scp () override=default | |
| void | set_retrieve_handler (retrieve_handler handler) |
| Set the retrieve handler function. | |
| void | set_destination_resolver (destination_resolver resolver) |
| Set the destination resolver function. | |
| void | set_store_sub_operation (store_sub_operation handler) |
| Set the store sub-operation handler. | |
| void | set_cancel_check (retrieve_cancel_check check) |
| Set the cancel check function. | |
| 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-MOVE-RQ or C-GET-RQ) | |
| std::string_view | service_name () const noexcept override |
| Get the service name. | |
| size_t | move_operations () const noexcept |
| Get total number of C-MOVE operations processed. | |
| size_t | get_operations () const noexcept |
| Get total number of C-GET operations processed. | |
| size_t | images_transferred () const noexcept |
| Get total number of images transferred. | |
| void | reset_statistics () noexcept |
| Reset statistics counters. | |
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 Member Functions | |
| network::Result< std::monostate > | handle_c_move (network::association &assoc, uint8_t context_id, const network::dimse::dimse_message &request) |
| Handle a C-MOVE request. | |
| network::Result< std::monostate > | handle_c_get (network::association &assoc, uint8_t context_id, const network::dimse::dimse_message &request) |
| Handle a C-GET request. | |
| network::Result< std::monostate > | send_pending_response (network::association &assoc, uint8_t context_id, uint16_t message_id, std::string_view sop_class_uid, bool is_move, const sub_operation_stats &stats) |
| Send a pending response with progress information. | |
| network::Result< std::monostate > | send_final_response (network::association &assoc, uint8_t context_id, uint16_t message_id, std::string_view sop_class_uid, bool is_move, const sub_operation_stats &stats, bool was_cancelled) |
| Send a final response with completion status. | |
| std::string | get_move_destination (const network::dimse::dimse_message &request) const |
| Get the Move Destination AE title from the request. | |
Private Attributes | |
| retrieve_handler | retrieve_handler_ |
| destination_resolver | destination_resolver_ |
| store_sub_operation | store_handler_ |
| retrieve_cancel_check | cancel_check_ |
| std::atomic< size_t > | move_operations_ {0} |
| std::atomic< size_t > | get_operations_ {0} |
| std::atomic< size_t > | images_transferred_ {0} |
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 230 of file retrieve_scp.h.
|
explicit |
Construct a Retrieve SCP with optional logger.
| logger | Logger instance for service logging (nullptr uses null_logger) |
Definition at line 26 of file retrieve_scp.cpp.
|
overridedefault |
|
nodiscardprivate |
Get the Move Destination AE title from the request.
| request | The C-MOVE-RQ message |
Definition at line 528 of file retrieve_scp.cpp.
References kcenon::pacs::network::dimse::dimse_message::command_set(), and kcenon::pacs::network::dimse::tag_move_destination.
Referenced by handle_c_move().


|
nodiscardnoexcept |
Get total number of C-GET operations processed.
Definition at line 97 of file retrieve_scp.cpp.
References get_operations_.
|
nodiscardprivate |
Handle a C-GET request.
| assoc | The association |
| context_id | The presentation context ID |
| request | The C-GET-RQ message |
Definition at line 278 of file retrieve_scp.cpp.
References kcenon::pacs::network::association::accepted_context_id(), kcenon::pacs::encoding::AE, kcenon::pacs::network::dimse::dimse_message::affected_sop_class_uid(), kcenon::pacs::events::c_get, kcenon::pacs::network::association::calling_ae(), cancel_check_, kcenon::pacs::network::dimse::dimse_message::dataset(), get_operations_, kcenon::pacs::network::dimse::dimse_message::has_dataset(), images_transferred_, kcenon::pacs::services::is_success(), kcenon::pacs::services::is_warning(), kcenon::pacs::network::dimse::dimse_message::message_id(), kcenon::pacs::pacs_void_error(), kcenon::pacs::network::association::receive_dimse(), retrieve_handler_, kcenon::pacs::error_codes::retrieve_handler_not_set, kcenon::pacs::network::association::send_dimse(), send_final_response(), send_pending_response(), store_handler_, kcenon::pacs::core::tags::study_instance_uid, and kcenon::pacs::encoding::US.
Referenced by handle_message().


|
nodiscardprivate |
Handle a C-MOVE request.
| assoc | The association |
| context_id | The presentation context ID |
| request | The C-MOVE-RQ message |
Definition at line 115 of file retrieve_scp.cpp.
References kcenon::pacs::network::dimse::dimse_message::affected_sop_class_uid(), kcenon::pacs::events::c_move, kcenon::pacs::network::association::calling_ae(), cancel_check_, kcenon::pacs::network::dimse::dimse_message::dataset(), destination_resolver_, get_move_destination(), kcenon::pacs::network::dimse::dimse_message::has_dataset(), images_transferred_, kcenon::pacs::services::is_success(), kcenon::pacs::services::is_warning(), kcenon::pacs::network::dimse::dimse_message::message_id(), move_operations_, kcenon::pacs::pacs_void_error(), retrieve_handler_, kcenon::pacs::error_codes::retrieve_handler_not_set, kcenon::pacs::error_codes::retrieve_missing_destination, kcenon::pacs::network::association::send_dimse(), send_final_response(), send_pending_response(), store_handler_, and kcenon::pacs::core::tags::study_instance_uid.
Referenced by handle_message().


|
nodiscardoverridevirtual |
Handle an incoming DIMSE message (C-MOVE-RQ or C-GET-RQ)
Processes the retrieve request:
| assoc | The association on which the message was received |
| context_id | The presentation context ID for the message |
| request | The incoming C-MOVE-RQ or C-GET-RQ message |
Implements kcenon::pacs::services::scp_service.
Definition at line 62 of file retrieve_scp.cpp.
References kcenon::pacs::network::dimse::dimse_message::command(), handle_c_get(), handle_c_move(), kcenon::pacs::pacs_void_error(), kcenon::pacs::error_codes::retrieve_unexpected_command, and kcenon::pacs::services::to_string().

|
nodiscardnoexcept |
Get total number of images transferred.
Definition at line 101 of file retrieve_scp.cpp.
References images_transferred_.
|
nodiscardnoexcept |
Get total number of C-MOVE operations processed.
Definition at line 93 of file retrieve_scp.cpp.
References move_operations_.
|
noexcept |
Reset statistics counters.
Definition at line 105 of file retrieve_scp.cpp.
References get_operations_, images_transferred_, and move_operations_.
|
nodiscardprivate |
Send a final response with completion status.
| assoc | The association |
| context_id | The presentation context ID |
| message_id | The original request message ID |
| sop_class_uid | The SOP Class UID |
| is_move | true for C-MOVE-RSP, false for C-GET-RSP |
| stats | Final sub-operation statistics |
| was_cancelled | true if operation was cancelled |
Definition at line 483 of file retrieve_scp.cpp.
References kcenon::pacs::network::association::send_dimse().
Referenced by handle_c_get(), and handle_c_move().


|
nodiscardprivate |
Send a pending response with progress information.
| assoc | The association |
| context_id | The presentation context ID |
| message_id | The original request message ID |
| sop_class_uid | The SOP Class UID |
| is_move | true for C-MOVE-RSP, false for C-GET-RSP |
| stats | Current sub-operation statistics |
Definition at line 455 of file retrieve_scp.cpp.
References kcenon::pacs::network::association::send_dimse().
Referenced by handle_c_get(), and handle_c_move().


|
nodiscardoverridevirtualnoexcept |
Get the service name.
Implements kcenon::pacs::services::scp_service.
Definition at line 85 of file retrieve_scp.cpp.
| void kcenon::pacs::services::retrieve_scp::set_cancel_check | ( | retrieve_cancel_check | check | ) |
Set the cancel check function.
The cancel check is called periodically during retrieve processing to check if a C-CANCEL has been received.
| check | The cancel check function |
Definition at line 45 of file retrieve_scp.cpp.
References cancel_check_.
| void kcenon::pacs::services::retrieve_scp::set_destination_resolver | ( | destination_resolver | resolver | ) |
Set the destination resolver function.
The resolver maps AE titles to network addresses for C-MOVE operations.
| resolver | The destination resolver function |
Definition at line 37 of file retrieve_scp.cpp.
References destination_resolver_.
| void kcenon::pacs::services::retrieve_scp::set_retrieve_handler | ( | retrieve_handler | handler | ) |
Set the retrieve handler function.
The handler is called for each retrieve request to find matching DICOM files in storage.
| handler | The retrieve handler function |
Definition at line 33 of file retrieve_scp.cpp.
References retrieve_handler_.
| void kcenon::pacs::services::retrieve_scp::set_store_sub_operation | ( | store_sub_operation | handler | ) |
Set the store sub-operation handler.
The store handler performs C-STORE sub-operations during C-MOVE/C-GET. If not set, a default implementation using the association's send_dimse will be used.
| handler | The store sub-operation handler |
Definition at line 41 of file retrieve_scp.cpp.
References store_handler_.
|
nodiscardoverridevirtual |
Get supported SOP Class UIDs.
Implements kcenon::pacs::services::scp_service.
Definition at line 53 of file retrieve_scp.cpp.
References kcenon::pacs::services::patient_root_get_sop_class_uid, kcenon::pacs::services::patient_root_move_sop_class_uid, kcenon::pacs::services::study_root_get_sop_class_uid, and kcenon::pacs::services::study_root_move_sop_class_uid.
|
private |
Definition at line 442 of file retrieve_scp.h.
Referenced by handle_c_get(), handle_c_move(), and set_cancel_check().
|
private |
Definition at line 440 of file retrieve_scp.h.
Referenced by handle_c_move(), and set_destination_resolver().
|
private |
Definition at line 445 of file retrieve_scp.h.
Referenced by get_operations(), handle_c_get(), and reset_statistics().
|
private |
Definition at line 446 of file retrieve_scp.h.
Referenced by handle_c_get(), handle_c_move(), images_transferred(), and reset_statistics().
|
private |
Definition at line 444 of file retrieve_scp.h.
Referenced by handle_c_move(), move_operations(), and reset_statistics().
|
private |
Definition at line 439 of file retrieve_scp.h.
Referenced by handle_c_get(), handle_c_move(), and set_retrieve_handler().
|
private |
Definition at line 441 of file retrieve_scp.h.
Referenced by handle_c_get(), handle_c_move(), and set_store_sub_operation().