|
PACS System 0.1.0
PACS DICOM system library
|
#include <production_pacs.h>

Public Member Functions | |
| production_pacs (const production_config &config) | |
| Construct Production PACS with configuration. | |
| ~production_pacs () | |
| Destructor - ensures clean shutdown. | |
| production_pacs (const production_pacs &)=delete | |
| production_pacs & | operator= (const production_pacs &)=delete |
| production_pacs (production_pacs &&)=delete | |
| production_pacs & | operator= (production_pacs &&)=delete |
| bool | start () |
| Start the production PACS server. | |
| void | stop () |
| Stop the production PACS server. | |
| void | wait () |
| Block until server shutdown. | |
| bool | is_running () const noexcept |
| Check if server is running. | |
| void | on_image_received (std::function< void(const events::image_received_event &)> handler) |
| Register handler for image received events. | |
| void | on_query_executed (std::function< void(const events::query_executed_event &)> handler) |
| Register handler for query executed events. | |
| void | on_association_event (std::function< void(const events::association_event &)> handler) |
| Register handler for association events. | |
| void | on_access_denied (std::function< void(const events::access_denied_event &)> handler) |
| Register handler for access denied events. | |
| void | print_status () const |
| Print server status to stdout. | |
| const production_statistics & | statistics () const noexcept |
| Get current statistics. | |
| monitoring::health_status | get_health () const |
| Get health status. | |
| void | export_statistics (const std::filesystem::path &path) const |
| Export statistics to JSON file. | |
| const production_config & | config () const noexcept |
| Get the configuration. | |
Private Member Functions | |
| void | setup_mini_pacs () |
| void | setup_security () |
| void | setup_anonymization () |
| void | setup_rest_api () |
| void | setup_monitoring () |
| void | setup_event_handlers () |
| void | dispatch_image_received (const events::image_received_event &event) |
| void | dispatch_query_executed (const events::query_executed_event &event) |
| void | dispatch_association_event (const events::association_event &event) |
| void | dispatch_access_denied (const events::access_denied_event &event) |
Private Attributes | |
| production_config | config_ |
| production_statistics | stats_ |
| std::unique_ptr< mini_pacs > | pacs_ |
| std::shared_ptr< security::access_control_manager > | access_control_ |
| std::unique_ptr< security::anonymizer > | anonymizer_ |
| std::unique_ptr< web::rest_server > | rest_server_ |
| std::shared_ptr< monitoring::health_checker > | health_checker_ |
| std::shared_ptr< monitoring::pacs_metrics > | metrics_ |
| std::vector< std::function< void(const events::image_received_event &)> > | image_handlers_ |
| std::vector< std::function< void(const events::query_executed_event &)> > | query_handlers_ |
| std::vector< std::function< void(const events::association_event &)> > | association_handlers_ |
| std::vector< std::function< void(const events::access_denied_event &)> > | access_denied_handlers_ |
| std::mutex | handlers_mutex_ |
| std::mutex | shutdown_mutex_ |
| std::condition_variable | shutdown_cv_ |
| std::atomic< bool > | running_ {false} |
Definition at line 195 of file production_pacs.h.
|
explicit |
Construct Production PACS with configuration.
| config | Production configuration |
Definition at line 22 of file production_pacs.cpp.
References kcenon::pacs::samples::production_statistics::start_time, and stats_.
| kcenon::pacs::samples::production_pacs::~production_pacs | ( | ) |
Destructor - ensures clean shutdown.
Definition at line 27 of file production_pacs.cpp.
References running_, and stop().

|
delete |
|
delete |
|
nodiscardnoexcept |
Get the configuration.
Definition at line 225 of file production_pacs.cpp.
References config_.
|
private |
Definition at line 353 of file production_pacs.cpp.
References kcenon::pacs::samples::production_statistics::access_denied_count, access_denied_handlers_, handlers_mutex_, and stats_.
|
private |
Definition at line 342 of file production_pacs.cpp.
References association_handlers_, and handlers_mutex_.
|
private |
Definition at line 320 of file production_pacs.cpp.
References handlers_mutex_, and image_handlers_.
|
private |
Definition at line 331 of file production_pacs.cpp.
References handlers_mutex_, and query_handlers_.
| void kcenon::pacs::samples::production_pacs::export_statistics | ( | const std::filesystem::path & | path | ) | const |
Export statistics to JSON file.
| path | Output file path |
Definition at line 196 of file production_pacs.cpp.
References kcenon::pacs::samples::production_statistics::access_denied_count, kcenon::pacs::samples::production_statistics::active_associations, kcenon::pacs::samples::server_config::ae_title, config_, kcenon::pacs::samples::rest_api_config::enabled, kcenon::pacs::samples::tls_config::enabled, kcenon::pacs::samples::production_statistics::images_anonymized, kcenon::pacs::samples::production_statistics::images_stored, kcenon::pacs::samples::rest_api_config::port, kcenon::pacs::samples::server_config::port, kcenon::pacs::samples::production_statistics::queries_executed, kcenon::pacs::samples::production_config::rest_api, kcenon::pacs::samples::production_statistics::rest_requests, kcenon::pacs::samples::production_config::server, stats_, kcenon::pacs::samples::server_config::tls, and kcenon::pacs::samples::production_statistics::uptime().

|
nodiscard |
Get health status.
Definition at line 189 of file production_pacs.cpp.
References health_checker_.
|
nodiscardnoexcept |
Check if server is running.
Definition at line 101 of file production_pacs.cpp.
References running_.
| void kcenon::pacs::samples::production_pacs::on_access_denied | ( | std::function< void(const events::access_denied_event &)> | handler | ) |
Register handler for access denied events.
| handler | Callback function |
Definition at line 127 of file production_pacs.cpp.
References access_denied_handlers_, and handlers_mutex_.
| void kcenon::pacs::samples::production_pacs::on_association_event | ( | std::function< void(const events::association_event &)> | handler | ) |
Register handler for association events.
| handler | Callback function |
Definition at line 121 of file production_pacs.cpp.
References association_handlers_, and handlers_mutex_.
| void kcenon::pacs::samples::production_pacs::on_image_received | ( | std::function< void(const events::image_received_event &)> | handler | ) |
Register handler for image received events.
| handler | Callback function |
Definition at line 109 of file production_pacs.cpp.
References handlers_mutex_, and image_handlers_.
| void kcenon::pacs::samples::production_pacs::on_query_executed | ( | std::function< void(const events::query_executed_event &)> | handler | ) |
Register handler for query executed events.
| handler | Callback function |
Definition at line 115 of file production_pacs.cpp.
References handlers_mutex_, and query_handlers_.
|
delete |
|
delete |
| void kcenon::pacs::samples::production_pacs::print_status | ( | ) | const |
Print server status to stdout.
Definition at line 137 of file production_pacs.cpp.
References kcenon::pacs::samples::security_config::access_control, kcenon::pacs::samples::production_statistics::active_associations, kcenon::pacs::samples::server_config::ae_title, kcenon::pacs::samples::security_config::anonymization, kcenon::pacs::samples::anonymization_config::auto_anonymize, config_, kcenon::pacs::samples::access_control_config::enabled, kcenon::pacs::samples::rest_api_config::enabled, kcenon::pacs::samples::tls_config::enabled, kcenon::pacs::samples::production_statistics::images_stored, kcenon::pacs::samples::rest_api_config::port, kcenon::pacs::samples::server_config::port, kcenon::pacs::samples::production_statistics::queries_executed, kcenon::pacs::samples::production_config::rest_api, kcenon::pacs::samples::production_config::security, kcenon::pacs::samples::production_config::server, stats_, kcenon::pacs::samples::server_config::tls, and kcenon::pacs::samples::production_statistics::uptime().

|
private |
Definition at line 260 of file production_pacs.cpp.
References kcenon::pacs::samples::security_config::anonymization, anonymizer_, kcenon::pacs::samples::anonymization_config::auto_anonymize, config_, kcenon::pacs::samples::anonymization_config::profile, and kcenon::pacs::samples::production_config::security.
Referenced by start().

|
private |
Definition at line 310 of file production_pacs.cpp.
Referenced by start().

|
private |
Definition at line 233 of file production_pacs.cpp.
References kcenon::pacs::samples::mini_pacs_config::ae_title, kcenon::pacs::samples::server_config::ae_title, config_, kcenon::pacs::samples::mini_pacs_config::enable_mpps, kcenon::pacs::samples::mini_pacs_config::enable_worklist, kcenon::pacs::samples::logging_config::level, kcenon::pacs::samples::production_config::logging, kcenon::pacs::samples::mini_pacs_config::max_associations, kcenon::pacs::samples::server_config::max_associations, pacs_, kcenon::pacs::samples::mini_pacs_config::port, kcenon::pacs::samples::server_config::port, kcenon::pacs::samples::storage_config::root_path, kcenon::pacs::samples::production_config::server, kcenon::pacs::samples::production_config::storage, kcenon::pacs::samples::mini_pacs_config::storage_path, and kcenon::pacs::samples::mini_pacs_config::verbose_logging.
Referenced by start().

|
private |
Definition at line 293 of file production_pacs.cpp.
References kcenon::pacs::monitoring::health_checker_config::cache_duration, kcenon::pacs::monitoring::health_checker_config::check_interval, config_, kcenon::pacs::samples::monitoring_config::health_check_interval, health_checker_, metrics_, kcenon::pacs::samples::monitoring_config::metrics_enabled, kcenon::pacs::samples::production_config::monitoring, kcenon::pacs::monitoring::health_checker_config::storage_critical_threshold, and kcenon::pacs::monitoring::health_checker_config::storage_warning_threshold.
Referenced by start().

|
private |
Definition at line 269 of file production_pacs.cpp.
References access_control_, kcenon::pacs::web::rest_server_config::concurrency, config_, kcenon::pacs::samples::rest_api_config::cors_enabled, kcenon::pacs::web::rest_server_config::enable_cors, kcenon::pacs::samples::rest_api_config::enabled, health_checker_, metrics_, kcenon::pacs::samples::rest_api_config::port, kcenon::pacs::web::rest_server_config::port, kcenon::pacs::samples::production_config::rest_api, and rest_server_.
Referenced by start().

|
private |
Definition at line 246 of file production_pacs.cpp.
References kcenon::pacs::samples::security_config::access_control, access_control_, kcenon::pacs::samples::security_config::allowed_ae_titles, config_, kcenon::pacs::samples::access_control_config::enabled, and kcenon::pacs::samples::production_config::security.
Referenced by start().

|
nodiscard |
Start the production PACS server.
Definition at line 37 of file production_pacs.cpp.
References config_, kcenon::pacs::samples::rest_api_config::enabled, pacs_, kcenon::pacs::samples::production_config::rest_api, rest_server_, running_, setup_anonymization(), setup_event_handlers(), setup_mini_pacs(), setup_monitoring(), setup_rest_api(), and setup_security().

|
nodiscardnoexcept |
Get current statistics.
Definition at line 185 of file production_pacs.cpp.
References stats_.
| void kcenon::pacs::samples::production_pacs::stop | ( | ) |
Stop the production PACS server.
Definition at line 71 of file production_pacs.cpp.
References pacs_, rest_server_, running_, and shutdown_cv_.
Referenced by ~production_pacs().

| void kcenon::pacs::samples::production_pacs::wait | ( | ) |
Block until server shutdown.
Definition at line 92 of file production_pacs.cpp.
References running_, shutdown_cv_, and shutdown_mutex_.
|
private |
Definition at line 341 of file production_pacs.h.
Referenced by setup_rest_api(), and setup_security().
|
private |
Definition at line 355 of file production_pacs.h.
Referenced by dispatch_access_denied(), and on_access_denied().
|
private |
Definition at line 342 of file production_pacs.h.
Referenced by setup_anonymization().
|
private |
Definition at line 354 of file production_pacs.h.
Referenced by dispatch_association_event(), and on_association_event().
|
private |
Definition at line 334 of file production_pacs.h.
Referenced by config(), export_statistics(), print_status(), setup_anonymization(), setup_mini_pacs(), setup_monitoring(), setup_rest_api(), setup_security(), and start().
|
mutableprivate |
Definition at line 358 of file production_pacs.h.
Referenced by dispatch_access_denied(), dispatch_association_event(), dispatch_image_received(), dispatch_query_executed(), on_access_denied(), on_association_event(), on_image_received(), and on_query_executed().
|
private |
Definition at line 348 of file production_pacs.h.
Referenced by get_health(), setup_monitoring(), and setup_rest_api().
|
private |
Definition at line 352 of file production_pacs.h.
Referenced by dispatch_image_received(), and on_image_received().
|
private |
Definition at line 349 of file production_pacs.h.
Referenced by setup_monitoring(), and setup_rest_api().
|
private |
Definition at line 338 of file production_pacs.h.
Referenced by setup_mini_pacs(), start(), and stop().
|
private |
Definition at line 353 of file production_pacs.h.
Referenced by dispatch_query_executed(), and on_query_executed().
|
private |
Definition at line 345 of file production_pacs.h.
Referenced by setup_rest_api(), start(), and stop().
|
private |
Definition at line 361 of file production_pacs.h.
Referenced by is_running(), start(), stop(), wait(), and ~production_pacs().
|
private |
Definition at line 360 of file production_pacs.h.
|
private |
Definition at line 359 of file production_pacs.h.
Referenced by wait().
|
private |
Definition at line 335 of file production_pacs.h.
Referenced by dispatch_access_denied(), export_statistics(), print_status(), production_pacs(), and statistics().