PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
patient_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 <optional>
21#include <string>
22
23namespace kcenon::pacs::storage {
24
33 int64_t pk{0};
34
36 std::string patient_id;
37
39 std::string patient_name;
40
42 std::string birth_date;
43
45 std::string sex;
46
48 std::string other_ids;
49
51 std::string ethnic_group;
52
54 std::string comments;
55
57 std::chrono::system_clock::time_point created_at;
58
60 std::chrono::system_clock::time_point updated_at;
61
67 [[nodiscard]] auto is_valid() const noexcept -> bool {
68 return !patient_id.empty();
69 }
70};
71
88 std::optional<std::string> patient_id;
89
91 std::optional<std::string> patient_name;
92
94 std::optional<std::string> birth_date;
95
97 std::optional<std::string> birth_date_from;
98
100 std::optional<std::string> birth_date_to;
101
103 std::optional<std::string> sex;
104
106 size_t limit{0};
107
109 size_t offset{0};
110
116 [[nodiscard]] auto has_criteria() const noexcept -> bool {
117 return patient_id.has_value() || patient_name.has_value() ||
118 birth_date.has_value() || birth_date_from.has_value() ||
119 birth_date_to.has_value() || sex.has_value();
120 }
121};
122
123} // namespace kcenon::pacs::storage
auto has_criteria() const noexcept -> bool
Check if any filter criteria is set.
size_t limit
Maximum number of results to return (0 = unlimited)
std::optional< std::string > birth_date_to
Birth date range end (inclusive)
std::optional< std::string > patient_name
Patient name pattern (supports * wildcard)
std::optional< std::string > patient_id
Patient ID pattern (supports * wildcard)
std::optional< std::string > birth_date
Birth date (exact match, format: YYYYMMDD)
size_t offset
Offset for pagination.
std::optional< std::string > birth_date_from
Birth date range start (inclusive)
std::optional< std::string > sex
Sex (exact match: M, F, O)
Patient record from the database.
std::string ethnic_group
Ethnic Group - DICOM tag (0010,2160)
std::chrono::system_clock::time_point created_at
Record creation timestamp.
std::string birth_date
Patient's Birth Date - DICOM tag (0010,0030) format: YYYYMMDD.
auto is_valid() const noexcept -> bool
Check if this record has valid data.
std::string sex
Patient's Sex - DICOM tag (0010,0040) values: M, F, O.
std::string patient_name
Patient's Name - DICOM tag (0010,0010)
std::chrono::system_clock::time_point updated_at
Record last update timestamp.
std::string patient_id
Patient ID - DICOM tag (0010,0020)
std::string comments
Patient Comments - DICOM tag (0010,4000)
int64_t pk
Primary key (auto-generated)
std::string other_ids
Other Patient IDs - DICOM tag (0010,1000)