PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
verification_scp.cpp
Go to the documentation of this file.
1// BSD 3-Clause License
2// Copyright (c) 2021-2025, 🍀☀🌕🌥 🌊
3// See the LICENSE file in the project root for full license information.
4
14
15namespace kcenon::pacs::services {
16
17std::vector<std::string> verification_scp::supported_sop_classes() const {
18 return {std::string(verification_sop_class_uid)};
19}
20
23 uint8_t context_id,
24 const network::dimse::dimse_message& request) {
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}
46
47std::string_view verification_scp::service_name() const noexcept {
48 return "Verification SCP";
49}
50
51} // namespace kcenon::pacs::services
Result< std::monostate > send_dimse(uint8_t context_id, const dimse::dimse_message &msg)
Send a DIMSE message.
auto message_id() const noexcept -> uint16_t
Get the message ID.
auto command() const noexcept -> command_field
Get the command field.
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.
std::vector< std::string > supported_sop_classes() const override
Get supported SOP Class UIDs.
DIMSE command field enumeration.
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
Result<T> type aliases and helpers for PACS system.
DIMSE status codes.
DICOM Verification SCP service (C-ECHO handler)