PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
viewer_state_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
19#pragma once
20
21#include <chrono>
22#include <optional>
23#include <string>
24
25namespace kcenon::pacs::storage {
26
36 int64_t pk{0};
37
39 std::string state_id;
40
42 std::string study_uid;
43
45 std::string user_id;
46
48 std::string state_json;
49
51 std::chrono::system_clock::time_point created_at;
52
54 std::chrono::system_clock::time_point updated_at;
55
61 [[nodiscard]] auto is_valid() const noexcept -> bool {
62 return !state_id.empty() && !study_uid.empty();
63 }
64};
65
82 std::optional<std::string> study_uid;
83
85 std::optional<std::string> user_id;
86
88 size_t limit{0};
89
91 size_t offset{0};
92
98 [[nodiscard]] auto has_criteria() const noexcept -> bool {
99 return study_uid.has_value() || user_id.has_value();
100 }
101};
102
112 int64_t pk{0};
113
115 std::string user_id;
116
118 std::string study_uid;
119
121 std::chrono::system_clock::time_point accessed_at;
122
128 [[nodiscard]] auto is_valid() const noexcept -> bool {
129 return !user_id.empty() && !study_uid.empty();
130 }
131};
132
133} // namespace kcenon::pacs::storage
Recent study access record from the database.
auto is_valid() const noexcept -> bool
Check if this record has valid data.
std::string user_id
User who accessed the study.
int64_t pk
Primary key (auto-generated)
std::chrono::system_clock::time_point accessed_at
When the study was accessed.
std::string study_uid
Study Instance UID - DICOM tag (0020,000D)
size_t limit
Maximum number of results to return (0 = unlimited)
auto has_criteria() const noexcept -> bool
Check if any filter criteria is set.
std::optional< std::string > study_uid
Study Instance UID filter.
std::optional< std::string > user_id
User ID filter.
Viewer state record from the database.
std::chrono::system_clock::time_point updated_at
Record last update timestamp.
std::string state_json
Full viewer state as JSON (layout, viewports, settings)
std::string state_id
Unique state identifier (UUID)
int64_t pk
Primary key (auto-generated)
std::chrono::system_clock::time_point created_at
Record creation timestamp.
std::string study_uid
Study Instance UID - DICOM tag (0020,000D)
std::string user_id
User who saved the state.
auto is_valid() const noexcept -> bool
Check if this record has valid data.