|
PACS System 0.1.0
PACS DICOM system library
|
UPS Watch SCU service for subscribing to events on remote systems. More...
#include <ups_watch_scu.h>

Public Types | |
| using | event_received_callback |
| Callback type for received event notifications. | |
Public Member Functions | |
| ups_watch_scu (std::shared_ptr< di::ILogger > logger=nullptr) | |
| Construct UPS Watch SCU with default configuration. | |
| ups_watch_scu (const ups_watch_scu_config &config, std::shared_ptr< di::ILogger > logger=nullptr) | |
| Construct UPS Watch SCU with custom configuration. | |
| ~ups_watch_scu ()=default | |
| ups_watch_scu (const ups_watch_scu &)=delete | |
| ups_watch_scu & | operator= (const ups_watch_scu &)=delete |
| ups_watch_scu (ups_watch_scu &&)=delete | |
| ups_watch_scu & | operator= (ups_watch_scu &&)=delete |
| void | set_event_received_callback (event_received_callback cb) |
| Set callback for received event notifications. | |
| network::Result< ups_result > | subscribe (network::association &assoc, const ups_subscribe_data &data) |
| Subscribe to UPS workitem events (N-ACTION Type 3) | |
| network::Result< ups_result > | unsubscribe (network::association &assoc, const ups_unsubscribe_data &data) |
| Unsubscribe from UPS workitem events (N-ACTION Type 4) | |
| network::Result< ups_result > | suspend_global (network::association &assoc) |
| Suspend global subscription (N-ACTION Type 5) | |
| network::Result< ups_watch_event > | handle_event_report (const network::dimse::dimse_message &event_rq) |
| Handle an N-EVENT-REPORT-RQ received from the SCP. | |
| size_t | subscribes_performed () const noexcept |
| size_t | unsubscribes_performed () const noexcept |
| size_t | events_received () const noexcept |
| void | reset_statistics () noexcept |
Private Member Functions | |
| network::Result< ups_result > | send_watch_action (network::association &assoc, const std::string &sop_instance_uid, uint16_t action_type_id) |
| uint16_t | next_message_id () noexcept |
Static Private Member Functions | |
| static ups_watch_event | parse_event_dataset (uint16_t event_type_id, const std::string &workitem_uid, const core::dicom_dataset &dataset) |
Private Attributes | |
| std::shared_ptr< di::ILogger > | logger_ |
| ups_watch_scu_config | config_ |
| event_received_callback | event_callback_ |
| std::atomic< uint16_t > | message_id_counter_ {1} |
| std::atomic< size_t > | subscribes_performed_ {0} |
| std::atomic< size_t > | unsubscribes_performed_ {0} |
| std::atomic< size_t > | events_received_ {0} |
UPS Watch SCU service for subscribing to events on remote systems.
The UPS Watch SCU (Service Class User) sends N-ACTION requests to remote UPS Watch SCP servers to subscribe/unsubscribe from workitem events, and handles incoming N-EVENT-REPORT notifications.
Definition at line 131 of file ups_watch_scu.h.
Callback type for received event notifications.
Invoked when an N-EVENT-REPORT is received from the SCP.
Definition at line 170 of file ups_watch_scu.h.
|
explicit |
Construct UPS Watch SCU with default configuration.
| logger | Logger instance (nullptr uses null_logger) |
Definition at line 22 of file ups_watch_scu.cpp.
|
explicit |
Construct UPS Watch SCU with custom configuration.
| config | Configuration options |
| logger | Logger instance (nullptr uses null_logger) |
Definition at line 25 of file ups_watch_scu.cpp.
|
default |
|
delete |
|
delete |
|
nodiscardnoexcept |
Definition at line 184 of file ups_watch_scu.cpp.
References events_received_.
|
nodiscard |
Handle an N-EVENT-REPORT-RQ received from the SCP.
Parses the event dataset and invokes the registered callback.
| event_rq | The N-EVENT-REPORT-RQ message |
Definition at line 115 of file ups_watch_scu.cpp.
References kcenon::pacs::network::dimse::dimse_message::affected_sop_instance_uid(), kcenon::pacs::network::dimse::dimse_message::command(), kcenon::pacs::network::dimse::dimse_message::dataset(), event_callback_, kcenon::pacs::network::dimse::dimse_message::event_type_id(), kcenon::pacs::services::ups_watch_event::event_type_id, events_received_, kcenon::pacs::network::dimse::dimse_message::has_dataset(), logger_, kcenon::pacs::pacs_error(), parse_event_dataset(), kcenon::pacs::services::to_string(), kcenon::pacs::error_codes::ups_invalid_action_type, kcenon::pacs::error_codes::ups_unexpected_command, and kcenon::pacs::services::ups_watch_event::workitem_uid.

|
nodiscardprivatenoexcept |
Definition at line 320 of file ups_watch_scu.cpp.
References message_id_counter_.
Referenced by send_watch_action().

|
delete |
|
delete |
|
staticnodiscardprivate |
Definition at line 281 of file ups_watch_scu.cpp.
References kcenon::pacs::services::ups_watch_event::event_type_id, kcenon::pacs::core::dicom_dataset::get_string(), kcenon::pacs::services::ups_tags::procedure_step_progress, kcenon::pacs::services::ups_tags::procedure_step_state, kcenon::pacs::services::ups_tags::reason_for_cancellation, kcenon::pacs::services::ups_event_cancel_requested, kcenon::pacs::services::ups_event_progress_report, and kcenon::pacs::services::ups_event_state_report.
Referenced by handle_event_report().


|
noexcept |
Definition at line 188 of file ups_watch_scu.cpp.
References events_received_, subscribes_performed_, and unsubscribes_performed_.
|
nodiscardprivate |
Definition at line 198 of file ups_watch_scu.cpp.
References kcenon::pacs::network::association::accepted_context_id(), kcenon::pacs::error_codes::association_not_established, config_, kcenon::pacs::services::ups_result::elapsed, kcenon::pacs::services::ups_result::error_comment, kcenon::pacs::network::association::is_established(), kcenon::pacs::services::ups_result::is_success(), logger_, next_message_id(), kcenon::pacs::pacs_error(), kcenon::pacs::network::association::receive_dimse(), kcenon::pacs::network::association::send_dimse(), kcenon::pacs::services::ups_result::status, kcenon::pacs::services::ups_watch_scu_config::timeout, kcenon::pacs::services::to_string(), kcenon::pacs::error_codes::ups_context_not_accepted, kcenon::pacs::error_codes::ups_unexpected_command, kcenon::pacs::services::ups_watch_sop_class_uid, and kcenon::pacs::services::ups_result::workitem_uid.
Referenced by subscribe(), suspend_global(), and unsubscribe().


| void kcenon::pacs::services::ups_watch_scu::set_event_received_callback | ( | event_received_callback | cb | ) |
Set callback for received event notifications.
| cb | The callback function |
Definition at line 34 of file ups_watch_scu.cpp.
References event_callback_.
|
nodiscard |
Subscribe to UPS workitem events (N-ACTION Type 3)
Sends a subscribe request to the remote UPS Watch SCP. Use empty workitem_uid for global subscription.
| assoc | The established association to use |
| data | The subscription parameters |
Definition at line 42 of file ups_watch_scu.cpp.
References logger_, send_watch_action(), subscribes_performed_, kcenon::pacs::services::ups_global_subscription_instance_uid, kcenon::pacs::services::ups_watch_action_subscribe, and kcenon::pacs::services::ups_subscribe_data::workitem_uid.

|
nodiscardnoexcept |
Definition at line 176 of file ups_watch_scu.cpp.
References subscribes_performed_.
|
nodiscard |
Suspend global subscription (N-ACTION Type 5)
| assoc | The established association to use |
Definition at line 93 of file ups_watch_scu.cpp.
References logger_, send_watch_action(), unsubscribes_performed_, kcenon::pacs::services::ups_global_subscription_instance_uid, and kcenon::pacs::services::ups_watch_action_suspend_global.

|
nodiscard |
Unsubscribe from UPS workitem events (N-ACTION Type 4)
| assoc | The established association to use |
| data | The unsubscription parameters |
Definition at line 68 of file ups_watch_scu.cpp.
References logger_, send_watch_action(), unsubscribes_performed_, kcenon::pacs::services::ups_global_subscription_instance_uid, kcenon::pacs::services::ups_watch_action_unsubscribe, and kcenon::pacs::services::ups_unsubscribe_data::workitem_uid.

|
nodiscardnoexcept |
Definition at line 180 of file ups_watch_scu.cpp.
References unsubscribes_performed_.
|
private |
Definition at line 264 of file ups_watch_scu.h.
Referenced by send_watch_action().
|
private |
Definition at line 265 of file ups_watch_scu.h.
Referenced by handle_event_report(), and set_event_received_callback().
|
private |
Definition at line 269 of file ups_watch_scu.h.
Referenced by events_received(), handle_event_report(), and reset_statistics().
|
private |
Definition at line 263 of file ups_watch_scu.h.
Referenced by handle_event_report(), send_watch_action(), subscribe(), suspend_global(), and unsubscribe().
|
private |
|
private |
Definition at line 267 of file ups_watch_scu.h.
Referenced by reset_statistics(), subscribe(), and subscribes_performed().
|
private |
Definition at line 268 of file ups_watch_scu.h.
Referenced by reset_statistics(), suspend_global(), unsubscribe(), and unsubscribes_performed().