19#ifndef PACS_SERVICES_MPPS_SCP_HPP
20#define PACS_SERVICES_MPPS_SCP_HPP
67 return "DISCONTINUED";
80 -> std::optional<mpps_status> {
81 if (str ==
"IN PROGRESS") {
84 if (str ==
"COMPLETED") {
87 if (str ==
"DISCONTINUED") {
138 const std::string& sop_instance_uid,
301 [[nodiscard]] std::string_view
service_name() const noexcept override;
356 network::association& assoc,
358 const network::dimse::dimse_message& request);
371 network::association& assoc,
373 const network::dimse::dimse_message& request);
386 network::association& assoc,
389 const std::
string& sop_instance_uid,
390 network::dimse::status_code status);
403 network::association& assoc,
406 const std::
string& sop_instance_uid,
407 network::dimse::status_code status);
void set_set_handler(mpps_set_handler handler)
Set the N-SET handler function.
void reset_statistics() noexcept
Reset statistics counters.
void set_create_handler(mpps_create_handler handler)
Set the N-CREATE handler function.
mpps_set_handler set_handler_
network::Result< std::monostate > handle_n_create(network::association &assoc, uint8_t context_id, const network::dimse::dimse_message &request)
Handle N-CREATE request.
size_t creates_processed() const noexcept
Get total number of N-CREATE requests processed.
network::Result< std::monostate > send_n_set_response(network::association &assoc, uint8_t context_id, uint16_t message_id, const std::string &sop_instance_uid, network::dimse::status_code status)
Send N-SET response.
std::atomic< size_t > creates_processed_
std::atomic< size_t > sets_processed_
network::Result< std::monostate > send_n_create_response(network::association &assoc, uint8_t context_id, uint16_t message_id, const std::string &sop_instance_uid, network::dimse::status_code status)
Send N-CREATE response.
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 (N-CREATE-RQ or N-SET-RQ)
size_t mpps_completed() const noexcept
Get number of MPPS completed successfully.
size_t mpps_discontinued() const noexcept
Get number of MPPS discontinued.
std::vector< std::string > supported_sop_classes() const override
Get supported SOP Class UIDs.
network::Result< std::monostate > handle_n_set(network::association &assoc, uint8_t context_id, const network::dimse::dimse_message &request)
Handle N-SET request.
mpps_create_handler create_handler_
~mpps_scp() override=default
mpps_scp(std::shared_ptr< di::ILogger > logger=nullptr)
Construct MPPS SCP with optional logger.
size_t sets_processed() const noexcept
Get total number of N-SET requests processed.
std::atomic< size_t > mpps_completed_
std::atomic< size_t > mpps_discontinued_
std::string_view service_name() const noexcept override
Get the service name.
const std::shared_ptr< di::ILogger > & logger() const noexcept
Get the current logger instance.
std::function< network::Result< std::monostate >( const std::string &sop_instance_uid, const core::dicom_dataset &modifications, mpps_status new_status)> mpps_set_handler
N-SET handler function type.
mpps_status
MPPS status enumeration.
@ completed
Procedure completed successfully.
@ discontinued
Procedure was stopped/cancelled.
@ in_progress
Procedure is currently being performed.
std::function< network::Result< std::monostate >( const mpps_instance &instance)> mpps_create_handler
N-CREATE handler function type.
auto to_string(mpps_status status) -> std::string_view
Convert mpps_status to DICOM string representation.
constexpr std::string_view mpps_sop_class_uid
MPPS (Modality Performed Procedure Step) SOP Class UID.
auto parse_mpps_status(std::string_view str) -> std::optional< mpps_status >
Parse DICOM string to mpps_status enum.
Base class for DICOM SCP (Service Class Provider) services.
MPPS instance data structure.
mpps_status status
Current status (always IN PROGRESS for N-CREATE)
std::string sop_instance_uid
SOP Instance UID - unique identifier for this MPPS.
std::string station_ae
Performing station AE Title.
core::dicom_dataset data
Complete MPPS dataset from the request.