19#ifndef PACS_SERVICES_QUERY_SCP_HPP
20#define PACS_SERVICES_QUERY_SCP_HPP
39 "1.2.840.10008.5.1.4.1.2.1.1";
43 "1.2.840.10008.5.1.4.1.2.2.1";
47 "1.2.840.10008.5.1.4.1.2.3.1";
51 "1.2.840.10008.5.1.4.31";
81 default:
return "UNKNOWN";
91 std::string_view level_str)
noexcept {
116 const std::string& calling_ae)>;
250 std::shared_ptr<
kcenon::
pacs::security::atna_service_auditor> auditor);
275 network::association& assoc,
277 const network::dimse::dimse_message& request) override;
284 [[nodiscard]] std::string_view
service_name() const noexcept override;
314 const core::dicom_dataset& dataset) const;
327 network::association& assoc,
330 std::string_view sop_class_uid,
331 const core::dicom_dataset& result);
344 network::association& assoc,
347 std::string_view sop_class_uid,
348 network::dimse::status_code status);
std::vector< std::string > supported_sop_classes() const override
Get supported SOP Class UIDs.
void set_audit_handler(std::shared_ptr< kcenon::pacs::security::atna_service_auditor > auditor)
Set the ATNA audit handler for C-FIND operations.
std::optional< query_level > extract_query_level(const core::dicom_dataset &dataset) const
Extract query level from request dataset.
network::Result< std::monostate > send_pending_response(network::association &assoc, uint8_t context_id, uint16_t message_id, std::string_view sop_class_uid, const core::dicom_dataset &result)
Send a pending C-FIND response with matching dataset.
size_t max_results() const noexcept
Get maximum number of results.
void set_cancel_check(cancel_check check)
Set the cancel check function.
void reset_statistics() noexcept
Reset statistics counters.
std::shared_ptr< kcenon::pacs::security::atna_service_auditor > auditor_
std::atomic< size_t > queries_processed_
void set_handler(query_handler handler)
Set the query handler function.
std::string_view service_name() const noexcept override
Get the service name.
network::Result< std::monostate > handle_message(network::association &assoc, uint8_t context_id, const network::dimse::dimse_message &request) override
Handle an incoming DIMSE message (C-FIND-RQ)
~query_scp() override=default
cancel_check cancel_check_
network::Result< std::monostate > send_final_response(network::association &assoc, uint8_t context_id, uint16_t message_id, std::string_view sop_class_uid, network::dimse::status_code status)
Send the final C-FIND response (success or cancel)
void set_max_results(size_t max) noexcept
Set maximum number of results to return.
size_t queries_processed() const noexcept
Get total number of queries processed.
query_scp(std::shared_ptr< di::ILogger > logger=nullptr)
Construct Query SCP with optional logger.
const std::shared_ptr< di::ILogger > & logger() const noexcept
Get the current logger instance.
constexpr std::string_view modality_worklist_find_sop_class_uid
Modality Worklist Information Model - FIND.
constexpr std::string_view study_root_find_sop_class_uid
Study Root Query/Retrieve Information Model - FIND.
constexpr std::string_view patient_root_find_sop_class_uid
Patient Root Query/Retrieve Information Model - FIND.
std::function< std::vector< core::dicom_dataset >( query_level level, const core::dicom_dataset &query_keys, const std::string &calling_ae)> query_handler
Query handler function type.
std::optional< query_level > parse_query_level(std::string_view level_str) noexcept
Parse query level from DICOM string.
auto to_string(mpps_status status) -> std::string_view
Convert mpps_status to DICOM string representation.
constexpr std::string_view patient_study_only_find_sop_class_uid
Patient/Study Only Query/Retrieve Information Model - FIND (Retired)
std::function< bool()> cancel_check
Cancel check function type.
query_level
DICOM Query/Retrieve level enumeration.
@ study
Study level - query study information.
@ image
Image (Instance) level - query instance information.
@ patient
Patient level - query patient demographics.
@ series
Series level - query series information.
Base class for DICOM SCP (Service Class Provider) services.