71 default:
return "unknown";
81 std::string_view str)
noexcept {
124 bool case_sens =
false,
bool neg =
false)
160 std::chrono::minutes del = std::chrono::minutes{0})
235 auto now = std::chrono::system_clock::now();
261 const std::string& rule_id,
262 const std::string& instance_uid,
263 const std::vector<routing_action>& triggered_actions)>;
Job types and structures for asynchronous DICOM operations.
routing_field
DICOM field to match in routing conditions.
@ series_description
(0008,103E) Series Description
@ department
(0008,1040) Institutional Department Name
@ body_part
(0018,0015) Body Part Examined
@ study_description
(0008,1030) Study Description
@ modality
(0008,0060) Modality - CT, MR, US, etc.
@ sop_class_uid
(0008,0016) SOP Class UID
@ institution
(0008,0080) Institution Name
@ station_ae
(0008,1010) Station Name or calling AE
@ patient_id_pattern
(0010,0020) Patient ID (pattern matching)
@ referring_physician
(0008,0090) Referring Physician's Name
job_priority
Priority level for job execution.
@ normal
Standard priority.
constexpr const char * to_string(job_type type) noexcept
Convert job_type to string representation.
std::function< void( const std::string &rule_id, const std::string &instance_uid, const std::vector< routing_action > &triggered_actions)> routing_event_callback
Callback type for routing events.
routing_field routing_field_from_string(std::string_view str) noexcept
Parse routing_field from string.
Action to perform when a routing rule matches.
std::string destination_node_id
Target remote node ID.
std::chrono::minutes delay
Delay before forwarding.
bool notify_on_failure
Generate notification on failure.
job_priority priority
Job priority for forwarding.
routing_action(std::string dest_node_id, job_priority prio=job_priority::normal, std::chrono::minutes del=std::chrono::minutes{0})
Construct with destination.
bool delete_after_send
Delete local copy after successful send.
routing_action()=default
Default constructor.
A single condition for routing rule evaluation.
std::string pattern
Pattern to match (supports wildcards: *, ?)
routing_field match_field
The DICOM field to match.
routing_condition()=default
Default constructor.
bool negate
Invert the match result.
routing_condition(routing_field field, std::string pat, bool case_sens=false, bool neg=false)
Construct with field and pattern.
bool case_sensitive
Whether matching is case-sensitive.
Configuration for the routing manager.
std::chrono::seconds evaluation_timeout
Timeout for rule evaluation.
size_t max_rules
Maximum number of rules.
bool enabled
Enable routing globally.
A complete routing rule with conditions and actions.
size_t success_count
Successful forwarding count.
std::string name
Human-readable name.
std::optional< std::string > schedule_cron
Cron expression for scheduling.
std::optional< std::chrono::system_clock::time_point > effective_until
std::optional< std::chrono::system_clock::time_point > effective_from
std::chrono::system_clock::time_point updated_at
std::string rule_id
Unique rule identifier.
bool enabled
Whether the rule is active.
std::chrono::system_clock::time_point created_at
std::vector< routing_condition > conditions
Conditions (AND logic)
std::chrono::system_clock::time_point last_triggered
std::string description
Detailed description.
size_t triggered_count
Number of times the rule was triggered.
int64_t pk
Primary key (0 if not persisted)
size_t failure_count
Failed forwarding count.
std::vector< routing_action > actions
Actions to execute on match.
bool is_effective_now() const noexcept
Check if the rule is currently effective based on schedule.
int priority
Evaluation priority (higher = first)
Statistics for routing operations.
size_t total_matched
Total instances that matched a rule.
size_t total_evaluated
Total instances evaluated.
size_t total_failed
Total failed forwards.
size_t total_forwarded
Total successful forwards.
Result of testing rules against a dataset (dry run)
std::string matched_rule_id
ID of the matched rule.
bool matched
Whether any rule matched.
std::vector< routing_action > actions
Actions that would execute.