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

Namespaces

namespace  lock_error
 Error codes for lock operations.
 

Classes

struct  archive_config
 Configuration for archive scheduling. More...
 
class  auto_prefetch_service
 
struct  cleanup_config
 Configuration for cleanup scheduling. More...
 
struct  cron_schedule
 Cron-like schedule expression. More...
 
struct  interval_schedule
 Simple interval-based schedule. More...
 
struct  lock_info
 Detailed information about a lock on a study. More...
 
struct  lock_manager_stats
 Statistics for lock manager operations. More...
 
struct  lock_token
 Unique identifier for a lock. More...
 
struct  one_time_schedule
 One-time execution at specific time. More...
 
struct  prefetch_criteria
 Prefetch selection criteria. More...
 
struct  prefetch_request
 Prefetch request for a single patient. More...
 
struct  prefetch_result
 Prefetch result statistics. More...
 
struct  prefetch_service_config
 Configuration for the auto prefetch service. More...
 
struct  prior_study_info
 Prior study information. More...
 
struct  remote_pacs_config
 Remote PACS connection configuration. More...
 
class  Result
 
struct  scheduled_task
 Scheduled task definition. More...
 
struct  scheduler_stats
 Statistics for task scheduler operations. More...
 
class  study_lock_manager
 Manages locks on DICOM studies for concurrent access control. More...
 
struct  study_lock_manager_config
 Configuration for the study lock manager. More...
 
struct  task_execution_record
 Record of a single task execution. More...
 
class  task_scheduler
 
struct  task_scheduler_config
 Configuration for the task scheduler service. More...
 
struct  verification_config
 Configuration for verification scheduling. More...
 

Typedefs

using schedule = std::variant<interval_schedule, cron_schedule, one_time_schedule>
 Combined schedule type.
 
using task_id = std::string
 Unique task identifier.
 
using task_callback = std::function<bool()>
 Task callback function type.
 
using task_callback_with_result = std::function<std::optional<std::string>()>
 Task callback with result details.
 

Enumerations

enum class  lock_type { exclusive , shared , migration }
 Type of lock to acquire on a study. More...
 
enum class  task_type { cleanup , archive , verification , custom }
 Task type enumeration. More...
 
enum class  task_state {
  pending , running , completed , failed ,
  cancelled , paused
}
 Task execution state. More...
 
enum class  archive_destination_type {
  local_path , network_share , cloud_s3 , cloud_azure ,
  tape
}
 Archive destination type. More...
 

Functions

auto to_string (lock_type type) -> std::string
 Convert lock_type to string.
 
auto parse_lock_type (const std::string &str) -> std::optional< lock_type >
 Parse lock_type from string.
 
auto to_string (task_state state) -> std::string
 Convert task_state to string.
 
auto to_string (task_type type) -> std::string
 Convert task_type to string.
 

Typedef Documentation

◆ schedule

Combined schedule type.

Definition at line 149 of file task_scheduler_config.h.

◆ task_callback

using kcenon::pacs::workflow::task_callback = std::function<bool()>

Task callback function type.

Returns
true if task completed successfully, false otherwise

Definition at line 262 of file task_scheduler_config.h.

◆ task_callback_with_result

using kcenon::pacs::workflow::task_callback_with_result = std::function<std::optional<std::string>()>

Task callback with result details.

Returns
Optional error message (nullopt = success)

Definition at line 269 of file task_scheduler_config.h.

◆ task_id

using kcenon::pacs::workflow::task_id = std::string

Unique task identifier.

Definition at line 255 of file task_scheduler_config.h.

Enumeration Type Documentation

◆ archive_destination_type

Archive destination type.

Enumerator
local_path 

Local filesystem path.

network_share 

Network share (SMB/NFS)

cloud_s3 

AWS S3 or compatible.

cloud_azure 

Azure Blob Storage.

tape 

Tape library.

Definition at line 390 of file task_scheduler_config.h.

◆ lock_type

Type of lock to acquire on a study.

Enumerator
exclusive 

No other access allowed (for modifications)

shared 

Read-only access allowed (for read operations)

migration 

Special lock for migration operations (highest priority)

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/workflow/study_lock_manager.h.

Definition at line 49 of file study_lock_manager.h.

49 {
50 exclusive,
51 shared,
53};
@ shared
Read-only access allowed (for read operations)
@ exclusive
No other access allowed (for modifications)
@ migration
Special lock for migration operations (highest priority)

◆ task_state

Task execution state.

Enumerator
pending 

Waiting for scheduled time.

running 

Currently executing.

completed 

Completed successfully.

failed 

Execution failed.

cancelled 

Cancelled by user.

paused 

Temporarily paused.

Definition at line 168 of file task_scheduler_config.h.

168 {
169 pending,
170 running,
171 completed,
172 failed,
173 cancelled,
174 paused
175};

◆ task_type

Task type enumeration.

Enumerator
cleanup 

Storage cleanup task.

archive 

Study archival task.

verification 

Data integrity verification.

custom 

User-defined task.

Definition at line 158 of file task_scheduler_config.h.

158 {
159 cleanup,
160 archive,
161 verification,
162 custom
163};
@ archive
Study archival task.
@ cleanup
Storage cleanup task.

Function Documentation

◆ parse_lock_type()

auto kcenon::pacs::workflow::parse_lock_type ( const std::string & str) -> std::optional<lock_type>
inlinenodiscard

Parse lock_type from string.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/workflow/study_lock_manager.h.

Definition at line 70 of file study_lock_manager.h.

71 {
72 if (str == "exclusive") return lock_type::exclusive;
73 if (str == "shared") return lock_type::shared;
74 if (str == "migration") return lock_type::migration;
75 return std::nullopt;
76}

References exclusive, migration, and shared.

◆ to_string() [1/3]

auto kcenon::pacs::workflow::to_string ( lock_type type) -> std::string
inlinenodiscard

Convert lock_type to string.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/workflow/study_lock_manager.h.

Definition at line 58 of file study_lock_manager.h.

58 {
59 switch (type) {
60 case lock_type::exclusive: return "exclusive";
61 case lock_type::shared: return "shared";
62 case lock_type::migration: return "migration";
63 default: return "unknown";
64 }
65}

References exclusive, migration, and shared.

Referenced by kcenon::pacs::workflow::study_lock_manager::lock(), and kcenon::pacs::workflow::task_scheduler::serialize_tasks().

Here is the caller graph for this function:

◆ to_string() [2/3]

auto kcenon::pacs::workflow::to_string ( task_state state) -> std::string
inlinenodiscard

Convert task_state to string.

Definition at line 180 of file task_scheduler_config.h.

180 {
181 switch (state) {
182 case task_state::pending: return "pending";
183 case task_state::running: return "running";
184 case task_state::completed: return "completed";
185 case task_state::failed: return "failed";
186 case task_state::cancelled: return "cancelled";
187 case task_state::paused: return "paused";
188 default: return "unknown";
189 }
190}

References cancelled, completed, failed, paused, pending, and running.

◆ to_string() [3/3]

auto kcenon::pacs::workflow::to_string ( task_type type) -> std::string
inlinenodiscard

Convert task_type to string.

Definition at line 195 of file task_scheduler_config.h.

195 {
196 switch (type) {
197 case task_type::cleanup: return "cleanup";
198 case task_type::archive: return "archive";
199 case task_type::verification: return "verification";
200 case task_type::custom: return "custom";
201 default: return "unknown";
202 }
203}

References archive, cleanup, custom, and verification.