PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
kcenon::pacs::services::verification_scp Class Referencefinal

#include <verification_scp.h>

Inheritance diagram for kcenon::pacs::services::verification_scp:
Inheritance graph
Collaboration diagram for kcenon::pacs::services::verification_scp:
Collaboration graph

Public Member Functions

 verification_scp (std::shared_ptr< di::ILogger > logger=nullptr)
 Construct Verification SCP with optional logger.
 
 ~verification_scp () override=default
 
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 (C-ECHO-RQ)
 
std::string_view service_name () const noexcept override
 Get the service name.
 
- 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_serviceoperator= (const scp_service &)=delete
 
 scp_service (scp_service &&)=default
 
scp_serviceoperator= (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.
 

Additional Inherited Members

- Protected Attributes inherited from kcenon::pacs::services::scp_service
std::shared_ptr< di::ILoggerlogger_
 Logger instance for service logging.
 

Detailed Description

Definition at line 74 of file verification_scp.h.

Constructor & Destructor Documentation

◆ verification_scp()

kcenon::pacs::services::verification_scp::verification_scp ( std::shared_ptr< di::ILogger > logger = nullptr)
inlineexplicit

Construct Verification SCP with optional logger.

Parameters
loggerLogger instance for service logging (nullptr uses null_logger)

Definition at line 85 of file verification_scp.h.

86 : scp_service(std::move(logger)) {}
const std::shared_ptr< di::ILogger > & logger() const noexcept
Get the current logger instance.
Definition scp_service.h:93
scp_service(std::shared_ptr< di::ILogger > logger=nullptr)
Construct SCP service with optional logger.
Definition scp_service.h:64

◆ ~verification_scp()

kcenon::pacs::services::verification_scp::~verification_scp ( )
overridedefault

Member Function Documentation

◆ handle_message()

network::Result< std::monostate > kcenon::pacs::services::verification_scp::handle_message ( network::association & assoc,
uint8_t context_id,
const network::dimse::dimse_message & request )
nodiscardoverridevirtual

Handle an incoming DIMSE message (C-ECHO-RQ)

Processes the C-ECHO request and sends a C-ECHO response with success status.

Parameters
assocThe association on which the message was received
context_idThe presentation context ID for the message
requestThe incoming C-ECHO-RQ message
Returns
Success or error if the message is not a valid C-ECHO-RQ
Note
This method rejects any message that is not a C-ECHO-RQ

Implements kcenon::pacs::services::scp_service.

Definition at line 21 of file verification_scp.cpp.

24 {
25
26 using namespace network::dimse;
27
28 // Verify the message is a C-ECHO request
29 if (request.command() != command_field::c_echo_rq) {
32 "Expected C-ECHO-RQ but received " +
33 std::string(to_string(request.command())));
34 }
35
36 // Build C-ECHO response using the factory function
37 auto response = make_c_echo_rsp(
38 request.message_id(),
39 status_success,
41 );
42
43 // Send the response
44 return assoc.send_dimse(context_id, response);
45}
constexpr int echo_unexpected_command
Definition result.h:169
auto to_string(mpps_status status) -> std::string_view
Convert mpps_status to DICOM string representation.
Definition mpps_scp.h:60
constexpr std::string_view verification_sop_class_uid
Verification SOP Class UID (1.2.840.10008.1.1)
VoidResult pacs_void_error(int code, const std::string &message, const std::string &details="")
Create a PACS void error result.
Definition result.h:249

References kcenon::pacs::network::dimse::dimse_message::command(), kcenon::pacs::error_codes::echo_unexpected_command, kcenon::pacs::network::dimse::dimse_message::message_id(), kcenon::pacs::pacs_void_error(), kcenon::pacs::network::association::send_dimse(), kcenon::pacs::services::to_string(), and kcenon::pacs::services::verification_sop_class_uid.

Here is the call graph for this function:

◆ service_name()

std::string_view kcenon::pacs::services::verification_scp::service_name ( ) const
nodiscardoverridevirtualnoexcept

Get the service name.

Returns
"Verification SCP"

Implements kcenon::pacs::services::scp_service.

Definition at line 47 of file verification_scp.cpp.

47 {
48 return "Verification SCP";
49}

◆ supported_sop_classes()

std::vector< std::string > kcenon::pacs::services::verification_scp::supported_sop_classes ( ) const
nodiscardoverridevirtual

Get supported SOP Class UIDs.

Returns
Vector containing only the Verification SOP Class UID

Implements kcenon::pacs::services::scp_service.

Definition at line 17 of file verification_scp.cpp.

17 {
18 return {std::string(verification_sop_class_uid)};
19}

References kcenon::pacs::services::verification_sop_class_uid.


The documentation for this class was generated from the following files: