PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
study_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 patient_pk{0};
38
40 std::string study_uid;
41
43 std::string study_id;
44
46 std::string study_date;
47
49 std::string study_time;
50
52 std::string accession_number;
53
56
58 std::string study_description;
59
62
64 int num_series{0};
65
68
70 std::chrono::system_clock::time_point created_at;
71
73 std::chrono::system_clock::time_point updated_at;
74
80 [[nodiscard]] auto is_valid() const noexcept -> bool {
81 return !study_uid.empty();
82 }
83};
84
103 std::optional<std::string> patient_id;
104
106 std::optional<std::string> patient_name;
107
109 std::optional<std::string> study_uid;
110
112 std::optional<std::string> study_id;
113
115 std::optional<std::string> study_date;
116
118 std::optional<std::string> study_date_from;
119
121 std::optional<std::string> study_date_to;
122
124 std::optional<std::string> accession_number;
125
127 std::optional<std::string> modality;
128
130 std::optional<std::string> referring_physician;
131
133 std::optional<std::string> study_description;
134
136 size_t limit{0};
137
139 size_t offset{0};
140
146 [[nodiscard]] auto has_criteria() const noexcept -> bool {
147 return patient_id.has_value() || patient_name.has_value() ||
148 study_uid.has_value() || study_id.has_value() ||
149 study_date.has_value() || study_date_from.has_value() ||
150 study_date_to.has_value() || accession_number.has_value() ||
151 modality.has_value() || referring_physician.has_value() ||
152 study_description.has_value();
153 }
154};
155
156} // namespace kcenon::pacs::storage
std::optional< std::string > study_uid
Study Instance UID (exact match)
std::optional< std::string > accession_number
Accession number pattern (supports * wildcard)
std::optional< std::string > modality
Modality filter (exact match, e.g., "CT", "MR")
std::optional< std::string > study_date_to
Study date range end (inclusive)
std::optional< std::string > study_date
Study date (exact match, format: YYYYMMDD)
std::optional< std::string > patient_name
Patient name pattern (supports * wildcard)
std::optional< std::string > referring_physician
Referring physician pattern (supports * wildcard)
std::optional< std::string > study_id
Study ID pattern (supports * wildcard)
std::optional< std::string > study_date_from
Study date range start (inclusive)
auto has_criteria() const noexcept -> bool
Check if any filter criteria is set.
std::optional< std::string > study_description
Study description pattern (supports * wildcard)
std::optional< std::string > patient_id
Patient ID for filtering by patient (exact match or wildcard)
size_t limit
Maximum number of results to return (0 = unlimited)
size_t offset
Offset for pagination.
Study record from the database.
std::string study_uid
Study Instance UID - DICOM tag (0020,000D)
std::string accession_number
Accession Number - DICOM tag (0008,0050)
std::string study_id
Study ID - DICOM tag (0020,0010)
int num_instances
Number of instances in this study (denormalized)
std::chrono::system_clock::time_point updated_at
Record last update timestamp.
std::string study_date
Study Date - DICOM tag (0008,0020) format: YYYYMMDD.
int num_series
Number of series in this study (denormalized)
auto is_valid() const noexcept -> bool
Check if this record has valid data.
std::string study_time
Study Time - DICOM tag (0008,0030) format: HHMMSS.
std::string modalities_in_study
Modalities in Study - DICOM tag (0008,0061) e.g., "CT\\MR".
int64_t pk
Primary key (auto-generated)
std::string study_description
Study Description - DICOM tag (0008,1030)
std::string referring_physician
Referring Physician's Name - DICOM tag (0008,0090)
std::chrono::system_clock::time_point created_at
Record creation timestamp.
int64_t patient_pk
Foreign key to patients table.