PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
kcenon::pacs::client::job_record Struct Reference

Complete job record with all metadata. More...

#include <job_types.h>

Collaboration diagram for kcenon::pacs::client::job_record:
Collaboration graph

Public Member Functions

bool is_finished () const noexcept
 Check if job is in a terminal state.
 
bool can_start () const noexcept
 Check if job can be started.
 
bool can_cancel () const noexcept
 Check if job can be cancelled.
 
bool can_pause () const noexcept
 Check if job can be paused.
 
bool can_retry () const noexcept
 Check if job can be retried.
 
std::chrono::milliseconds duration () const noexcept
 Get job duration.
 

Public Attributes

std::string job_id
 Unique job identifier (UUID)
 
job_type type
 Type of operation.
 
job_status status {job_status::pending}
 Current status.
 
job_priority priority {job_priority::normal}
 Execution priority.
 
std::string source_node_id
 Source remote node ID.
 
std::string destination_node_id
 Destination remote node ID.
 
std::optional< std::string > patient_id
 Patient ID filter.
 
std::optional< std::string > study_uid
 Study Instance UID.
 
std::optional< std::string > series_uid
 Series Instance UID.
 
std::optional< std::string > sop_instance_uid
 Single SOP Instance UID.
 
std::vector< std::string > instance_uids
 Batch operation UIDs.
 
job_progress progress
 Current progress.
 
std::chrono::system_clock::time_point created_at
 Job creation time.
 
std::optional< std::chrono::system_clock::time_point > queued_at
 Time added to queue.
 
std::optional< std::chrono::system_clock::time_point > started_at
 Execution start time.
 
std::optional< std::chrono::system_clock::time_point > completed_at
 Completion time.
 
std::string error_message
 Error message if failed.
 
std::string error_details
 Detailed error information.
 
int retry_count {0}
 Number of retry attempts.
 
int max_retries {3}
 Maximum retry attempts.
 
std::string created_by
 User ID who created the job.
 
std::unordered_map< std::string, std::string > metadata
 Custom key-value pairs.
 
int64_t pk {0}
 Primary key (0 if not persisted)
 

Detailed Description

Complete job record with all metadata.

Contains all information about a job including its configuration, progress, timing, and error information.

Definition at line 255 of file job_types.h.

Member Function Documentation

◆ can_cancel()

bool kcenon::pacs::client::job_record::can_cancel ( ) const
inlinenodiscardnoexcept

Check if job can be cancelled.

Definition at line 342 of file job_types.h.

342 {
343 return !is_terminal_status(status);
344 }
constexpr bool is_terminal_status(job_status status) noexcept
Check if job status is a terminal state.
Definition job_types.h:139
job_status status
Current status.
Definition job_types.h:262

References kcenon::pacs::client::is_terminal_status(), and status.

Here is the call graph for this function:

◆ can_pause()

bool kcenon::pacs::client::job_record::can_pause ( ) const
inlinenodiscardnoexcept

Check if job can be paused.

Definition at line 349 of file job_types.h.

349 {
350 return status == job_status::running ||
352 }
@ running
Job is currently executing.
@ queued
Job is in the execution queue.

References kcenon::pacs::client::queued, kcenon::pacs::client::running, and status.

◆ can_retry()

bool kcenon::pacs::client::job_record::can_retry ( ) const
inlinenodiscardnoexcept

Check if job can be retried.

Definition at line 357 of file job_types.h.

357 {
359 }
@ failed
Job failed with error.
int retry_count
Number of retry attempts.
Definition job_types.h:303
int max_retries
Maximum retry attempts.
Definition job_types.h:304

References kcenon::pacs::client::failed, max_retries, retry_count, and status.

◆ can_start()

bool kcenon::pacs::client::job_record::can_start ( ) const
inlinenodiscardnoexcept

Check if job can be started.

Definition at line 333 of file job_types.h.

333 {
334 return status == job_status::pending ||
337 }
@ pending
Job created but not yet queued.

References kcenon::pacs::client::paused, kcenon::pacs::client::pending, kcenon::pacs::client::queued, and status.

◆ duration()

std::chrono::milliseconds kcenon::pacs::client::job_record::duration ( ) const
inlinenodiscardnoexcept

Get job duration.

Returns
Duration from start to completion (or now if still running)

Definition at line 365 of file job_types.h.

365 {
366 if (!started_at.has_value()) {
367 return std::chrono::milliseconds{0};
368 }
369 auto end_time = completed_at.value_or(std::chrono::system_clock::now());
370 return std::chrono::duration_cast<std::chrono::milliseconds>(
371 end_time - started_at.value());
372 }
std::optional< std::chrono::system_clock::time_point > completed_at
Completion time.
Definition job_types.h:295
std::optional< std::chrono::system_clock::time_point > started_at
Execution start time.
Definition job_types.h:294

References completed_at, and started_at.

◆ is_finished()

bool kcenon::pacs::client::job_record::is_finished ( ) const
inlinenodiscardnoexcept

Check if job is in a terminal state.

Definition at line 326 of file job_types.h.

326 {
328 }

References kcenon::pacs::client::is_terminal_status(), and status.

Here is the call graph for this function:

Member Data Documentation

◆ completed_at

std::optional<std::chrono::system_clock::time_point> kcenon::pacs::client::job_record::completed_at

Completion time.

Definition at line 295 of file job_types.h.

Referenced by duration().

◆ created_at

std::chrono::system_clock::time_point kcenon::pacs::client::job_record::created_at

Job creation time.

Definition at line 292 of file job_types.h.

◆ created_by

std::string kcenon::pacs::client::job_record::created_by

User ID who created the job.

Definition at line 310 of file job_types.h.

◆ destination_node_id

std::string kcenon::pacs::client::job_record::destination_node_id

Destination remote node ID.

Definition at line 270 of file job_types.h.

◆ error_details

std::string kcenon::pacs::client::job_record::error_details

Detailed error information.

Definition at line 302 of file job_types.h.

◆ error_message

std::string kcenon::pacs::client::job_record::error_message

Error message if failed.

Definition at line 301 of file job_types.h.

◆ instance_uids

std::vector<std::string> kcenon::pacs::client::job_record::instance_uids

Batch operation UIDs.

Definition at line 280 of file job_types.h.

◆ job_id

std::string kcenon::pacs::client::job_record::job_id

Unique job identifier (UUID)

Definition at line 260 of file job_types.h.

◆ max_retries

int kcenon::pacs::client::job_record::max_retries {3}

Maximum retry attempts.

Definition at line 304 of file job_types.h.

304{3};

Referenced by can_retry().

◆ metadata

std::unordered_map<std::string, std::string> kcenon::pacs::client::job_record::metadata

Custom key-value pairs.

Definition at line 311 of file job_types.h.

◆ patient_id

std::optional<std::string> kcenon::pacs::client::job_record::patient_id

Patient ID filter.

Definition at line 276 of file job_types.h.

◆ pk

int64_t kcenon::pacs::client::job_record::pk {0}

Primary key (0 if not persisted)

Definition at line 317 of file job_types.h.

317{0};

◆ priority

job_priority kcenon::pacs::client::job_record::priority {job_priority::normal}

Execution priority.

Definition at line 263 of file job_types.h.

◆ progress

job_progress kcenon::pacs::client::job_record::progress

Current progress.

Definition at line 286 of file job_types.h.

◆ queued_at

std::optional<std::chrono::system_clock::time_point> kcenon::pacs::client::job_record::queued_at

Time added to queue.

Definition at line 293 of file job_types.h.

◆ retry_count

int kcenon::pacs::client::job_record::retry_count {0}

Number of retry attempts.

Definition at line 303 of file job_types.h.

303{0};

Referenced by can_retry().

◆ series_uid

std::optional<std::string> kcenon::pacs::client::job_record::series_uid

Series Instance UID.

Definition at line 278 of file job_types.h.

◆ sop_instance_uid

std::optional<std::string> kcenon::pacs::client::job_record::sop_instance_uid

Single SOP Instance UID.

Definition at line 279 of file job_types.h.

◆ source_node_id

std::string kcenon::pacs::client::job_record::source_node_id

Source remote node ID.

Definition at line 269 of file job_types.h.

◆ started_at

std::optional<std::chrono::system_clock::time_point> kcenon::pacs::client::job_record::started_at

Execution start time.

Definition at line 294 of file job_types.h.

Referenced by duration().

◆ status

job_status kcenon::pacs::client::job_record::status {job_status::pending}

Current status.

Definition at line 262 of file job_types.h.

Referenced by can_cancel(), can_pause(), can_retry(), can_start(), and is_finished().

◆ study_uid

std::optional<std::string> kcenon::pacs::client::job_record::study_uid

Study Instance UID.

Definition at line 277 of file job_types.h.

◆ type

job_type kcenon::pacs::client::job_record::type

Type of operation.

Definition at line 261 of file job_types.h.


The documentation for this struct was generated from the following file: