PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
sr_storage.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#ifndef PACS_SERVICES_SOP_CLASSES_SR_STORAGE_HPP
20#define PACS_SERVICES_SOP_CLASSES_SR_STORAGE_HPP
21
22#include <array>
23#include <cstdint>
24#include <string>
25#include <string_view>
26#include <vector>
27
29
30// =============================================================================
31// Structured Report Storage SOP Class UIDs
32// =============================================================================
33
36
38inline constexpr std::string_view basic_text_sr_storage_uid =
39 "1.2.840.10008.5.1.4.1.1.88.11";
40
42inline constexpr std::string_view enhanced_sr_storage_uid =
43 "1.2.840.10008.5.1.4.1.1.88.22";
44
46inline constexpr std::string_view comprehensive_sr_storage_uid =
47 "1.2.840.10008.5.1.4.1.1.88.33";
48
50inline constexpr std::string_view comprehensive_3d_sr_storage_uid =
51 "1.2.840.10008.5.1.4.1.1.88.34";
52
54inline constexpr std::string_view extensible_sr_storage_uid =
55 "1.2.840.10008.5.1.4.1.1.88.35";
56
58
61
63inline constexpr std::string_view mammography_cad_sr_storage_uid =
64 "1.2.840.10008.5.1.4.1.1.88.50";
65
67inline constexpr std::string_view chest_cad_sr_storage_uid =
68 "1.2.840.10008.5.1.4.1.1.88.65";
69
71inline constexpr std::string_view colon_cad_sr_storage_uid =
72 "1.2.840.10008.5.1.4.1.1.88.69";
73
75inline constexpr std::string_view xray_radiation_dose_sr_storage_uid =
76 "1.2.840.10008.5.1.4.1.1.88.67";
77
79inline constexpr std::string_view radiopharmaceutical_radiation_dose_sr_storage_uid =
80 "1.2.840.10008.5.1.4.1.1.88.68";
81
83inline constexpr std::string_view acquisition_context_sr_storage_uid =
84 "1.2.840.10008.5.1.4.1.1.88.71";
85
87inline constexpr std::string_view simplified_adult_echo_sr_storage_uid =
88 "1.2.840.10008.5.1.4.1.1.88.72";
89
91inline constexpr std::string_view patient_radiation_dose_sr_storage_uid =
92 "1.2.840.10008.5.1.4.1.1.88.73";
93
95inline constexpr std::string_view planned_imaging_agent_admin_sr_storage_uid =
96 "1.2.840.10008.5.1.4.1.1.88.74";
97
99inline constexpr std::string_view performed_imaging_agent_admin_sr_storage_uid =
100 "1.2.840.10008.5.1.4.1.1.88.75";
101
103inline constexpr std::string_view enhanced_xray_radiation_dose_sr_storage_uid =
104 "1.2.840.10008.5.1.4.1.1.88.76";
105
107
110
112inline constexpr std::string_view key_object_selection_document_storage_uid =
113 "1.2.840.10008.5.1.4.1.1.88.59";
114
116
117// =============================================================================
118// SR-Specific Transfer Syntaxes
119// =============================================================================
120
130[[nodiscard]] std::vector<std::string> get_sr_transfer_syntaxes();
131
132// =============================================================================
133// SR Document Type
134// =============================================================================
135
153
159[[nodiscard]] sr_document_type get_sr_document_type(std::string_view uid) noexcept;
160
166[[nodiscard]] std::string_view to_string(sr_document_type type) noexcept;
167
168// =============================================================================
169// SR Value Types
170// =============================================================================
171
177enum class sr_value_type {
178 text,
179 code,
180 num,
181 datetime,
182 date,
183 time,
184 uidref,
185 pname,
186 composite,
187 image,
188 waveform,
189 scoord,
190 scoord3d,
191 tcoord,
192 container,
193 table,
194 unknown
195};
196
202[[nodiscard]] std::string_view to_string(sr_value_type type) noexcept;
203
209[[nodiscard]] sr_value_type parse_sr_value_type(std::string_view value) noexcept;
210
216[[nodiscard]] bool is_valid_sr_value_type(std::string_view value) noexcept;
217
218// =============================================================================
219// SR Relationship Types
220// =============================================================================
221
237
243[[nodiscard]] std::string_view to_string(sr_relationship_type type) noexcept;
244
250[[nodiscard]] sr_relationship_type parse_sr_relationship_type(std::string_view value) noexcept;
251
252// =============================================================================
253// SR Completion and Verification
254// =============================================================================
255
260 partial,
261 complete
262};
263
269[[nodiscard]] std::string_view to_string(sr_completion_flag flag) noexcept;
270
276[[nodiscard]] sr_completion_flag parse_sr_completion_flag(std::string_view value) noexcept;
277
282 unverified,
283 verified
284};
285
291[[nodiscard]] std::string_view to_string(sr_verification_flag flag) noexcept;
292
298[[nodiscard]] sr_verification_flag parse_sr_verification_flag(std::string_view value) noexcept;
299
300// =============================================================================
301// SR SOP Class Information
302// =============================================================================
303
316
324[[nodiscard]] std::vector<std::string>
325get_sr_storage_sop_classes(bool include_cad = true, bool include_dose = true);
326
333[[nodiscard]] const sr_sop_class_info*
334get_sr_sop_class_info(std::string_view uid) noexcept;
335
342[[nodiscard]] bool is_sr_storage_sop_class(std::string_view uid) noexcept;
343
350[[nodiscard]] bool is_cad_sr_storage_sop_class(std::string_view uid) noexcept;
351
358[[nodiscard]] bool is_dose_sr_storage_sop_class(std::string_view uid) noexcept;
359
366[[nodiscard]] bool sr_supports_spatial_coords(std::string_view uid) noexcept;
367
368// =============================================================================
369// SR Template Identification
370// =============================================================================
371
377namespace sr_template {
378
380inline constexpr std::string_view basic_diagnostic_imaging_report = "2000";
381
383inline constexpr std::string_view mammography_cad_report = "4000";
384
386inline constexpr std::string_view chest_cad_report = "4100";
387
389inline constexpr std::string_view colon_cad_report = "4200";
390
392inline constexpr std::string_view xray_radiation_dose_report = "10001";
393
395inline constexpr std::string_view ct_radiation_dose_report = "10011";
396
398inline constexpr std::string_view projection_xray_dose_report = "10020";
399
401inline constexpr std::string_view key_object_selection = "2010";
402
404inline constexpr std::string_view measurement_report = "1500";
405
406} // namespace sr_template
407
413[[nodiscard]] std::string_view get_recommended_sr_template(std::string_view uid) noexcept;
414
415} // namespace kcenon::pacs::services::sop_classes
416
417#endif // PACS_SERVICES_SOP_CLASSES_SR_STORAGE_HPP
constexpr std::string_view mammography_cad_report
Mammography CAD Report (TID 4000)
Definition sr_storage.h:383
constexpr std::string_view key_object_selection
Key Object Selection (TID 2010)
Definition sr_storage.h:401
constexpr std::string_view measurement_report
AI Results Report (TID 1500 - measurement group)
Definition sr_storage.h:404
constexpr std::string_view chest_cad_report
Chest CAD Report (TID 4100)
Definition sr_storage.h:386
constexpr std::string_view ct_radiation_dose_report
CT Radiation Dose Report (TID 10011)
Definition sr_storage.h:395
constexpr std::string_view xray_radiation_dose_report
X-Ray Radiation Dose Report (TID 10001)
Definition sr_storage.h:392
constexpr std::string_view projection_xray_dose_report
Projection X-Ray Radiation Dose Report (TID 10020)
Definition sr_storage.h:398
constexpr std::string_view colon_cad_report
Colon CAD Report (TID 4200)
Definition sr_storage.h:389
constexpr std::string_view basic_diagnostic_imaging_report
Basic Diagnostic Imaging Report (TID 2000)
Definition sr_storage.h:380
constexpr std::string_view comprehensive_sr_storage_uid
Comprehensive SR Storage SOP Class UID.
Definition sr_storage.h:46
sr_relationship_type
SR Content Item Relationship Type (0040,A010)
Definition sr_storage.h:227
@ inferred_from
INFERRED FROM - Inference source.
@ selected_from
SELECTED FROM - Selection source.
@ has_concept_mod
HAS CONCEPT MOD - Concept modifier.
@ has_obs_context
HAS OBS CONTEXT - Observation context.
@ has_acq_context
HAS ACQ CONTEXT - Acquisition context.
constexpr std::string_view simplified_adult_echo_sr_storage_uid
Simplified Adult Echo SR Storage SOP Class UID.
Definition sr_storage.h:87
constexpr std::string_view colon_cad_sr_storage_uid
Colon CAD SR Storage SOP Class UID.
Definition sr_storage.h:71
sr_document_type get_sr_document_type(std::string_view uid) noexcept
Get SR document type for a SOP Class UID.
constexpr std::string_view patient_radiation_dose_sr_storage_uid
Patient Radiation Dose SR Storage SOP Class UID.
Definition sr_storage.h:91
constexpr std::string_view mammography_cad_sr_storage_uid
Mammography CAD SR Storage SOP Class UID.
Definition sr_storage.h:63
bool is_dose_sr_storage_sop_class(std::string_view uid) noexcept
Check if a SOP Class UID is a Dose Report SR Storage SOP Class.
constexpr std::string_view radiopharmaceutical_radiation_dose_sr_storage_uid
Radiopharmaceutical Radiation Dose SR Storage SOP Class UID.
Definition sr_storage.h:79
sr_completion_flag parse_sr_completion_flag(std::string_view value) noexcept
Parse SR completion flag from DICOM string.
bool is_sr_storage_sop_class(std::string_view uid) noexcept
Check if a SOP Class UID is an SR Storage SOP Class.
constexpr std::string_view acquisition_context_sr_storage_uid
Acquisition Context SR Storage SOP Class UID.
Definition sr_storage.h:83
bool sr_supports_spatial_coords(std::string_view uid) noexcept
Check if an SR SOP Class supports spatial coordinates.
std::vector< std::string > get_sr_transfer_syntaxes()
Get recommended transfer syntaxes for SR objects.
bool is_valid_sr_value_type(std::string_view value) noexcept
Check if SR value type string is valid.
bool is_cad_sr_storage_sop_class(std::string_view uid) noexcept
Check if a SOP Class UID is a CAD SR Storage SOP Class.
constexpr std::string_view basic_text_sr_storage_uid
Basic Text SR Storage SOP Class UID.
Definition sr_storage.h:38
sr_document_type
SR Document type classification.
Definition sr_storage.h:141
@ procedure_log
Procedure Log - Procedure documentation.
@ enhanced
Enhanced SR - References to images/waveforms.
@ comprehensive
Comprehensive SR - Complex with spatial coords.
@ comprehensive_3d
Comprehensive 3D SR - 3D spatial coordinates.
@ basic_text
Basic Text SR - Simple text reports.
@ cad
CAD SR - Computer-aided detection results.
@ key_object_selection
Key Object Selection - Image selection.
@ dose_report
Dose Report - Radiation dose information.
sr_completion_flag
SR Completion Flag (0040,A491)
Definition sr_storage.h:259
@ partial
PARTIAL - Document is not complete.
sr_value_type parse_sr_value_type(std::string_view value) noexcept
Parse SR value type from DICOM string.
constexpr std::string_view performed_imaging_agent_admin_sr_storage_uid
Performed Imaging Agent Administration SR Storage SOP Class UID.
Definition sr_storage.h:99
std::string_view get_recommended_sr_template(std::string_view uid) noexcept
Get recommended template ID for an SR SOP Class.
sr_relationship_type parse_sr_relationship_type(std::string_view value) noexcept
Parse SR relationship type from DICOM string.
constexpr std::string_view extensible_sr_storage_uid
Extensible SR Storage SOP Class UID.
Definition sr_storage.h:54
sr_verification_flag parse_sr_verification_flag(std::string_view value) noexcept
Parse SR verification flag from DICOM string.
constexpr std::string_view enhanced_sr_storage_uid
Enhanced SR Storage SOP Class UID.
Definition sr_storage.h:42
const sr_sop_class_info * get_sr_sop_class_info(std::string_view uid) noexcept
Get information about a specific SR SOP Class.
constexpr std::string_view xray_radiation_dose_sr_storage_uid
X-Ray Radiation Dose SR Storage SOP Class UID.
Definition sr_storage.h:75
constexpr std::string_view planned_imaging_agent_admin_sr_storage_uid
Planned Imaging Agent Administration SR Storage SOP Class UID.
Definition sr_storage.h:95
constexpr std::string_view comprehensive_3d_sr_storage_uid
Comprehensive 3D SR Storage SOP Class UID.
Definition sr_storage.h:50
sr_verification_flag
SR Verification Flag (0040,A493)
Definition sr_storage.h:281
@ verified
VERIFIED - Verified by authorized person.
constexpr std::string_view chest_cad_sr_storage_uid
Chest CAD SR Storage SOP Class UID.
Definition sr_storage.h:67
@ unknown
Unknown or unspecified laterality.
constexpr std::string_view key_object_selection_document_storage_uid
Key Object Selection Document Storage SOP Class UID.
Definition sr_storage.h:112
sr_value_type
SR Content Item Value Type (0040,A040)
Definition sr_storage.h:177
@ scoord
SCOORD - Spatial coordinates (2D)
@ container
CONTAINER - Container for other items.
@ waveform
WAVEFORM - Reference to waveform.
@ table
TABLE - Tabular data (Extensible SR)
@ scoord3d
SCOORD3D - Spatial coordinates (3D)
@ composite
COMPOSITE - Reference to composite object.
std::string_view to_string(dx_photometric_interpretation interp) noexcept
Convert photometric interpretation enum to DICOM string.
std::vector< std::string > get_sr_storage_sop_classes(bool include_cad=true, bool include_dose=true)
Get all SR Storage SOP Class UIDs.
constexpr std::string_view enhanced_xray_radiation_dose_sr_storage_uid
Enhanced X-Ray Radiation Dose SR Storage SOP Class UID.
Definition sr_storage.h:103
Information about an SR Storage SOP Class.
Definition sr_storage.h:307
std::string_view name
Human-readable name.
Definition sr_storage.h:309
bool is_retired
Whether this SOP class is retired.
Definition sr_storage.h:312
std::string_view description
Brief description.
Definition sr_storage.h:310
sr_document_type document_type
Document type classification.
Definition sr_storage.h:311
bool supports_spatial_coords
Can contain SCOORD/SCOORD3D.
Definition sr_storage.h:313
std::string_view uid