22#ifndef PACS_SERVICES_RETRIEVE_SCP_HPP
23#define PACS_SERVICES_RETRIEVE_SCP_HPP
44 "1.2.840.10008.5.1.4.1.2.1.2";
48 "1.2.840.10008.5.1.4.1.2.2.2";
52 "1.2.840.10008.5.1.4.1.2.1.3";
56 "1.2.840.10008.5.1.4.1.2.2.3";
77 [[nodiscard]] uint16_t
total() const noexcept {
115 std::optional<std::pair<std::string, uint16_t>>(
116 const std::string& ae_title)>;
136 const std::string& move_originator_ae,
137 uint16_t move_originator_msg_id)>;
326 [[nodiscard]] std::string_view
service_name() const noexcept override;
369 network::association& assoc,
371 const network::dimse::dimse_message& request);
382 network::association& assoc,
384 const network::dimse::dimse_message& request);
398 network::association& assoc,
401 std::string_view sop_class_uid,
418 network::association& assoc,
421 std::string_view sop_class_uid,
433 const network::dimse::dimse_message& request) const;
std::string_view service_name() const noexcept override
Get the service name.
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 get_move_destination(const network::dimse::dimse_message &request) const
Get the Move Destination AE title from the request.
void set_destination_resolver(destination_resolver resolver)
Set the destination resolver function.
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.
std::atomic< size_t > get_operations_
size_t get_operations() const noexcept
Get total number of C-GET operations processed.
void reset_statistics() noexcept
Reset statistics counters.
~retrieve_scp() override=default
size_t images_transferred() const noexcept
Get total number of images transferred.
void set_cancel_check(retrieve_cancel_check check)
Set the cancel check function.
retrieve_cancel_check cancel_check_
std::atomic< size_t > images_transferred_
std::vector< std::string > supported_sop_classes() const override
Get supported SOP Class UIDs.
store_sub_operation store_handler_
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_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.
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.
destination_resolver destination_resolver_
void set_retrieve_handler(retrieve_handler handler)
Set the retrieve handler function.
std::atomic< size_t > move_operations_
retrieve_handler retrieve_handler_
size_t move_operations() const noexcept
Get total number of C-MOVE operations processed.
void set_store_sub_operation(store_sub_operation handler)
Set the store sub-operation handler.
retrieve_scp(std::shared_ptr< di::ILogger > logger=nullptr)
Construct a Retrieve SCP with optional logger.
const std::shared_ptr< di::ILogger > & logger() const noexcept
Get the current logger instance.
DICOM Dataset - ordered collection of Data Elements.
DICOM Part 10 file handling for reading/writing DICOM files.
uint16_t status_code
DIMSE status code type alias.
std::function< std::optional< std::pair< std::string, uint16_t > >( const std::string &ae_title)> destination_resolver
Destination resolver function type.
std::function< network::dimse::status_code( network::association &assoc, uint8_t context_id, const core::dicom_file &file, const std::string &move_originator_ae, uint16_t move_originator_msg_id)> store_sub_operation
Store sub-operation function type.
std::function< std::vector< core::dicom_file >( const core::dicom_dataset &query_keys)> retrieve_handler
Retrieve handler function type.
std::function< bool()> retrieve_cancel_check
Cancel check function type.
constexpr std::string_view study_root_move_sop_class_uid
Study Root Query/Retrieve Information Model - MOVE.
constexpr std::string_view study_root_get_sop_class_uid
Study Root Query/Retrieve Information Model - GET.
constexpr std::string_view patient_root_move_sop_class_uid
Patient Root Query/Retrieve Information Model - MOVE.
constexpr std::string_view patient_root_get_sop_class_uid
Patient Root Query/Retrieve Information Model - GET.
Base class for DICOM SCP (Service Class Provider) services.
Statistics for C-MOVE/C-GET sub-operations.
uint16_t total() const noexcept
Get total number of sub-operations.
uint16_t failed
Number of failed sub-operations.
bool all_successful() const noexcept
Check if all operations completed successfully.
uint16_t warning
Number of sub-operations with warnings.
uint16_t remaining
Number of remaining sub-operations.
uint16_t completed
Number of completed sub-operations.