PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
instance_record.h
Go to the documentation of this file.
1// BSD 3-Clause License
2// Copyright (c) 2021-2025, 🍀☀🌕🌥 🌊
3// See the LICENSE file in the project root for full license information.
4
17#pragma once
18
19#include <chrono>
20#include <cstdint>
21#include <optional>
22#include <string>
23
24namespace kcenon::pacs::storage {
25
34 int64_t pk{0};
35
37 int64_t series_pk{0};
38
40 std::string sop_uid;
41
43 std::string sop_class_uid;
44
46 std::optional<int> instance_number;
47
49 std::string transfer_syntax;
50
52 std::string content_date;
53
55 std::string content_time;
56
58 std::optional<int> rows;
59
61 std::optional<int> columns;
62
64 std::optional<int> bits_allocated;
65
67 std::optional<int> number_of_frames;
68
70 std::string file_path;
71
73 int64_t file_size{0};
74
76 std::string file_hash;
77
79 std::chrono::system_clock::time_point created_at;
80
86 [[nodiscard]] auto is_valid() const noexcept -> bool {
87 return !sop_uid.empty() && !file_path.empty();
88 }
89};
90
107 std::optional<std::string> series_uid;
108
110 std::optional<std::string> sop_uid;
111
113 std::optional<std::string> sop_class_uid;
114
116 std::optional<int> instance_number;
117
119 std::optional<std::string> content_date;
120
122 std::optional<std::string> content_date_from;
123
125 std::optional<std::string> content_date_to;
126
128 size_t limit{0};
129
131 size_t offset{0};
132
138 [[nodiscard]] auto has_criteria() const noexcept -> bool {
139 return series_uid.has_value() || sop_uid.has_value() ||
140 sop_class_uid.has_value() || instance_number.has_value() ||
141 content_date.has_value() || content_date_from.has_value() ||
142 content_date_to.has_value();
143 }
144};
145
146} // namespace kcenon::pacs::storage
std::optional< int > instance_number
Instance number filter.
std::optional< std::string > series_uid
Series Instance UID for filtering by series (exact match)
size_t limit
Maximum number of results to return (0 = unlimited)
std::optional< std::string > sop_uid
SOP Instance UID (exact match)
auto has_criteria() const noexcept -> bool
Check if any filter criteria is set.
size_t offset
Offset for pagination.
std::optional< std::string > content_date
Content date (exact match, format: YYYYMMDD)
std::optional< std::string > content_date_from
Content date range start (inclusive)
std::optional< std::string > content_date_to
Content date range end (inclusive)
std::optional< std::string > sop_class_uid
SOP Class UID filter (exact match)
Instance record from the database.
auto is_valid() const noexcept -> bool
Check if this record has valid data.
std::optional< int > rows
Image Rows - DICOM tag (0028,0010)
std::optional< int > columns
Image Columns - DICOM tag (0028,0011)
std::string file_hash
File hash (e.g., MD5 or SHA-256) for integrity verification.
int64_t series_pk
Foreign key to series table.
std::chrono::system_clock::time_point created_at
Record creation timestamp.
std::string sop_class_uid
SOP Class UID - DICOM tag (0008,0016)
std::string content_time
Content Time - DICOM tag (0008,0033) format: HHMMSS.
std::string transfer_syntax
Transfer Syntax UID - DICOM tag (0002,0010)
std::optional< int > number_of_frames
Number of Frames - DICOM tag (0028,0008)
std::optional< int > bits_allocated
Bits Allocated - DICOM tag (0028,0100)
int64_t pk
Primary key (auto-generated)
std::string content_date
Content Date - DICOM tag (0008,0023) format: YYYYMMDD.
std::string sop_uid
SOP Instance UID - DICOM tag (0008,0018)
int64_t file_size
File size in bytes.
std::string file_path
File path where the instance is stored.
std::optional< int > instance_number
Instance Number - DICOM tag (0020,0013)