16#ifndef PACS_SERVICES_UPS_WATCH_SCP_HPP
17#define PACS_SERVICES_UPS_WATCH_SCP_HPP
32 "1.2.840.10008.5.1.4.34.6.2";
41 "1.2.840.10008.5.1.4.34.5";
88 const std::string& subscriber_ae,
89 const std::string& workitem_uid,
103 const std::string& subscriber_ae,
104 const std::string& workitem_uid)>;
117 const std::string& workitem_uid)>;
132 const std::string& subscriber_ae,
133 uint16_t event_type_id,
134 const std::string& workitem_uid,
209 [[nodiscard]] std::string_view
service_name() const noexcept override;
225 const std::
string& new_state);
234 const std::
string& reason);
243 int progress_percent);
261 network::association& assoc,
263 const network::dimse::dimse_message& request);
266 network::association& assoc,
269 const std::
string& sop_instance_uid);
272 network::association& assoc,
275 const std::
string& sop_instance_uid);
278 network::association& assoc,
280 uint16_t message_id);
283 network::association& assoc,
286 const std::
string& sop_instance_uid,
287 uint16_t action_type_id,
288 network::dimse::status_code status);
291 const std::
string& workitem_uid,
292 const core::dicom_dataset& event_info);
const std::shared_ptr< di::ILogger > & logger() const noexcept
Get the current logger instance.
UPS Watch SCP service for subscription and event notification.
ups_event_callback event_callback_
ups_unsubscribe_handler unsubscribe_handler_
std::atomic< size_t > subscriptions_removed_
void set_subscribe_handler(ups_subscribe_handler handler)
void dispatch_event(uint16_t event_type_id, const std::string &workitem_uid, const core::dicom_dataset &event_info)
ups_watch_scp(std::shared_ptr< di::ILogger > logger=nullptr)
Construct UPS Watch SCP with optional logger.
std::string_view service_name() const noexcept override
Get the service name for logging/debugging.
void notify_state_change(const std::string &workitem_uid, const std::string &new_state)
Notify subscribers of a workitem state change.
void notify_cancel_requested(const std::string &workitem_uid, const std::string &reason)
Notify subscribers of a cancel request.
std::atomic< size_t > events_sent_
network::Result< std::monostate > handle_suspend_global(network::association &assoc, uint8_t context_id, uint16_t message_id)
size_t events_sent() const noexcept
ups_get_subscribers_handler get_subscribers_handler_
void notify_progress(const std::string &workitem_uid, int progress_percent)
Notify subscribers of progress update.
void reset_statistics() noexcept
std::atomic< size_t > subscriptions_created_
ups_subscribe_handler subscribe_handler_
network::Result< std::monostate > handle_subscribe(network::association &assoc, uint8_t context_id, uint16_t message_id, const std::string &sop_instance_uid)
network::Result< std::monostate > send_n_action_response(network::association &assoc, uint8_t context_id, uint16_t message_id, const std::string &sop_instance_uid, uint16_t action_type_id, network::dimse::status_code status)
network::Result< std::monostate > handle_n_action(network::association &assoc, uint8_t context_id, const network::dimse::dimse_message &request)
size_t subscriptions_created() const noexcept
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.
void set_event_callback(ups_event_callback callback)
size_t subscriptions_removed() const noexcept
void set_unsubscribe_handler(ups_unsubscribe_handler handler)
network::Result< std::monostate > handle_unsubscribe(network::association &assoc, uint8_t context_id, uint16_t message_id, const std::string &sop_instance_uid)
void set_get_subscribers_handler(ups_get_subscribers_handler handler)
std::vector< std::string > supported_sop_classes() const override
Get the list of SOP Class UIDs supported by this service.
~ups_watch_scp() override=default
constexpr uint16_t ups_event_scp_status_change
Event Type 4: SCP Status Change — SCP going down/restarting.
std::function< network::Result< std::monostate >( const std::string &subscriber_ae, const std::string &workitem_uid, bool deletion_lock)> ups_subscribe_handler
Subscribe handler function type.
constexpr uint16_t ups_event_state_report
Event Type 1: UPS State Report — workitem state changed.
constexpr uint16_t ups_event_progress_report
Event Type 3: UPS Progress Report — progress percentage update.
constexpr std::string_view ups_watch_sop_class_uid
UPS Watch SOP Class UID (PS3.4 Table CC.2-1)
std::function< network::Result< std::monostate >( const std::string &subscriber_ae, const std::string &workitem_uid)> ups_unsubscribe_handler
Unsubscribe handler function type.
constexpr uint16_t ups_watch_action_suspend_global
N-ACTION Type 5: Suspend Global Subscription (PS3.4 CC.2.3.5)
constexpr std::string_view ups_global_subscription_instance_uid
UPS Global Subscription SOP Instance UID Used as the SOP Instance UID for global (non-workitem-specif...
constexpr uint16_t ups_event_cancel_requested
Event Type 2: UPS Cancel Requested — performer should stop processing.
std::function< network::Result< std::vector< std::string > >( const std::string &workitem_uid)> ups_get_subscribers_handler
Get subscribers handler function type.
std::function< void( const std::string &subscriber_ae, uint16_t event_type_id, const std::string &workitem_uid, const core::dicom_dataset &event_info)> ups_event_callback
Event notification callback type.
constexpr uint16_t ups_watch_action_unsubscribe
N-ACTION Type 4: Unsubscribe from Receiving UPS Event Reports (PS3.4 CC.2.3.4)
constexpr uint16_t ups_watch_action_subscribe
N-ACTION Type 3: Subscribe to Receive UPS Event Reports (PS3.4 CC.2.3.3)
Base class for DICOM SCP (Service Class Provider) services.