PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
kcenon::pacs::ihe::xds::registry_query Class Reference

ITI-18 Registry Query actor. More...

#include <registry_query.h>

Collaboration diagram for kcenon::pacs::ihe::xds::registry_query:
Collaboration graph

Classes

class  impl
 

Public Member Functions

 registry_query (http_options opts, signing_material signing)
 Construct an ITI-18 Registry Query actor bound to a registry endpoint and a signing credential.
 
 registry_query (registry_query &&) noexcept
 
registry_query & operator= (registry_query &&) noexcept
 
 registry_query (const registry_query &)=delete
 
registry_query & operator= (const registry_query &)=delete
 
 ~registry_query ()
 
kcenon::common::Result< registry_query_result > find_documents (const std::string &patient_id, const registry_query_options &options={})
 Execute the FindDocuments stored query (urn:uuid:14d4debf-8f97-4251-9a1e-a3a9d68b2a6f).
 
kcenon::common::Result< registry_query_result > get_documents (const std::vector< std::string > &uuids)
 Execute the GetDocuments stored query (urn:uuid:5737b14c-8a1a-4539-b659-e03a34a5e1e4).
 
void set_audit_sink (std::shared_ptr< kcenon::pacs::security::xds_audit_sink > sink)
 Install an ATNA audit sink.
 

Private Attributes

std::unique_ptr< impl > impl_
 

Detailed Description

ITI-18 Registry Query actor.

Binds one registry endpoint and one signing credential. To query different registries or sign with different certificates, instantiate multiple registry_query objects.

The signing_material type is reused from document_source so a single deployment can share the WS-Security credential between the ITI-41 (push), ITI-43 (retrieve), and ITI-18 (query) actors without re-declaring the struct.

Thread-safety: find_documents / get_documents are NOT reentrant per instance - callers must serialize calls per instance, or create one instance per worker thread. The underlying libcurl handle is owned by the impl and may not be shared between threads.

Definition at line 66 of file registry_query.h.

Constructor & Destructor Documentation

◆ registry_query() [1/3]

kcenon::pacs::ihe::xds::registry_query::registry_query ( http_options opts,
signing_material signing )

Construct an ITI-18 Registry Query actor bound to a registry endpoint and a signing credential.

The endpoint in opts must be the Registry Stored Query service URL on the Document Registry. The default http_options::soap_action ("urn:ihe:iti:2007:RegisterDocumentSet-b") is ITI-41-specific and is overwritten internally by the ITI-18 action URI before the POST. Callers need not clear it themselves.

Signing material is copied into the instance; the caller may then zeroize the original buffer. The constructor never throws - any material validation failure is deferred to the query methods and surfaces as a typed error_code.

Definition at line 272 of file registry_query.cpp.

273 : impl_(std::make_unique<impl>(std::move(opts), std::move(signing))) {}

◆ registry_query() [2/3]

kcenon::pacs::ihe::xds::registry_query::registry_query ( registry_query && )
defaultnoexcept

◆ registry_query() [3/3]

kcenon::pacs::ihe::xds::registry_query::registry_query ( const registry_query & )
delete

◆ ~registry_query()

kcenon::pacs::ihe::xds::registry_query::~registry_query ( )
default

Member Function Documentation

◆ find_documents()

kcenon::common::Result< registry_query_result > kcenon::pacs::ihe::xds::registry_query::find_documents ( const std::string & patient_id,
const registry_query_options & options = {} )

Execute the FindDocuments stored query (urn:uuid:14d4debf-8f97-4251-9a1e-a3a9d68b2a6f).

Returns the list of XDSDocumentEntry metadata the registry holds for patient_id. An empty result list on Success means the query was well-formed but no documents matched - callers should branch on the result's entries vector rather than treating empty as an error.

options is optional; pass a default-constructed registry_query_options to let the actor emit the default "Approved" status filter and no creation-time window.

TRUST CAVEAT: the response signature check is integrity-only - it binds the payload to the cert embedded in the response's BST, but does NOT validate that cert against a trust anchor. Callers must not treat a successful Result as signer-authenticated.

All failure modes surface as typed error_code values; the function never throws across the API boundary.

Definition at line 280 of file registry_query.cpp.

281 {
282 return impl_->find_documents(patient_id, options);
283}
kcenon::common::Result< registry_query_result > find_documents(const std::string &patient_id, const registry_query_options &options)

References find_documents().

Referenced by find_documents().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_documents()

kcenon::common::Result< registry_query_result > kcenon::pacs::ihe::xds::registry_query::get_documents ( const std::vector< std::string > & uuids)

Execute the GetDocuments stored query (urn:uuid:5737b14c-8a1a-4539-b659-e03a34a5e1e4).

Resolves explicit XDSDocumentEntry UUIDs to their metadata. uuids must carry at least one entry_uuid in urn:uuid: form; an empty list is rejected with registry_query_empty_uuid_list before any transport call is made.

Returns the entries the registry has for the requested UUIDs. The registry may return fewer entries than requested when some UUIDs are unknown; callers wanting a strict all-or-nothing semantic must compare entries.size() to uuids.size() themselves.

Definition at line 285 of file registry_query.cpp.

286 {
287 return impl_->get_documents(uuids);
288}
kcenon::common::Result< registry_query_result > get_documents(const std::vector< std::string > &uuids)

References kcenon::pacs::ihe::xds::registry_query::impl::get_documents(), and impl_.

Here is the call graph for this function:

◆ operator=() [1/2]

registry_query & kcenon::pacs::ihe::xds::registry_query::operator= ( const registry_query & )
delete

◆ operator=() [2/2]

registry_query & kcenon::pacs::ihe::xds::registry_query::operator= ( registry_query && )
defaultnoexcept

◆ set_audit_sink()

void kcenon::pacs::ihe::xds::registry_query::set_audit_sink ( std::shared_ptr< kcenon::pacs::security::xds_audit_sink > sink)

Install an ATNA audit sink.

When set, find_documents() and get_documents() each emit one audit event per invocation - success or failure - carrying the query kind, query keys (patient_id or uuid list), registry endpoint, and the outcome code.

See also
kcenon::pacs::security::xds_audit_sink
Issue #1131

Definition at line 290 of file registry_query.cpp.

291 {
292 impl_->set_audit_sink(std::move(sink));
293}
void set_audit_sink(std::shared_ptr< kcenon::pacs::security::xds_audit_sink > sink)

References impl_, and kcenon::pacs::ihe::xds::registry_query::impl::set_audit_sink().

Here is the call graph for this function:

Member Data Documentation

◆ impl_

std::unique_ptr<impl> kcenon::pacs::ihe::xds::registry_query::impl_
private

Definition at line 151 of file registry_query.h.

Referenced by get_documents(), and set_audit_sink().


The documentation for this class was generated from the following files: