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


Public Member Functions | |
| worklist_scp (std::shared_ptr< di::ILogger > logger=nullptr) | |
| Construct Worklist SCP with optional logger. | |
| ~worklist_scp () override=default | |
| void | set_handler (worklist_handler handler) |
| Set the worklist handler function. | |
| void | set_max_results (size_t max) noexcept |
| Set maximum number of results to return. | |
| size_t | max_results () const noexcept |
| Get maximum number of results. | |
| void | set_cancel_check (worklist_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 (MWL C-FIND-RQ) | |
| std::string_view | service_name () const noexcept override |
| Get the service name. | |
| size_t | queries_processed () const noexcept |
| Get total number of worklist queries processed. | |
| size_t | items_returned () const noexcept |
| Get total number of worklist items returned. | |
| 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 > | send_pending_response (network::association &assoc, uint8_t context_id, uint16_t message_id, const core::dicom_dataset &result) |
| Send a pending C-FIND response with matching worklist item. | |
| network::Result< std::monostate > | send_final_response (network::association &assoc, uint8_t context_id, uint16_t message_id, network::dimse::status_code status) |
| Send the final C-FIND response (success or cancel) | |
Private Attributes | |
| worklist_handler | handler_ |
| worklist_cancel_check | cancel_check_ |
| size_t | max_results_ {0} |
| std::atomic< size_t > | queries_processed_ {0} |
| std::atomic< size_t > | items_returned_ {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 192 of file worklist_scp.h.
|
explicit |
Construct Worklist SCP with optional logger.
| logger | Logger instance for service logging (nullptr uses null_logger) |
Definition at line 23 of file worklist_scp.cpp.
|
overridedefault |
|
nodiscardoverridevirtual |
Handle an incoming DIMSE message (MWL C-FIND-RQ)
Processes the Modality Worklist C-FIND request, queries the worklist repository through the handler, and sends pending responses for each match followed by a final success.
| assoc | The association on which the message was received |
| context_id | The presentation context ID for the message |
| request | The incoming C-FIND-RQ message |
Implements kcenon::pacs::services::scp_service.
Definition at line 56 of file worklist_scp.cpp.
References kcenon::pacs::network::dimse::dimse_message::affected_sop_class_uid(), kcenon::pacs::network::association::calling_ae(), cancel_check_, kcenon::pacs::network::dimse::dimse_message::command(), kcenon::pacs::network::dimse::dimse_message::dataset(), handler_, kcenon::pacs::network::dimse::dimse_message::has_dataset(), items_returned_, max_results_, kcenon::pacs::network::dimse::dimse_message::message_id(), kcenon::pacs::pacs_void_error(), queries_processed_, send_final_response(), send_pending_response(), kcenon::pacs::services::to_string(), kcenon::pacs::services::worklist_find_sop_class_uid, kcenon::pacs::error_codes::worklist_handler_not_set, and kcenon::pacs::error_codes::worklist_unexpected_command.

|
nodiscardnoexcept |
Get total number of worklist items returned.
Definition at line 156 of file worklist_scp.cpp.
References items_returned_.
|
nodiscardnoexcept |
Get maximum number of results.
Definition at line 38 of file worklist_scp.cpp.
References max_results_.
|
nodiscardnoexcept |
Get total number of worklist queries processed.
Definition at line 152 of file worklist_scp.cpp.
References queries_processed_.
|
noexcept |
Reset statistics counters.
Definition at line 160 of file worklist_scp.cpp.
References items_returned_, and queries_processed_.
|
nodiscardprivate |
Send the final C-FIND response (success or cancel)
| assoc | The association |
| context_id | The presentation context ID |
| message_id | The original request message ID |
| status | The final status code |
Definition at line 191 of file worklist_scp.cpp.
References kcenon::pacs::network::association::send_dimse(), and kcenon::pacs::services::worklist_find_sop_class_uid.
Referenced by handle_message().


|
nodiscardprivate |
Send a pending C-FIND response with matching worklist item.
| assoc | The association |
| context_id | The presentation context ID |
| message_id | The original request message ID |
| result | The matching worklist item dataset |
Definition at line 169 of file worklist_scp.cpp.
References kcenon::pacs::network::association::send_dimse(), and kcenon::pacs::services::worklist_find_sop_class_uid.
Referenced by handle_message().


|
nodiscardoverridevirtualnoexcept |
Get the service name.
Implements kcenon::pacs::services::scp_service.
Definition at line 144 of file worklist_scp.cpp.
| void kcenon::pacs::services::worklist_scp::set_cancel_check | ( | worklist_cancel_check | check | ) |
Set the cancel check function.
The cancel check is called periodically during query processing to check if a C-CANCEL has been received.
| check | The cancel check function |
Definition at line 42 of file worklist_scp.cpp.
References cancel_check_.
| void kcenon::pacs::services::worklist_scp::set_handler | ( | worklist_handler | handler | ) |
Set the worklist handler function.
The handler is called for each MWL C-FIND request to retrieve matching scheduled procedure items from the RIS/HIS database.
| handler | The worklist handler function |
Definition at line 30 of file worklist_scp.cpp.
References handler_.
|
noexcept |
Set maximum number of results to return.
| max | Maximum results (0 = unlimited) |
Definition at line 34 of file worklist_scp.cpp.
|
nodiscardoverridevirtual |
Get supported SOP Class UIDs.
Implements kcenon::pacs::services::scp_service.
Definition at line 50 of file worklist_scp.cpp.
References kcenon::pacs::services::worklist_find_sop_class_uid.
|
private |
Definition at line 343 of file worklist_scp.h.
Referenced by handle_message(), and set_cancel_check().
|
private |
Definition at line 342 of file worklist_scp.h.
Referenced by handle_message(), and set_handler().
|
private |
Definition at line 346 of file worklist_scp.h.
Referenced by handle_message(), items_returned(), and reset_statistics().
|
private |
Definition at line 344 of file worklist_scp.h.
Referenced by handle_message(), and max_results().
|
private |
Definition at line 345 of file worklist_scp.h.
Referenced by handle_message(), queries_processed(), and reset_statistics().