PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
aira_assessment.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
20#ifndef PACS_AI_AIRA_ASSESSMENT_HPP
21#define PACS_AI_AIRA_ASSESSMENT_HPP
22
24
25#include <chrono>
26#include <optional>
27#include <string>
28#include <vector>
29
30namespace kcenon::pacs::ai {
31
32// =============================================================================
33// Assessment Types
34// =============================================================================
35
39enum class assessment_type {
40 accept,
41 modify,
42 reject
43};
44
49 draft,
50 final_,
51 amended
52};
53
54// =============================================================================
55// Data Structures
56// =============================================================================
57
63 std::string sop_class_uid;
64
66 std::string sop_instance_uid;
67
69 std::string study_instance_uid;
70
73};
74
80 std::string description;
81
83 std::optional<std::string> modified_result_uid;
84
86 std::optional<std::string> modified_result_class_uid;
87};
88
94 std::string reason_code;
95
97 std::string reason_scheme{"DCM"};
98
101};
102
109
112
115
117 std::string assessor_name;
118
120 std::optional<std::string> assessor_id;
121
123 std::optional<std::string> institution_name;
124
126 std::optional<std::string> comment;
127
129 std::optional<assessment_modification> modification;
130
132 std::optional<assessment_rejection> rejection;
133
135 std::chrono::system_clock::time_point assessment_time{
136 std::chrono::system_clock::now()};
137};
138
144 bool success{false};
145
147 std::optional<core::dicom_dataset> sr_dataset;
148
150 std::string assessment_uid;
151
153 std::string error_message;
154};
155
161 std::string assessment_uid;
162
165
168
170 std::string ai_result_uid;
171
173 std::string assessor_name;
174
176 std::chrono::system_clock::time_point assessment_time;
177};
178
179// =============================================================================
180// Assessment Creator
181// =============================================================================
182
211public:
213
221 const ai_assessment& assessment) const;
222
229 [[nodiscard]] static std::string assessment_type_to_code(
230 assessment_type type);
231
238 [[nodiscard]] static std::string assessment_type_to_meaning(
239 assessment_type type);
240
247 [[nodiscard]] static std::string status_to_completion_flag(
248 assessment_status status);
249
250private:
252 const ai_assessment& assessment) const;
254 const ai_assessment& assessment) const;
256 const ai_assessment& assessment) const;
257
258 [[nodiscard]] std::string generate_uid() const;
259};
260
264[[nodiscard]] std::string to_string(assessment_type type);
265
269[[nodiscard]] std::string to_string(assessment_status status);
270
271} // namespace kcenon::pacs::ai
272
273#endif // PACS_AI_AIRA_ASSESSMENT_HPP
assessment_creation_result create_assessment(const ai_assessment &assessment) const
Create an assessment SR document for an AI result.
static std::string assessment_type_to_meaning(assessment_type type)
Convert assessment_type to human-readable meaning.
static std::string status_to_completion_flag(assessment_status status)
Convert assessment_status to DICOM completion flag value.
void build_referenced_sop_sequence(core::dicom_dataset &sr, const ai_assessment &assessment) const
void build_patient_module(core::dicom_dataset &sr, const ai_assessment &assessment) const
static std::string assessment_type_to_code(assessment_type type)
Convert assessment_type to DICOM coded value.
void build_sr_content(core::dicom_dataset &sr, const ai_assessment &assessment) const
DICOM Dataset - ordered collection of Data Elements.
assessment_type
Assessment decision made by a clinician on an AI result.
@ accept
Clinician accepts AI result as-is.
@ reject
Clinician rejects AI result with reason.
@ modify
Clinician modifies AI result (e.g., edits segmentation)
auto to_string(inference_status_code status) -> std::string
Convert inference status code to string.
assessment_status
Assessment status tracking.
@ amended
Previously finalized assessment has been amended.
@ draft
Assessment in progress, not yet finalized.
@ final_
Assessment finalized and signed off.
Complete assessment of an AI result.
std::optional< std::string > assessor_id
Clinician identifier.
std::chrono::system_clock::time_point assessment_time
Timestamp of the assessment.
std::optional< assessment_rejection > rejection
Rejection details (only for assessment_type::reject)
assessment_status status
Current status of the assessment.
assessed_result_reference ai_result
Reference to the AI result being assessed.
assessment_type type
Assessment type (accept/modify/reject)
std::optional< std::string > institution_name
Institution name.
std::optional< std::string > comment
Free-text comment about the assessment.
std::string assessor_name
Clinician who performed the assessment.
std::optional< assessment_modification > modification
Modification details (only for assessment_type::modify)
Reference to the AI result being assessed.
std::string study_instance_uid
Study Instance UID containing the AI result.
std::string series_instance_uid
Series Instance UID of the AI result.
std::string sop_class_uid
SOP Class UID of the AI result.
std::string sop_instance_uid
SOP Instance UID of the AI result.
Result of creating an assessment SR document.
std::string assessment_uid
SOP Instance UID of the created assessment.
std::optional< core::dicom_dataset > sr_dataset
The created assessment SR dataset.
std::string error_message
Error message (if failed)
bool success
Whether creation succeeded.
Information about a stored assessment.
std::string assessor_name
Assessor name.
assessment_type type
Assessment type.
std::chrono::system_clock::time_point assessment_time
Assessment timestamp.
std::string assessment_uid
SOP Instance UID of the assessment SR.
assessment_status status
Assessment status.
std::string ai_result_uid
Reference to the assessed AI result.
Modification details when assessment_type is modify.
std::string description
Description of what was modified.
std::optional< std::string > modified_result_uid
SOP Instance UID of the modified result (if a new object was created)
std::optional< std::string > modified_result_class_uid
SOP Class UID of the modified result.
Rejection reason when assessment_type is reject.
std::string reason_scheme
Code scheme designator for the reason.
std::string reason_code
Coded reason for rejection.
std::string reason_description
Human-readable reason description.