18#ifndef PACS_SERVICES_PRINT_SCP_HPP
19#define PACS_SERVICES_PRINT_SCP_HPP
30#include <unordered_map>
41 "1.2.840.10008.5.1.1.1";
45 "1.2.840.10008.5.1.1.2";
49 "1.2.840.10008.5.1.1.4";
53 "1.2.840.10008.5.1.1.4.1";
57 "1.2.840.10008.5.1.1.16";
61 "1.2.840.10008.5.1.1.9";
65 "1.2.840.10008.5.1.1.18";
198 const std::string& film_box_uid)>;
300 [[nodiscard]] std::string_view
service_name() const noexcept override;
308 [[nodiscard]]
size_t images_set() const noexcept;
319 network::association& assoc,
321 const network::dimse::dimse_message& request);
324 network::association& assoc,
326 const network::dimse::dimse_message& request);
329 network::association& assoc,
331 const network::dimse::dimse_message& request);
334 network::association& assoc,
336 const network::dimse::dimse_message& request);
339 network::association& assoc,
341 const network::dimse::dimse_message& request);
348 network::association& assoc,
350 const network::dimse::dimse_message& request);
353 network::association& assoc,
355 const network::dimse::dimse_message& request);
362 network::association& assoc,
364 network::dimse::command_field response_type,
366 std::string_view sop_class_uid,
367 const std::
string& sop_instance_uid,
368 network::dimse::status_code status);
411namespace print_tags {
Print Management SCP service.
std::atomic< size_t > images_set_
size_t printer_queries() const noexcept
print_session_handler session_handler_
std::vector< std::string > supported_sop_classes() const override
Get supported SOP Class UIDs.
size_t sessions_created() const noexcept
size_t film_boxes_created() const noexcept
network::Result< std::monostate > handle_n_set(network::association &assoc, uint8_t context_id, const network::dimse::dimse_message &request)
std::atomic< size_t > sessions_created_
Statistics.
print_action_handler print_handler_
network::Result< std::monostate > create_film_box(network::association &assoc, uint8_t context_id, const network::dimse::dimse_message &request)
network::Result< std::monostate > handle_n_delete(network::association &assoc, uint8_t context_id, const network::dimse::dimse_message &request)
network::Result< std::monostate > handle_n_action(network::association &assoc, uint8_t context_id, const network::dimse::dimse_message &request)
std::unordered_map< std::string, film_box > film_boxes_
Active film boxes indexed by SOP Instance UID.
std::unordered_map< std::string, film_session > sessions_
Active film sessions indexed by SOP Instance UID.
std::atomic< size_t > prints_executed_
size_t prints_executed() const noexcept
size_t images_set() const noexcept
std::string_view service_name() const noexcept override
Get the service name.
void set_session_handler(print_session_handler handler)
Set handler for film session creation.
network::Result< std::monostate > handle_n_create(network::association &assoc, uint8_t context_id, const network::dimse::dimse_message &request)
printer_status_handler printer_status_handler_
~print_scp() override=default
void set_print_handler(print_action_handler handler)
Set handler for print action (film box print)
std::atomic< size_t > printer_queries_
network::Result< std::monostate > send_response(network::association &assoc, uint8_t context_id, network::dimse::command_field response_type, uint16_t message_id, std::string_view sop_class_uid, const std::string &sop_instance_uid, network::dimse::status_code status)
auto generate_uid() -> std::string
network::Result< std::monostate > handle_n_get(network::association &assoc, uint8_t context_id, const network::dimse::dimse_message &request)
std::atomic< size_t > film_boxes_created_
void reset_statistics() noexcept
network::Result< std::monostate > create_film_session(network::association &assoc, uint8_t context_id, const network::dimse::dimse_message &request)
network::Result< std::monostate > handle_message(network::association &assoc, uint8_t context_id, const network::dimse::dimse_message &request) override
Handle an incoming DIMSE-N message.
std::unordered_map< std::string, image_box > image_boxes_
Active image boxes indexed by SOP Instance UID.
std::mutex mutex_
Mutex for state management.
print_scp(std::shared_ptr< di::ILogger > logger=nullptr)
Construct Print SCP with optional logger.
std::atomic< uint32_t > uid_counter_
UID generation counter.
void set_printer_status_handler(printer_status_handler handler)
Set handler for printer status query.
const std::shared_ptr< di::ILogger > & logger() const noexcept
Get the current logger instance.
DICOM Dataset - ordered collection of Data Elements.
std::shared_mutex mutex
Mutex for thread-safe access.
constexpr std::string_view basic_grayscale_print_meta_sop_class_uid
Basic Grayscale Print Management Meta SOP Class UID.
printer_status
Printer status enumeration (PS3.4 H.4.17)
@ failure
Printer has a critical error.
@ warning
Printer has a non-critical issue.
@ normal
Printer is operating normally.
constexpr std::string_view basic_color_print_meta_sop_class_uid
Basic Color Print Management Meta SOP Class UID.
constexpr std::string_view basic_film_session_sop_class_uid
Basic Film Session SOP Class UID.
std::function< network::Result< std::monostate >( const film_session &session)> print_session_handler
Handler for film session creation.
constexpr std::string_view basic_color_image_box_sop_class_uid
Basic Color Image Box SOP Class UID.
print_job_status
Print job status.
@ printing
Job is being printed.
@ done
Job completed successfully.
std::function< network::Result< std::monostate >( const std::string &film_box_uid)> print_action_handler
Handler for print action (film box print)
std::function< network::Result< std::pair< printer_status, core::dicom_dataset > >()> printer_status_handler
Handler for printer status query.
constexpr std::string_view basic_film_box_sop_class_uid
Basic Film Box SOP Class UID.
auto to_string(mpps_status status) -> std::string_view
Convert mpps_status to DICOM string representation.
constexpr std::string_view basic_grayscale_image_box_sop_class_uid
Basic Grayscale Image Box SOP Class UID.
constexpr std::string_view printer_sop_class_uid
Printer SOP Class UID.
Base class for DICOM SCP (Service Class Provider) services.
Film box data created by N-CREATE.
std::string film_orientation
Film orientation (PORTRAIT, LANDSCAPE)
std::vector< std::string > image_box_uids
Associated image box UIDs.
std::string sop_instance_uid
SOP Instance UID.
std::string film_size_id
Film size ID (8INX10IN, 14INX17IN, etc.)
std::string film_session_uid
Parent film session UID.
std::string image_display_format
Image display format (STANDARD\1,1 etc.)
core::dicom_dataset data
Complete dataset from request.
Film session data created by N-CREATE.
std::string sop_instance_uid
SOP Instance UID.
uint32_t number_of_copies
Number of copies.
std::string print_priority
Print priority (HIGH, MED, LOW)
std::vector< std::string > film_box_uids
Associated film box UIDs.
core::dicom_dataset data
Complete dataset from request.
std::string film_destination
Film destination (MAGAZINE, PROCESSOR)
std::string medium_type
Medium type (PAPER, CLEAR FILM, BLUE FILM)
Image box data set by N-SET.
std::string film_box_uid
Parent film box UID.
core::dicom_dataset data
Complete dataset from request.
std::string sop_instance_uid
SOP Instance UID.
uint16_t image_position
Image position (1-based)
bool has_pixel_data
Whether pixel data has been set.