PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
kcenon::pacs::services Namespace Reference

Namespaces

namespace  cache
 
namespace  monitoring
 
namespace  mpps_tags
 
namespace  pir
 
namespace  print_tags
 
namespace  sop_classes
 
namespace  ups_tags
 
namespace  validation
 
namespace  xds
 

Classes

struct  commitment_result
 Result of a Storage Commitment verification. More...
 
struct  film_box
 Film box data created by N-CREATE. More...
 
struct  film_session
 Film session data created by N-CREATE. More...
 
struct  image_box
 Image box data set by N-SET. More...
 
struct  instance_query_keys
 Query keys for IMAGE (Instance) level queries. More...
 
struct  mpps_create_data
 Data for N-CREATE operation (start procedure) More...
 
struct  mpps_instance
 MPPS instance data structure. More...
 
struct  mpps_result
 Result of an MPPS operation. More...
 
class  mpps_scp
 
class  mpps_scu
 
struct  mpps_scu_config
 Configuration for MPPS SCU service. More...
 
struct  mpps_set_data
 Data for N-SET operation (update/complete procedure) More...
 
struct  n_get_result
 Result of an N-GET operation. More...
 
class  n_get_scp
 
class  n_get_scu
 
struct  n_get_scu_config
 Configuration for N-GET SCU service. More...
 
struct  patient_query_keys
 Query keys for PATIENT level queries. More...
 
struct  performed_series_info
 Information about a performed series for N-SET COMPLETED. More...
 
struct  print_film_box_data
 Data for creating a Film Box via N-CREATE. More...
 
struct  print_image_data
 Data for setting an Image Box via N-SET. More...
 
struct  print_result
 Result of a Print DIMSE-N operation. More...
 
class  print_scp
 Print Management SCP service. More...
 
class  print_scu
 
struct  print_scu_config
 Configuration for Print SCU service. More...
 
struct  print_session_data
 Data for creating a Film Session via N-CREATE. More...
 
struct  query_result
 Result of a C-FIND query operation. More...
 
class  query_scp
 
class  query_scu
 
struct  query_scu_config
 Configuration for Query SCU service. More...
 
struct  retrieve_progress
 Progress information for a retrieve operation. More...
 
struct  retrieve_result
 Result of a retrieve operation (C-MOVE or C-GET) More...
 
class  retrieve_scp
 
class  retrieve_scu
 
struct  retrieve_scu_config
 Configuration for Retrieve SCU service. More...
 
class  scp_service
 
struct  series_query_keys
 Query keys for SERIES level queries. More...
 
struct  sop_class_info
 Complete information about a SOP Class. More...
 
class  sop_class_registry
 
struct  sop_reference
 Reference to a SOP Instance in a commitment request. More...
 
class  storage_commitment_scp
 Storage Commitment Push Model SCP. More...
 
class  storage_commitment_scu
 Storage Commitment Push Model SCU. More...
 
class  storage_scp
 
struct  storage_scp_config
 Configuration for Storage SCP service. More...
 
class  storage_scu
 
struct  storage_scu_config
 Configuration for Storage SCU service. More...
 
struct  store_result
 Result of a C-STORE operation. More...
 
struct  stream_config
 Configuration for query result streaming. More...
 
struct  study_query_keys
 Query keys for STUDY level queries. More...
 
struct  sub_operation_stats
 Statistics for C-MOVE/C-GET sub-operations. More...
 
struct  ups_change_state_data
 Data for N-ACTION Type 1 (change UPS state) More...
 
struct  ups_create_data
 Data for N-CREATE operation (create new workitem) More...
 
struct  ups_get_data
 Data for N-GET operation (retrieve workitem) More...
 
class  ups_push_scp
 
class  ups_push_scu
 
struct  ups_push_scu_config
 Configuration for UPS Push SCU service. More...
 
class  ups_query_scp
 UPS Query SCP service for handling workitem C-FIND requests. More...
 
struct  ups_request_cancel_data
 Data for N-ACTION Type 3 (request cancellation) More...
 
struct  ups_result
 Result of a UPS SCU operation. More...
 
struct  ups_set_data
 Data for N-SET operation (modify workitem attributes) More...
 
struct  ups_subscribe_data
 Data for N-ACTION subscribe request. More...
 
struct  ups_unsubscribe_data
 Data for N-ACTION unsubscribe request. More...
 
struct  ups_watch_event
 Parsed UPS event notification received from SCP. More...
 
class  ups_watch_scp
 UPS Watch SCP service for subscription and event notification. More...
 
class  ups_watch_scu
 UPS Watch SCU service for subscribing to events on remote systems. More...
 
struct  ups_watch_scu_config
 Configuration for UPS Watch SCU service. More...
 
class  verification_scp
 
struct  worklist_item
 Parsed worklist item from MWL query response. More...
 
struct  worklist_query_keys
 Typed query keys for Modality Worklist queries. More...
 
struct  worklist_result
 Result of a Modality Worklist query operation. More...
 
class  worklist_scp
 
class  worklist_scu
 
struct  worklist_scu_config
 Configuration for Worklist SCU service. More...
 

Typedefs

template<typename T >
using Result = kcenon::common::Result<T>
 Result type alias for operations returning a value.
 
using mpps_create_handler
 N-CREATE handler function type.
 
using mpps_set_handler
 N-SET handler function type.
 
using n_get_handler
 N-GET handler function type.
 
using print_session_handler
 Handler for film session creation.
 
using print_action_handler
 Handler for print action (film box print)
 
using printer_status_handler
 Handler for printer status query.
 
using query_handler
 Query handler function type.
 
using cancel_check = std::function<bool()>
 Cancel check function type.
 
using query_streaming_callback = std::function<bool(const core::dicom_dataset&)>
 Callback type for streaming query results.
 
using retrieve_handler
 Retrieve handler function type.
 
using destination_resolver
 Destination resolver function type.
 
using store_sub_operation
 Store sub-operation function type.
 
using retrieve_cancel_check = std::function<bool()>
 Cancel check function type.
 
using retrieve_progress_callback = std::function<void(const retrieve_progress&)>
 Callback type for retrieve progress updates.
 
using instance_receive_callback = std::function<bool(const core::dicom_dataset&)>
 Callback type for receiving instances during C-GET.
 
using scp_service_ptr = std::shared_ptr<scp_service>
 Shared pointer type for SCP services.
 
using storage_handler
 Callback type for handling received DICOM images.
 
using pre_store_handler = std::function<bool(const core::dicom_dataset& dataset)>
 Callback type for pre-store validation.
 
using post_store_handler
 Callback type for post-store notification.
 
using store_progress_callback = std::function<void(size_t completed, size_t total)>
 Progress callback type for batch operations.
 
using ups_create_handler
 N-CREATE handler function type.
 
using ups_set_handler
 N-SET handler function type.
 
using ups_get_handler
 N-GET handler function type.
 
using ups_change_state_handler
 N-ACTION Type 1 handler: Change UPS State.
 
using ups_request_cancel_handler
 N-ACTION Type 3 handler: Request Cancellation.
 
using ups_query_handler
 UPS query handler function type.
 
using ups_query_cancel_check = std::function<bool()>
 Cancel check function type for UPS queries.
 
using ups_subscribe_handler
 Subscribe handler function type.
 
using ups_unsubscribe_handler
 Unsubscribe handler function type.
 
using ups_get_subscribers_handler
 Get subscribers handler function type.
 
using ups_event_callback
 Event notification callback type.
 
using worklist_handler
 
using worklist_cancel_check = std::function<bool()>
 Cancel check function type.
 
using worklist_streaming_callback = std::function<bool(const worklist_item&)>
 Callback type for streaming worklist query results.
 

Enumerations

enum class  mpps_status { in_progress , completed , discontinued }
 MPPS status enumeration. More...
 
enum class  printer_status { normal , warning , failure }
 Printer status enumeration (PS3.4 H.4.17) More...
 
enum class  print_job_status { pending , printing , done , failure }
 Print job status. More...
 
enum class  query_level { patient , study , series , image }
 DICOM Query/Retrieve level enumeration. More...
 
enum class  query_model { patient_root , study_root }
 DICOM Query/Retrieve Information Model. More...
 
enum class  retrieve_mode { c_move , c_get }
 DICOM Retrieve Mode (C-MOVE vs C-GET) More...
 
enum class  sop_class_category {
  storage , query_retrieve , worklist , mpps ,
  storage_commitment , ups , verification , print ,
  media , other
}
 Category of SOP Class. More...
 
enum class  modality_type {
  ct , mr , us , xa ,
  xrf , cr , dx , mg ,
  nm , pet , rt , sc ,
  sr , seg , sm , op ,
  pmap , other
}
 Modality type for storage SOP classes. More...
 
enum class  commitment_failure_reason : uint16_t {
  processing_failure = 0x0110 , no_such_object_instance = 0x0112 , resource_limitation = 0x0213 , referenced_sop_class_not_supported = 0x0122 ,
  class_instance_conflict = 0x0119 , duplicate_transaction_uid = 0xA770
}
 Failure reason codes for Storage Commitment. More...
 
enum class  duplicate_policy { reject , replace , ignore }
 Policy for handling duplicate SOP instances. More...
 
enum class  storage_status : uint16_t {
  success = 0x0000 , coercion_of_data_elements = 0xB000 , data_set_does_not_match_sop_class_warning = 0xB007 , elements_discarded = 0xB006 ,
  duplicate_sop_instance = 0x0111 , out_of_resources = 0xA700 , out_of_resources_unable_to_store = 0xA701 , data_set_does_not_match_sop_class = 0xA900 ,
  cannot_understand = 0xC000 , storage_error = 0xC001
}
 Storage operation status codes. More...
 

Functions

auto to_string (mpps_status status) -> std::string_view
 Convert mpps_status to DICOM string representation.
 
auto parse_mpps_status (std::string_view str) -> std::optional< mpps_status >
 Parse DICOM string to mpps_status enum.
 
auto to_string (printer_status status) -> std::string_view
 Convert printer_status to DICOM string representation.
 
constexpr std::string_view to_string (query_level level) noexcept
 Convert query_level to string representation.
 
std::optional< query_levelparse_query_level (std::string_view level_str) noexcept
 Parse query level from DICOM string.
 
constexpr std::string_view to_string (query_model model) noexcept
 Convert query_model to string representation.
 
constexpr std::string_view get_find_sop_class_uid (query_model model) noexcept
 Get the FIND SOP Class UID for a query model.
 
constexpr std::string_view to_string (retrieve_mode mode) noexcept
 Convert retrieve_mode to string representation.
 
bool is_storage_sop_class (std::string_view uid)
 Check if a SOP Class UID is a storage class.
 
modality_type get_storage_modality (std::string_view uid)
 Get the modality for a storage SOP Class.
 
std::string_view get_sop_class_name (std::string_view uid)
 Get human-readable name for a SOP Class.
 
std::string_view to_string (commitment_failure_reason reason) noexcept
 Convert failure reason to human-readable string.
 
std::vector< std::string > get_standard_storage_sop_classes ()
 Get a list of all standard Storage SOP Class UIDs.
 
constexpr bool is_success (storage_status status) noexcept
 Check if the status indicates success.
 
constexpr bool is_warning (storage_status status) noexcept
 Check if the status indicates a warning.
 
constexpr bool is_failure (storage_status status) noexcept
 Check if the status indicates a failure.
 
constexpr std::string_view to_string (storage_status status) noexcept
 Get a human-readable description of the storage status.
 
constexpr uint16_t to_status_code (storage_status status) noexcept
 Convert storage_status to DIMSE status_code.
 

Variables

constexpr std::string_view mpps_sop_class_uid = "1.2.840.10008.3.1.2.3.3"
 MPPS (Modality Performed Procedure Step) SOP Class UID.
 
constexpr std::string_view basic_film_session_sop_class_uid
 Basic Film Session SOP Class UID.
 
constexpr std::string_view basic_film_box_sop_class_uid
 Basic Film Box SOP Class UID.
 
constexpr std::string_view basic_grayscale_image_box_sop_class_uid
 Basic Grayscale Image Box SOP Class UID.
 
constexpr std::string_view basic_color_image_box_sop_class_uid
 Basic Color Image Box SOP Class UID.
 
constexpr std::string_view printer_sop_class_uid
 Printer SOP Class UID.
 
constexpr std::string_view basic_grayscale_print_meta_sop_class_uid
 Basic Grayscale Print Management Meta SOP Class UID.
 
constexpr std::string_view basic_color_print_meta_sop_class_uid
 Basic Color Print Management Meta SOP Class UID.
 
constexpr std::string_view patient_root_find_sop_class_uid
 Patient Root Query/Retrieve Information Model - FIND.
 
constexpr std::string_view study_root_find_sop_class_uid
 Study Root Query/Retrieve Information Model - FIND.
 
constexpr std::string_view patient_study_only_find_sop_class_uid
 Patient/Study Only Query/Retrieve Information Model - FIND (Retired)
 
constexpr std::string_view modality_worklist_find_sop_class_uid
 Modality Worklist Information Model - FIND.
 
constexpr std::string_view patient_root_move_sop_class_uid
 Patient Root Query/Retrieve Information Model - MOVE.
 
constexpr std::string_view study_root_move_sop_class_uid
 Study Root Query/Retrieve Information Model - MOVE.
 
constexpr std::string_view patient_root_get_sop_class_uid
 Patient Root Query/Retrieve Information Model - GET.
 
constexpr std::string_view study_root_get_sop_class_uid
 Study Root Query/Retrieve Information Model - GET.
 
constexpr std::string_view storage_commitment_push_model_sop_class_uid
 Storage Commitment Push Model SOP Class UID (PS3.4 Table J.3-1)
 
constexpr std::string_view storage_commitment_push_model_sop_instance_uid
 Storage Commitment Push Model SOP Instance UID (Well-Known)
 
constexpr uint16_t storage_commitment_action_type_request = 1
 N-ACTION: Request Storage Commitment (Action Type ID = 1)
 
constexpr uint16_t storage_commitment_event_type_success = 1
 N-EVENT-REPORT: Storage Commitment Request Successful (Event Type ID = 1)
 
constexpr uint16_t storage_commitment_event_type_failure = 2
 N-EVENT-REPORT: Storage Commitment Request Complete - Failures Exist (Event Type ID = 2)
 
constexpr std::string_view ups_push_sop_class_uid
 UPS Push SOP Class UID (PS3.4 Table CC.2-1)
 
constexpr uint16_t ups_action_change_state = 1
 N-ACTION Type 1: Change UPS State (PS3.4 CC.2.4)
 
constexpr uint16_t ups_action_request_cancel = 3
 N-ACTION Type 3: Request Cancellation (PS3.4 CC.2.5)
 
constexpr std::string_view ups_query_find_sop_class_uid
 UPS Query Information Model - FIND SOP Class UID (PS3.4 Table CC.2-1)
 
constexpr std::string_view ups_watch_sop_class_uid
 UPS Watch SOP Class UID (PS3.4 Table CC.2-1)
 
constexpr std::string_view ups_global_subscription_instance_uid
 UPS Global Subscription SOP Instance UID Used as the SOP Instance UID for global (non-workitem-specific) subscriptions.
 
constexpr uint16_t ups_watch_action_subscribe = 3
 N-ACTION Type 3: Subscribe to Receive UPS Event Reports (PS3.4 CC.2.3.3)
 
constexpr uint16_t ups_watch_action_unsubscribe = 4
 N-ACTION Type 4: Unsubscribe from Receiving UPS Event Reports (PS3.4 CC.2.3.4)
 
constexpr uint16_t ups_watch_action_suspend_global = 5
 N-ACTION Type 5: Suspend Global Subscription (PS3.4 CC.2.3.5)
 
constexpr uint16_t ups_event_state_report = 1
 Event Type 1: UPS State Report — workitem state changed.
 
constexpr uint16_t ups_event_cancel_requested = 2
 Event Type 2: UPS Cancel Requested — performer should stop processing.
 
constexpr uint16_t ups_event_progress_report = 3
 Event Type 3: UPS Progress Report — progress percentage update.
 
constexpr uint16_t ups_event_scp_status_change = 4
 Event Type 4: SCP Status Change — SCP going down/restarting.
 
constexpr std::string_view verification_sop_class_uid = "1.2.840.10008.1.1"
 Verification SOP Class UID (1.2.840.10008.1.1)
 
constexpr std::string_view worklist_find_sop_class_uid
 Modality Worklist Information Model - FIND SOP Class UID.
 
Common Storage SOP Class UIDs
constexpr std::string_view ct_image_storage_uid
 CT Image Storage.
 
constexpr std::string_view enhanced_ct_image_storage_uid
 Enhanced CT Image Storage.
 
constexpr std::string_view mr_image_storage_uid
 MR Image Storage.
 
constexpr std::string_view enhanced_mr_image_storage_uid
 Enhanced MR Image Storage.
 
constexpr std::string_view cr_image_storage_uid
 CR Image Storage.
 
constexpr std::string_view dx_image_storage_presentation_uid
 Digital X-Ray Image Storage - For Presentation.
 
constexpr std::string_view dx_image_storage_processing_uid
 Digital X-Ray Image Storage - For Processing.
 
constexpr std::string_view us_image_storage_uid
 US Image Storage.
 
constexpr std::string_view secondary_capture_image_storage_uid
 Secondary Capture Image Storage.
 
constexpr std::string_view rt_image_storage_uid
 RT Image Storage.
 
constexpr std::string_view rt_dose_storage_uid
 RT Dose Storage.
 
constexpr std::string_view rt_structure_set_storage_uid
 RT Structure Set Storage.
 
constexpr std::string_view rt_plan_storage_uid
 RT Plan Storage.
 

Typedef Documentation

◆ cancel_check

using kcenon::pacs::services::cancel_check = std::function<bool()>

Cancel check function type.

Called periodically during query processing to check if a C-CANCEL request has been received.

Returns
true if cancel has been requested

Definition at line 126 of file query_scp.h.

◆ destination_resolver

Initial value:
std::function<
std::optional<std::pair<std::string, uint16_t>>(
const std::string& ae_title)>

Destination resolver function type.

Called by retrieve_scp to resolve a Move Destination AE title to a network address (host and port).

Parameters
ae_titleThe AE title of the destination
Returns
Optional pair of (host, port) if resolved, std::nullopt if unknown

Definition at line 114 of file retrieve_scp.h.

◆ instance_receive_callback

Callback type for receiving instances during C-GET.

Called for each C-STORE sub-operation received during C-GET.

Parameters
datasetThe received DICOM dataset
Returns
true to continue receiving, false to cancel

Definition at line 198 of file retrieve_scu.h.

◆ mpps_create_handler

Initial value:
std::function<network::Result<std::monostate>(
const mpps_instance& instance)>

N-CREATE handler function type.

Called when an N-CREATE request is received to create a new MPPS instance.

Parameters
instanceThe MPPS instance data from the N-CREATE request
Returns
Success if the instance was created, error description otherwise

Definition at line 124 of file mpps_scp.h.

◆ mpps_set_handler

Initial value:
std::function<network::Result<std::monostate>(
const std::string& sop_instance_uid,
const core::dicom_dataset& modifications,
mpps_status new_status)>

N-SET handler function type.

Called when an N-SET request is received to update an existing MPPS instance.

Parameters
sop_instance_uidThe SOP Instance UID of the MPPS to update
modificationsThe dataset containing the modifications
new_statusThe new status (COMPLETED or DISCONTINUED)
Returns
Success if the instance was updated, error description otherwise

Definition at line 137 of file mpps_scp.h.

◆ n_get_handler

Initial value:
std::function<network::Result<core::dicom_dataset>(
const std::string& sop_class_uid,
const std::string& sop_instance_uid,
const std::vector<core::dicom_tag>& attribute_tags)>

N-GET handler function type.

Called when an N-GET request is received to retrieve attributes from a managed SOP Instance.

The handler should:

  1. Look up the SOP Instance by its UID
  2. If attribute_tags is empty, return all attributes
  3. If attribute_tags is not empty, return only the requested attributes
  4. Return the dataset containing the requested attributes
Parameters
sop_class_uidThe SOP Class UID of the instance
sop_instance_uidThe SOP Instance UID to look up
attribute_tagsTags to retrieve (empty = all attributes)
Returns
Dataset containing the requested attributes, or error

Definition at line 51 of file n_get_scp.h.

◆ post_store_handler

Initial value:
std::function<void(
const core::dicom_dataset& dataset,
const std::string& patient_id,
const std::string& study_uid,
const std::string& series_uid,
const std::string& sop_instance_uid)>

Callback type for post-store notification.

Called after successful storage. Useful for cache invalidation, notifications, or other post-processing tasks.

Parameters
datasetThe stored DICOM dataset
patient_idThe patient ID from the dataset
study_uidThe Study Instance UID
series_uidThe Series Instance UID
sop_instance_uidThe SOP Instance UID

Definition at line 95 of file storage_scp.h.

◆ pre_store_handler

using kcenon::pacs::services::pre_store_handler = std::function<bool(const core::dicom_dataset& dataset)>

Callback type for pre-store validation.

Called before the storage handler to validate incoming datasets. Return false to reject the storage request.

Parameters
datasetThe received DICOM dataset
Returns
true to proceed with storage, false to reject

Definition at line 81 of file storage_scp.h.

◆ print_action_handler

Initial value:
std::function<network::Result<std::monostate>(
const std::string& film_box_uid)>

Handler for print action (film box print)

Parameters
film_box_uidThe film box UID to print
Returns
Success or error

Definition at line 197 of file print_scp.h.

◆ print_session_handler

Initial value:
std::function<network::Result<std::monostate>(
const film_session& session)>

Handler for film session creation.

Parameters
sessionThe film session data
Returns
Success or error

Definition at line 188 of file print_scp.h.

◆ printer_status_handler

Initial value:
std::function<
network::Result<std::pair<printer_status, core::dicom_dataset>>()>

Handler for printer status query.

Returns
Printer status and info dataset

Definition at line 205 of file print_scp.h.

◆ query_handler

Initial value:
std::function<std::vector<core::dicom_dataset>(
query_level level,
const core::dicom_dataset& query_keys,
const std::string& calling_ae)>

Query handler function type.

Called by query_scp to retrieve matching records for a C-FIND query.

Parameters
levelThe query level (Patient/Study/Series/Image)
query_keysThe query dataset containing search criteria
calling_aeThe calling AE title of the requesting SCU
Returns
Vector of matching datasets (empty if no matches)

Definition at line 113 of file query_scp.h.

◆ query_streaming_callback

Callback type for streaming query results.

Called for each pending response received from the SCP.

Parameters
datasetThe matching dataset from the SCP
Returns
true to continue receiving, false to cancel the query

Definition at line 197 of file query_scu.h.

◆ Result

template<typename T >
using kcenon::pacs::services::Result = kcenon::common::Result<T>

Result type alias for operations returning a value.

Definition at line 50 of file parallel_query_executor.h.

◆ retrieve_cancel_check

using kcenon::pacs::services::retrieve_cancel_check = std::function<bool()>

Cancel check function type.

Called periodically during retrieve processing to check if a C-CANCEL request has been received.

Returns
true if cancel has been requested

Definition at line 147 of file retrieve_scp.h.

◆ retrieve_handler

Initial value:
std::function<std::vector<core::dicom_file>(
const core::dicom_dataset& query_keys)>

Retrieve handler function type.

Called by retrieve_scp to get matching DICOM files for a retrieve query.

Parameters
query_keysThe query dataset containing search criteria
Returns
Vector of matching DICOM files (empty if no matches)

Definition at line 102 of file retrieve_scp.h.

◆ retrieve_progress_callback

Callback type for retrieve progress updates.

Called periodically during retrieve operations with current progress.

Parameters
progressCurrent progress information

Definition at line 184 of file retrieve_scu.h.

◆ scp_service_ptr

Shared pointer type for SCP services.

Definition at line 162 of file scp_service.h.

◆ storage_handler

Initial value:
std::function<storage_status(
const core::dicom_dataset& dataset,
const std::string& calling_ae,
const std::string& sop_class_uid,
const std::string& sop_instance_uid)>

Callback type for handling received DICOM images.

Parameters
datasetThe received DICOM dataset
calling_aeThe AE title of the sending application
sop_class_uidThe SOP Class UID of the instance
sop_instance_uidThe unique identifier of the instance
Returns
Status indicating success/failure of storage operation

Definition at line 66 of file storage_scp.h.

◆ store_progress_callback

using kcenon::pacs::services::store_progress_callback = std::function<void(size_t completed, size_t total)>

Progress callback type for batch operations.

Parameters
completedNumber of completed operations
totalTotal number of operations

Definition at line 75 of file storage_scu.h.

◆ store_sub_operation

Initial value:
std::function<network::dimse::status_code(
network::association& assoc,
uint8_t context_id,
const core::dicom_file& file,
const std::string& move_originator_ae,
uint16_t move_originator_msg_id)>

Store sub-operation function type.

Called by retrieve_scp to perform a C-STORE sub-operation. This is used for both C-MOVE (to external destination) and C-GET (back to requesting SCU on the same association).

Parameters
assocThe association to use for C-STORE
context_idThe presentation context ID
fileThe DICOM file to store
move_originator_aeThe original requester's AE title (for C-MOVE)
move_originator_msg_idThe original message ID (for C-MOVE)
Returns
Status code from the C-STORE operation

Definition at line 132 of file retrieve_scp.h.

◆ ups_change_state_handler

Initial value:
std::function<network::Result<std::monostate>(
const std::string& workitem_uid,
const std::string& new_state,
const std::string& transaction_uid)>

N-ACTION Type 1 handler: Change UPS State.

Called when an N-ACTION request with Action Type ID 1 is received.

Parameters
workitem_uidThe SOP Instance UID of the workitem
new_stateThe requested new state
transaction_uidThe transaction UID for claiming
Returns
Success if the state was changed, error otherwise

Definition at line 97 of file ups_push_scp.h.

◆ ups_create_handler

Initial value:
std::function<network::Result<std::monostate>(
const storage::ups_workitem& workitem)>

N-CREATE handler function type.

Called when an N-CREATE request is received to create a new UPS workitem. The workitem will always have state=SCHEDULED.

Parameters
workitemThe UPS workitem data from the N-CREATE request
Returns
Success if the workitem was created, error description otherwise

Definition at line 60 of file ups_push_scp.h.

◆ ups_event_callback

Initial value:
std::function<void(
const std::string& subscriber_ae,
uint16_t event_type_id,
const std::string& workitem_uid,
const core::dicom_dataset& event_info)>

Event notification callback type.

Called by the Watch SCP when an event needs to be dispatched to subscribers. The application layer is responsible for establishing the network connection and sending the N-EVENT-REPORT to each subscriber.

Parameters
subscriber_aeThe AE Title of the subscriber to notify
event_type_idThe event type (ups_event_state_report, etc.)
workitem_uidThe workitem UID that triggered the event
event_infoDataset containing event details

Definition at line 131 of file ups_watch_scp.h.

◆ ups_get_handler

Initial value:
std::function<network::Result<storage::ups_workitem>(
const std::string& workitem_uid)>

N-GET handler function type.

Called when an N-GET request is received to retrieve a UPS workitem.

Parameters
workitem_uidThe SOP Instance UID of the workitem to retrieve
Returns
The workitem if found, error otherwise

Definition at line 84 of file ups_push_scp.h.

◆ ups_get_subscribers_handler

Initial value:
std::function<
network::Result<std::vector<std::string>>(
const std::string& workitem_uid)>

Get subscribers handler function type.

Called to retrieve subscriber AE titles for a specific workitem. Used when sending N-EVENT-REPORT notifications.

Parameters
workitem_uidThe workitem UID to find subscribers for
Returns
Vector of subscriber AE titles

Definition at line 115 of file ups_watch_scp.h.

◆ ups_query_cancel_check

using kcenon::pacs::services::ups_query_cancel_check = std::function<bool()>

Cancel check function type for UPS queries.

Called periodically during query processing to check if a C-CANCEL request has been received.

Returns
true if cancel has been requested

Definition at line 65 of file ups_query_scp.h.

◆ ups_query_handler

Initial value:
std::function<std::vector<core::dicom_dataset>(
const core::dicom_dataset& query_keys,
const std::string& calling_ae)>

UPS query handler function type.

Called by ups_query_scp to retrieve matching UPS workitems for a C-FIND query. The handler should query the database using the provided query keys and return matching workitem datasets.

Parameters
query_keysThe query dataset containing search criteria:
  • Procedure Step State (0074,1000)
  • Scheduled Procedure Step Priority (0074,1200)
  • Procedure Step Label (0074,1204)
  • Worklist Label (0074,1202)
  • SOP Instance UID (0008,0018) for unique key match
calling_aeThe calling AE title of the requesting system
Returns
Vector of matching workitem datasets (empty if no matches)

Definition at line 53 of file ups_query_scp.h.

◆ ups_request_cancel_handler

Initial value:
std::function<network::Result<std::monostate>(
const std::string& workitem_uid,
const std::string& reason)>

N-ACTION Type 3 handler: Request Cancellation.

Called when an N-ACTION request with Action Type ID 3 is received.

Parameters
workitem_uidThe SOP Instance UID of the workitem
reasonThe cancellation reason (may be empty)
Returns
Success if the cancellation request was accepted, error otherwise

Definition at line 111 of file ups_push_scp.h.

◆ ups_set_handler

Initial value:
std::function<network::Result<std::monostate>(
const std::string& workitem_uid,
const core::dicom_dataset& modifications)>

N-SET handler function type.

Called when an N-SET request is received to update an existing UPS workitem.

Parameters
workitem_uidThe SOP Instance UID of the workitem to update
modificationsThe dataset containing the modifications
Returns
Success if the workitem was updated, error description otherwise

Definition at line 72 of file ups_push_scp.h.

◆ ups_subscribe_handler

Initial value:
std::function<network::Result<std::monostate>(
const std::string& subscriber_ae,
const std::string& workitem_uid,
bool deletion_lock)>

Subscribe handler function type.

Called when an N-ACTION subscribe request is received. The handler should persist the subscription (e.g., to the ups_subscriptions database table).

Parameters
subscriber_aeThe AE Title of the subscribing system
workitem_uidThe specific workitem UID (empty for global subscription)
deletion_lockWhether deletion lock is requested
Returns
Success if the subscription was created, error otherwise

Definition at line 87 of file ups_watch_scp.h.

◆ ups_unsubscribe_handler

Initial value:
std::function<network::Result<std::monostate>(
const std::string& subscriber_ae,
const std::string& workitem_uid)>

Unsubscribe handler function type.

Called when an N-ACTION unsubscribe request is received. The handler should remove the subscription from persistence.

Parameters
subscriber_aeThe AE Title of the unsubscribing system
workitem_uidThe specific workitem UID (empty for global unsubscription)
Returns
Success if the subscription was removed, error otherwise

Definition at line 102 of file ups_watch_scp.h.

◆ worklist_cancel_check

using kcenon::pacs::services::worklist_cancel_check = std::function<bool()>

Cancel check function type.

Called periodically during query processing to check if a C-CANCEL request has been received.

Returns
true if cancel has been requested

Definition at line 97 of file worklist_scp.h.

◆ worklist_handler

Initial value:
std::function<std::vector<core::dicom_dataset>(
const core::dicom_dataset& query_keys,
const std::string& calling_ae)>

Definition at line 85 of file worklist_scp.h.

◆ worklist_streaming_callback

Callback type for streaming worklist query results.

Called for each pending response received from the SCP.

Parameters
itemThe parsed worklist item from the SCP
Returns
true to continue receiving, false to cancel the query

Definition at line 259 of file worklist_scu.h.

Enumeration Type Documentation

◆ commitment_failure_reason

Failure reason codes for Storage Commitment.

As defined in DICOM PS3.4 Table J.3-2 (Failure Reason values). These codes appear in the Failure Reason (0008,1197) attribute within the Failed SOP Sequence.

Enumerator
processing_failure 

General processing failure.

no_such_object_instance 

Referenced SOP Instance not found in storage.

resource_limitation 

Storage resource limitation (e.g., disk full)

referenced_sop_class_not_supported 

Referenced SOP Class not supported by SCP.

class_instance_conflict 

SOP Class / Instance UID mismatch.

duplicate_transaction_uid 

Duplicate Transaction UID.

Definition at line 81 of file storage_commitment_types.h.

81 : uint16_t {
83 processing_failure = 0x0110,
84
87
89 resource_limitation = 0x0213,
90
93
96
99};
@ referenced_sop_class_not_supported
Referenced SOP Class not supported by SCP.
@ duplicate_transaction_uid
Duplicate Transaction UID.
@ no_such_object_instance
Referenced SOP Instance not found in storage.
@ class_instance_conflict
SOP Class / Instance UID mismatch.
@ resource_limitation
Storage resource limitation (e.g., disk full)

◆ duplicate_policy

Policy for handling duplicate SOP instances.

Enumerator
reject 

Reject duplicates with error status.

replace 

Replace existing instance with new one.

ignore 

Silently accept duplicate (return success)

Definition at line 40 of file storage_scp.h.

40 {
41 reject,
42 replace,
43 ignore
44};
@ ignore
Silently accept duplicate (return success)

◆ modality_type

Modality type for storage SOP classes.

Enumerator
ct 

Computed Tomography.

mr 

Magnetic Resonance.

us 

Ultrasound.

xa 

X-Ray Angiographic.

xrf 

X-Ray Radiofluoroscopic.

cr 

Computed Radiography.

dx 

Digital Radiography.

mg 

Mammography.

nm 

Nuclear Medicine.

pet 

Positron Emission Tomography.

rt 

Radiation Therapy.

sc 

Secondary Capture.

sr 

Structured Report.

seg 

Segmentation.

sm 

Slide Microscopy (Whole Slide Imaging)

op 

Ophthalmic Photography / Tomography.

pmap 

Parametric Map.

other 

Other modalities.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/services/sop_class_registry.h.

Definition at line 53 of file sop_class_registry.h.

53 {
54 ct,
55 mr,
56 us,
57 xa,
58 xrf,
59 cr,
60 dx,
61 mg,
62 nm,
63 pet,
64 rt,
65 sc,
66 sr,
67 seg,
68 sm,
69 op,
70 pmap,
71 other
72};
@ op
Ophthalmic Photography / Tomography.
@ pet
Positron Emission Tomography.
@ xrf
X-Ray Radiofluoroscopic.
@ sm
Slide Microscopy (Whole Slide Imaging)

◆ mpps_status

MPPS status enumeration.

Defines valid states for a Modality Performed Procedure Step. COMPLETED and DISCONTINUED are final (terminal) states.

Enumerator
in_progress 

Procedure is currently being performed.

completed 

Procedure completed successfully.

discontinued 

Procedure was stopped/cancelled.

Definition at line 48 of file mpps_scp.h.

48 {
50 completed,
52};
@ discontinued
Procedure was stopped/cancelled.
@ in_progress
Procedure is currently being performed.

◆ print_job_status

Print job status.

Enumerator
pending 

Job is queued.

printing 

Job is being printed.

done 

Job completed successfully.

failure 

Job failed.

Definition at line 99 of file print_scp.h.

99 {
100 pending,
101 printing,
102 done,
103 failure
104};
@ failure
Printer has a critical error.
@ done
Job completed successfully.

◆ printer_status

Printer status enumeration (PS3.4 H.4.17)

Enumerator
normal 

Printer is operating normally.

warning 

Printer has a non-critical issue.

failure 

Printer has a critical error.

Definition at line 74 of file print_scp.h.

74 {
75 normal,
76 warning,
77 failure
78};

◆ query_level

DICOM Query/Retrieve level enumeration.

Defines the hierarchical levels at which queries can be performed in the DICOM Query/Retrieve Information Model.

Enumerator
patient 

Patient level - query patient demographics.

study 

Study level - query study information.

series 

Series level - query series information.

image 

Image (Instance) level - query instance information.

Examples
/home/runner/work/pacs_system/pacs_system/examples/query_scu/query_builder.h.

Definition at line 63 of file query_scp.h.

63 {
64 patient,
65 study,
66 series,
67 image
68};

◆ query_model

DICOM Query/Retrieve Information Model.

Defines which information model to use for queries.

Enumerator
patient_root 

Patient Root Query/Retrieve Information Model.

study_root 

Study Root Query/Retrieve Information Model.

Definition at line 47 of file query_scu.h.

47 {
50};
@ study_root
Study Root Query/Retrieve Information Model.
@ patient_root
Patient Root Query/Retrieve Information Model.

◆ retrieve_mode

DICOM Retrieve Mode (C-MOVE vs C-GET)

Defines which retrieve operation to use.

Enumerator
c_move 

Request SCP to send to third party (requires move destination)

c_get 

Receive directly from SCP on same association.

Definition at line 50 of file retrieve_scu.h.

50 {
51 c_move,
52 c_get
53};

◆ sop_class_category

Category of SOP Class.

Enumerator
storage 

Storage Service Class.

query_retrieve 

Query/Retrieve Service Class.

worklist 

Modality Worklist Service Class.

mpps 

Modality Performed Procedure Step.

storage_commitment 

Storage Commitment Push Model Service Class.

ups 

Unified Procedure Step Service Class.

verification 

Verification Service Class.

print 

Print Management Service Class.

media 

Media Storage Service Class.

other 

Other service classes.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/services/sop_class_registry.h.

Definition at line 37 of file sop_class_registry.h.

37 {
38 storage,
40 worklist,
41 mpps,
43 ups,
45 print,
46 media,
47 other
48};
@ query_retrieve
Query/Retrieve Service Class.
@ worklist
Modality Worklist Service Class.
@ media
Media Storage Service Class.
@ ups
Unified Procedure Step Service Class.
@ storage_commitment
Storage Commitment Push Model Service Class.
@ mpps
Modality Performed Procedure Step.
@ print
Print Management Service Class.
@ verification
Verification Service Class.

◆ storage_status

enum class kcenon::pacs::services::storage_status : uint16_t
strong

Storage operation status codes.

These status codes are returned by the storage handler to indicate the result of a C-STORE operation. They map to DICOM status codes defined in PS3.4 Annex B.

Enumerator
success 

Success - image stored successfully (0x0000)

coercion_of_data_elements 

Warning: Coercion of data elements (0xB000)

data_set_does_not_match_sop_class_warning 

Warning: Data set does not match SOP class (0xB007)

elements_discarded 

Warning: Elements discarded (0xB006)

duplicate_sop_instance 

Failure: Duplicate SOP instance - already exists (0x0111)

out_of_resources 

Failure: Out of resources (0xA700)

out_of_resources_unable_to_store 

Failure: Out of resources - Unable to store (0xA701)

data_set_does_not_match_sop_class 

Failure: Data set does not match SOP class (0xA900)

cannot_understand 

Failure: Cannot understand - processing failure (0xC000)

storage_error 

Failure: Unable to process - storage error (0xC001)

Definition at line 33 of file storage_status.h.

33 : uint16_t {
35 success = 0x0000,
36
39
42
44 elements_discarded = 0xB006,
45
48
50 out_of_resources = 0xA700,
51
54
57
59 cannot_understand = 0xC000,
60
62 storage_error = 0xC001
63};
@ elements_discarded
Warning: Elements discarded (0xB006)
@ storage_error
Failure: Unable to process - storage error (0xC001)
@ data_set_does_not_match_sop_class
Failure: Data set does not match SOP class (0xA900)
@ data_set_does_not_match_sop_class_warning
Warning: Data set does not match SOP class (0xB007)
@ duplicate_sop_instance
Failure: Duplicate SOP instance - already exists (0x0111)
@ out_of_resources_unable_to_store
Failure: Out of resources - Unable to store (0xA701)
@ coercion_of_data_elements
Warning: Coercion of data elements (0xB000)

Function Documentation

◆ get_find_sop_class_uid()

std::string_view kcenon::pacs::services::get_find_sop_class_uid ( query_model model)
nodiscardconstexprnoexcept

Get the FIND SOP Class UID for a query model.

Parameters
modelThe query model
Returns
The corresponding SOP Class UID

Definition at line 70 of file query_scu.h.

71 {
72 switch (model) {
73 case query_model::patient_root:
75 case query_model::study_root:
77 default:
79 }
80}
constexpr std::string_view study_root_find_sop_class_uid
Study Root Query/Retrieve Information Model - FIND.
Definition query_scp.h:42
constexpr std::string_view patient_root_find_sop_class_uid
Patient Root Query/Retrieve Information Model - FIND.
Definition query_scp.h:38

References patient_root, patient_root_find_sop_class_uid, study_root, and study_root_find_sop_class_uid.

Referenced by kcenon::pacs::services::query_scu::get_sop_class_uid().

Here is the caller graph for this function:

◆ get_sop_class_name()

std::string_view kcenon::pacs::services::get_sop_class_name ( std::string_view uid)
nodiscard

Get human-readable name for a SOP Class.

Parameters
uidThe SOP Class UID
Returns
The SOP Class name, or "Unknown" if not found
Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/services/sop_class_registry.h.

Definition at line 1183 of file sop_class_registry.cpp.

1183 {
1184 const auto* info = sop_class_registry::instance().get_info(uid);
1185 if (info != nullptr) {
1186 return info->name;
1187 }
1188 return "Unknown";
1189}
std::string_view uid

References kcenon::pacs::services::sop_class_registry::get_info(), kcenon::pacs::services::sop_class_registry::instance(), and uid.

Here is the call graph for this function:

◆ get_standard_storage_sop_classes()

std::vector< std::string > kcenon::pacs::services::get_standard_storage_sop_classes ( )
nodiscard

Get a list of all standard Storage SOP Class UIDs.

This function returns a comprehensive list of commonly supported storage SOP classes for a typical PACS implementation.

Returns
Vector of standard Storage SOP Class UIDs

Definition at line 222 of file storage_scp.cpp.

222 {
223 return {
224 // CT
225 std::string(ct_image_storage_uid),
226 std::string(enhanced_ct_image_storage_uid),
227
228 // MR
229 std::string(mr_image_storage_uid),
230 std::string(enhanced_mr_image_storage_uid),
231
232 // CR/DX
233 std::string(cr_image_storage_uid),
234 std::string(dx_image_storage_presentation_uid),
235 std::string(dx_image_storage_processing_uid),
236
237 // US
238 std::string(us_image_storage_uid),
239
240 // Secondary Capture
241 std::string(secondary_capture_image_storage_uid),
242
243 // RT
244 std::string(rt_image_storage_uid),
245 std::string(rt_dose_storage_uid),
246 std::string(rt_structure_set_storage_uid),
247 std::string(rt_plan_storage_uid),
248
249 // NM/PET
250 "1.2.840.10008.5.1.4.1.1.20", // NM Image Storage
251 "1.2.840.10008.5.1.4.1.1.128", // PET Image Storage
252 "1.2.840.10008.5.1.4.1.1.130", // Enhanced PET Image Storage
253
254 // XA/RF
255 "1.2.840.10008.5.1.4.1.1.12.1", // XA Image Storage
256 "1.2.840.10008.5.1.4.1.1.12.2", // XRF Image Storage
257
258 // Mammography
259 "1.2.840.10008.5.1.4.1.1.1.2", // Digital Mammography X-Ray - Presentation
260 "1.2.840.10008.5.1.4.1.1.1.2.1", // Digital Mammography X-Ray - Processing
261
262 // Multi-frame
263 "1.2.840.10008.5.1.4.1.1.7.1", // Multi-frame Single Bit SC
264 "1.2.840.10008.5.1.4.1.1.7.2", // Multi-frame Grayscale Byte SC
265 "1.2.840.10008.5.1.4.1.1.7.3", // Multi-frame Grayscale Word SC
266 "1.2.840.10008.5.1.4.1.1.7.4", // Multi-frame True Color SC
267
268 // SR (Structured Reports)
269 "1.2.840.10008.5.1.4.1.1.88.11", // Basic Text SR
270 "1.2.840.10008.5.1.4.1.1.88.22", // Enhanced SR
271 "1.2.840.10008.5.1.4.1.1.88.33", // Comprehensive SR
272 "1.2.840.10008.5.1.4.1.1.88.34", // Comprehensive 3D SR
273
274 // Other common types
275 "1.2.840.10008.5.1.4.1.1.104.1", // Encapsulated PDF
276 "1.2.840.10008.5.1.4.1.1.104.2", // Encapsulated CDA
277 };
278}

References cr_image_storage_uid, ct_image_storage_uid, dx_image_storage_presentation_uid, dx_image_storage_processing_uid, enhanced_ct_image_storage_uid, enhanced_mr_image_storage_uid, mr_image_storage_uid, rt_dose_storage_uid, rt_image_storage_uid, rt_plan_storage_uid, rt_structure_set_storage_uid, secondary_capture_image_storage_uid, and us_image_storage_uid.

Referenced by kcenon::pacs::services::storage_scp::supported_sop_classes().

Here is the caller graph for this function:

◆ get_storage_modality()

modality_type kcenon::pacs::services::get_storage_modality ( std::string_view uid)
nodiscard

Get the modality for a storage SOP Class.

Parameters
uidThe SOP Class UID
Returns
The modality type, or modality_type::other if not a storage class
Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/services/sop_class_registry.h.

Definition at line 1175 of file sop_class_registry.cpp.

1175 {
1176 const auto* info = sop_class_registry::instance().get_info(uid);
1177 if (info != nullptr && info->category == sop_class_category::storage) {
1178 return info->modality;
1179 }
1180 return modality_type::other;
1181}

References kcenon::pacs::services::sop_class_registry::get_info(), kcenon::pacs::services::sop_class_registry::instance(), other, storage, and uid.

Here is the call graph for this function:

◆ is_failure()

bool kcenon::pacs::services::is_failure ( storage_status status)
nodiscardconstexprnoexcept

Check if the status indicates a failure.

Parameters
statusThe status to check
Returns
true if the operation failed

Definition at line 89 of file storage_status.h.

89 {
90 const auto value = static_cast<uint16_t>(status);
91 const auto high_nibble = (value & 0xF000) >> 12;
92 return high_nibble == 0xA || high_nibble == 0xC ||
93 (value >= 0x0100 && value <= 0x01FF);
94}

Referenced by kcenon::pacs::services::storage_scp::handle_message().

Here is the caller graph for this function:

◆ is_storage_sop_class()

bool kcenon::pacs::services::is_storage_sop_class ( std::string_view uid)
nodiscard

Check if a SOP Class UID is a storage class.

Parameters
uidThe SOP Class UID
Returns
true if this is any storage SOP class
Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/services/sop_class_registry.h.

Definition at line 1170 of file sop_class_registry.cpp.

1170 {
1171 const auto* info = sop_class_registry::instance().get_info(uid);
1172 return info != nullptr && info->category == sop_class_category::storage;
1173}

References kcenon::pacs::services::sop_class_registry::get_info(), kcenon::pacs::services::sop_class_registry::instance(), storage, and uid.

Here is the call graph for this function:

◆ is_success()

bool kcenon::pacs::services::is_success ( storage_status status)
nodiscardconstexprnoexcept

Check if the status indicates success.

Parameters
statusThe status to check
Returns
true if the operation was successful

Definition at line 70 of file storage_status.h.

70 {
71 return status == storage_status::success;
72}

References success.

Referenced by kcenon::pacs::services::retrieve_scp::handle_c_get(), and kcenon::pacs::services::retrieve_scp::handle_c_move().

Here is the caller graph for this function:

◆ is_warning()

bool kcenon::pacs::services::is_warning ( storage_status status)
nodiscardconstexprnoexcept

Check if the status indicates a warning.

Parameters
statusThe status to check
Returns
true if the operation completed with a warning

Definition at line 79 of file storage_status.h.

79 {
80 const auto value = static_cast<uint16_t>(status);
81 return (value & 0xF000) == 0xB000;
82}

Referenced by kcenon::pacs::services::retrieve_scp::handle_c_get(), and kcenon::pacs::services::retrieve_scp::handle_c_move().

Here is the caller graph for this function:

◆ parse_mpps_status()

auto kcenon::pacs::services::parse_mpps_status ( std::string_view str) -> std::optional<mpps_status>
inlinenodiscard

Parse DICOM string to mpps_status enum.

Parameters
strThe DICOM string representation
Returns
Optional containing the status if valid, nullopt otherwise

Definition at line 79 of file mpps_scp.h.

80 {
81 if (str == "IN PROGRESS") {
82 return mpps_status::in_progress;
83 }
84 if (str == "COMPLETED") {
85 return mpps_status::completed;
86 }
87 if (str == "DISCONTINUED") {
88 return mpps_status::discontinued;
89 }
90 return std::nullopt;
91}

References completed, discontinued, and in_progress.

Referenced by kcenon::pacs::services::mpps_scp::handle_n_create(), and kcenon::pacs::services::mpps_scp::handle_n_set().

Here is the caller graph for this function:

◆ parse_query_level()

std::optional< query_level > kcenon::pacs::services::parse_query_level ( std::string_view level_str)
inlinenodiscardnoexcept

Parse query level from DICOM string.

Parameters
level_strThe DICOM string (PATIENT, STUDY, SERIES, IMAGE)
Returns
Parsed query level, or std::nullopt if invalid

Definition at line 90 of file query_scp.h.

91 {
92 if (level_str == "PATIENT") return query_level::patient;
93 if (level_str == "STUDY") return query_level::study;
94 if (level_str == "SERIES") return query_level::series;
95 if (level_str == "IMAGE") return query_level::image;
96 return std::nullopt;
97}

References image, patient, series, and study.

Referenced by kcenon::pacs::services::query_scp::extract_query_level().

Here is the caller graph for this function:

◆ to_status_code()

uint16_t kcenon::pacs::services::to_status_code ( storage_status status)
nodiscardconstexprnoexcept

Convert storage_status to DIMSE status_code.

Parameters
statusThe storage status
Returns
Equivalent DIMSE status code

Definition at line 133 of file storage_status.h.

133 {
134 return static_cast<uint16_t>(status);
135}

◆ to_string() [1/7]

std::string_view kcenon::pacs::services::to_string ( commitment_failure_reason reason)
inlinenodiscardnoexcept

Convert failure reason to human-readable string.

Parameters
reasonThe failure reason code
Returns
Description string

Definition at line 107 of file storage_commitment_types.h.

107 {
108 switch (reason) {
109 case commitment_failure_reason::processing_failure:
110 return "Processing failure";
111 case commitment_failure_reason::no_such_object_instance:
112 return "No such object instance";
113 case commitment_failure_reason::resource_limitation:
114 return "Resource limitation";
115 case commitment_failure_reason::referenced_sop_class_not_supported:
116 return "Referenced SOP Class not supported";
117 case commitment_failure_reason::class_instance_conflict:
118 return "Class/Instance conflict";
119 case commitment_failure_reason::duplicate_transaction_uid:
120 return "Duplicate Transaction UID";
121 }
122 return "Unknown failure reason";
123}

References class_instance_conflict, duplicate_transaction_uid, no_such_object_instance, processing_failure, referenced_sop_class_not_supported, and resource_limitation.

◆ to_string() [2/7]

auto kcenon::pacs::services::to_string ( mpps_status status) -> std::string_view
inlinenodiscard

Convert mpps_status to DICOM string representation.

Parameters
statusThe status enum value
Returns
DICOM-compliant string ("IN PROGRESS", "COMPLETED", "DISCONTINUED")
Examples
/home/runner/work/pacs_system/pacs_system/examples/query_scu/query_builder.h, and mpps_scp/main.cpp.

Definition at line 60 of file mpps_scp.h.

60 {
61 switch (status) {
62 case mpps_status::in_progress:
63 return "IN PROGRESS";
64 case mpps_status::completed:
65 return "COMPLETED";
66 case mpps_status::discontinued:
67 return "DISCONTINUED";
68 default:
69 return "IN PROGRESS";
70 }
71}

References completed, discontinued, and in_progress.

Referenced by query_scu::query_builder::build(), kcenon::pacs::services::mpps_scu::build_set_dataset(), kcenon::pacs::services::ups_push_scu::change_state(), kcenon::pacs::services::mpps_scu::create(), kcenon::pacs::services::ups_push_scu::create(), kcenon::pacs::services::print_scu::create_film_box(), kcenon::pacs::services::print_scu::create_film_session(), kcenon::pacs::services::print_scu::delete_film_box(), kcenon::pacs::services::print_scu::delete_film_session(), kcenon::pacs::services::query_scu::find_impl(), kcenon::pacs::services::query_scu::find_streaming(), query_scu::result_formatter::format_json(), query_scu::result_formatter::format_table(), kcenon::pacs::services::n_get_scu::get(), kcenon::pacs::services::ups_push_scu::get(), kcenon::pacs::services::storage_commitment_scu::handle_event_report(), kcenon::pacs::services::ups_watch_scu::handle_event_report(), kcenon::pacs::services::mpps_scp::handle_message(), kcenon::pacs::services::n_get_scp::handle_message(), kcenon::pacs::services::print_scp::handle_message(), kcenon::pacs::services::query_scp::handle_message(), kcenon::pacs::services::retrieve_scp::handle_message(), kcenon::pacs::services::storage_commitment_scp::handle_message(), kcenon::pacs::services::storage_scp::handle_message(), kcenon::pacs::services::ups_push_scp::handle_message(), kcenon::pacs::services::ups_query_scp::handle_message(), kcenon::pacs::services::ups_watch_scp::handle_message(), kcenon::pacs::services::verification_scp::handle_message(), kcenon::pacs::services::worklist_scp::handle_message(), kcenon::pacs::example::pacs_server_app::handle_mpps_set(), kcenon::pacs::services::print_scp::handle_n_get(), kcenon::pacs::example::pacs_server_app::handle_query(), kcenon::pacs::services::retrieve_scu::perform_move(), kcenon::pacs::services::print_scu::print_film_box(), kcenon::pacs::services::worklist_scu::query_impl(), kcenon::pacs::services::print_scu::query_printer_status(), kcenon::pacs::services::worklist_scu::query_streaming(), kcenon::pacs::services::ups_push_scu::request_cancel(), kcenon::pacs::services::ups_watch_scu::send_watch_action(), kcenon::pacs::services::mpps_scu::set(), kcenon::pacs::services::ups_push_scu::set(), kcenon::pacs::services::print_scu::set_image_box(), and kcenon::pacs::services::storage_scu::store_impl().

Here is the caller graph for this function:

◆ to_string() [3/7]

auto kcenon::pacs::services::to_string ( printer_status status) -> std::string_view
inlinenodiscard

Convert printer_status to DICOM string representation.

Definition at line 83 of file print_scp.h.

83 {
84 switch (status) {
85 case printer_status::normal:
86 return "NORMAL";
87 case printer_status::warning:
88 return "WARNING";
89 case printer_status::failure:
90 return "FAILURE";
91 default:
92 return "NORMAL";
93 }
94}

References failure, normal, and warning.

◆ to_string() [4/7]

std::string_view kcenon::pacs::services::to_string ( query_level level)
nodiscardconstexprnoexcept

Convert query_level to string representation.

Parameters
levelThe query level to convert
Returns
DICOM string representation (PATIENT, STUDY, SERIES, IMAGE)

Definition at line 75 of file query_scp.h.

75 {
76 switch (level) {
77 case query_level::patient: return "PATIENT";
78 case query_level::study: return "STUDY";
79 case query_level::series: return "SERIES";
80 case query_level::image: return "IMAGE";
81 default: return "UNKNOWN";
82 }
83}

References image, patient, series, and study.

◆ to_string() [5/7]

std::string_view kcenon::pacs::services::to_string ( query_model model)
nodiscardconstexprnoexcept

Convert query_model to string representation.

Parameters
modelThe query model to convert
Returns
String representation

Definition at line 57 of file query_scu.h.

57 {
58 switch (model) {
59 case query_model::patient_root: return "Patient Root";
60 case query_model::study_root: return "Study Root";
61 default: return "Unknown";
62 }
63}

References patient_root, and study_root.

◆ to_string() [6/7]

std::string_view kcenon::pacs::services::to_string ( retrieve_mode mode)
nodiscardconstexprnoexcept

Convert retrieve_mode to string representation.

Parameters
modeThe retrieve mode to convert
Returns
String representation

Definition at line 60 of file retrieve_scu.h.

60 {
61 switch (mode) {
62 case retrieve_mode::c_move: return "C-MOVE";
63 case retrieve_mode::c_get: return "C-GET";
64 default: return "Unknown";
65 }
66}

References c_get, and c_move.

◆ to_string() [7/7]

std::string_view kcenon::pacs::services::to_string ( storage_status status)
nodiscardconstexprnoexcept

Get a human-readable description of the storage status.

Parameters
statusThe status to describe
Returns
Description string

Definition at line 101 of file storage_status.h.

101 {
102 switch (status) {
103 case storage_status::success:
104 return "Success";
105 case storage_status::coercion_of_data_elements:
106 return "Warning: Coercion of data elements";
107 case storage_status::data_set_does_not_match_sop_class_warning:
108 return "Warning: Data set does not match SOP class";
109 case storage_status::elements_discarded:
110 return "Warning: Elements discarded";
111 case storage_status::duplicate_sop_instance:
112 return "Failure: Duplicate SOP instance";
113 case storage_status::out_of_resources:
114 return "Failure: Out of resources";
115 case storage_status::out_of_resources_unable_to_store:
116 return "Failure: Out of resources - Unable to store";
117 case storage_status::data_set_does_not_match_sop_class:
118 return "Failure: Data set does not match SOP class";
119 case storage_status::cannot_understand:
120 return "Failure: Cannot understand";
121 case storage_status::storage_error:
122 return "Failure: Storage error";
123 default:
124 return "Unknown status";
125 }
126}

References cannot_understand, coercion_of_data_elements, data_set_does_not_match_sop_class, data_set_does_not_match_sop_class_warning, duplicate_sop_instance, elements_discarded, out_of_resources, out_of_resources_unable_to_store, storage_error, and success.

Variable Documentation

◆ basic_color_image_box_sop_class_uid

std::string_view kcenon::pacs::services::basic_color_image_box_sop_class_uid
inlineconstexpr
Initial value:
=
"1.2.840.10008.5.1.1.4.1"

Basic Color Image Box SOP Class UID.

Definition at line 52 of file print_scp.h.

Referenced by kcenon::pacs::services::print_scp::handle_n_set(), kcenon::pacs::services::print_scu::set_image_box(), and kcenon::pacs::services::print_scp::supported_sop_classes().

◆ basic_color_print_meta_sop_class_uid

std::string_view kcenon::pacs::services::basic_color_print_meta_sop_class_uid
inlineconstexpr
Initial value:
=
"1.2.840.10008.5.1.1.18"

Basic Color Print Management Meta SOP Class UID.

Definition at line 64 of file print_scp.h.

Referenced by kcenon::pacs::services::print_scu::find_print_context(), and kcenon::pacs::services::print_scp::supported_sop_classes().

◆ basic_film_box_sop_class_uid

◆ basic_film_session_sop_class_uid

◆ basic_grayscale_image_box_sop_class_uid

std::string_view kcenon::pacs::services::basic_grayscale_image_box_sop_class_uid
inlineconstexpr

◆ basic_grayscale_print_meta_sop_class_uid

std::string_view kcenon::pacs::services::basic_grayscale_print_meta_sop_class_uid
inlineconstexpr
Initial value:
=
"1.2.840.10008.5.1.1.9"

Basic Grayscale Print Management Meta SOP Class UID.

Definition at line 60 of file print_scp.h.

Referenced by kcenon::pacs::services::print_scu::find_print_context(), and kcenon::pacs::services::print_scp::supported_sop_classes().

◆ cr_image_storage_uid

std::string_view kcenon::pacs::services::cr_image_storage_uid
inlineconstexpr
Initial value:
=
"1.2.840.10008.5.1.4.1.1.1"

CR Image Storage.

Definition at line 361 of file storage_scp.h.

Referenced by get_standard_storage_sop_classes().

◆ ct_image_storage_uid

std::string_view kcenon::pacs::services::ct_image_storage_uid
inlineconstexpr
Initial value:
=
"1.2.840.10008.5.1.4.1.1.2"

CT Image Storage.

Definition at line 345 of file storage_scp.h.

Referenced by get_standard_storage_sop_classes().

◆ dx_image_storage_presentation_uid

std::string_view kcenon::pacs::services::dx_image_storage_presentation_uid
inlineconstexpr
Initial value:
=
"1.2.840.10008.5.1.4.1.1.1.1"

Digital X-Ray Image Storage - For Presentation.

Definition at line 365 of file storage_scp.h.

Referenced by get_standard_storage_sop_classes().

◆ dx_image_storage_processing_uid

std::string_view kcenon::pacs::services::dx_image_storage_processing_uid
inlineconstexpr
Initial value:
=
"1.2.840.10008.5.1.4.1.1.1.1.1"

Digital X-Ray Image Storage - For Processing.

Definition at line 369 of file storage_scp.h.

Referenced by get_standard_storage_sop_classes().

◆ enhanced_ct_image_storage_uid

std::string_view kcenon::pacs::services::enhanced_ct_image_storage_uid
inlineconstexpr
Initial value:
=
"1.2.840.10008.5.1.4.1.1.2.1"

Enhanced CT Image Storage.

Definition at line 349 of file storage_scp.h.

Referenced by get_standard_storage_sop_classes().

◆ enhanced_mr_image_storage_uid

std::string_view kcenon::pacs::services::enhanced_mr_image_storage_uid
inlineconstexpr
Initial value:
=
"1.2.840.10008.5.1.4.1.1.4.1"

Enhanced MR Image Storage.

Definition at line 357 of file storage_scp.h.

Referenced by get_standard_storage_sop_classes().

◆ modality_worklist_find_sop_class_uid

std::string_view kcenon::pacs::services::modality_worklist_find_sop_class_uid
inlineconstexpr
Initial value:
=
"1.2.840.10008.5.1.4.31"

Modality Worklist Information Model - FIND.

Definition at line 50 of file query_scp.h.

◆ mpps_sop_class_uid

◆ mr_image_storage_uid

std::string_view kcenon::pacs::services::mr_image_storage_uid
inlineconstexpr
Initial value:
=
"1.2.840.10008.5.1.4.1.1.4"

MR Image Storage.

Definition at line 353 of file storage_scp.h.

Referenced by get_standard_storage_sop_classes().

◆ patient_root_find_sop_class_uid

std::string_view kcenon::pacs::services::patient_root_find_sop_class_uid
inlineconstexpr
Initial value:
=
"1.2.840.10008.5.1.4.1.2.1.1"

Patient Root Query/Retrieve Information Model - FIND.

Examples
find_scu/main.cpp, and query_scu/main.cpp.

Definition at line 38 of file query_scp.h.

Referenced by get_find_sop_class_uid(), and kcenon::pacs::services::query_scp::supported_sop_classes().

◆ patient_root_get_sop_class_uid

std::string_view kcenon::pacs::services::patient_root_get_sop_class_uid
inlineconstexpr
Initial value:
=
"1.2.840.10008.5.1.4.1.2.1.3"

Patient Root Query/Retrieve Information Model - GET.

Examples
get_scu/main.cpp, and retrieve_scu/main.cpp.

Definition at line 51 of file retrieve_scp.h.

Referenced by kcenon::pacs::services::retrieve_scu::get_get_sop_class_uid(), and kcenon::pacs::services::retrieve_scp::supported_sop_classes().

◆ patient_root_move_sop_class_uid

std::string_view kcenon::pacs::services::patient_root_move_sop_class_uid
inlineconstexpr
Initial value:
=
"1.2.840.10008.5.1.4.1.2.1.2"

Patient Root Query/Retrieve Information Model - MOVE.

Examples
move_scu/main.cpp, and retrieve_scu/main.cpp.

Definition at line 43 of file retrieve_scp.h.

Referenced by kcenon::pacs::services::retrieve_scu::get_move_sop_class_uid(), and kcenon::pacs::services::retrieve_scp::supported_sop_classes().

◆ patient_study_only_find_sop_class_uid

std::string_view kcenon::pacs::services::patient_study_only_find_sop_class_uid
inlineconstexpr
Initial value:
=
"1.2.840.10008.5.1.4.1.2.3.1"

Patient/Study Only Query/Retrieve Information Model - FIND (Retired)

Definition at line 46 of file query_scp.h.

◆ printer_sop_class_uid

std::string_view kcenon::pacs::services::printer_sop_class_uid
inlineconstexpr
Initial value:
=
"1.2.840.10008.5.1.1.16"

Printer SOP Class UID.

Definition at line 56 of file print_scp.h.

Referenced by kcenon::pacs::services::print_scp::handle_n_get(), kcenon::pacs::services::print_scu::query_printer_status(), and kcenon::pacs::services::print_scp::supported_sop_classes().

◆ rt_dose_storage_uid

std::string_view kcenon::pacs::services::rt_dose_storage_uid
inlineconstexpr
Initial value:
=
"1.2.840.10008.5.1.4.1.1.481.2"

RT Dose Storage.

Definition at line 385 of file storage_scp.h.

Referenced by get_standard_storage_sop_classes().

◆ rt_image_storage_uid

std::string_view kcenon::pacs::services::rt_image_storage_uid
inlineconstexpr
Initial value:
=
"1.2.840.10008.5.1.4.1.1.481.1"

RT Image Storage.

Definition at line 381 of file storage_scp.h.

Referenced by get_standard_storage_sop_classes().

◆ rt_plan_storage_uid

std::string_view kcenon::pacs::services::rt_plan_storage_uid
inlineconstexpr
Initial value:
=
"1.2.840.10008.5.1.4.1.1.481.5"

RT Plan Storage.

Definition at line 393 of file storage_scp.h.

Referenced by get_standard_storage_sop_classes().

◆ rt_structure_set_storage_uid

std::string_view kcenon::pacs::services::rt_structure_set_storage_uid
inlineconstexpr
Initial value:
=
"1.2.840.10008.5.1.4.1.1.481.3"

RT Structure Set Storage.

Definition at line 389 of file storage_scp.h.

Referenced by get_standard_storage_sop_classes().

◆ secondary_capture_image_storage_uid

std::string_view kcenon::pacs::services::secondary_capture_image_storage_uid
inlineconstexpr
Initial value:
=
"1.2.840.10008.5.1.4.1.1.7"

Secondary Capture Image Storage.

Definition at line 377 of file storage_scp.h.

Referenced by get_standard_storage_sop_classes().

◆ storage_commitment_action_type_request

uint16_t kcenon::pacs::services::storage_commitment_action_type_request = 1
inlineconstexpr

◆ storage_commitment_event_type_failure

uint16_t kcenon::pacs::services::storage_commitment_event_type_failure = 2
inlineconstexpr

N-EVENT-REPORT: Storage Commitment Request Complete - Failures Exist (Event Type ID = 2)

Definition at line 53 of file storage_commitment_types.h.

Referenced by kcenon::pacs::services::storage_commitment_scp::send_event_report().

◆ storage_commitment_event_type_success

uint16_t kcenon::pacs::services::storage_commitment_event_type_success = 1
inlineconstexpr

N-EVENT-REPORT: Storage Commitment Request Successful (Event Type ID = 1)

Definition at line 50 of file storage_commitment_types.h.

Referenced by kcenon::pacs::services::storage_commitment_scp::send_event_report().

◆ storage_commitment_push_model_sop_class_uid

◆ storage_commitment_push_model_sop_instance_uid

std::string_view kcenon::pacs::services::storage_commitment_push_model_sop_instance_uid
inlineconstexpr

◆ study_root_find_sop_class_uid

◆ study_root_get_sop_class_uid

std::string_view kcenon::pacs::services::study_root_get_sop_class_uid
inlineconstexpr
Initial value:
=
"1.2.840.10008.5.1.4.1.2.2.3"

Study Root Query/Retrieve Information Model - GET.

Examples
get_scu/main.cpp, and retrieve_scu/main.cpp.

Definition at line 55 of file retrieve_scp.h.

Referenced by kcenon::pacs::client::job_manager::impl::execute_retrieve_job(), kcenon::pacs::services::retrieve_scu::get_get_sop_class_uid(), and kcenon::pacs::services::retrieve_scp::supported_sop_classes().

◆ study_root_move_sop_class_uid

std::string_view kcenon::pacs::services::study_root_move_sop_class_uid
inlineconstexpr

◆ ups_action_change_state

uint16_t kcenon::pacs::services::ups_action_change_state = 1
inlineconstexpr

N-ACTION Type 1: Change UPS State (PS3.4 CC.2.4)

Definition at line 42 of file ups_push_scp.h.

Referenced by kcenon::pacs::services::ups_push_scu::change_state(), and kcenon::pacs::services::ups_push_scp::handle_n_action().

◆ ups_action_request_cancel

uint16_t kcenon::pacs::services::ups_action_request_cancel = 3
inlineconstexpr

N-ACTION Type 3: Request Cancellation (PS3.4 CC.2.5)

Definition at line 45 of file ups_push_scp.h.

Referenced by kcenon::pacs::services::ups_push_scp::handle_n_action(), and kcenon::pacs::services::ups_push_scu::request_cancel().

◆ ups_event_cancel_requested

uint16_t kcenon::pacs::services::ups_event_cancel_requested = 2
inlineconstexpr

Event Type 2: UPS Cancel Requested — performer should stop processing.

Definition at line 64 of file ups_watch_scp.h.

Referenced by kcenon::pacs::services::ups_watch_scp::notify_cancel_requested(), and kcenon::pacs::services::ups_watch_scu::parse_event_dataset().

◆ ups_event_progress_report

uint16_t kcenon::pacs::services::ups_event_progress_report = 3
inlineconstexpr

Event Type 3: UPS Progress Report — progress percentage update.

Definition at line 67 of file ups_watch_scp.h.

Referenced by kcenon::pacs::services::ups_watch_scp::notify_progress(), and kcenon::pacs::services::ups_watch_scu::parse_event_dataset().

◆ ups_event_scp_status_change

uint16_t kcenon::pacs::services::ups_event_scp_status_change = 4
inlineconstexpr

Event Type 4: SCP Status Change — SCP going down/restarting.

Definition at line 70 of file ups_watch_scp.h.

◆ ups_event_state_report

uint16_t kcenon::pacs::services::ups_event_state_report = 1
inlineconstexpr

Event Type 1: UPS State Report — workitem state changed.

Definition at line 61 of file ups_watch_scp.h.

Referenced by kcenon::pacs::services::ups_watch_scp::notify_state_change(), and kcenon::pacs::services::ups_watch_scu::parse_event_dataset().

◆ ups_global_subscription_instance_uid

std::string_view kcenon::pacs::services::ups_global_subscription_instance_uid
inlineconstexpr

◆ ups_push_sop_class_uid

◆ ups_query_find_sop_class_uid

std::string_view kcenon::pacs::services::ups_query_find_sop_class_uid
inlineconstexpr
Initial value:
=
"1.2.840.10008.5.1.4.34.6.4"

UPS Query Information Model - FIND SOP Class UID (PS3.4 Table CC.2-1)

Definition at line 30 of file ups_query_scp.h.

Referenced by kcenon::pacs::services::ups_query_scp::handle_message(), kcenon::pacs::services::ups_query_scp::send_final_response(), kcenon::pacs::services::ups_query_scp::send_pending_response(), and kcenon::pacs::services::ups_query_scp::supported_sop_classes().

◆ ups_watch_action_subscribe

uint16_t kcenon::pacs::services::ups_watch_action_subscribe = 3
inlineconstexpr

N-ACTION Type 3: Subscribe to Receive UPS Event Reports (PS3.4 CC.2.3.3)

Definition at line 48 of file ups_watch_scp.h.

Referenced by kcenon::pacs::services::ups_watch_scp::handle_n_action(), kcenon::pacs::services::ups_watch_scp::handle_subscribe(), and kcenon::pacs::services::ups_watch_scu::subscribe().

◆ ups_watch_action_suspend_global

uint16_t kcenon::pacs::services::ups_watch_action_suspend_global = 5
inlineconstexpr

◆ ups_watch_action_unsubscribe

uint16_t kcenon::pacs::services::ups_watch_action_unsubscribe = 4
inlineconstexpr

N-ACTION Type 4: Unsubscribe from Receiving UPS Event Reports (PS3.4 CC.2.3.4)

Definition at line 51 of file ups_watch_scp.h.

Referenced by kcenon::pacs::services::ups_watch_scp::handle_n_action(), kcenon::pacs::services::ups_watch_scp::handle_unsubscribe(), and kcenon::pacs::services::ups_watch_scu::unsubscribe().

◆ ups_watch_sop_class_uid

std::string_view kcenon::pacs::services::ups_watch_sop_class_uid
inlineconstexpr
Initial value:
=
"1.2.840.10008.5.1.4.34.6.2"

UPS Watch SOP Class UID (PS3.4 Table CC.2-1)

Definition at line 31 of file ups_watch_scp.h.

Referenced by kcenon::pacs::services::ups_watch_scp::send_n_action_response(), kcenon::pacs::services::ups_watch_scu::send_watch_action(), and kcenon::pacs::services::ups_watch_scp::supported_sop_classes().

◆ us_image_storage_uid

std::string_view kcenon::pacs::services::us_image_storage_uid
inlineconstexpr
Initial value:
=
"1.2.840.10008.5.1.4.1.1.6.1"

US Image Storage.

Definition at line 373 of file storage_scp.h.

Referenced by get_standard_storage_sop_classes().

◆ verification_sop_class_uid

std::string_view kcenon::pacs::services::verification_sop_class_uid = "1.2.840.10008.1.1"
inlineconstexpr

◆ worklist_find_sop_class_uid