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

Public Member Functions | |
| retrieve_scu (std::shared_ptr< di::ILogger > logger=nullptr) | |
| Construct a Retrieve SCU with default configuration. | |
| retrieve_scu (const retrieve_scu_config &config, std::shared_ptr< di::ILogger > logger=nullptr) | |
| Construct a Retrieve SCU with custom configuration. | |
| ~retrieve_scu ()=default | |
| retrieve_scu (const retrieve_scu &)=delete | |
| retrieve_scu & | operator= (const retrieve_scu &)=delete |
| retrieve_scu (retrieve_scu &&)=delete | |
| retrieve_scu & | operator= (retrieve_scu &&)=delete |
| network::Result< retrieve_result > | move (network::association &assoc, const core::dicom_dataset &query_keys, std::string_view destination_ae, retrieve_progress_callback progress=nullptr) |
| Perform a C-MOVE operation with raw dataset. | |
| network::Result< retrieve_result > | get (network::association &assoc, const core::dicom_dataset &query_keys, retrieve_progress_callback progress=nullptr) |
| Perform a C-GET operation with raw dataset. | |
| network::Result< retrieve_result > | retrieve_study (network::association &assoc, std::string_view study_uid, retrieve_progress_callback progress=nullptr) |
| Retrieve a study by Study Instance UID. | |
| network::Result< retrieve_result > | retrieve_series (network::association &assoc, std::string_view series_uid, retrieve_progress_callback progress=nullptr) |
| Retrieve a series by Series Instance UID. | |
| network::Result< retrieve_result > | retrieve_instance (network::association &assoc, std::string_view sop_instance_uid, retrieve_progress_callback progress=nullptr) |
| Retrieve a single instance by SOP Instance UID. | |
| network::Result< std::monostate > | cancel (network::association &assoc, uint16_t message_id) |
| Send a C-CANCEL request to stop an ongoing retrieve. | |
| void | set_config (const retrieve_scu_config &config) |
| Update the SCU configuration. | |
| void | set_move_destination (std::string_view ae_title) |
| Set the move destination AE title. | |
| const retrieve_scu_config & | config () const noexcept |
| Get the current configuration. | |
| size_t | retrieves_performed () const noexcept |
| Get the number of retrieves performed since construction. | |
| size_t | instances_retrieved () const noexcept |
| Get the total number of instances retrieved since construction. | |
| size_t | bytes_retrieved () const noexcept |
| Get the total bytes retrieved since construction (C-GET only) | |
| void | reset_statistics () noexcept |
| Reset statistics counters to zero. | |
Private Member Functions | |
| network::Result< retrieve_result > | perform_move (network::association &assoc, const core::dicom_dataset &query_keys, std::string_view destination_ae, retrieve_progress_callback progress) |
| Internal C-MOVE implementation. | |
| network::Result< retrieve_result > | perform_get (network::association &assoc, const core::dicom_dataset &query_keys, retrieve_progress_callback progress) |
| Internal C-GET implementation. | |
| uint16_t | next_message_id () noexcept |
| Get the next message ID for DIMSE operations. | |
| std::string_view | get_move_sop_class_uid () const noexcept |
| Get MOVE SOP Class UID based on current configuration. | |
| std::string_view | get_get_sop_class_uid () const noexcept |
| Get GET SOP Class UID based on current configuration. | |
| core::dicom_dataset | build_study_query (std::string_view study_uid) const |
| Build query dataset for study retrieval. | |
| core::dicom_dataset | build_series_query (std::string_view series_uid) const |
| Build query dataset for series retrieval. | |
| core::dicom_dataset | build_instance_query (std::string_view sop_instance_uid) const |
| Build query dataset for instance retrieval. | |
Private Attributes | |
| std::shared_ptr< di::ILogger > | logger_ |
| Logger instance for service logging. | |
| retrieve_scu_config | config_ |
| Configuration. | |
| std::atomic< uint16_t > | message_id_counter_ {1} |
| Message ID counter. | |
| std::atomic< size_t > | retrieves_performed_ {0} |
| Statistics: number of retrieves performed. | |
| std::atomic< size_t > | instances_retrieved_ {0} |
| Statistics: total number of instances retrieved. | |
| std::atomic< size_t > | bytes_retrieved_ {0} |
| Statistics: total bytes retrieved. | |
Definition at line 352 of file retrieve_scu.h.
|
explicit |
Construct a Retrieve SCU with default configuration.
| logger | Logger instance for service logging (nullptr uses null_logger) |
Definition at line 25 of file retrieve_scu.cpp.
|
explicit |
Construct a Retrieve SCU with custom configuration.
| config | Configuration options |
| logger | Logger instance for service logging (nullptr uses null_logger) |
Definition at line 28 of file retrieve_scu.cpp.
|
default |
|
delete |
|
delete |
|
nodiscardprivate |
Build query dataset for instance retrieval.
Definition at line 526 of file retrieve_scu.cpp.
References kcenon::pacs::core::tags::query_retrieve_level, and kcenon::pacs::core::tags::sop_instance_uid.
Referenced by retrieve_instance().

|
nodiscardprivate |
Build query dataset for series retrieval.
Definition at line 513 of file retrieve_scu.cpp.
References kcenon::pacs::core::tags::query_retrieve_level, and kcenon::pacs::core::tags::series_instance_uid.
Referenced by retrieve_series().

|
nodiscardprivate |
Build query dataset for study retrieval.
Definition at line 500 of file retrieve_scu.cpp.
References kcenon::pacs::core::tags::query_retrieve_level, and kcenon::pacs::core::tags::study_instance_uid.
Referenced by retrieve_study().

|
nodiscardnoexcept |
Get the total bytes retrieved since construction (C-GET only)
Definition at line 455 of file retrieve_scu.cpp.
References bytes_retrieved_.
|
nodiscard |
Send a C-CANCEL request to stop an ongoing retrieve.
| assoc | The association on which the retrieve is running |
| message_id | The message ID of the retrieve to cancel |
Definition at line 405 of file retrieve_scu.cpp.
References kcenon::pacs::network::association::accepted_context_id(), kcenon::pacs::services::c_move, config_, get_get_sop_class_uid(), get_move_sop_class_uid(), kcenon::pacs::services::retrieve_scu_config::mode, kcenon::pacs::error_codes::no_acceptable_context, kcenon::pacs::pacs_error(), and kcenon::pacs::network::association::send_dimse().

|
nodiscardnoexcept |
Get the current configuration.
Definition at line 439 of file retrieve_scu.cpp.
References config_.
Referenced by set_config().

|
nodiscard |
Perform a C-GET operation with raw dataset.
Sends a C-GET request with the provided query keys to retrieve matching images. The images are received directly on the same association via C-STORE sub-operations.
| assoc | The established association to use |
| query_keys | The DICOM dataset containing query keys |
| progress | Optional callback for progress updates |
Definition at line 186 of file retrieve_scu.cpp.
References perform_get().
Referenced by retrieve_instance(), retrieve_series(), and retrieve_study().


|
nodiscardprivatenoexcept |
Get GET SOP Class UID based on current configuration.
Definition at line 489 of file retrieve_scu.cpp.
References config_, kcenon::pacs::services::retrieve_scu_config::model, kcenon::pacs::services::patient_root, kcenon::pacs::services::patient_root_get_sop_class_uid, kcenon::pacs::services::study_root, and kcenon::pacs::services::study_root_get_sop_class_uid.
Referenced by cancel(), and perform_get().

|
nodiscardprivatenoexcept |
Get MOVE SOP Class UID based on current configuration.
Definition at line 478 of file retrieve_scu.cpp.
References config_, kcenon::pacs::services::retrieve_scu_config::model, kcenon::pacs::services::patient_root, kcenon::pacs::services::patient_root_move_sop_class_uid, kcenon::pacs::services::study_root, and kcenon::pacs::services::study_root_move_sop_class_uid.
Referenced by cancel(), and perform_move().

|
nodiscardnoexcept |
Get the total number of instances retrieved since construction.
Definition at line 451 of file retrieve_scu.cpp.
References instances_retrieved_.
|
nodiscard |
Perform a C-MOVE operation with raw dataset.
Sends a C-MOVE request with the provided query keys to retrieve matching images. The SCP will send the images to the specified destination AE title.
| assoc | The established association to use |
| query_keys | The DICOM dataset containing query keys |
| destination_ae | The destination AE title to send images to |
| progress | Optional callback for progress updates |
Definition at line 36 of file retrieve_scu.cpp.
References perform_move().
Referenced by retrieve_instance(), retrieve_series(), and retrieve_study().


|
nodiscardprivatenoexcept |
Get the next message ID for DIMSE operations.
Definition at line 469 of file retrieve_scu.cpp.
References message_id_counter_.
Referenced by perform_get(), and perform_move().

|
delete |
|
delete |
|
nodiscardprivate |
Internal C-GET implementation.
Definition at line 194 of file retrieve_scu.cpp.
References kcenon::pacs::network::association::accepted_context_id(), kcenon::pacs::error_codes::association_not_established, bytes_retrieved_, kcenon::pacs::services::completed, kcenon::pacs::services::retrieve_progress::completed, kcenon::pacs::services::retrieve_result::completed, config_, kcenon::pacs::services::retrieve_result::elapsed, kcenon::pacs::services::retrieve_progress::failed, kcenon::pacs::services::retrieve_result::failed, kcenon::pacs::services::retrieve_result::final_status, get_get_sop_class_uid(), instances_retrieved_, kcenon::pacs::network::association::is_established(), logger_, next_message_id(), kcenon::pacs::error_codes::no_acceptable_context, kcenon::pacs::pacs_error(), kcenon::pacs::services::retrieve_scu_config::priority, kcenon::pacs::network::association::receive_dimse(), kcenon::pacs::services::retrieve_result::received_instances, kcenon::pacs::services::retrieve_progress::remaining, retrieves_performed_, kcenon::pacs::network::association::send_dimse(), kcenon::pacs::services::retrieve_progress::start_time, kcenon::pacs::services::retrieve_scu_config::timeout, kcenon::pacs::services::warning, kcenon::pacs::services::retrieve_progress::warning, and kcenon::pacs::services::retrieve_result::warning.
Referenced by get().


|
nodiscardprivate |
Internal C-MOVE implementation.
Definition at line 45 of file retrieve_scu.cpp.
References kcenon::pacs::network::association::accepted_context_id(), kcenon::pacs::encoding::AE, kcenon::pacs::error_codes::association_not_established, kcenon::pacs::services::completed, kcenon::pacs::services::retrieve_progress::completed, kcenon::pacs::services::retrieve_result::completed, config_, kcenon::pacs::services::retrieve_result::elapsed, kcenon::pacs::services::retrieve_progress::failed, kcenon::pacs::services::retrieve_result::failed, kcenon::pacs::services::retrieve_result::final_status, get_move_sop_class_uid(), instances_retrieved_, kcenon::pacs::network::association::is_established(), logger_, next_message_id(), kcenon::pacs::error_codes::no_acceptable_context, kcenon::pacs::pacs_error(), kcenon::pacs::services::retrieve_scu_config::priority, kcenon::pacs::network::association::receive_dimse(), kcenon::pacs::services::retrieve_progress::remaining, kcenon::pacs::error_codes::retrieve_missing_destination, kcenon::pacs::error_codes::retrieve_unexpected_command, retrieves_performed_, kcenon::pacs::network::association::send_dimse(), kcenon::pacs::services::retrieve_progress::start_time, kcenon::pacs::services::retrieve_scu_config::timeout, kcenon::pacs::services::to_string(), kcenon::pacs::services::warning, kcenon::pacs::services::retrieve_progress::warning, and kcenon::pacs::services::retrieve_result::warning.
Referenced by move().


|
noexcept |
Reset statistics counters to zero.
Definition at line 459 of file retrieve_scu.cpp.
References bytes_retrieved_, instances_retrieved_, and retrieves_performed_.
|
nodiscard |
Retrieve a single instance by SOP Instance UID.
Uses C-MOVE or C-GET based on current configuration.
| assoc | The established association to use |
| sop_instance_uid | The SOP Instance UID to retrieve |
| progress | Optional callback for progress updates |
Definition at line 382 of file retrieve_scu.cpp.
References build_instance_query(), kcenon::pacs::services::c_move, config_, get(), kcenon::pacs::services::retrieve_scu_config::mode, move(), kcenon::pacs::services::retrieve_scu_config::move_destination, kcenon::pacs::pacs_error(), and kcenon::pacs::error_codes::retrieve_missing_destination.

|
nodiscard |
Retrieve a series by Series Instance UID.
Uses C-MOVE or C-GET based on current configuration.
| assoc | The established association to use |
| series_uid | The Series Instance UID to retrieve |
| progress | Optional callback for progress updates |
Definition at line 363 of file retrieve_scu.cpp.
References build_series_query(), kcenon::pacs::services::c_move, config_, get(), kcenon::pacs::services::retrieve_scu_config::mode, move(), kcenon::pacs::services::retrieve_scu_config::move_destination, kcenon::pacs::pacs_error(), and kcenon::pacs::error_codes::retrieve_missing_destination.
Referenced by kcenon::pacs::client::job_manager::impl::execute_retrieve_job().


|
nodiscard |
Retrieve a study by Study Instance UID.
Uses C-MOVE or C-GET based on current configuration.
| assoc | The established association to use |
| study_uid | The Study Instance UID to retrieve |
| progress | Optional callback for progress updates |
Definition at line 344 of file retrieve_scu.cpp.
References build_study_query(), kcenon::pacs::services::c_move, config_, get(), kcenon::pacs::services::retrieve_scu_config::mode, move(), kcenon::pacs::services::retrieve_scu_config::move_destination, kcenon::pacs::pacs_error(), and kcenon::pacs::error_codes::retrieve_missing_destination.
Referenced by kcenon::pacs::client::job_manager::impl::execute_retrieve_job(), and kcenon::pacs::workflow::auto_prefetch_service::prefetch_study().


|
nodiscardnoexcept |
Get the number of retrieves performed since construction.
Definition at line 447 of file retrieve_scu.cpp.
References retrieves_performed_.
| void kcenon::pacs::services::retrieve_scu::set_config | ( | const retrieve_scu_config & | config | ) |
| void kcenon::pacs::services::retrieve_scu::set_move_destination | ( | std::string_view | ae_title | ) |
Set the move destination AE title.
| ae_title | The destination AE title for C-MOVE operations |
Definition at line 435 of file retrieve_scu.cpp.
References config_, and kcenon::pacs::services::retrieve_scu_config::move_destination.
|
private |
Statistics: total bytes retrieved.
Definition at line 617 of file retrieve_scu.h.
Referenced by bytes_retrieved(), perform_get(), and reset_statistics().
|
private |
Configuration.
Definition at line 605 of file retrieve_scu.h.
Referenced by cancel(), config(), get_get_sop_class_uid(), get_move_sop_class_uid(), perform_get(), perform_move(), retrieve_instance(), retrieve_series(), retrieve_study(), set_config(), and set_move_destination().
|
private |
Statistics: total number of instances retrieved.
Definition at line 614 of file retrieve_scu.h.
Referenced by instances_retrieved(), perform_get(), perform_move(), and reset_statistics().
|
private |
Logger instance for service logging.
Definition at line 602 of file retrieve_scu.h.
Referenced by perform_get(), and perform_move().
|
private |
Message ID counter.
Definition at line 608 of file retrieve_scu.h.
Referenced by next_message_id().
|
private |
Statistics: number of retrieves performed.
Definition at line 611 of file retrieve_scu.h.
Referenced by perform_get(), perform_move(), reset_statistics(), and retrieves_performed().