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


Classes | |
| class | azure_client_interface |
| Abstract interface for Azure Blob client operations. More... | |
Public Member Functions | |
| azure_blob_storage (const azure_storage_config &config) | |
| Construct Azure Blob storage with configuration. | |
| ~azure_blob_storage () override | |
| Destructor. | |
| azure_blob_storage (const azure_blob_storage &)=delete | |
| Non-copyable (contains mutex) | |
| azure_blob_storage & | operator= (const azure_blob_storage &)=delete |
| azure_blob_storage (azure_blob_storage &&)=delete | |
| Non-movable (contains mutex) | |
| azure_blob_storage & | operator= (azure_blob_storage &&)=delete |
| auto | store (const core::dicom_dataset &dataset) -> VoidResult override |
| Store a DICOM dataset to Azure Blob Storage. | |
| auto | retrieve (std::string_view sop_instance_uid) -> Result< core::dicom_dataset > override |
| Retrieve a DICOM dataset by SOP Instance UID. | |
| auto | remove (std::string_view sop_instance_uid) -> VoidResult override |
| Remove a DICOM blob from Azure Storage. | |
| auto | exists (std::string_view sop_instance_uid) const -> bool override |
| Check if a DICOM instance exists in Azure Storage. | |
| auto | find (const core::dicom_dataset &query) -> Result< std::vector< core::dicom_dataset > > override |
| Find DICOM datasets matching query criteria. | |
| auto | get_statistics () const -> storage_statistics override |
| Get storage statistics. | |
| auto | verify_integrity () -> VoidResult override |
| Verify storage integrity. | |
| auto | store_with_progress (const core::dicom_dataset &dataset, azure_progress_callback callback) -> VoidResult |
| Store with progress tracking. | |
| auto | retrieve_with_progress (std::string_view sop_instance_uid, azure_progress_callback callback) -> Result< core::dicom_dataset > |
| Retrieve with progress tracking. | |
| auto | get_blob_name (std::string_view sop_instance_uid) const -> std::string |
| Get the blob name for a SOP Instance UID. | |
| auto | container_name () const -> const std::string & |
| Get the container name. | |
| auto | rebuild_index () -> VoidResult |
| Rebuild the local index from Azure. | |
| auto | is_connected () const -> bool |
| Check Azure connectivity. | |
| auto | set_access_tier (std::string_view sop_instance_uid, std::string_view tier) -> VoidResult |
| Set blob access tier. | |
Public Member Functions inherited from kcenon::pacs::storage::storage_interface | |
| virtual | ~storage_interface ()=default |
| Virtual destructor for proper polymorphic destruction. | |
| virtual auto | store_batch (const std::vector< core::dicom_dataset > &datasets) -> VoidResult |
| Store multiple DICOM datasets in a single operation. | |
| virtual auto | retrieve_batch (const std::vector< std::string > &sop_instance_uids) -> Result< std::vector< core::dicom_dataset > > |
| Retrieve multiple DICOM datasets by their SOP Instance UIDs. | |
Private Member Functions | |
| auto | build_blob_name (std::string_view study_uid, std::string_view series_uid, std::string_view sop_uid) const -> std::string |
| Build blob name for a dataset. | |
| auto | upload_block_blob (const std::string &blob_name, const std::vector< std::uint8_t > &data, azure_progress_callback callback) -> VoidResult |
| Execute block blob upload for large files. | |
Static Private Member Functions | |
| static auto | sanitize_uid (std::string_view uid) -> std::string |
| Sanitize UID for use in blob name. | |
| static auto | matches_query (const core::dicom_dataset &dataset, const core::dicom_dataset &query) -> bool |
| Check if dataset matches query criteria. | |
Private Attributes | |
| azure_storage_config | config_ |
| Storage configuration. | |
| std::unique_ptr< azure_client_interface > | client_ |
| Azure client (mock for testing, Azure SDK for production) | |
| std::unordered_map< std::string, azure_blob_info > | index_ |
| Mapping from SOP Instance UID to Azure blob info. | |
| std::shared_mutex | mutex_ |
| Mutex for thread-safe access. | |
Additional Inherited Members | |
Protected Member Functions inherited from kcenon::pacs::storage::storage_interface | |
| storage_interface ()=default | |
| Protected default constructor for derived classes. | |
| storage_interface (const storage_interface &)=delete | |
| Non-copyable. | |
| storage_interface & | operator= (const storage_interface &)=delete |
| storage_interface (storage_interface &&)=default | |
| Movable. | |
| storage_interface & | operator= (storage_interface &&)=default |
Definition at line 170 of file azure_blob_storage.h.
|
explicit |
Construct Azure Blob storage with configuration.
| config | Azure storage configuration |
Definition at line 552 of file azure_blob_storage.cpp.
|
overridedefault |
|
delete |
Non-copyable (contains mutex)
|
delete |
Non-movable (contains mutex)
|
nodiscardprivate |
Build blob name for a dataset.
| study_uid | Study Instance UID |
| series_uid | Series Instance UID |
| sop_uid | SOP Instance UID |
Definition at line 902 of file azure_blob_storage.cpp.
|
nodiscard |
Get the container name.
Definition at line 823 of file azure_blob_storage.cpp.
References config_, and kcenon::pacs::storage::azure_storage_config::container_name.
|
nodiscardoverridevirtual |
Check if a DICOM instance exists in Azure Storage.
Uses Azure GetBlobProperties to check existence without downloading.
| sop_instance_uid | The unique identifier to check |
Implements kcenon::pacs::storage::storage_interface.
Definition at line 713 of file azure_blob_storage.cpp.
|
nodiscardoverridevirtual |
Find DICOM datasets matching query criteria.
This operation requires scanning the local index. For large containers, consider using the index_database instead.
| query | The query dataset containing search criteria |
Implements kcenon::pacs::storage::storage_interface.
Definition at line 719 of file azure_blob_storage.cpp.
References kcenon::pacs::core::dicom_file::from_bytes(), and uid.

|
nodiscard |
Get the blob name for a SOP Instance UID.
| sop_instance_uid | The SOP Instance UID |
Definition at line 813 of file azure_blob_storage.cpp.
|
nodiscardoverridevirtual |
Get storage statistics.
Implements kcenon::pacs::storage::storage_interface.
Definition at line 752 of file azure_blob_storage.cpp.
|
nodiscard |
Check Azure connectivity.
Definition at line 867 of file azure_blob_storage.cpp.
References client_.
|
staticnodiscardprivate |
Check if dataset matches query criteria.
| dataset | The dataset to check |
| query | The query criteria |
Definition at line 976 of file azure_blob_storage.cpp.
|
delete |
|
delete |
|
nodiscard |
Rebuild the local index from Azure.
Lists all blobs in the container and rebuilds the SOP UID mapping.
Definition at line 827 of file azure_blob_storage.cpp.
References kcenon::pacs::core::dicom_file::from_bytes(), kcenon::pacs::core::tags::series_instance_uid, kcenon::pacs::core::tags::sop_instance_uid, and kcenon::pacs::core::tags::study_instance_uid.

|
nodiscardoverridevirtual |
Remove a DICOM blob from Azure Storage.
| sop_instance_uid | The unique identifier for the instance to remove |
Implements kcenon::pacs::storage::storage_interface.
Definition at line 691 of file azure_blob_storage.cpp.
|
nodiscardoverridevirtual |
Retrieve a DICOM dataset by SOP Instance UID.
Downloads the blob from Azure and deserializes to dicom_dataset.
| sop_instance_uid | The unique identifier for the instance |
Implements kcenon::pacs::storage::storage_interface.
Definition at line 642 of file azure_blob_storage.cpp.
|
nodiscard |
Retrieve with progress tracking.
| sop_instance_uid | The SOP Instance UID |
| callback | Progress callback function |
Definition at line 647 of file azure_blob_storage.cpp.
References kcenon::pacs::core::dicom_file::from_bytes().

|
staticnodiscardprivate |
Sanitize UID for use in blob name.
| uid | The UID to sanitize |
Definition at line 912 of file azure_blob_storage.cpp.
References uid.
|
nodiscard |
Set blob access tier.
| sop_instance_uid | The SOP Instance UID |
| tier | The access tier (Hot, Cool, Archive) |
Definition at line 871 of file azure_blob_storage.cpp.
|
nodiscardoverridevirtual |
Store a DICOM dataset to Azure Blob Storage.
Serializes the dataset to DICOM Part 10 format and uploads to Azure. Uses block blob upload for files exceeding block_upload_threshold.
| dataset | The DICOM dataset to store |
Implements kcenon::pacs::storage::storage_interface.
Definition at line 568 of file azure_blob_storage.cpp.
|
nodiscard |
Store with progress tracking.
| dataset | The DICOM dataset to store |
| callback | Progress callback function |
Definition at line 573 of file azure_blob_storage.cpp.
References kcenon::pacs::core::dicom_file::create(), kcenon::pacs::encoding::transfer_syntax::explicit_vr_little_endian, kcenon::pacs::core::tags::series_instance_uid, kcenon::pacs::core::tags::sop_instance_uid, and kcenon::pacs::core::tags::study_instance_uid.

|
nodiscardprivate |
Execute block blob upload for large files.
| blob_name | Blob name |
| data | Data to upload |
| callback | Optional progress callback |
Definition at line 929 of file azure_blob_storage.cpp.
|
nodiscardoverridevirtual |
Verify storage integrity.
Checks that all indexed blobs exist in Azure and have valid ETags.
Implements kcenon::pacs::storage::storage_interface.
Definition at line 781 of file azure_blob_storage.cpp.
References uid.
|
private |
Azure client (mock for testing, Azure SDK for production)
Definition at line 410 of file azure_blob_storage.h.
Referenced by is_connected().
|
private |
Storage configuration.
Definition at line 407 of file azure_blob_storage.h.
Referenced by container_name().
|
private |
Mapping from SOP Instance UID to Azure blob info.
Definition at line 413 of file azure_blob_storage.h.
Referenced by get_statistics().
|
mutableprivate |
Mutex for thread-safe access.
Definition at line 416 of file azure_blob_storage.h.
Referenced by get_statistics().