PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
anonymization_profile.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 <cstdint>
21#include <optional>
22#include <string>
23#include <string_view>
24
25namespace kcenon::pacs::security {
26
40enum class anonymization_profile : std::uint8_t {
51 basic = 0,
52
61 clean_pixel = 1,
62
75
86
97
113
125};
126
132[[nodiscard]] constexpr auto to_string(anonymization_profile profile) noexcept
133 -> std::string_view {
134 switch (profile) {
136 return "basic";
138 return "clean_pixel";
140 return "clean_descriptions";
142 return "retain_longitudinal";
144 return "retain_patient_characteristics";
146 return "hipaa_safe_harbor";
148 return "gdpr_compliant";
149 }
150 return "unknown";
151}
152
158[[nodiscard]] inline auto profile_from_string(std::string_view name)
159 -> std::optional<anonymization_profile> {
160 if (name == "basic") return anonymization_profile::basic;
161 if (name == "clean_pixel") return anonymization_profile::clean_pixel;
162 if (name == "clean_descriptions") return anonymization_profile::clean_descriptions;
163 if (name == "retain_longitudinal") return anonymization_profile::retain_longitudinal;
164 if (name == "retain_patient_characteristics") {
166 }
167 if (name == "hipaa_safe_harbor") return anonymization_profile::hipaa_safe_harbor;
168 if (name == "gdpr_compliant") return anonymization_profile::gdpr_compliant;
169 return std::nullopt;
170}
171
172} // namespace kcenon::pacs::security
constexpr auto to_string(anonymization_profile profile) noexcept -> std::string_view
Convert profile enum to string representation.
anonymization_profile
DICOM de-identification profiles based on PS3.15 Annex E.
@ clean_pixel
Clean Pixel Data - Remove burned-in annotations.
@ hipaa_safe_harbor
HIPAA Safe Harbor - 18 identifier removal.
@ gdpr_compliant
GDPR Compliant - European data protection.
@ retain_longitudinal
Retain Longitudinal - Preserve temporal relationships.
@ retain_patient_characteristics
Retain Patient Characteristics.
@ clean_descriptions
Clean Descriptions - Sanitize text fields.
@ basic
Basic Profile - Remove direct identifiers.
auto profile_from_string(std::string_view name) -> std::optional< anonymization_profile >
Parse profile from string.
std::string_view name