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

Public Member Functions | |
| worklist_scu (std::shared_ptr< di::ILogger > logger=nullptr) | |
| Construct a Worklist SCU with default configuration. | |
| worklist_scu (const worklist_scu_config &config, std::shared_ptr< di::ILogger > logger=nullptr) | |
| Construct a Worklist SCU with custom configuration. | |
| ~worklist_scu ()=default | |
| worklist_scu (const worklist_scu &)=delete | |
| worklist_scu & | operator= (const worklist_scu &)=delete |
| worklist_scu (worklist_scu &&)=delete | |
| worklist_scu & | operator= (worklist_scu &&)=delete |
| network::Result< worklist_result > | query (network::association &assoc, const worklist_query_keys &keys) |
| Perform a MWL C-FIND query with typed keys. | |
| network::Result< worklist_result > | query (network::association &assoc, const core::dicom_dataset &query_keys) |
| Perform a MWL C-FIND query with raw dataset. | |
| network::Result< worklist_result > | query_today (network::association &assoc, std::string_view station_ae, std::string_view modality="") |
| Query today's worklist for a station. | |
| network::Result< worklist_result > | query_date_range (network::association &assoc, std::string_view start_date, std::string_view end_date, std::string_view modality="") |
| Query worklist by date range. | |
| network::Result< worklist_result > | query_patient (network::association &assoc, std::string_view patient_id) |
| Query worklist by patient ID. | |
| network::Result< size_t > | query_streaming (network::association &assoc, const worklist_query_keys &keys, worklist_streaming_callback callback) |
| Perform a streaming MWL query for large worklists. | |
| network::Result< std::monostate > | cancel (network::association &assoc, uint16_t message_id) |
| Send a C-CANCEL request to stop an ongoing query. | |
| void | set_config (const worklist_scu_config &config) |
| Update the SCU configuration. | |
| const worklist_scu_config & | config () const noexcept |
| Get the current configuration. | |
| size_t | queries_performed () const noexcept |
| Get the number of queries performed since construction. | |
| size_t | total_items () const noexcept |
| Get the total number of items received since construction. | |
| void | reset_statistics () noexcept |
| Reset statistics counters to zero. | |
Private Member Functions | |
| worklist_item | parse_worklist_item (const core::dicom_dataset &ds) const |
| Parse a worklist item from a response dataset. | |
| core::dicom_dataset | build_query_dataset (const worklist_query_keys &keys) const |
| Build query dataset from typed keys. | |
| uint16_t | next_message_id () noexcept |
| Get the next message ID for DIMSE operations. | |
| network::Result< worklist_result > | query_impl (network::association &assoc, const core::dicom_dataset &query_keys, uint16_t message_id) |
| Internal query implementation. | |
Static Private Member Functions | |
| static std::string | get_today_date () |
| Get today's date in DICOM format (YYYYMMDD) | |
Private Attributes | |
| std::shared_ptr< di::ILogger > | logger_ |
| Logger instance for service logging. | |
| worklist_scu_config | config_ |
| Configuration. | |
| std::atomic< uint16_t > | message_id_counter_ {1} |
| Message ID counter. | |
| std::atomic< size_t > | queries_performed_ {0} |
| Statistics: number of queries performed. | |
| std::atomic< size_t > | total_items_ {0} |
| Statistics: total number of items received. | |
Definition at line 357 of file worklist_scu.h.
|
explicit |
Construct a Worklist SCU with default configuration.
| logger | Logger instance for service logging (nullptr uses null_logger) |
Definition at line 31 of file worklist_scu.cpp.
|
explicit |
Construct a Worklist SCU with custom configuration.
| config | Configuration options |
| logger | Logger instance for service logging (nullptr uses null_logger) |
Definition at line 34 of file worklist_scu.cpp.
|
default |
|
delete |
|
delete |
|
nodiscardprivate |
Build query dataset from typed keys.
Definition at line 441 of file worklist_scu.cpp.
References kcenon::pacs::core::tags::accession_number, kcenon::pacs::services::worklist_query_keys::accession_number, kcenon::pacs::services::worklist_query_keys::institution, kcenon::pacs::core::tags::institution_name, kcenon::pacs::core::tags::modality, kcenon::pacs::services::worklist_query_keys::modality, kcenon::pacs::core::tags::patient_birth_date, kcenon::pacs::services::worklist_query_keys::patient_birth_date, kcenon::pacs::core::tags::patient_id, kcenon::pacs::services::worklist_query_keys::patient_id, kcenon::pacs::core::tags::patient_name, kcenon::pacs::services::worklist_query_keys::patient_name, kcenon::pacs::core::tags::patient_sex, kcenon::pacs::services::worklist_query_keys::patient_sex, kcenon::pacs::services::worklist_query_keys::referring_physician, kcenon::pacs::core::tags::referring_physician_name, kcenon::pacs::services::worklist_query_keys::requested_procedure_description, kcenon::pacs::core::tags::requested_procedure_id, kcenon::pacs::services::worklist_query_keys::requested_procedure_id, kcenon::pacs::services::worklist_query_keys::scheduled_date, kcenon::pacs::core::tags::scheduled_performing_physician_name, kcenon::pacs::services::worklist_query_keys::scheduled_physician, kcenon::pacs::core::tags::scheduled_procedure_step_description, kcenon::pacs::core::tags::scheduled_procedure_step_id, kcenon::pacs::services::worklist_query_keys::scheduled_procedure_step_id, kcenon::pacs::core::tags::scheduled_procedure_step_location, kcenon::pacs::core::tags::scheduled_procedure_step_start_date, kcenon::pacs::core::tags::scheduled_procedure_step_start_time, kcenon::pacs::services::worklist_query_keys::scheduled_station_ae, kcenon::pacs::core::tags::scheduled_station_ae_title, kcenon::pacs::core::tags::scheduled_station_name, kcenon::pacs::services::worklist_query_keys::scheduled_time, kcenon::pacs::core::tags::study_description, and kcenon::pacs::core::tags::study_instance_uid.
Referenced by query(), and query_streaming().

|
nodiscard |
Send a C-CANCEL request to stop an ongoing query.
| assoc | The association on which the query is running |
| message_id | The message ID of the query to cancel |
Definition at line 335 of file worklist_scu.cpp.
References kcenon::pacs::network::association::accepted_context_id(), kcenon::pacs::error_codes::no_acceptable_context, kcenon::pacs::pacs_error(), kcenon::pacs::network::association::send_dimse(), and kcenon::pacs::services::worklist_find_sop_class_uid.
Referenced by query_impl(), and query_streaming().


|
nodiscardnoexcept |
Get the current configuration.
Definition at line 361 of file worklist_scu.cpp.
References config_.
Referenced by set_config().

|
staticnodiscardprivate |
Get today's date in DICOM format (YYYYMMDD)
Definition at line 395 of file worklist_scu.cpp.
Referenced by query_today().

|
nodiscardprivatenoexcept |
Get the next message ID for DIMSE operations.
Definition at line 386 of file worklist_scu.cpp.
References message_id_counter_.
Referenced by query(), and query_streaming().

|
delete |
|
delete |
|
nodiscardprivate |
Parse a worklist item from a response dataset.
Definition at line 403 of file worklist_scu.cpp.
References kcenon::pacs::core::tags::accession_number, kcenon::pacs::core::dicom_dataset::get_string(), kcenon::pacs::core::tags::institution_name, kcenon::pacs::core::tags::modality, kcenon::pacs::core::tags::patient_birth_date, kcenon::pacs::core::tags::patient_id, kcenon::pacs::core::tags::patient_name, kcenon::pacs::core::tags::patient_sex, kcenon::pacs::core::tags::referring_physician_name, kcenon::pacs::core::tags::requested_procedure_id, kcenon::pacs::core::tags::scheduled_procedure_step_description, kcenon::pacs::core::tags::scheduled_procedure_step_id, kcenon::pacs::core::tags::scheduled_procedure_step_start_date, kcenon::pacs::core::tags::scheduled_procedure_step_start_time, kcenon::pacs::core::tags::scheduled_station_ae_title, kcenon::pacs::core::tags::study_description, and kcenon::pacs::core::tags::study_instance_uid.
Referenced by query_impl(), and query_streaming().


|
nodiscardnoexcept |
Get the number of queries performed since construction.
Definition at line 369 of file worklist_scu.cpp.
References queries_performed_.
|
nodiscard |
Perform a MWL C-FIND query with raw dataset.
Sends a C-FIND request with the provided raw query dataset. Use this when you need full control over the query attributes.
| assoc | The established association to use |
| query_keys | The DICOM dataset containing query keys |
Definition at line 50 of file worklist_scu.cpp.
References next_message_id(), and query_impl().

|
nodiscard |
Perform a MWL C-FIND query with typed keys.
Sends a C-FIND request with the provided query keys and collects all matching worklist items from the SCP.
| assoc | The established association to use |
| keys | The typed query keys for filtering |
Definition at line 42 of file worklist_scu.cpp.
References build_query_dataset(), and query().
Referenced by query(), query_date_range(), query_patient(), and query_today().


|
nodiscard |
Query worklist by date range.
Query scheduled procedures within a date range, optionally filtered by modality.
| assoc | The established association to use |
| start_date | Start date in YYYYMMDD format |
| end_date | End date in YYYYMMDD format |
| modality | Modality filter (empty = any) |
Definition at line 192 of file worklist_scu.cpp.
References kcenon::pacs::services::worklist_query_keys::modality, query(), and kcenon::pacs::services::worklist_query_keys::scheduled_date.

|
nodiscardprivate |
Internal query implementation.
Definition at line 57 of file worklist_scu.cpp.
References kcenon::pacs::network::association::accepted_context_id(), kcenon::pacs::error_codes::association_not_established, cancel(), kcenon::pacs::services::worklist_scu_config::cancel_on_max, config_, kcenon::pacs::services::worklist_result::elapsed, kcenon::pacs::error_codes::find_unexpected_command, kcenon::pacs::network::association::is_established(), kcenon::pacs::services::worklist_result::items, logger_, kcenon::pacs::services::worklist_scu_config::max_results, kcenon::pacs::error_codes::no_acceptable_context, kcenon::pacs::pacs_error(), parse_worklist_item(), queries_performed_, kcenon::pacs::network::association::receive_dimse(), kcenon::pacs::network::association::send_dimse(), kcenon::pacs::services::worklist_result::status, kcenon::pacs::services::worklist_scu_config::timeout, kcenon::pacs::services::to_string(), total_items_, kcenon::pacs::services::worklist_result::total_pending, and kcenon::pacs::services::worklist_find_sop_class_uid.
Referenced by query().


|
nodiscard |
Query worklist by patient ID.
Query all scheduled procedures for a specific patient.
| assoc | The established association to use |
| patient_id | The patient ID to query |
Definition at line 206 of file worklist_scu.cpp.
References kcenon::pacs::services::worklist_query_keys::patient_id, and query().

|
nodiscard |
Perform a streaming MWL query for large worklists.
Sends a C-FIND request and calls the callback for each pending response. This is more memory-efficient for large worklists.
| assoc | The established association to use |
| keys | The typed query keys for filtering |
| callback | Called for each worklist item; return false to cancel |
Definition at line 220 of file worklist_scu.cpp.
References kcenon::pacs::network::association::accepted_context_id(), kcenon::pacs::error_codes::association_not_established, build_query_dataset(), cancel(), kcenon::pacs::services::worklist_scu_config::cancel_on_max, config_, kcenon::pacs::error_codes::find_unexpected_command, kcenon::pacs::network::association::is_established(), logger_, kcenon::pacs::services::worklist_scu_config::max_results, next_message_id(), kcenon::pacs::error_codes::no_acceptable_context, kcenon::pacs::pacs_error(), parse_worklist_item(), queries_performed_, kcenon::pacs::network::association::receive_dimse(), kcenon::pacs::network::association::send_dimse(), kcenon::pacs::services::worklist_scu_config::timeout, kcenon::pacs::services::to_string(), total_items_, and kcenon::pacs::services::worklist_find_sop_class_uid.

|
nodiscard |
Query today's worklist for a station.
Convenience method to query scheduled procedures for today, optionally filtered by station AE title and modality.
| assoc | The established association to use |
| station_ae | Scheduled Station AE Title (empty = any) |
| modality | Modality filter (empty = any) |
Definition at line 179 of file worklist_scu.cpp.
References get_today_date(), kcenon::pacs::services::worklist_query_keys::modality, query(), kcenon::pacs::services::worklist_query_keys::scheduled_date, and kcenon::pacs::services::worklist_query_keys::scheduled_station_ae.

|
noexcept |
Reset statistics counters to zero.
Definition at line 377 of file worklist_scu.cpp.
References queries_performed_, and total_items_.
| void kcenon::pacs::services::worklist_scu::set_config | ( | const worklist_scu_config & | config | ) |
|
nodiscardnoexcept |
Get the total number of items received since construction.
Definition at line 373 of file worklist_scu.cpp.
References total_items_.
|
private |
Configuration.
Definition at line 587 of file worklist_scu.h.
Referenced by config(), query_impl(), query_streaming(), and set_config().
|
private |
Logger instance for service logging.
Definition at line 584 of file worklist_scu.h.
Referenced by query_impl(), and query_streaming().
|
private |
Message ID counter.
Definition at line 590 of file worklist_scu.h.
Referenced by next_message_id().
|
private |
Statistics: number of queries performed.
Definition at line 593 of file worklist_scu.h.
Referenced by queries_performed(), query_impl(), query_streaming(), and reset_statistics().
|
private |
Statistics: total number of items received.
Definition at line 596 of file worklist_scu.h.
Referenced by query_impl(), query_streaming(), reset_statistics(), and total_items().