PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
mpps_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
18#pragma once
19
20#include <chrono>
21#include <optional>
22#include <string>
23#include <vector>
24
25namespace kcenon::pacs::storage {
26
33enum class mpps_status {
35 completed,
37};
38
45[[nodiscard]] inline auto to_string(mpps_status status) -> std::string {
46 switch (status) {
48 return "IN PROGRESS";
50 return "COMPLETED";
52 return "DISCONTINUED";
53 default:
54 return "IN PROGRESS";
55 }
56}
57
64[[nodiscard]] inline auto parse_mpps_status(std::string_view str)
65 -> std::optional<mpps_status> {
66 if (str == "IN PROGRESS") {
68 }
69 if (str == "COMPLETED") {
71 }
72 if (str == "DISCONTINUED") {
74 }
75 return std::nullopt;
76}
77
84 std::string series_uid;
85 std::string protocol_name;
87};
88
117 int64_t pk{0};
118
120 std::string mpps_uid;
121
123 std::string status;
124
126 std::string start_datetime;
127
129 std::string end_datetime;
130
132 std::string station_ae;
133
135 std::string station_name;
136
138 std::string modality;
139
141 std::string study_uid;
142
144 std::string accession_no;
145
147 std::string scheduled_step_id;
148
150 std::string requested_proc_id;
151
153 std::string performed_series;
154
156 std::chrono::system_clock::time_point created_at;
157
159 std::chrono::system_clock::time_point updated_at;
160
166 [[nodiscard]] auto is_valid() const noexcept -> bool {
167 return !mpps_uid.empty();
168 }
169
175 [[nodiscard]] auto is_final() const noexcept -> bool {
176 return status == "COMPLETED" || status == "DISCONTINUED";
177 }
178
184 [[nodiscard]] auto get_status() const -> std::optional<mpps_status> {
186 }
187};
188
204 std::optional<std::string> mpps_uid;
205
207 std::optional<std::string> status;
208
210 std::optional<std::string> station_ae;
211
213 std::optional<std::string> modality;
214
216 std::optional<std::string> study_uid;
217
219 std::optional<std::string> accession_no;
220
222 std::optional<std::string> start_date_from;
223
225 std::optional<std::string> start_date_to;
226
228 size_t limit{0};
229
231 size_t offset{0};
232
238 [[nodiscard]] auto has_criteria() const noexcept -> bool {
239 return mpps_uid.has_value() || status.has_value() ||
240 station_ae.has_value() || modality.has_value() ||
241 study_uid.has_value() || accession_no.has_value() ||
242 start_date_from.has_value() || start_date_to.has_value();
243 }
244};
245
246} // namespace kcenon::pacs::storage
mpps_status
MPPS status values.
Definition mpps_record.h:33
@ completed
Procedure completed successfully.
@ discontinued
Procedure was stopped/cancelled.
@ in_progress
Procedure is currently being performed.
auto parse_mpps_status(std::string_view str) -> std::optional< mpps_status >
Parse string to mpps_status enum.
Definition mpps_record.h:64
auto to_string(annotation_type type) -> std::string
Convert annotation_type to string.
std::optional< std::string > start_date_from
Start date range begin (inclusive, format: YYYYMMDD)
std::optional< std::string > station_ae
Station AE Title filter (exact match)
std::optional< std::string > status
Status filter (exact match)
std::optional< std::string > start_date_to
Start date range end (inclusive, format: YYYYMMDD)
std::optional< std::string > mpps_uid
MPPS SOP Instance UID (exact match)
size_t offset
Offset for pagination.
std::optional< std::string > study_uid
Study Instance UID filter (exact match)
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 > accession_no
Accession number filter (exact match)
std::optional< std::string > modality
Modality filter (exact match)
MPPS record from the database.
std::string station_name
Performing station name.
int64_t pk
Primary key (auto-generated)
std::string station_ae
Performing station AE Title.
std::string end_datetime
End date/time of the procedure (set when completed/discontinued)
std::chrono::system_clock::time_point updated_at
Record last update timestamp.
std::string scheduled_step_id
Scheduled Procedure Step ID (from worklist)
std::string modality
Modality type (CT, MR, etc.)
std::string mpps_uid
SOP Instance UID - unique identifier for this MPPS.
std::chrono::system_clock::time_point created_at
Record creation timestamp.
std::string accession_no
Accession number.
auto is_final() const noexcept -> bool
Check if this MPPS is in a final state.
std::string start_datetime
Start date/time of the procedure (DICOM DT format: YYYYMMDDHHMMSS)
std::string study_uid
Related Study Instance UID.
std::string performed_series
Performed series information (JSON serialized)
auto get_status() const -> std::optional< mpps_status >
Get the status as enum.
std::string status
Current status of the procedure step.
auto is_valid() const noexcept -> bool
Check if this record has valid data.
std::string requested_proc_id
Requested Procedure ID.
Information about a performed series.
Definition mpps_record.h:83
std::string series_uid
Series Instance UID.
Definition mpps_record.h:84
int num_instances
Number of instances in this series.
Definition mpps_record.h:86
std::string protocol_name
Protocol name used.
Definition mpps_record.h:85