dicom_anonymization/
config.rs

1use super::actions::{Action, HashLength};
2use crate::actions::Action::HashUID;
3use dicom_core::Tag;
4use dicom_dictionary_std::tags;
5use regex::Regex;
6use std::collections::HashMap;
7use std::str::FromStr;
8use std::sync::OnceLock;
9use thiserror::Error;
10
11static UID_ROOT_REGEX: OnceLock<Regex> = OnceLock::new();
12
13const UID_ROOT_MAX_LENGTH: usize = 32;
14const UID_ROOT_DEFAULT_VALUE: &str = "9999";
15const DEIDENTIFIER: &str = "CARECODERS";
16
17/// The [`UidRoot`] struct represents a DICOM UID root that can be used as prefix for
18/// generating new UIDs during de-identification.
19///
20/// The [`UidRoot`] must follow DICOM UID format rules:
21/// - Start with a digit 1-9
22/// - Contain only numbers and dots
23///
24/// It also must not have more than 32 characters.
25///
26/// # Example
27///
28/// ```
29/// use dicom_anonymization::config::UidRoot;
30///
31/// // Create a valid UID root
32/// let uid_root = "1.2.840.123".parse::<UidRoot>().unwrap();
33///
34/// // Invalid UID root (not starting with 1-9)
35/// let invalid = "0.1.2".parse::<UidRoot>();
36/// assert!(invalid.is_err());
37/// ```
38#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd)]
39pub struct UidRoot(String);
40
41#[derive(Error, Debug, Clone, Eq, PartialEq, Ord, PartialOrd)]
42#[error("{0} is not a valid UID root")]
43pub struct UidRootError(String);
44
45#[derive(Error, Debug, Clone, Eq, PartialEq, Ord, PartialOrd)]
46pub enum ConfigError {
47    #[error("invalid UID root: {0}")]
48    InvalidUidRoot(String),
49
50    #[error("invalid hash length: {0}")]
51    InvalidHashLength(String),
52}
53
54impl From<UidRootError> for ConfigError {
55    fn from(err: UidRootError) -> Self {
56        ConfigError::InvalidUidRoot(err.0)
57    }
58}
59
60impl UidRoot {
61    pub fn new(uid_root: &str) -> Result<Self, UidRootError> {
62        let regex = UID_ROOT_REGEX.get_or_init(|| {
63            Regex::new(&format!(
64                r"^([1-9][0-9.]{{0,{}}})?$",
65                UID_ROOT_MAX_LENGTH - 1
66            ))
67            .unwrap()
68        });
69
70        if !regex.is_match(uid_root) {
71            return Err(UidRootError(format!(
72                "UID root must be empty or start with 1-9, contain only numbers and dots, and be no longer than {UID_ROOT_MAX_LENGTH} characters"
73            )));
74        }
75
76        Ok(Self(uid_root.into()))
77    }
78
79    /// Returns a string representation of the [`UidRoot`] suitable for use as a UID prefix.
80    ///
81    /// If the [`UidRoot`] is not empty and does not end with a dot, a dot is appended.
82    /// Whitespace is trimmed from both ends in all cases.
83    ///
84    /// # Returns
85    ///
86    /// A `String` containing the formatted UID prefix
87    pub fn as_prefix(&self) -> String {
88        if !self.0.is_empty() && !self.0.ends_with('.') {
89            format!("{}.", self.0.trim())
90        } else {
91            self.0.trim().into()
92        }
93    }
94}
95
96impl Default for UidRoot {
97    /// Default implementation for [`UidRoot`] that returns a [`UidRoot`] instance
98    /// initialized with the default UID root value (i.e. `"9999"`).
99    fn default() -> Self {
100        Self(UID_ROOT_DEFAULT_VALUE.into())
101    }
102}
103
104impl FromStr for UidRoot {
105    type Err = UidRootError;
106
107    fn from_str(s: &str) -> Result<Self, Self::Err> {
108        UidRoot::new(s)
109    }
110}
111
112impl AsRef<str> for UidRoot {
113    fn as_ref(&self) -> &str {
114        &self.0
115    }
116}
117
118#[derive(Debug, Clone, PartialEq)]
119enum PreservationPolicy {
120    Remove,
121    Keep,
122}
123
124/// Configuration for DICOM de-identification.
125///
126/// This struct contains all the settings that control how DICOM objects will be de-identified, including
127/// UID handling, tag-specific actions, and policies for special tag groups.
128///
129/// # Fields
130///
131/// * `uid_root` - The [`UidRoot`] to use as prefix when generating new UIDs during de-identification
132/// * `tag_actions` - Mapping of specific DICOM tags to their corresponding de-identification actions
133/// * `private_tags` - Policy determining whether to keep or remove private DICOM tags
134/// * `curves` - Policy determining whether to keep or remove curve data (groups `0x5000-0x50FF`)
135/// * `overlays` - Policy determining whether to keep or remove overlay data (groups `0x6000-0x60FF`)
136#[derive(Debug, Clone, PartialEq)]
137pub struct Config {
138    uid_root: UidRoot,
139    tag_actions: HashMap<Tag, Action>,
140    private_tags: PreservationPolicy,
141    curves: PreservationPolicy,
142    overlays: PreservationPolicy,
143}
144
145pub(crate) fn is_private_tag(tag: &Tag) -> bool {
146    // tags with odd group numbers are private tags
147    tag.group() % 2 != 0
148}
149
150pub(crate) fn is_curve_tag(tag: &Tag) -> bool {
151    (tag.group() & 0xFF00) == 0x5000
152}
153
154pub(crate) fn is_overlay_tag(tag: &Tag) -> bool {
155    (tag.group() & 0xFF00) == 0x6000
156}
157
158impl Config {
159    pub fn get_uid_root(&self) -> &UidRoot {
160        &self.uid_root
161    }
162
163    /// Returns the appropriate [`Action`] to take for a given DICOM tag.
164    ///
165    /// This function determines what action should be taken for a specific tag during de-identification
166    /// by checking:
167    /// 1. If the tag has an explicit action defined in `tag_actions`
168    /// 2. Whether the tag should be removed based on the configuration for tag groups (i.e. private tags, curves, overlays)
169    ///
170    /// # Priority Rules
171    /// - If the tag has an explicit action configured of `Action::None` but should be removed based on point 2., returns `Action::Remove`
172    /// - If the tag has any other explicit action configured, returns that action
173    /// - If the tag has no explicit action configured but should be removed based on point 2., returns `Action::Remove`
174    /// - If the tag has no explicit action configured and shouldn't be removed based on point 2., returns `Action::Keep`
175    ///
176    /// # Arguments
177    ///
178    /// * `tag` - Reference to the DICOM tag to get the action for
179    ///
180    /// # Returns
181    ///
182    /// A reference to the appropriate [`Action`] to take for the given tag
183    pub fn get_action(&self, tag: &Tag) -> &Action {
184        match self.tag_actions.get(tag) {
185            Some(action) if self.should_be_removed(tag) && action == &Action::None => {
186                &Action::Remove
187            }
188            Some(action) => action,
189            None if self.should_be_removed(tag) => &Action::Remove,
190            None => &Action::Keep,
191        }
192    }
193
194    fn should_be_removed(&self, tag: &Tag) -> bool {
195        match tag {
196            tag if self.remove_private_tags() && is_private_tag(tag) => true,
197            tag if self.remove_curves() && is_curve_tag(tag) => true,
198            tag if self.remove_overlays() && is_overlay_tag(tag) => true,
199            _ => false,
200        }
201    }
202
203    fn remove_private_tags(&self) -> bool {
204        matches!(self.private_tags, PreservationPolicy::Remove)
205    }
206
207    fn remove_curves(&self) -> bool {
208        matches!(self.curves, PreservationPolicy::Remove)
209    }
210
211    fn remove_overlays(&self) -> bool {
212        matches!(self.overlays, PreservationPolicy::Remove)
213    }
214}
215
216/// A builder for [`Config`] to configure DICOM de-identification settings.
217///
218/// The builder provides methods to customize various aspects of de-identification, including:
219/// - Setting the UID root prefix for generating UIDs
220/// - Configuring actions for specific DICOM tags
221/// - Setting policies for private tags, curves, and overlays
222///
223/// # Example
224///
225/// ```
226/// use dicom_anonymization::config::ConfigBuilder;
227/// use dicom_anonymization::actions::Action;
228/// use dicom_dictionary_std::tags;
229///
230/// let config = ConfigBuilder::new()
231///     .uid_root("1.2.840.123".parse().unwrap())
232///     .tag_action(tags::PATIENT_NAME, Action::Empty)
233///     .tag_action(tags::PATIENT_ID, Action::Hash(None))
234///     .remove_private_tags(true)
235///     .build();
236/// ```
237pub struct ConfigBuilder(Config);
238
239impl ConfigBuilder {
240    pub fn new() -> Self {
241        ConfigBuilder(Config {
242            uid_root: "".parse().unwrap(),
243            tag_actions: HashMap::<Tag, Action>::new(),
244            private_tags: PreservationPolicy::Remove,
245            curves: PreservationPolicy::Remove,
246            overlays: PreservationPolicy::Remove,
247        })
248    }
249
250    /// Sets the UID root for the configuration.
251    ///
252    /// The [`UidRoot`] provides the prefix that will be used when creating new UIDs with [`Action::HashUID`].
253    /// It must follow DICOM UID format rules: start with a digit 1-9 and contain only numbers and dots.
254    /// It must also have no more than 32 characters.
255    ///
256    /// Setting it is optional. In that case, no specific UID prefix will be used when creating new UIDs.
257    ///
258    /// # Example
259    ///
260    /// ```
261    /// use dicom_anonymization::config::ConfigBuilder;
262    ///
263    /// let config = ConfigBuilder::new()
264    ///     .uid_root("1.2.840.123".parse().unwrap())
265    ///     .build();
266    /// ```
267    pub fn uid_root(mut self, uid_root: UidRoot) -> Self {
268        self.0.uid_root = uid_root;
269        self
270    }
271
272    /// Sets the action to take for a specific DICOM tag.
273    ///
274    /// The action determines how the tag value will be handled during de-identification.
275    ///
276    /// # Arguments
277    ///
278    /// * `tag` - The DICOM tag to apply the action to
279    /// * `action` - The [`Action`] to take
280    ///
281    /// # Examples
282    ///
283    /// ```
284    /// use dicom_anonymization::actions::{Action, HashLength};
285    /// use dicom_anonymization::config::ConfigBuilder;
286    /// use dicom_dictionary_std::tags;
287    ///
288    /// let mut config_builder = ConfigBuilder::new();
289    ///
290    /// // Keep the tag value unchanged
291    /// config_builder = config_builder.tag_action(tags::MODALITY, Action::Keep);
292    ///
293    /// // Remove the tag completely
294    /// config_builder = config_builder.tag_action(tags::SERIES_DATE, Action::Remove);
295    ///
296    /// // Replace with empty value
297    /// config_builder = config_builder.tag_action(tags::PATIENT_SEX, Action::Empty);
298    ///
299    /// // Hash the value with specified length
300    /// config_builder = config_builder.tag_action(tags::PATIENT_ID, Action::Hash(Some(HashLength::new(10).unwrap())));
301    ///
302    /// // Hash a UID
303    /// config_builder = config_builder.tag_action(tags::STUDY_INSTANCE_UID, Action::HashUID);
304    ///
305    /// // Replace a date with another date using a hash of another tag value to determine the offset
306    /// config_builder = config_builder.tag_action(tags::STUDY_DATE, Action::HashDate(tags::PATIENT_ID));
307    ///
308    /// // Replace with specific value
309    /// config_builder = config_builder.tag_action(tags::DEIDENTIFICATION_METHOD, Action::Replace("MYAPP".into()));
310    ///
311    /// // No specific tag action
312    /// //
313    /// // Mainly for documentation purposes to show that certain tags were considered, but
314    /// // that no specific tag actions are applied to those.
315    /// config_builder = config_builder.tag_action(tags::IMAGE_TYPE, Action::None);
316    /// ```
317    pub fn tag_action(mut self, tag: Tag, action: Action) -> Self {
318        self.0.tag_actions.insert(tag, action);
319        self
320    }
321
322    /// Controls whether private DICOM tags will be removed during de-identification.
323    ///
324    /// Private DICOM tags are those with odd group numbers. This function configures whether
325    /// these tags should be removed or preserved.
326    ///
327    /// By default (i.e. if not explicitly set to `false`) all private tags will be removed. If enabled,
328    /// individual private tags can still be kept by setting a specific tag [`Action`] for those
329    /// (except [`Action::None`]).
330    ///
331    /// # Arguments
332    ///
333    /// * `remove` - If `true`, all private tags will be removed. If `false`, they will be kept.
334    ///
335    /// # Examples
336    ///
337    /// ```
338    /// use dicom_anonymization::config::ConfigBuilder;
339    ///
340    /// // Remove private tags (default)
341    /// let config = ConfigBuilder::new()
342    ///     .remove_private_tags(true)
343    ///     .build();
344    ///
345    /// // Keep private tags
346    /// let config = ConfigBuilder::new()
347    ///     .remove_private_tags(false)
348    ///     .build();
349    /// ```
350    pub fn remove_private_tags(mut self, remove: bool) -> Self {
351        match remove {
352            true => self.0.private_tags = PreservationPolicy::Remove,
353            false => self.0.private_tags = PreservationPolicy::Keep,
354        }
355        self
356    }
357
358    /// Controls whether DICOM curve tags (from groups `0x5000-0x50FF`) will be removed during de-identification.
359    ///
360    /// By default (i.e. if not explicitly set to `false`) all curve tags will be removed. If enabled,
361    /// individual curve tags can still be kept by setting a specific tag [`Action`] for those
362    /// (except [`Action::None`]).
363    ///
364    /// # Arguments
365    ///
366    /// * `remove` - If `true`, all curve tags will be removed. If `false`, they will be kept.
367    ///
368    /// # Examples
369    ///
370    /// ```
371    /// use dicom_anonymization::config::ConfigBuilder;
372    ///
373    /// // Remove curve tags (default)
374    /// let config = ConfigBuilder::new()
375    ///     .remove_curves(true)
376    ///     .build();
377    ///
378    /// // Keep curve tags
379    /// let config = ConfigBuilder::new()
380    ///     .remove_curves(false)
381    ///     .build();
382    /// ```
383    pub fn remove_curves(mut self, remove: bool) -> Self {
384        match remove {
385            true => self.0.curves = PreservationPolicy::Remove,
386            false => self.0.curves = PreservationPolicy::Keep,
387        }
388        self
389    }
390
391    /// Controls whether DICOM overlay tags (from groups `0x6000-0x60FF`) will be removed during de-identification.
392    ///
393    /// By default (i.e. if not explicitly set to `false`) all overlay tags will be removed. If enabled,
394    /// individual overlay tags can still be kept by setting a specific tag [`Action`] for those
395    /// (except [`Action::None`]).
396    ///
397    /// # Arguments
398    ///
399    /// * `remove` - If `true`, all overlay tags will be removed. If `false`, they will be kept.
400    ///
401    /// # Examples
402    ///
403    /// ```
404    /// use dicom_anonymization::config::ConfigBuilder;
405    ///
406    /// // Remove overlay tags (default)
407    /// let config = ConfigBuilder::new()
408    ///     .remove_overlays(true)
409    ///     .build();
410    ///
411    /// // Keep overlay tags
412    /// let config = ConfigBuilder::new()
413    ///     .remove_overlays(false)
414    ///     .build();
415    /// ```
416    pub fn remove_overlays(mut self, remove: bool) -> Self {
417        match remove {
418            true => self.0.overlays = PreservationPolicy::Remove,
419            false => self.0.overlays = PreservationPolicy::Keep,
420        }
421        self
422    }
423
424    /// Transforms the [`ConfigBuilder`] into a [`Config`] with all configured options.
425    ///
426    /// # Example
427    ///
428    /// ```
429    /// use dicom_anonymization::config::ConfigBuilder;
430    /// use dicom_anonymization::actions::Action;
431    /// use dicom_core::Tag;
432    /// use dicom_dictionary_std::tags;
433    ///
434    /// let config = ConfigBuilder::new()
435    ///     .uid_root("1.2.840.123".parse().unwrap())
436    ///     .tag_action(tags::SOP_INSTANCE_UID, Action::HashUID)
437    ///     .tag_action(tags::PATIENT_NAME, Action::Empty)
438    ///     .tag_action(Tag(0x0033, 0x0010), Action::Keep)
439    ///     .build();
440    /// ```
441    pub fn build(self) -> Config {
442        self.0
443    }
444}
445
446impl Default for ConfigBuilder {
447    #[allow(deprecated)]
448    /// Creates a new `ConfigBuilder` with the default configuration.
449    ///
450    /// The default configuration includes a standard set of tag actions for DICOM de-identification,
451    /// as well as default settings for removing private tags, curves, and overlays. Also, a default
452    /// [`UidRoot`] value is used (i.e. `"9999"`).
453    ///
454    /// Returns a `ConfigBuilder` initialized with these default settings, which can be further customized
455    /// if needed before building the final [`Config`].
456    fn default() -> Self {
457        Self::new()
458            .uid_root(UidRoot::default())
459            .remove_private_tags(true)
460            .remove_curves(true)
461            .remove_overlays(true)
462            .tag_action(tags::SPECIFIC_CHARACTER_SET, Action::Keep)
463            .tag_action(tags::IMAGE_TYPE, Action::None)
464            .tag_action(
465                tags::INSTANCE_CREATION_DATE,
466                Action::HashDate(tags::PATIENT_ID),
467            )
468            .tag_action(tags::INSTANCE_CREATION_TIME, Action::None)
469            .tag_action(tags::INSTANCE_CREATOR_UID, Action::HashUID)
470            .tag_action(
471                tags::INSTANCE_COERCION_DATE_TIME,
472                Action::HashDate(tags::PATIENT_ID),
473            ) // nic
474            .tag_action(tags::SOP_CLASS_UID, Action::Keep)
475            .tag_action(tags::ACQUISITION_UID, Action::HashUID) // nic
476            .tag_action(tags::SOP_INSTANCE_UID, Action::HashUID)
477            .tag_action(tags::STUDY_DATE, Action::HashDate(tags::PATIENT_ID))
478            .tag_action(tags::SERIES_DATE, Action::Remove)
479            .tag_action(tags::ACQUISITION_DATE, Action::Remove)
480            .tag_action(tags::CONTENT_DATE, Action::HashDate(tags::PATIENT_ID))
481            .tag_action(tags::OVERLAY_DATE, Action::Remove)
482            .tag_action(tags::CURVE_DATE, Action::Remove)
483            .tag_action(tags::ACQUISITION_DATE_TIME, Action::Remove)
484            .tag_action(tags::STUDY_TIME, Action::Empty)
485            .tag_action(tags::SERIES_TIME, Action::Remove)
486            .tag_action(tags::ACQUISITION_TIME, Action::Remove)
487            .tag_action(tags::CONTENT_TIME, Action::Empty)
488            .tag_action(tags::OVERLAY_TIME, Action::Remove)
489            .tag_action(tags::CURVE_TIME, Action::Remove)
490            .tag_action(
491                tags::ACCESSION_NUMBER,
492                Action::Hash(Some(HashLength::new(16).unwrap())),
493            )
494            .tag_action(tags::QUERY_RETRIEVE_LEVEL, Action::None)
495            .tag_action(tags::RETRIEVE_AE_TITLE, Action::None)
496            .tag_action(tags::STATION_AE_TITLE, Action::None) // nic
497            .tag_action(tags::INSTANCE_AVAILABILITY, Action::None)
498            .tag_action(tags::FAILED_SOP_INSTANCE_UID_LIST, Action::HashUID)
499            .tag_action(tags::MODALITY, Action::Keep)
500            .tag_action(tags::MODALITIES_IN_STUDY, Action::None)
501            .tag_action(tags::ANATOMIC_REGIONS_IN_STUDY_CODE_SEQUENCE, Action::None) // nic
502            .tag_action(tags::CONVERSION_TYPE, Action::None)
503            .tag_action(tags::PRESENTATION_INTENT_TYPE, Action::None)
504            .tag_action(tags::MANUFACTURER, Action::Empty)
505            .tag_action(tags::INSTITUTION_NAME, Action::Remove)
506            .tag_action(tags::INSTITUTION_ADDRESS, Action::Remove)
507            .tag_action(tags::INSTITUTION_CODE_SEQUENCE, Action::None)
508            .tag_action(tags::REFERRING_PHYSICIAN_NAME, Action::Empty)
509            .tag_action(tags::REFERRING_PHYSICIAN_ADDRESS, Action::Remove)
510            .tag_action(tags::REFERRING_PHYSICIAN_TELEPHONE_NUMBERS, Action::Remove)
511            .tag_action(
512                tags::REFERRING_PHYSICIAN_IDENTIFICATION_SEQUENCE,
513                Action::Remove,
514            )
515            .tag_action(tags::CONSULTING_PHYSICIAN_NAME, Action::Remove) // nic
516            .tag_action(
517                tags::CONSULTING_PHYSICIAN_IDENTIFICATION_SEQUENCE,
518                Action::Remove,
519            ) // nic
520            .tag_action(tags::CODE_VALUE, Action::None)
521            .tag_action(tags::CODING_SCHEME_DESIGNATOR, Action::None)
522            .tag_action(tags::CODING_SCHEME_VERSION, Action::None)
523            .tag_action(tags::CODE_MEANING, Action::None)
524            .tag_action(tags::MAPPING_RESOURCE, Action::None)
525            .tag_action(tags::CONTEXT_GROUP_VERSION, Action::None)
526            .tag_action(tags::CONTEXT_GROUP_LOCAL_VERSION, Action::None)
527            .tag_action(tags::EXTENDED_CODE_MEANING, Action::None) // nic
528            .tag_action(tags::CODING_SCHEME_URL_TYPE, Action::None) // nic
529            .tag_action(tags::CONTEXT_GROUP_EXTENSION_FLAG, Action::None)
530            .tag_action(tags::CODING_SCHEME_UID, Action::HashUID)
531            .tag_action(tags::CONTEXT_GROUP_EXTENSION_CREATOR_UID, Action::HashUID)
532            .tag_action(tags::CODING_SCHEME_URL, Action::None) // nic
533            .tag_action(tags::CONTEXT_IDENTIFIER, Action::None)
534            .tag_action(tags::CODING_SCHEME_REGISTRY, Action::None) // nic
535            .tag_action(tags::CODING_SCHEME_EXTERNAL_ID, Action::None) // nic
536            .tag_action(tags::CODING_SCHEME_NAME, Action::None) // nic
537            .tag_action(tags::CODING_SCHEME_RESPONSIBLE_ORGANIZATION, Action::None) // nic
538            .tag_action(tags::CONTEXT_UID, Action::HashUID) // nic
539            .tag_action(tags::MAPPING_RESOURCE_UID, Action::HashUID) // nic
540            .tag_action(tags::LONG_CODE_VALUE, Action::None) // nic
541            .tag_action(tags::URN_CODE_VALUE, Action::None) // nic
542            .tag_action(tags::EQUIVALENT_CODE_SEQUENCE, Action::None) // nic
543            .tag_action(tags::MAPPING_RESOURCE_NAME, Action::None) // nic
544            .tag_action(tags::TIMEZONE_OFFSET_FROM_UTC, Action::Remove)
545            // checked nic's until here
546            .tag_action(tags::STATION_NAME, Action::Remove)
547            .tag_action(tags::STUDY_DESCRIPTION, Action::Keep)
548            .tag_action(tags::PROCEDURE_CODE_SEQUENCE, Action::None)
549            .tag_action(tags::SERIES_DESCRIPTION, Action::Keep)
550            .tag_action(tags::INSTITUTIONAL_DEPARTMENT_NAME, Action::Remove)
551            .tag_action(tags::PHYSICIANS_OF_RECORD, Action::Remove)
552            .tag_action(
553                tags::PHYSICIANS_OF_RECORD_IDENTIFICATION_SEQUENCE,
554                Action::Remove,
555            )
556            .tag_action(tags::PERFORMING_PHYSICIAN_NAME, Action::Remove)
557            .tag_action(
558                tags::PERFORMING_PHYSICIAN_IDENTIFICATION_SEQUENCE,
559                Action::Remove,
560            )
561            .tag_action(tags::NAME_OF_PHYSICIANS_READING_STUDY, Action::Remove)
562            .tag_action(
563                tags::PHYSICIANS_READING_STUDY_IDENTIFICATION_SEQUENCE,
564                Action::Remove,
565            )
566            .tag_action(tags::OPERATORS_NAME, Action::Remove)
567            .tag_action(tags::OPERATOR_IDENTIFICATION_SEQUENCE, Action::Remove)
568            .tag_action(tags::ADMITTING_DIAGNOSES_DESCRIPTION, Action::Remove)
569            .tag_action(tags::ADMITTING_DIAGNOSES_CODE_SEQUENCE, Action::Remove)
570            .tag_action(tags::MANUFACTURER_MODEL_NAME, Action::Remove)
571            .tag_action(tags::REFERENCED_RESULTS_SEQUENCE, Action::None)
572            .tag_action(tags::REFERENCED_STUDY_SEQUENCE, Action::Remove)
573            .tag_action(
574                tags::REFERENCED_PERFORMED_PROCEDURE_STEP_SEQUENCE,
575                Action::Remove,
576            )
577            .tag_action(tags::REFERENCED_SERIES_SEQUENCE, Action::None)
578            .tag_action(tags::REFERENCED_PATIENT_SEQUENCE, Action::Remove)
579            .tag_action(tags::REFERENCED_VISIT_SEQUENCE, Action::None)
580            .tag_action(tags::REFERENCED_OVERLAY_SEQUENCE, Action::None)
581            .tag_action(tags::REFERENCED_IMAGE_SEQUENCE, Action::Remove)
582            .tag_action(tags::REFERENCED_CURVE_SEQUENCE, Action::None)
583            .tag_action(tags::REFERENCED_INSTANCE_SEQUENCE, Action::None)
584            .tag_action(tags::REFERENCED_SOP_CLASS_UID, Action::Keep)
585            .tag_action(tags::REFERENCED_SOP_INSTANCE_UID, Action::HashUID)
586            .tag_action(tags::SOP_CLASSES_SUPPORTED, Action::None)
587            .tag_action(tags::REFERENCED_FRAME_NUMBER, Action::None)
588            .tag_action(tags::TRANSACTION_UID, Action::HashUID)
589            .tag_action(tags::FAILURE_REASON, Action::None)
590            .tag_action(tags::FAILED_SOP_SEQUENCE, Action::None)
591            .tag_action(tags::REFERENCED_SOP_SEQUENCE, Action::None)
592            .tag_action(tags::DERIVATION_DESCRIPTION, Action::Remove)
593            .tag_action(tags::SOURCE_IMAGE_SEQUENCE, Action::Remove)
594            .tag_action(tags::STAGE_NAME, Action::None)
595            .tag_action(tags::STAGE_NUMBER, Action::None)
596            .tag_action(tags::NUMBER_OF_STAGES, Action::None)
597            .tag_action(tags::VIEW_NUMBER, Action::None)
598            .tag_action(tags::NUMBER_OF_EVENT_TIMERS, Action::None)
599            .tag_action(tags::NUMBER_OF_VIEWS_IN_STAGE, Action::None)
600            .tag_action(tags::EVENT_ELAPSED_TIMES, Action::None)
601            .tag_action(tags::EVENT_TIMER_NAMES, Action::None)
602            .tag_action(tags::START_TRIM, Action::None)
603            .tag_action(tags::STOP_TRIM, Action::None)
604            .tag_action(tags::RECOMMENDED_DISPLAY_FRAME_RATE, Action::None)
605            .tag_action(tags::ANATOMIC_REGION_SEQUENCE, Action::None)
606            .tag_action(tags::ANATOMIC_REGION_MODIFIER_SEQUENCE, Action::None)
607            .tag_action(tags::PRIMARY_ANATOMIC_STRUCTURE_SEQUENCE, Action::None)
608            .tag_action(
609                tags::ANATOMIC_STRUCTURE_SPACE_OR_REGION_SEQUENCE,
610                Action::None,
611            )
612            .tag_action(
613                tags::PRIMARY_ANATOMIC_STRUCTURE_MODIFIER_SEQUENCE,
614                Action::None,
615            )
616            .tag_action(tags::TRANSDUCER_POSITION_SEQUENCE, Action::None)
617            .tag_action(tags::TRANSDUCER_POSITION_MODIFIER_SEQUENCE, Action::None)
618            .tag_action(tags::TRANSDUCER_ORIENTATION_SEQUENCE, Action::None)
619            .tag_action(tags::TRANSDUCER_ORIENTATION_MODIFIER_SEQUENCE, Action::None)
620            .tag_action(tags::IRRADIATION_EVENT_UID, HashUID)
621            .tag_action(tags::IDENTIFYING_COMMENTS, Action::Remove)
622            .tag_action(tags::FRAME_TYPE, Action::None)
623            .tag_action(tags::REFERENCED_IMAGE_EVIDENCE_SEQUENCE, Action::None)
624            .tag_action(tags::REFERENCED_RAW_DATA_SEQUENCE, Action::None)
625            .tag_action(tags::CREATOR_VERSION_UID, HashUID)
626            .tag_action(tags::DERIVATION_IMAGE_SEQUENCE, Action::None)
627            .tag_action(tags::SOURCE_IMAGE_EVIDENCE_SEQUENCE, Action::None)
628            .tag_action(tags::PIXEL_PRESENTATION, Action::None)
629            .tag_action(tags::VOLUMETRIC_PROPERTIES, Action::None)
630            .tag_action(tags::VOLUME_BASED_CALCULATION_TECHNIQUE, Action::None)
631            .tag_action(tags::COMPLEX_IMAGE_COMPONENT, Action::None)
632            .tag_action(tags::ACQUISITION_CONTRAST, Action::None)
633            .tag_action(tags::DERIVATION_CODE_SEQUENCE, Action::None)
634            .tag_action(tags::REFERENCED_PRESENTATION_STATE_SEQUENCE, Action::None)
635            .tag_action(
636                tags::PATIENT_NAME,
637                Action::Hash(Some(HashLength::new(10).unwrap())),
638            )
639            .tag_action(
640                tags::PATIENT_ID,
641                Action::Hash(Some(HashLength::new(10).unwrap())),
642            )
643            .tag_action(tags::ISSUER_OF_PATIENT_ID, Action::Remove)
644            .tag_action(tags::PATIENT_BIRTH_DATE, Action::HashDate(tags::PATIENT_ID))
645            .tag_action(tags::PATIENT_BIRTH_TIME, Action::Remove)
646            .tag_action(tags::PATIENT_SEX, Action::Empty)
647            .tag_action(tags::PATIENT_INSURANCE_PLAN_CODE_SEQUENCE, Action::Remove)
648            .tag_action(tags::PATIENT_PRIMARY_LANGUAGE_CODE_SEQUENCE, Action::Remove)
649            .tag_action(tags::OTHER_PATIENT_I_DS, Action::Remove)
650            .tag_action(tags::OTHER_PATIENT_NAMES, Action::Remove)
651            .tag_action(tags::OTHER_PATIENT_I_DS_SEQUENCE, Action::Remove)
652            .tag_action(tags::PATIENT_BIRTH_NAME, Action::Remove)
653            .tag_action(tags::PATIENT_AGE, Action::Remove)
654            .tag_action(tags::PATIENT_SIZE, Action::Remove)
655            .tag_action(tags::PATIENT_WEIGHT, Action::Remove)
656            .tag_action(tags::PATIENT_ADDRESS, Action::Remove)
657            .tag_action(tags::INSURANCE_PLAN_IDENTIFICATION, Action::Remove)
658            .tag_action(tags::PATIENT_MOTHER_BIRTH_NAME, Action::Remove)
659            .tag_action(tags::MILITARY_RANK, Action::Remove)
660            .tag_action(tags::BRANCH_OF_SERVICE, Action::Remove)
661            .tag_action(tags::MEDICAL_RECORD_LOCATOR, Action::Remove)
662            .tag_action(tags::MEDICAL_ALERTS, Action::Remove)
663            .tag_action(tags::ALLERGIES, Action::Remove)
664            .tag_action(tags::COUNTRY_OF_RESIDENCE, Action::Remove)
665            .tag_action(tags::REGION_OF_RESIDENCE, Action::Remove)
666            .tag_action(tags::PATIENT_TELEPHONE_NUMBERS, Action::Remove)
667            .tag_action(tags::PATIENT_TELECOM_INFORMATION, Action::Remove) // nic
668            .tag_action(tags::ETHNIC_GROUP, Action::Remove)
669            .tag_action(tags::OCCUPATION, Action::Remove)
670            .tag_action(tags::SMOKING_STATUS, Action::Remove)
671            .tag_action(tags::ADDITIONAL_PATIENT_HISTORY, Action::Remove)
672            .tag_action(tags::PREGNANCY_STATUS, Action::Remove)
673            .tag_action(tags::LAST_MENSTRUAL_DATE, Action::Remove)
674            .tag_action(tags::PATIENT_RELIGIOUS_PREFERENCE, Action::Remove)
675            .tag_action(tags::PATIENT_SEX_NEUTERED, Action::Remove)
676            .tag_action(tags::RESPONSIBLE_PERSON, Action::Remove)
677            .tag_action(tags::RESPONSIBLE_ORGANIZATION, Action::Remove)
678            .tag_action(tags::PATIENT_COMMENTS, Action::Remove)
679            .tag_action(tags::CLINICAL_TRIAL_SPONSOR_NAME, Action::None)
680            .tag_action(tags::CLINICAL_TRIAL_PROTOCOL_ID, Action::None)
681            .tag_action(tags::CLINICAL_TRIAL_PROTOCOL_NAME, Action::None)
682            .tag_action(tags::CLINICAL_TRIAL_SITE_ID, Action::None)
683            .tag_action(tags::CLINICAL_TRIAL_SITE_NAME, Action::None)
684            .tag_action(tags::CLINICAL_TRIAL_SUBJECT_ID, Action::None)
685            .tag_action(tags::CLINICAL_TRIAL_SUBJECT_READING_ID, Action::None)
686            .tag_action(tags::CLINICAL_TRIAL_TIME_POINT_ID, Action::None)
687            .tag_action(tags::CLINICAL_TRIAL_TIME_POINT_DESCRIPTION, Action::None)
688            .tag_action(tags::CLINICAL_TRIAL_COORDINATING_CENTER_NAME, Action::None)
689            // patient identity removal behaviour can be overridden by the user, therefore we can't know
690            // for sure whether this happened or not
691            .tag_action(tags::PATIENT_IDENTITY_REMOVED, Action::Remove)
692            .tag_action(
693                tags::DEIDENTIFICATION_METHOD,
694                Action::Replace(DEIDENTIFIER.into()),
695            )
696            .tag_action(tags::DEIDENTIFICATION_METHOD_CODE_SEQUENCE, Action::Remove)
697            .tag_action(tags::CONTRAST_BOLUS_AGENT, Action::Empty)
698            .tag_action(tags::CONTRAST_BOLUS_AGENT_SEQUENCE, Action::None)
699            .tag_action(
700                tags::CONTRAST_BOLUS_ADMINISTRATION_ROUTE_SEQUENCE,
701                Action::None,
702            )
703            .tag_action(tags::BODY_PART_EXAMINED, Action::Keep)
704            .tag_action(tags::SCANNING_SEQUENCE, Action::None)
705            .tag_action(tags::SEQUENCE_VARIANT, Action::None)
706            .tag_action(tags::SCAN_OPTIONS, Action::None)
707            .tag_action(tags::MR_ACQUISITION_TYPE, Action::None)
708            .tag_action(tags::SEQUENCE_NAME, Action::None)
709            .tag_action(tags::ANGIO_FLAG, Action::None)
710            .tag_action(tags::INTERVENTION_DRUG_INFORMATION_SEQUENCE, Action::None)
711            .tag_action(tags::INTERVENTION_DRUG_STOP_TIME, Action::None)
712            .tag_action(tags::INTERVENTION_DRUG_DOSE, Action::None)
713            .tag_action(tags::INTERVENTION_DRUG_CODE_SEQUENCE, Action::None)
714            .tag_action(tags::ADDITIONAL_DRUG_SEQUENCE, Action::None)
715            .tag_action(tags::RADIOPHARMACEUTICAL, Action::None)
716            .tag_action(tags::INTERVENTION_DRUG_NAME, Action::None)
717            .tag_action(tags::INTERVENTION_DRUG_START_TIME, Action::None)
718            .tag_action(tags::INTERVENTION_SEQUENCE, Action::None)
719            .tag_action(tags::THERAPY_TYPE, Action::None)
720            .tag_action(tags::INTERVENTION_STATUS, Action::None)
721            .tag_action(tags::THERAPY_DESCRIPTION, Action::None)
722            .tag_action(tags::CINE_RATE, Action::None)
723            .tag_action(tags::SLICE_THICKNESS, Action::None)
724            .tag_action(tags::KVP, Action::None)
725            .tag_action(tags::COUNTS_ACCUMULATED, Action::None)
726            .tag_action(tags::ACQUISITION_TERMINATION_CONDITION, Action::None)
727            .tag_action(tags::EFFECTIVE_DURATION, Action::None)
728            .tag_action(tags::ACQUISITION_START_CONDITION, Action::None)
729            .tag_action(tags::ACQUISITION_START_CONDITION_DATA, Action::None)
730            .tag_action(tags::ACQUISITION_TERMINATION_CONDITION_DATA, Action::None)
731            .tag_action(tags::REPETITION_TIME, Action::None)
732            .tag_action(tags::ECHO_TIME, Action::None)
733            .tag_action(tags::INVERSION_TIME, Action::None)
734            .tag_action(tags::NUMBER_OF_AVERAGES, Action::None)
735            .tag_action(tags::IMAGING_FREQUENCY, Action::None)
736            .tag_action(tags::IMAGED_NUCLEUS, Action::None)
737            .tag_action(tags::ECHO_NUMBERS, Action::None)
738            .tag_action(tags::MAGNETIC_FIELD_STRENGTH, Action::None)
739            .tag_action(tags::SPACING_BETWEEN_SLICES, Action::None)
740            .tag_action(tags::NUMBER_OF_PHASE_ENCODING_STEPS, Action::None)
741            .tag_action(tags::DATA_COLLECTION_DIAMETER, Action::None)
742            .tag_action(tags::ECHO_TRAIN_LENGTH, Action::None)
743            .tag_action(tags::PERCENT_SAMPLING, Action::None)
744            .tag_action(tags::PERCENT_PHASE_FIELD_OF_VIEW, Action::None)
745            .tag_action(tags::PIXEL_BANDWIDTH, Action::None)
746            .tag_action(tags::DEVICE_SERIAL_NUMBER, Action::Remove)
747            .tag_action(tags::DEVICE_UID, Action::HashUID)
748            .tag_action(tags::PLATE_ID, Action::Remove)
749            .tag_action(tags::GENERATOR_ID, Action::Remove)
750            .tag_action(tags::CASSETTE_ID, Action::Remove)
751            .tag_action(tags::GANTRY_ID, Action::Remove)
752            .tag_action(tags::SECONDARY_CAPTURE_DEVICE_ID, Action::None)
753            .tag_action(tags::HARDCOPY_CREATION_DEVICE_ID, Action::None)
754            .tag_action(
755                tags::DATE_OF_SECONDARY_CAPTURE,
756                Action::HashDate(tags::PATIENT_ID),
757            )
758            .tag_action(tags::TIME_OF_SECONDARY_CAPTURE, Action::None)
759            .tag_action(tags::SECONDARY_CAPTURE_DEVICE_MANUFACTURER, Action::None)
760            .tag_action(tags::HARDCOPY_DEVICE_MANUFACTURER, Action::None)
761            .tag_action(
762                tags::SECONDARY_CAPTURE_DEVICE_MANUFACTURER_MODEL_NAME,
763                Action::None,
764            )
765            .tag_action(
766                tags::SECONDARY_CAPTURE_DEVICE_SOFTWARE_VERSIONS,
767                Action::None,
768            )
769            .tag_action(tags::HARDCOPY_DEVICE_SOFTWARE_VERSION, Action::None)
770            .tag_action(tags::HARDCOPY_DEVICE_MANUFACTURER_MODEL_NAME, Action::None)
771            .tag_action(tags::SOFTWARE_VERSIONS, Action::Remove)
772            .tag_action(tags::VIDEO_IMAGE_FORMAT_ACQUIRED, Action::None)
773            .tag_action(tags::DIGITAL_IMAGE_FORMAT_ACQUIRED, Action::None)
774            .tag_action(tags::PROTOCOL_NAME, Action::Remove)
775            .tag_action(tags::CONTRAST_BOLUS_ROUTE, Action::None)
776            .tag_action(tags::CONTRAST_BOLUS_VOLUME, Action::None)
777            .tag_action(tags::CONTRAST_BOLUS_START_TIME, Action::None)
778            .tag_action(tags::CONTRAST_BOLUS_STOP_TIME, Action::None)
779            .tag_action(tags::CONTRAST_BOLUS_TOTAL_DOSE, Action::None)
780            .tag_action(tags::SYRINGE_COUNTS, Action::None)
781            .tag_action(tags::CONTRAST_FLOW_RATE, Action::None)
782            .tag_action(tags::CONTRAST_FLOW_DURATION, Action::None)
783            .tag_action(tags::CONTRAST_BOLUS_INGREDIENT, Action::None)
784            .tag_action(tags::CONTRAST_BOLUS_INGREDIENT_CONCENTRATION, Action::None)
785            .tag_action(tags::SPATIAL_RESOLUTION, Action::None)
786            .tag_action(tags::TRIGGER_TIME, Action::None)
787            .tag_action(tags::TRIGGER_SOURCE_OR_TYPE, Action::None)
788            .tag_action(tags::NOMINAL_INTERVAL, Action::None)
789            .tag_action(tags::FRAME_TIME, Action::None)
790            .tag_action(tags::CARDIAC_FRAMING_TYPE, Action::None)
791            .tag_action(tags::FRAME_TIME_VECTOR, Action::None)
792            .tag_action(tags::FRAME_DELAY, Action::None)
793            .tag_action(tags::IMAGE_TRIGGER_DELAY, Action::None)
794            .tag_action(tags::MULTIPLEX_GROUP_TIME_OFFSET, Action::None)
795            .tag_action(tags::TRIGGER_TIME_OFFSET, Action::None)
796            .tag_action(tags::SYNCHRONIZATION_TRIGGER, Action::None)
797            .tag_action(tags::SYNCHRONIZATION_CHANNEL, Action::None)
798            .tag_action(tags::TRIGGER_SAMPLE_POSITION, Action::None)
799            .tag_action(tags::RADIOPHARMACEUTICAL_ROUTE, Action::None)
800            .tag_action(tags::RADIOPHARMACEUTICAL_VOLUME, Action::None)
801            .tag_action(tags::RADIOPHARMACEUTICAL_START_TIME, Action::None)
802            .tag_action(tags::RADIOPHARMACEUTICAL_STOP_TIME, Action::None)
803            .tag_action(tags::RADIONUCLIDE_TOTAL_DOSE, Action::None)
804            .tag_action(tags::RADIONUCLIDE_HALF_LIFE, Action::None)
805            .tag_action(tags::RADIONUCLIDE_POSITRON_FRACTION, Action::None)
806            .tag_action(tags::RADIOPHARMACEUTICAL_SPECIFIC_ACTIVITY, Action::None)
807            .tag_action(tags::BEAT_REJECTION_FLAG, Action::None)
808            .tag_action(tags::LOW_RR_VALUE, Action::None)
809            .tag_action(tags::HIGH_RR_VALUE, Action::None)
810            .tag_action(tags::INTERVALS_ACQUIRED, Action::None)
811            .tag_action(tags::INTERVALS_REJECTED, Action::None)
812            .tag_action(tags::PVC_REJECTION, Action::None)
813            .tag_action(tags::SKIP_BEATS, Action::None)
814            .tag_action(tags::HEART_RATE, Action::None)
815            .tag_action(tags::CARDIAC_NUMBER_OF_IMAGES, Action::None)
816            .tag_action(tags::TRIGGER_WINDOW, Action::None)
817            .tag_action(tags::RECONSTRUCTION_DIAMETER, Action::None)
818            .tag_action(tags::DISTANCE_SOURCE_TO_DETECTOR, Action::None)
819            .tag_action(tags::DISTANCE_SOURCE_TO_PATIENT, Action::None)
820            .tag_action(
821                tags::ESTIMATED_RADIOGRAPHIC_MAGNIFICATION_FACTOR,
822                Action::None,
823            )
824            .tag_action(tags::GANTRY_DETECTOR_TILT, Action::None)
825            .tag_action(tags::GANTRY_DETECTOR_SLEW, Action::None)
826            .tag_action(tags::TABLE_HEIGHT, Action::None)
827            .tag_action(tags::TABLE_TRAVERSE, Action::None)
828            .tag_action(tags::TABLE_MOTION, Action::None)
829            .tag_action(tags::TABLE_VERTICAL_INCREMENT, Action::None)
830            .tag_action(tags::TABLE_LATERAL_INCREMENT, Action::None)
831            .tag_action(tags::TABLE_LONGITUDINAL_INCREMENT, Action::None)
832            .tag_action(tags::TABLE_ANGLE, Action::None)
833            .tag_action(tags::TABLE_TYPE, Action::None)
834            .tag_action(tags::ROTATION_DIRECTION, Action::None)
835            .tag_action(tags::ANGULAR_POSITION, Action::None)
836            .tag_action(tags::RADIAL_POSITION, Action::None)
837            .tag_action(tags::SCAN_ARC, Action::None)
838            .tag_action(tags::ANGULAR_STEP, Action::None)
839            .tag_action(tags::CENTER_OF_ROTATION_OFFSET, Action::None)
840            .tag_action(tags::FIELD_OF_VIEW_SHAPE, Action::None)
841            .tag_action(tags::FIELD_OF_VIEW_DIMENSIONS, Action::None)
842            .tag_action(tags::EXPOSURE_TIME, Action::None)
843            .tag_action(tags::X_RAY_TUBE_CURRENT, Action::None)
844            .tag_action(tags::EXPOSURE, Action::None)
845            .tag_action(tags::EXPOSURE_INU_AS, Action::None)
846            .tag_action(tags::AVERAGE_PULSE_WIDTH, Action::None)
847            .tag_action(tags::RADIATION_SETTING, Action::None)
848            .tag_action(tags::RECTIFICATION_TYPE, Action::None)
849            .tag_action(tags::RADIATION_MODE, Action::None)
850            .tag_action(tags::IMAGE_AND_FLUOROSCOPY_AREA_DOSE_PRODUCT, Action::None)
851            .tag_action(tags::FILTER_TYPE, Action::None)
852            .tag_action(tags::TYPE_OF_FILTERS, Action::None)
853            .tag_action(tags::INTENSIFIER_SIZE, Action::None)
854            .tag_action(tags::IMAGER_PIXEL_SPACING, Action::None)
855            .tag_action(tags::GRID, Action::None)
856            .tag_action(tags::GENERATOR_POWER, Action::None)
857            .tag_action(tags::COLLIMATOR_GRID_NAME, Action::None)
858            .tag_action(tags::COLLIMATOR_TYPE, Action::None)
859            .tag_action(tags::FOCAL_DISTANCE, Action::None)
860            .tag_action(tags::X_FOCUS_CENTER, Action::None)
861            .tag_action(tags::Y_FOCUS_CENTER, Action::None)
862            .tag_action(tags::FOCAL_SPOTS, Action::None)
863            .tag_action(tags::ANODE_TARGET_MATERIAL, Action::None)
864            .tag_action(tags::BODY_PART_THICKNESS, Action::None)
865            .tag_action(tags::COMPRESSION_FORCE, Action::None)
866            .tag_action(
867                tags::DATE_OF_LAST_CALIBRATION,
868                Action::HashDate(tags::PATIENT_ID),
869            )
870            .tag_action(tags::TIME_OF_LAST_CALIBRATION, Action::None)
871            .tag_action(tags::CONVOLUTION_KERNEL, Action::None)
872            .tag_action(tags::ACTUAL_FRAME_DURATION, Action::None)
873            .tag_action(tags::COUNT_RATE, Action::None)
874            .tag_action(tags::PREFERRED_PLAYBACK_SEQUENCING, Action::None)
875            .tag_action(tags::RECEIVE_COIL_NAME, Action::None)
876            .tag_action(tags::TRANSMIT_COIL_NAME, Action::None)
877            .tag_action(tags::PLATE_TYPE, Action::None)
878            .tag_action(tags::PHOSPHOR_TYPE, Action::None)
879            .tag_action(tags::SCAN_VELOCITY, Action::None)
880            .tag_action(tags::WHOLE_BODY_TECHNIQUE, Action::None)
881            .tag_action(tags::SCAN_LENGTH, Action::None)
882            .tag_action(tags::ACQUISITION_MATRIX, Action::None)
883            .tag_action(tags::IN_PLANE_PHASE_ENCODING_DIRECTION, Action::None)
884            .tag_action(tags::FLIP_ANGLE, Action::None)
885            .tag_action(tags::VARIABLE_FLIP_ANGLE_FLAG, Action::None)
886            .tag_action(tags::SAR, Action::None)
887            .tag_action(tags::D_BDT, Action::None)
888            .tag_action(
889                tags::ACQUISITION_DEVICE_PROCESSING_DESCRIPTION,
890                Action::Remove,
891            )
892            .tag_action(tags::ACQUISITION_DEVICE_PROCESSING_CODE, Action::None)
893            .tag_action(tags::CASSETTE_ORIENTATION, Action::None)
894            .tag_action(tags::CASSETTE_SIZE, Action::None)
895            .tag_action(tags::EXPOSURES_ON_PLATE, Action::None)
896            .tag_action(tags::RELATIVE_X_RAY_EXPOSURE, Action::None)
897            .tag_action(tags::COLUMN_ANGULATION, Action::None)
898            .tag_action(tags::TOMO_LAYER_HEIGHT, Action::None)
899            .tag_action(tags::TOMO_ANGLE, Action::None)
900            .tag_action(tags::TOMO_TIME, Action::None)
901            .tag_action(tags::TOMO_TYPE, Action::None)
902            .tag_action(tags::TOMO_CLASS, Action::None)
903            .tag_action(tags::NUMBER_OF_TOMOSYNTHESIS_SOURCE_IMAGES, Action::None)
904            .tag_action(tags::POSITIONER_MOTION, Action::None)
905            .tag_action(tags::POSITIONER_TYPE, Action::None)
906            .tag_action(tags::POSITIONER_PRIMARY_ANGLE, Action::None)
907            .tag_action(tags::POSITIONER_SECONDARY_ANGLE, Action::None)
908            .tag_action(tags::POSITIONER_PRIMARY_ANGLE_INCREMENT, Action::None)
909            .tag_action(tags::POSITIONER_SECONDARY_ANGLE_INCREMENT, Action::None)
910            .tag_action(tags::DETECTOR_PRIMARY_ANGLE, Action::None)
911            .tag_action(tags::DETECTOR_SECONDARY_ANGLE, Action::None)
912            .tag_action(tags::SHUTTER_SHAPE, Action::None)
913            .tag_action(tags::SHUTTER_LEFT_VERTICAL_EDGE, Action::None)
914            .tag_action(tags::SHUTTER_RIGHT_VERTICAL_EDGE, Action::None)
915            .tag_action(tags::SHUTTER_UPPER_HORIZONTAL_EDGE, Action::None)
916            .tag_action(tags::SHUTTER_LOWER_HORIZONTAL_EDGE, Action::None)
917            .tag_action(tags::CENTER_OF_CIRCULAR_SHUTTER, Action::None)
918            .tag_action(tags::RADIUS_OF_CIRCULAR_SHUTTER, Action::None)
919            .tag_action(tags::VERTICES_OF_THE_POLYGONAL_SHUTTER, Action::None)
920            .tag_action(tags::SHUTTER_PRESENTATION_VALUE, Action::None)
921            .tag_action(tags::SHUTTER_OVERLAY_GROUP, Action::None)
922            .tag_action(tags::COLLIMATOR_SHAPE, Action::None)
923            .tag_action(tags::COLLIMATOR_LEFT_VERTICAL_EDGE, Action::None)
924            .tag_action(tags::COLLIMATOR_RIGHT_VERTICAL_EDGE, Action::None)
925            .tag_action(tags::COLLIMATOR_UPPER_HORIZONTAL_EDGE, Action::None)
926            .tag_action(tags::COLLIMATOR_LOWER_HORIZONTAL_EDGE, Action::None)
927            .tag_action(tags::CENTER_OF_CIRCULAR_COLLIMATOR, Action::None)
928            .tag_action(tags::RADIUS_OF_CIRCULAR_COLLIMATOR, Action::None)
929            .tag_action(tags::VERTICES_OF_THE_POLYGONAL_COLLIMATOR, Action::None)
930            .tag_action(tags::ACQUISITION_TIME_SYNCHRONIZED, Action::None)
931            .tag_action(tags::TIME_SOURCE, Action::None)
932            .tag_action(tags::TIME_DISTRIBUTION_PROTOCOL, Action::None)
933            .tag_action(tags::ACQUISITION_COMMENTS, Action::Remove)
934            .tag_action(tags::OUTPUT_POWER, Action::None)
935            .tag_action(tags::TRANSDUCER_DATA, Action::None)
936            .tag_action(tags::FOCUS_DEPTH, Action::None)
937            .tag_action(tags::PROCESSING_FUNCTION, Action::None)
938            .tag_action(tags::POSTPROCESSING_FUNCTION, Action::None)
939            .tag_action(tags::MECHANICAL_INDEX, Action::None)
940            .tag_action(tags::BONE_THERMAL_INDEX, Action::None)
941            .tag_action(tags::CRANIAL_THERMAL_INDEX, Action::None)
942            .tag_action(tags::SOFT_TISSUE_THERMAL_INDEX, Action::None)
943            .tag_action(tags::SOFT_TISSUE_FOCUS_THERMAL_INDEX, Action::None)
944            .tag_action(tags::SOFT_TISSUE_SURFACE_THERMAL_INDEX, Action::None)
945            .tag_action(tags::DEPTH_OF_SCAN_FIELD, Action::None)
946            .tag_action(tags::PATIENT_POSITION, Action::None)
947            .tag_action(tags::VIEW_POSITION, Action::None)
948            .tag_action(tags::PROJECTION_EPONYMOUS_NAME_CODE_SEQUENCE, Action::None)
949            .tag_action(tags::IMAGE_TRANSFORMATION_MATRIX, Action::None)
950            .tag_action(tags::IMAGE_TRANSLATION_VECTOR, Action::None)
951            .tag_action(tags::SENSITIVITY, Action::None)
952            .tag_action(tags::SEQUENCE_OF_ULTRASOUND_REGIONS, Action::None)
953            .tag_action(tags::REGION_SPATIAL_FORMAT, Action::None)
954            .tag_action(tags::REGION_DATA_TYPE, Action::None)
955            .tag_action(tags::REGION_FLAGS, Action::None)
956            .tag_action(tags::REGION_LOCATION_MIN_X0, Action::None)
957            .tag_action(tags::REGION_LOCATION_MIN_Y0, Action::None)
958            .tag_action(tags::REGION_LOCATION_MAX_X1, Action::None)
959            .tag_action(tags::REGION_LOCATION_MAX_Y1, Action::None)
960            .tag_action(tags::REFERENCE_PIXEL_X0, Action::None)
961            .tag_action(tags::REFERENCE_PIXEL_Y0, Action::None)
962            .tag_action(tags::PHYSICAL_UNITS_X_DIRECTION, Action::None)
963            .tag_action(tags::PHYSICAL_UNITS_Y_DIRECTION, Action::None)
964            .tag_action(tags::REFERENCE_PIXEL_PHYSICAL_VALUE_X, Action::None)
965            .tag_action(tags::REFERENCE_PIXEL_PHYSICAL_VALUE_Y, Action::None)
966            .tag_action(tags::PHYSICAL_DELTA_X, Action::None)
967            .tag_action(tags::PHYSICAL_DELTA_Y, Action::None)
968            .tag_action(tags::TRANSDUCER_FREQUENCY, Action::None)
969            .tag_action(tags::TRANSDUCER_TYPE, Action::None)
970            .tag_action(tags::PULSE_REPETITION_FREQUENCY, Action::None)
971            .tag_action(tags::DOPPLER_CORRECTION_ANGLE, Action::None)
972            .tag_action(tags::STEERING_ANGLE, Action::None)
973            .tag_action(tags::DOPPLER_SAMPLE_VOLUME_X_POSITION, Action::None)
974            .tag_action(tags::DOPPLER_SAMPLE_VOLUME_Y_POSITION, Action::None)
975            .tag_action(tags::TM_LINE_POSITION_X0, Action::None)
976            .tag_action(tags::TM_LINE_POSITION_Y0, Action::None)
977            .tag_action(tags::TM_LINE_POSITION_X1, Action::None)
978            .tag_action(tags::TM_LINE_POSITION_Y1, Action::None)
979            .tag_action(tags::PIXEL_COMPONENT_ORGANIZATION, Action::None)
980            .tag_action(tags::PIXEL_COMPONENT_MASK, Action::None)
981            .tag_action(tags::PIXEL_COMPONENT_RANGE_START, Action::None)
982            .tag_action(tags::PIXEL_COMPONENT_RANGE_STOP, Action::None)
983            .tag_action(tags::PIXEL_COMPONENT_PHYSICAL_UNITS, Action::None)
984            .tag_action(tags::PIXEL_COMPONENT_DATA_TYPE, Action::None)
985            .tag_action(tags::NUMBER_OF_TABLE_BREAK_POINTS, Action::None)
986            .tag_action(tags::TABLE_OF_X_BREAK_POINTS, Action::None)
987            .tag_action(tags::TABLE_OF_Y_BREAK_POINTS, Action::None)
988            .tag_action(tags::NUMBER_OF_TABLE_ENTRIES, Action::None)
989            .tag_action(tags::TABLE_OF_PIXEL_VALUES, Action::None)
990            .tag_action(tags::TABLE_OF_PARAMETER_VALUES, Action::None)
991            .tag_action(tags::DETECTOR_CONDITIONS_NOMINAL_FLAG, Action::None)
992            .tag_action(tags::DETECTOR_TEMPERATURE, Action::None)
993            .tag_action(tags::DETECTOR_TYPE, Action::None)
994            .tag_action(tags::DETECTOR_CONFIGURATION, Action::None)
995            .tag_action(tags::DETECTOR_DESCRIPTION, Action::None)
996            .tag_action(tags::DETECTOR_MODE, Action::None)
997            .tag_action(tags::DETECTOR_ID, Action::Remove)
998            .tag_action(
999                tags::DATE_OF_LAST_DETECTOR_CALIBRATION,
1000                Action::HashDate(tags::PATIENT_ID),
1001            )
1002            .tag_action(tags::TIME_OF_LAST_DETECTOR_CALIBRATION, Action::None)
1003            .tag_action(
1004                tags::EXPOSURES_ON_DETECTOR_SINCE_LAST_CALIBRATION,
1005                Action::None,
1006            )
1007            .tag_action(tags::EXPOSURES_ON_DETECTOR_SINCE_MANUFACTURED, Action::None)
1008            .tag_action(tags::DETECTOR_TIME_SINCE_LAST_EXPOSURE, Action::None)
1009            .tag_action(tags::DETECTOR_ACTIVE_TIME, Action::None)
1010            .tag_action(tags::DETECTOR_ACTIVATION_OFFSET_FROM_EXPOSURE, Action::None)
1011            .tag_action(tags::DETECTOR_BINNING, Action::None)
1012            .tag_action(tags::DETECTOR_ELEMENT_PHYSICAL_SIZE, Action::None)
1013            .tag_action(tags::DETECTOR_ELEMENT_SPACING, Action::None)
1014            .tag_action(tags::DETECTOR_ACTIVE_SHAPE, Action::None)
1015            .tag_action(tags::DETECTOR_ACTIVE_DIMENSIONS, Action::None)
1016            .tag_action(tags::DETECTOR_ACTIVE_ORIGIN, Action::None)
1017            .tag_action(tags::FIELD_OF_VIEW_ORIGIN, Action::None)
1018            .tag_action(tags::FIELD_OF_VIEW_ROTATION, Action::None)
1019            .tag_action(tags::FIELD_OF_VIEW_HORIZONTAL_FLIP, Action::None)
1020            .tag_action(tags::GRID_ABSORBING_MATERIAL, Action::None)
1021            .tag_action(tags::GRID_SPACING_MATERIAL, Action::None)
1022            .tag_action(tags::GRID_THICKNESS, Action::None)
1023            .tag_action(tags::GRID_PITCH, Action::None)
1024            .tag_action(tags::GRID_ASPECT_RATIO, Action::None)
1025            .tag_action(tags::GRID_PERIOD, Action::None)
1026            .tag_action(tags::GRID_FOCAL_DISTANCE, Action::None)
1027            .tag_action(tags::FILTER_MATERIAL, Action::None)
1028            .tag_action(tags::FILTER_THICKNESS_MINIMUM, Action::None)
1029            .tag_action(tags::FILTER_THICKNESS_MAXIMUM, Action::None)
1030            .tag_action(tags::EXPOSURE_CONTROL_MODE, Action::None)
1031            .tag_action(tags::EXPOSURE_CONTROL_MODE_DESCRIPTION, Action::None)
1032            .tag_action(tags::EXPOSURE_STATUS, Action::None)
1033            .tag_action(tags::PHOTOTIMER_SETTING, Action::None)
1034            .tag_action(tags::EXPOSURE_TIME_INU_S, Action::None)
1035            .tag_action(tags::X_RAY_TUBE_CURRENT_INU_A, Action::None)
1036            .tag_action(tags::CONTENT_QUALIFICATION, Action::None)
1037            .tag_action(tags::PULSE_SEQUENCE_NAME, Action::None)
1038            .tag_action(tags::MR_IMAGING_MODIFIER_SEQUENCE, Action::None)
1039            .tag_action(tags::ECHO_PULSE_SEQUENCE, Action::None)
1040            .tag_action(tags::INVERSION_RECOVERY, Action::None)
1041            .tag_action(tags::FLOW_COMPENSATION, Action::None)
1042            .tag_action(tags::MULTIPLE_SPIN_ECHO, Action::None)
1043            .tag_action(tags::MULTI_PLANAR_EXCITATION, Action::None)
1044            .tag_action(tags::PHASE_CONTRAST, Action::None)
1045            .tag_action(tags::TIME_OF_FLIGHT_CONTRAST, Action::None)
1046            .tag_action(tags::SPOILING, Action::None)
1047            .tag_action(tags::STEADY_STATE_PULSE_SEQUENCE, Action::None)
1048            .tag_action(tags::ECHO_PLANAR_PULSE_SEQUENCE, Action::None)
1049            .tag_action(tags::TAG_ANGLE_FIRST_AXIS, Action::None)
1050            .tag_action(tags::MAGNETIZATION_TRANSFER, Action::None)
1051            .tag_action(tags::T2_PREPARATION, Action::None)
1052            .tag_action(tags::BLOOD_SIGNAL_NULLING, Action::None)
1053            .tag_action(tags::SATURATION_RECOVERY, Action::None)
1054            .tag_action(tags::SPECTRALLY_SELECTED_SUPPRESSION, Action::None)
1055            .tag_action(tags::SPECTRALLY_SELECTED_EXCITATION, Action::None)
1056            .tag_action(tags::SPATIAL_PRESATURATION, Action::None)
1057            .tag_action(tags::TAGGING, Action::None)
1058            .tag_action(tags::OVERSAMPLING_PHASE, Action::None)
1059            .tag_action(tags::TAG_SPACING_FIRST_DIMENSION, Action::None)
1060            .tag_action(tags::GEOMETRY_OF_K_SPACE_TRAVERSAL, Action::None)
1061            .tag_action(tags::SEGMENTED_K_SPACE_TRAVERSAL, Action::None)
1062            .tag_action(tags::RECTILINEAR_PHASE_ENCODE_REORDERING, Action::None)
1063            .tag_action(tags::TAG_THICKNESS, Action::None)
1064            .tag_action(tags::PARTIAL_FOURIER_DIRECTION, Action::None)
1065            .tag_action(tags::CARDIAC_SYNCHRONIZATION_TECHNIQUE, Action::None)
1066            .tag_action(tags::RECEIVE_COIL_MANUFACTURER_NAME, Action::None)
1067            .tag_action(tags::MR_RECEIVE_COIL_SEQUENCE, Action::None)
1068            .tag_action(tags::RECEIVE_COIL_TYPE, Action::None)
1069            .tag_action(tags::QUADRATURE_RECEIVE_COIL, Action::None)
1070            .tag_action(tags::MULTI_COIL_DEFINITION_SEQUENCE, Action::None)
1071            .tag_action(tags::MULTI_COIL_CONFIGURATION, Action::None)
1072            .tag_action(tags::MULTI_COIL_ELEMENT_NAME, Action::None)
1073            .tag_action(tags::MULTI_COIL_ELEMENT_USED, Action::None)
1074            .tag_action(tags::MR_TRANSMIT_COIL_SEQUENCE, Action::None)
1075            .tag_action(tags::TRANSMIT_COIL_MANUFACTURER_NAME, Action::None)
1076            .tag_action(tags::TRANSMIT_COIL_TYPE, Action::None)
1077            .tag_action(tags::SPECTRAL_WIDTH, Action::None)
1078            .tag_action(tags::CHEMICAL_SHIFT_REFERENCE, Action::None)
1079            .tag_action(tags::VOLUME_LOCALIZATION_TECHNIQUE, Action::None)
1080            .tag_action(tags::MR_ACQUISITION_FREQUENCY_ENCODING_STEPS, Action::None)
1081            .tag_action(tags::DECOUPLING, Action::None)
1082            .tag_action(tags::DECOUPLED_NUCLEUS, Action::None)
1083            .tag_action(tags::DECOUPLING_FREQUENCY, Action::None)
1084            .tag_action(tags::DECOUPLING_METHOD, Action::None)
1085            .tag_action(tags::DECOUPLING_CHEMICAL_SHIFT_REFERENCE, Action::None)
1086            .tag_action(tags::K_SPACE_FILTERING, Action::None)
1087            .tag_action(tags::TIME_DOMAIN_FILTERING, Action::None)
1088            .tag_action(tags::NUMBER_OF_ZERO_FILLS, Action::None)
1089            .tag_action(tags::BASELINE_CORRECTION, Action::None)
1090            .tag_action(tags::CARDIAC_RR_INTERVAL_SPECIFIED, Action::None)
1091            .tag_action(tags::ACQUISITION_DURATION, Action::None)
1092            .tag_action(
1093                tags::FRAME_ACQUISITION_DATE_TIME,
1094                Action::HashDate(tags::PATIENT_ID),
1095            )
1096            .tag_action(tags::DIFFUSION_DIRECTIONALITY, Action::None)
1097            .tag_action(tags::DIFFUSION_GRADIENT_DIRECTION_SEQUENCE, Action::None)
1098            .tag_action(tags::PARALLEL_ACQUISITION, Action::None)
1099            .tag_action(tags::PARALLEL_ACQUISITION_TECHNIQUE, Action::None)
1100            .tag_action(tags::INVERSION_TIMES, Action::None)
1101            .tag_action(tags::METABOLITE_MAP_DESCRIPTION, Action::None)
1102            .tag_action(tags::PARTIAL_FOURIER, Action::None)
1103            .tag_action(tags::EFFECTIVE_ECHO_TIME, Action::None)
1104            .tag_action(tags::CHEMICAL_SHIFT_SEQUENCE, Action::None)
1105            .tag_action(tags::CARDIAC_SIGNAL_SOURCE, Action::None)
1106            .tag_action(tags::DIFFUSION_B_VALUE, Action::None)
1107            .tag_action(tags::DIFFUSION_GRADIENT_ORIENTATION, Action::None)
1108            .tag_action(tags::VELOCITY_ENCODING_DIRECTION, Action::None)
1109            .tag_action(tags::VELOCITY_ENCODING_MINIMUM_VALUE, Action::None)
1110            .tag_action(tags::NUMBER_OF_K_SPACE_TRAJECTORIES, Action::None)
1111            .tag_action(tags::COVERAGE_OF_K_SPACE, Action::None)
1112            .tag_action(tags::SPECTROSCOPY_ACQUISITION_PHASE_ROWS, Action::None)
1113            .tag_action(tags::PARALLEL_REDUCTION_FACTOR_IN_PLANE, Action::None)
1114            .tag_action(tags::TRANSMITTER_FREQUENCY, Action::None)
1115            .tag_action(tags::RESONANT_NUCLEUS, Action::None)
1116            .tag_action(tags::FREQUENCY_CORRECTION, Action::None)
1117            .tag_action(tags::MR_SPECTROSCOPY_FOV_GEOMETRY_SEQUENCE, Action::None)
1118            .tag_action(tags::SLAB_THICKNESS, Action::None)
1119            .tag_action(tags::SLAB_ORIENTATION, Action::None)
1120            .tag_action(tags::MID_SLAB_POSITION, Action::None)
1121            .tag_action(tags::MR_SPATIAL_SATURATION_SEQUENCE, Action::None)
1122            .tag_action(
1123                tags::MR_TIMING_AND_RELATED_PARAMETERS_SEQUENCE,
1124                Action::None,
1125            )
1126            .tag_action(tags::MR_ECHO_SEQUENCE, Action::None)
1127            .tag_action(tags::MR_MODIFIER_SEQUENCE, Action::None)
1128            .tag_action(tags::MR_DIFFUSION_SEQUENCE, Action::None)
1129            .tag_action(tags::CARDIAC_SYNCHRONIZATION_SEQUENCE, Action::None)
1130            .tag_action(tags::MR_AVERAGES_SEQUENCE, Action::None)
1131            .tag_action(tags::MRFOV_GEOMETRY_SEQUENCE, Action::None)
1132            .tag_action(tags::VOLUME_LOCALIZATION_SEQUENCE, Action::None)
1133            .tag_action(tags::SPECTROSCOPY_ACQUISITION_DATA_COLUMNS, Action::None)
1134            .tag_action(tags::DIFFUSION_ANISOTROPY_TYPE, Action::None)
1135            .tag_action(
1136                tags::FRAME_REFERENCE_DATE_TIME,
1137                Action::HashDate(tags::PATIENT_ID),
1138            )
1139            .tag_action(tags::MR_METABOLITE_MAP_SEQUENCE, Action::None)
1140            .tag_action(tags::PARALLEL_REDUCTION_FACTOR_OUT_OF_PLANE, Action::None)
1141            .tag_action(
1142                tags::SPECTROSCOPY_ACQUISITION_OUT_OF_PLANE_PHASE_STEPS,
1143                Action::None,
1144            )
1145            .tag_action(tags::BULK_MOTION_STATUS, Action::None)
1146            .tag_action(
1147                tags::PARALLEL_REDUCTION_FACTOR_SECOND_IN_PLANE,
1148                Action::None,
1149            )
1150            .tag_action(tags::CARDIAC_BEAT_REJECTION_TECHNIQUE, Action::None)
1151            .tag_action(
1152                tags::RESPIRATORY_MOTION_COMPENSATION_TECHNIQUE,
1153                Action::None,
1154            )
1155            .tag_action(tags::RESPIRATORY_SIGNAL_SOURCE, Action::None)
1156            .tag_action(tags::BULK_MOTION_COMPENSATION_TECHNIQUE, Action::None)
1157            .tag_action(tags::BULK_MOTION_SIGNAL_SOURCE, Action::None)
1158            .tag_action(tags::APPLICABLE_SAFETY_STANDARD_AGENCY, Action::None)
1159            .tag_action(tags::APPLICABLE_SAFETY_STANDARD_DESCRIPTION, Action::None)
1160            .tag_action(tags::OPERATING_MODE_SEQUENCE, Action::None)
1161            .tag_action(tags::OPERATING_MODE_TYPE, Action::None)
1162            .tag_action(tags::OPERATING_MODE, Action::None)
1163            .tag_action(tags::SPECIFIC_ABSORPTION_RATE_DEFINITION, Action::None)
1164            .tag_action(tags::GRADIENT_OUTPUT_TYPE, Action::None)
1165            .tag_action(tags::SPECIFIC_ABSORPTION_RATE_VALUE, Action::None)
1166            .tag_action(tags::GRADIENT_OUTPUT, Action::None)
1167            .tag_action(tags::FLOW_COMPENSATION_DIRECTION, Action::None)
1168            .tag_action(tags::TAGGING_DELAY, Action::None)
1169            .tag_action(
1170                tags::CHEMICAL_SHIFT_MINIMUM_INTEGRATION_LIMIT_IN_HZ,
1171                Action::None,
1172            )
1173            .tag_action(
1174                tags::CHEMICAL_SHIFT_MAXIMUM_INTEGRATION_LIMIT_IN_HZ,
1175                Action::None,
1176            )
1177            .tag_action(tags::MR_VELOCITY_ENCODING_SEQUENCE, Action::None)
1178            .tag_action(tags::FIRST_ORDER_PHASE_CORRECTION, Action::None)
1179            .tag_action(tags::WATER_REFERENCED_PHASE_CORRECTION, Action::None)
1180            .tag_action(tags::MR_SPECTROSCOPY_ACQUISITION_TYPE, Action::None)
1181            .tag_action(tags::RESPIRATORY_CYCLE_POSITION, Action::None)
1182            .tag_action(tags::VELOCITY_ENCODING_MAXIMUM_VALUE, Action::None)
1183            .tag_action(tags::TAG_SPACING_SECOND_DIMENSION, Action::None)
1184            .tag_action(tags::TAG_ANGLE_SECOND_AXIS, Action::None)
1185            .tag_action(tags::FRAME_ACQUISITION_DURATION, Action::None)
1186            .tag_action(tags::MR_IMAGE_FRAME_TYPE_SEQUENCE, Action::None)
1187            .tag_action(tags::MR_SPECTROSCOPY_FRAME_TYPE_SEQUENCE, Action::None)
1188            .tag_action(
1189                tags::MR_ACQUISITION_PHASE_ENCODING_STEPS_IN_PLANE,
1190                Action::None,
1191            )
1192            .tag_action(
1193                tags::MR_ACQUISITION_PHASE_ENCODING_STEPS_OUT_OF_PLANE,
1194                Action::None,
1195            )
1196            .tag_action(tags::SPECTROSCOPY_ACQUISITION_PHASE_COLUMNS, Action::None)
1197            .tag_action(tags::CARDIAC_CYCLE_POSITION, Action::None)
1198            .tag_action(tags::SPECIFIC_ABSORPTION_RATE_SEQUENCE, Action::None)
1199            .tag_action(tags::CONTRIBUTION_DESCRIPTION, Action::Remove)
1200            .tag_action(tags::STUDY_INSTANCE_UID, Action::HashUID)
1201            .tag_action(tags::SERIES_INSTANCE_UID, Action::HashUID)
1202            .tag_action(tags::STUDY_ID, Action::Empty)
1203            .tag_action(tags::SERIES_NUMBER, Action::None)
1204            .tag_action(tags::ACQUISITION_NUMBER, Action::None)
1205            .tag_action(tags::INSTANCE_NUMBER, Action::None)
1206            .tag_action(tags::ITEM_NUMBER, Action::None)
1207            .tag_action(tags::PATIENT_ORIENTATION, Action::None)
1208            .tag_action(tags::OVERLAY_NUMBER, Action::None)
1209            .tag_action(tags::CURVE_NUMBER, Action::None)
1210            .tag_action(tags::LUT_NUMBER, Action::None)
1211            .tag_action(tags::IMAGE_POSITION, Action::None)
1212            .tag_action(tags::IMAGE_ORIENTATION, Action::None)
1213            .tag_action(tags::FRAME_OF_REFERENCE_UID, Action::HashUID)
1214            .tag_action(tags::LATERALITY, Action::None)
1215            .tag_action(tags::IMAGE_LATERALITY, Action::None)
1216            .tag_action(tags::TEMPORAL_POSITION_IDENTIFIER, Action::None)
1217            .tag_action(tags::NUMBER_OF_TEMPORAL_POSITIONS, Action::None)
1218            .tag_action(tags::TEMPORAL_RESOLUTION, Action::None)
1219            .tag_action(
1220                tags::SYNCHRONIZATION_FRAME_OF_REFERENCE_UID,
1221                Action::HashUID,
1222            )
1223            .tag_action(tags::SERIES_IN_STUDY, Action::None)
1224            .tag_action(tags::IMAGES_IN_ACQUISITION, Action::None)
1225            .tag_action(tags::ACQUISITIONS_IN_STUDY, Action::None)
1226            .tag_action(tags::POSITION_REFERENCE_INDICATOR, Action::None)
1227            .tag_action(tags::SLICE_LOCATION, Action::None)
1228            .tag_action(tags::OTHER_STUDY_NUMBERS, Action::None)
1229            .tag_action(tags::NUMBER_OF_PATIENT_RELATED_STUDIES, Action::None)
1230            .tag_action(tags::NUMBER_OF_PATIENT_RELATED_SERIES, Action::None)
1231            .tag_action(tags::NUMBER_OF_PATIENT_RELATED_INSTANCES, Action::None)
1232            .tag_action(tags::NUMBER_OF_STUDY_RELATED_SERIES, Action::None)
1233            .tag_action(tags::NUMBER_OF_STUDY_RELATED_INSTANCES, Action::None)
1234            .tag_action(tags::NUMBER_OF_SERIES_RELATED_INSTANCES, Action::None)
1235            .tag_action(tags::MODIFYING_DEVICE_ID, Action::Remove)
1236            .tag_action(tags::MODIFYING_DEVICE_MANUFACTURER, Action::Remove)
1237            .tag_action(tags::MODIFIED_IMAGE_DESCRIPTION, Action::Remove)
1238            .tag_action(tags::IMAGE_COMMENTS, Action::Remove)
1239            .tag_action(tags::STACK_ID, Action::None)
1240            .tag_action(tags::IN_STACK_POSITION_NUMBER, Action::None)
1241            .tag_action(tags::FRAME_ANATOMY_SEQUENCE, Action::None)
1242            .tag_action(tags::FRAME_LATERALITY, Action::None)
1243            .tag_action(tags::FRAME_CONTENT_SEQUENCE, Action::None)
1244            .tag_action(tags::PLANE_POSITION_SEQUENCE, Action::None)
1245            .tag_action(tags::PLANE_ORIENTATION_SEQUENCE, Action::None)
1246            .tag_action(tags::TEMPORAL_POSITION_INDEX, Action::None)
1247            .tag_action(tags::NOMINAL_CARDIAC_TRIGGER_DELAY_TIME, Action::None)
1248            .tag_action(tags::FRAME_ACQUISITION_NUMBER, Action::None)
1249            .tag_action(tags::DIMENSION_INDEX_VALUES, Action::None)
1250            .tag_action(tags::FRAME_COMMENTS, Action::None)
1251            .tag_action(tags::CONCATENATION_UID, Action::HashUID)
1252            .tag_action(tags::IN_CONCATENATION_NUMBER, Action::None)
1253            .tag_action(tags::IN_CONCATENATION_TOTAL_NUMBER, Action::None)
1254            .tag_action(tags::DIMENSION_ORGANIZATION_UID, Action::HashUID)
1255            .tag_action(tags::DIMENSION_INDEX_POINTER, Action::None)
1256            .tag_action(tags::FUNCTIONAL_GROUP_POINTER, Action::None)
1257            .tag_action(tags::DIMENSION_INDEX_PRIVATE_CREATOR, Action::None)
1258            .tag_action(tags::DIMENSION_ORGANIZATION_SEQUENCE, Action::None)
1259            .tag_action(tags::DIMENSION_INDEX_SEQUENCE, Action::None)
1260            .tag_action(tags::CONCATENATION_FRAME_OFFSET_NUMBER, Action::None)
1261            .tag_action(tags::FUNCTIONAL_GROUP_PRIVATE_CREATOR, Action::None)
1262            .tag_action(tags::SAMPLES_PER_PIXEL, Action::None)
1263            .tag_action(tags::PHOTOMETRIC_INTERPRETATION, Action::None)
1264            .tag_action(tags::PLANAR_CONFIGURATION, Action::None)
1265            .tag_action(tags::NUMBER_OF_FRAMES, Action::None)
1266            .tag_action(tags::FRAME_INCREMENT_POINTER, Action::None)
1267            .tag_action(tags::ROWS, Action::None)
1268            .tag_action(tags::COLUMNS, Action::None)
1269            .tag_action(tags::PLANES, Action::None)
1270            .tag_action(tags::ULTRASOUND_COLOR_DATA_PRESENT, Action::None)
1271            .tag_action(tags::PIXEL_SPACING, Action::None)
1272            .tag_action(tags::ZOOM_FACTOR, Action::None)
1273            .tag_action(tags::ZOOM_CENTER, Action::None)
1274            .tag_action(tags::PIXEL_ASPECT_RATIO, Action::None)
1275            .tag_action(tags::CORRECTED_IMAGE, Action::None)
1276            .tag_action(tags::BITS_ALLOCATED, Action::None)
1277            .tag_action(tags::BITS_STORED, Action::None)
1278            .tag_action(tags::HIGH_BIT, Action::None)
1279            .tag_action(tags::PIXEL_REPRESENTATION, Action::None)
1280            .tag_action(tags::SMALLEST_IMAGE_PIXEL_VALUE, Action::None)
1281            .tag_action(tags::LARGEST_IMAGE_PIXEL_VALUE, Action::None)
1282            .tag_action(tags::SMALLEST_PIXEL_VALUE_IN_SERIES, Action::None)
1283            .tag_action(tags::LARGEST_PIXEL_VALUE_IN_SERIES, Action::None)
1284            .tag_action(tags::SMALLEST_IMAGE_PIXEL_VALUE_IN_PLANE, Action::None)
1285            .tag_action(tags::LARGEST_IMAGE_PIXEL_VALUE_IN_PLANE, Action::None)
1286            .tag_action(tags::PIXEL_PADDING_VALUE, Action::None)
1287            .tag_action(tags::QUALITY_CONTROL_IMAGE, Action::None)
1288            .tag_action(tags::BURNED_IN_ANNOTATION, Action::None)
1289            .tag_action(tags::PIXEL_INTENSITY_RELATIONSHIP, Action::None)
1290            .tag_action(tags::PIXEL_INTENSITY_RELATIONSHIP_SIGN, Action::None)
1291            .tag_action(tags::WINDOW_CENTER, Action::None)
1292            .tag_action(tags::WINDOW_WIDTH, Action::None)
1293            .tag_action(tags::RESCALE_INTERCEPT, Action::None)
1294            .tag_action(tags::RESCALE_SLOPE, Action::None)
1295            .tag_action(tags::RESCALE_TYPE, Action::None)
1296            .tag_action(tags::WINDOW_CENTER_WIDTH_EXPLANATION, Action::None)
1297            .tag_action(tags::RECOMMENDED_VIEWING_MODE, Action::None)
1298            .tag_action(
1299                tags::RED_PALETTE_COLOR_LOOKUP_TABLE_DESCRIPTOR,
1300                Action::None,
1301            )
1302            .tag_action(
1303                tags::GREEN_PALETTE_COLOR_LOOKUP_TABLE_DESCRIPTOR,
1304                Action::None,
1305            )
1306            .tag_action(
1307                tags::BLUE_PALETTE_COLOR_LOOKUP_TABLE_DESCRIPTOR,
1308                Action::None,
1309            )
1310            .tag_action(tags::PALETTE_COLOR_LOOKUP_TABLE_UID, Action::HashUID)
1311            .tag_action(tags::RED_PALETTE_COLOR_LOOKUP_TABLE_DATA, Action::None)
1312            .tag_action(tags::GREEN_PALETTE_COLOR_LOOKUP_TABLE_DATA, Action::None)
1313            .tag_action(tags::BLUE_PALETTE_COLOR_LOOKUP_TABLE_DATA, Action::None)
1314            .tag_action(tags::LARGE_PALETTE_COLOR_LOOKUP_TABLE_UID, Action::HashUID)
1315            .tag_action(
1316                tags::SEGMENTED_RED_PALETTE_COLOR_LOOKUP_TABLE_DATA,
1317                Action::None,
1318            )
1319            .tag_action(
1320                tags::SEGMENTED_GREEN_PALETTE_COLOR_LOOKUP_TABLE_DATA,
1321                Action::None,
1322            )
1323            .tag_action(
1324                tags::SEGMENTED_BLUE_PALETTE_COLOR_LOOKUP_TABLE_DATA,
1325                Action::None,
1326            )
1327            .tag_action(tags::BREAST_IMPLANT_PRESENT, Action::None)
1328            .tag_action(tags::PARTIAL_VIEW, Action::None)
1329            .tag_action(tags::PARTIAL_VIEW_DESCRIPTION, Action::None)
1330            .tag_action(tags::LOSSY_IMAGE_COMPRESSION, Action::None)
1331            .tag_action(tags::LOSSY_IMAGE_COMPRESSION_RATIO, Action::None)
1332            .tag_action(tags::MODALITY_LUT_SEQUENCE, Action::None)
1333            .tag_action(tags::LUT_DESCRIPTOR, Action::None)
1334            .tag_action(tags::LUT_EXPLANATION, Action::None)
1335            .tag_action(tags::MODALITY_LUT_TYPE, Action::None)
1336            .tag_action(tags::LUT_DATA, Action::None)
1337            .tag_action(tags::VOILUT_SEQUENCE, Action::None)
1338            .tag_action(tags::SOFTCOPY_VOILUT_SEQUENCE, Action::None)
1339            .tag_action(tags::IMAGE_PRESENTATION_COMMENTS, Action::Remove)
1340            .tag_action(tags::BI_PLANE_ACQUISITION_SEQUENCE, Action::None)
1341            .tag_action(tags::REPRESENTATIVE_FRAME_NUMBER, Action::None)
1342            .tag_action(tags::FRAME_NUMBERS_OF_INTEREST, Action::None)
1343            .tag_action(tags::FRAME_OF_INTEREST_DESCRIPTION, Action::None)
1344            .tag_action(tags::MASK_POINTERS, Action::None)
1345            .tag_action(tags::MASK_SUBTRACTION_SEQUENCE, Action::None)
1346            .tag_action(tags::MASK_OPERATION, Action::None)
1347            .tag_action(tags::APPLICABLE_FRAME_RANGE, Action::None)
1348            .tag_action(tags::MASK_FRAME_NUMBERS, Action::None)
1349            .tag_action(tags::CONTRAST_FRAME_AVERAGING, Action::None)
1350            .tag_action(tags::MASK_SUB_PIXEL_SHIFT, Action::None)
1351            .tag_action(tags::TID_OFFSET, Action::None)
1352            .tag_action(tags::MASK_OPERATION_EXPLANATION, Action::None)
1353            .tag_action(tags::DATA_POINT_ROWS, Action::None)
1354            .tag_action(tags::DATA_POINT_COLUMNS, Action::None)
1355            .tag_action(tags::SIGNAL_DOMAIN_COLUMNS, Action::None)
1356            .tag_action(tags::LARGEST_MONOCHROME_PIXEL_VALUE, Action::None)
1357            .tag_action(tags::DATA_REPRESENTATION, Action::None)
1358            .tag_action(tags::PIXEL_MEASURES_SEQUENCE, Action::None)
1359            .tag_action(tags::FRAME_VOILUT_SEQUENCE, Action::None)
1360            .tag_action(tags::PIXEL_VALUE_TRANSFORMATION_SEQUENCE, Action::None)
1361            .tag_action(tags::SIGNAL_DOMAIN_ROWS, Action::None)
1362            .tag_action(tags::STUDY_STATUS_ID, Action::None)
1363            .tag_action(tags::STUDY_PRIORITY_ID, Action::None)
1364            .tag_action(tags::STUDY_ID_ISSUER, Action::Remove)
1365            .tag_action(
1366                tags::STUDY_VERIFIED_DATE,
1367                Action::HashDate(tags::PATIENT_ID),
1368            )
1369            .tag_action(tags::STUDY_VERIFIED_TIME, Action::None)
1370            .tag_action(tags::STUDY_READ_DATE, Action::HashDate(tags::PATIENT_ID))
1371            .tag_action(tags::STUDY_READ_TIME, Action::None)
1372            .tag_action(
1373                tags::SCHEDULED_STUDY_START_DATE,
1374                Action::HashDate(tags::PATIENT_ID),
1375            )
1376            .tag_action(tags::SCHEDULED_STUDY_START_TIME, Action::None)
1377            .tag_action(
1378                tags::SCHEDULED_STUDY_STOP_DATE,
1379                Action::HashDate(tags::PATIENT_ID),
1380            )
1381            .tag_action(tags::SCHEDULED_STUDY_STOP_TIME, Action::None)
1382            .tag_action(tags::SCHEDULED_STUDY_LOCATION, Action::Remove)
1383            .tag_action(tags::SCHEDULED_STUDY_LOCATION_AE_TITLE, Action::Remove)
1384            .tag_action(tags::REASON_FOR_STUDY, Action::Remove)
1385            .tag_action(tags::REQUESTING_PHYSICIAN, Action::Remove)
1386            .tag_action(tags::REQUESTING_SERVICE, Action::Remove)
1387            .tag_action(tags::STUDY_ARRIVAL_DATE, Action::HashDate(tags::PATIENT_ID))
1388            .tag_action(tags::STUDY_ARRIVAL_TIME, Action::None)
1389            .tag_action(
1390                tags::STUDY_COMPLETION_DATE,
1391                Action::HashDate(tags::PATIENT_ID),
1392            )
1393            .tag_action(tags::STUDY_COMPLETION_TIME, Action::None)
1394            .tag_action(tags::STUDY_COMPONENT_STATUS_ID, Action::None)
1395            .tag_action(tags::REQUESTED_PROCEDURE_DESCRIPTION, Action::Remove)
1396            .tag_action(tags::REQUESTED_PROCEDURE_CODE_SEQUENCE, Action::None)
1397            .tag_action(tags::REQUESTED_CONTRAST_AGENT, Action::Remove)
1398            .tag_action(tags::STUDY_COMMENTS, Action::Remove)
1399            .tag_action(tags::REFERENCED_PATIENT_ALIAS_SEQUENCE, Action::None)
1400            .tag_action(tags::VISIT_STATUS_ID, Action::None)
1401            .tag_action(tags::ADMISSION_ID, Action::Remove)
1402            .tag_action(tags::ISSUER_OF_ADMISSION_ID, Action::Remove)
1403            .tag_action(tags::ROUTE_OF_ADMISSIONS, Action::None)
1404            .tag_action(
1405                tags::SCHEDULED_ADMISSION_DATE,
1406                Action::HashDate(tags::PATIENT_ID),
1407            )
1408            .tag_action(tags::SCHEDULED_ADMISSION_TIME, Action::None)
1409            .tag_action(
1410                tags::SCHEDULED_DISCHARGE_DATE,
1411                Action::HashDate(tags::PATIENT_ID),
1412            )
1413            .tag_action(tags::SCHEDULED_DISCHARGE_TIME, Action::None)
1414            .tag_action(tags::ADMITTING_DATE, Action::Remove)
1415            .tag_action(tags::ADMITTING_TIME, Action::Remove)
1416            .tag_action(tags::DISCHARGE_DATE, Action::HashDate(tags::PATIENT_ID))
1417            .tag_action(tags::DISCHARGE_TIME, Action::None)
1418            .tag_action(tags::DISCHARGE_DIAGNOSIS_DESCRIPTION, Action::Remove)
1419            .tag_action(tags::DISCHARGE_DIAGNOSIS_CODE_SEQUENCE, Action::None)
1420            .tag_action(tags::SPECIAL_NEEDS, Action::Remove)
1421            .tag_action(tags::SERVICE_EPISODE_ID, Action::Remove)
1422            .tag_action(tags::ISSUER_OF_SERVICE_EPISODE_ID, Action::Remove)
1423            .tag_action(tags::SERVICE_EPISODE_DESCRIPTION, Action::Remove)
1424            .tag_action(tags::CURRENT_PATIENT_LOCATION, Action::Remove)
1425            .tag_action(tags::PATIENT_INSTITUTION_RESIDENCE, Action::Remove)
1426            .tag_action(tags::PATIENT_STATE, Action::Remove)
1427            .tag_action(tags::REFERENCED_PATIENT_ALIAS_SEQUENCE, Action::Remove)
1428            .tag_action(tags::VISIT_COMMENTS, Action::Remove)
1429            .tag_action(tags::WAVEFORM_ORIGINALITY, Action::None)
1430            .tag_action(tags::NUMBER_OF_WAVEFORM_CHANNELS, Action::None)
1431            .tag_action(tags::NUMBER_OF_WAVEFORM_SAMPLES, Action::None)
1432            .tag_action(tags::SAMPLING_FREQUENCY, Action::None)
1433            .tag_action(tags::MULTIPLEX_GROUP_LABEL, Action::None)
1434            .tag_action(tags::CHANNEL_DEFINITION_SEQUENCE, Action::None)
1435            .tag_action(tags::WAVEFORM_CHANNEL_NUMBER, Action::None)
1436            .tag_action(tags::CHANNEL_LABEL, Action::None)
1437            .tag_action(tags::CHANNEL_STATUS, Action::None)
1438            .tag_action(tags::CHANNEL_SOURCE_SEQUENCE, Action::None)
1439            .tag_action(tags::CHANNEL_SOURCE_MODIFIERS_SEQUENCE, Action::None)
1440            .tag_action(tags::SOURCE_WAVEFORM_SEQUENCE, Action::None)
1441            .tag_action(tags::CHANNEL_DERIVATION_DESCRIPTION, Action::None)
1442            .tag_action(tags::CHANNEL_SENSITIVITY, Action::None)
1443            .tag_action(tags::CHANNEL_SENSITIVITY_UNITS_SEQUENCE, Action::None)
1444            .tag_action(tags::CHANNEL_SENSITIVITY_CORRECTION_FACTOR, Action::None)
1445            .tag_action(tags::CHANNEL_BASELINE, Action::None)
1446            .tag_action(tags::CHANNEL_TIME_SKEW, Action::None)
1447            .tag_action(tags::CHANNEL_SAMPLE_SKEW, Action::None)
1448            .tag_action(tags::CHANNEL_OFFSET, Action::None)
1449            .tag_action(tags::WAVEFORM_BITS_STORED, Action::None)
1450            .tag_action(tags::FILTER_LOW_FREQUENCY, Action::None)
1451            .tag_action(tags::FILTER_HIGH_FREQUENCY, Action::None)
1452            .tag_action(tags::NOTCH_FILTER_FREQUENCY, Action::None)
1453            .tag_action(tags::NOTCH_FILTER_BANDWIDTH, Action::None)
1454            .tag_action(tags::SCHEDULED_STATION_AE_TITLE, Action::Remove)
1455            .tag_action(
1456                tags::SCHEDULED_PROCEDURE_STEP_START_DATE,
1457                Action::HashDate(tags::PATIENT_ID),
1458            )
1459            .tag_action(tags::SCHEDULED_PROCEDURE_STEP_START_TIME, Action::None)
1460            .tag_action(
1461                tags::SCHEDULED_PROCEDURE_STEP_END_DATE,
1462                Action::HashDate(tags::PATIENT_ID),
1463            )
1464            .tag_action(tags::SCHEDULED_PROCEDURE_STEP_END_TIME, Action::None)
1465            .tag_action(tags::SCHEDULED_PERFORMING_PHYSICIAN_NAME, Action::Remove)
1466            .tag_action(tags::SCHEDULED_PROCEDURE_STEP_DESCRIPTION, Action::Remove)
1467            .tag_action(tags::SCHEDULED_PROTOCOL_CODE_SEQUENCE, Action::None)
1468            .tag_action(tags::SCHEDULED_PROCEDURE_STEP_ID, Action::None)
1469            .tag_action(
1470                tags::SCHEDULED_PERFORMING_PHYSICIAN_IDENTIFICATION_SEQUENCE,
1471                Action::Remove,
1472            )
1473            .tag_action(tags::SCHEDULED_STATION_NAME, Action::Remove)
1474            .tag_action(tags::SCHEDULED_PROCEDURE_STEP_LOCATION, Action::Remove)
1475            .tag_action(tags::PRE_MEDICATION, Action::Remove)
1476            .tag_action(tags::SCHEDULED_PROCEDURE_STEP_STATUS, Action::None)
1477            .tag_action(tags::SCHEDULED_PROCEDURE_STEP_SEQUENCE, Action::None)
1478            .tag_action(
1479                tags::REFERENCED_NON_IMAGE_COMPOSITE_SOP_INSTANCE_SEQUENCE,
1480                Action::None,
1481            )
1482            .tag_action(tags::PERFORMED_STATION_AE_TITLE, Action::Remove)
1483            .tag_action(tags::PERFORMED_STATION_NAME, Action::Remove)
1484            .tag_action(tags::PERFORMED_LOCATION, Action::Remove)
1485            .tag_action(
1486                tags::PERFORMED_PROCEDURE_STEP_START_DATE,
1487                Action::HashDate(tags::PATIENT_ID),
1488            )
1489            .tag_action(tags::PERFORMED_PROCEDURE_STEP_START_TIME, Action::None)
1490            .tag_action(tags::PERFORMED_STATION_NAME_CODE_SEQUENCE, Action::Remove)
1491            .tag_action(
1492                tags::PERFORMED_PROCEDURE_STEP_END_DATE,
1493                Action::HashDate(tags::PATIENT_ID),
1494            )
1495            .tag_action(tags::PERFORMED_PROCEDURE_STEP_END_TIME, Action::None)
1496            .tag_action(tags::PERFORMED_PROCEDURE_STEP_ID, Action::Remove)
1497            .tag_action(tags::PERFORMED_PROCEDURE_STEP_DESCRIPTION, Action::Remove)
1498            .tag_action(tags::PERFORMED_PROCEDURE_TYPE_DESCRIPTION, Action::None)
1499            .tag_action(tags::PERFORMED_PROTOCOL_CODE_SEQUENCE, Action::None)
1500            .tag_action(tags::SCHEDULED_STEP_ATTRIBUTES_SEQUENCE, Action::None)
1501            .tag_action(tags::REQUEST_ATTRIBUTES_SEQUENCE, Action::Remove)
1502            .tag_action(
1503                tags::COMMENTS_ON_THE_PERFORMED_PROCEDURE_STEP,
1504                Action::Remove,
1505            )
1506            .tag_action(
1507                tags::PERFORMED_PROCEDURE_STEP_DISCONTINUATION_REASON_CODE_SEQUENCE,
1508                Action::None,
1509            )
1510            .tag_action(tags::QUANTITY_SEQUENCE, Action::None)
1511            .tag_action(tags::QUANTITY, Action::None)
1512            .tag_action(tags::MEASURING_UNITS_SEQUENCE, Action::None)
1513            .tag_action(tags::BILLING_ITEM_SEQUENCE, Action::None)
1514            .tag_action(tags::TOTAL_TIME_OF_FLUOROSCOPY, Action::None)
1515            .tag_action(tags::TOTAL_NUMBER_OF_EXPOSURES, Action::None)
1516            .tag_action(tags::ENTRANCE_DOSE, Action::None)
1517            .tag_action(tags::EXPOSED_AREA, Action::None)
1518            .tag_action(tags::DISTANCE_SOURCE_TO_ENTRANCE, Action::None)
1519            .tag_action(tags::DISTANCE_SOURCE_TO_SUPPORT, Action::None)
1520            .tag_action(tags::EXPOSURE_DOSE_SEQUENCE, Action::None)
1521            .tag_action(tags::COMMENTS_ON_RADIATION_DOSE, Action::None)
1522            .tag_action(tags::X_RAY_OUTPUT, Action::None)
1523            .tag_action(tags::HALF_VALUE_LAYER, Action::None)
1524            .tag_action(tags::ORGAN_DOSE, Action::None)
1525            .tag_action(tags::ORGAN_EXPOSED, Action::None)
1526            .tag_action(tags::BILLING_PROCEDURE_STEP_SEQUENCE, Action::None)
1527            .tag_action(tags::FILM_CONSUMPTION_SEQUENCE, Action::None)
1528            .tag_action(tags::BILLING_SUPPLIES_AND_DEVICES_SEQUENCE, Action::None)
1529            .tag_action(tags::REFERENCED_PROCEDURE_STEP_SEQUENCE, Action::None)
1530            .tag_action(tags::PERFORMED_SERIES_SEQUENCE, Action::None)
1531            .tag_action(tags::COMMENTS_ON_THE_SCHEDULED_PROCEDURE_STEP, Action::None)
1532            .tag_action(tags::SPECIMEN_ACCESSION_NUMBER, Action::None)
1533            .tag_action(tags::SPECIMEN_SEQUENCE, Action::None)
1534            .tag_action(tags::SPECIMEN_IDENTIFIER, Action::None)
1535            .tag_action(tags::ACQUISITION_CONTEXT_SEQUENCE, Action::Remove)
1536            .tag_action(tags::ACQUISITION_CONTEXT_DESCRIPTION, Action::None)
1537            .tag_action(tags::SPECIMEN_TYPE_CODE_SEQUENCE, Action::None)
1538            .tag_action(tags::SLIDE_IDENTIFIER, Action::None)
1539            .tag_action(tags::IMAGE_CENTER_POINT_COORDINATES_SEQUENCE, Action::None)
1540            .tag_action(tags::X_OFFSET_IN_SLIDE_COORDINATE_SYSTEM, Action::None)
1541            .tag_action(tags::Y_OFFSET_IN_SLIDE_COORDINATE_SYSTEM, Action::None)
1542            .tag_action(tags::Z_OFFSET_IN_SLIDE_COORDINATE_SYSTEM, Action::None)
1543            .tag_action(tags::PIXEL_SPACING_SEQUENCE, Action::None)
1544            .tag_action(tags::COORDINATE_SYSTEM_AXIS_CODE_SEQUENCE, Action::None)
1545            .tag_action(tags::MEASUREMENT_UNITS_CODE_SEQUENCE, Action::None)
1546            .tag_action(tags::REQUESTED_PROCEDURE_ID, Action::None)
1547            .tag_action(tags::REASON_FOR_THE_REQUESTED_PROCEDURE, Action::None)
1548            .tag_action(tags::REQUESTED_PROCEDURE_PRIORITY, Action::None)
1549            .tag_action(tags::PATIENT_TRANSPORT_ARRANGEMENTS, Action::Remove)
1550            .tag_action(tags::REQUESTED_PROCEDURE_LOCATION, Action::Remove)
1551            .tag_action(tags::CONFIDENTIALITY_CODE, Action::None)
1552            .tag_action(tags::REPORTING_PRIORITY, Action::None)
1553            .tag_action(
1554                tags::NAMES_OF_INTENDED_RECIPIENTS_OF_RESULTS,
1555                Action::Remove,
1556            )
1557            .tag_action(
1558                tags::INTENDED_RECIPIENTS_OF_RESULTS_IDENTIFICATION_SEQUENCE,
1559                Action::Remove,
1560            )
1561            .tag_action(tags::PERSON_ADDRESS, Action::Remove)
1562            .tag_action(tags::PERSON_TELEPHONE_NUMBERS, Action::Remove)
1563            .tag_action(tags::REQUESTED_PROCEDURE_COMMENTS, Action::Remove)
1564            .tag_action(tags::REASON_FOR_THE_IMAGING_SERVICE_REQUEST, Action::Remove)
1565            .tag_action(
1566                tags::ISSUE_DATE_OF_IMAGING_SERVICE_REQUEST,
1567                Action::HashDate(tags::PATIENT_ID),
1568            )
1569            .tag_action(tags::ISSUE_TIME_OF_IMAGING_SERVICE_REQUEST, Action::None)
1570            .tag_action(tags::ORDER_ENTERED_BY, Action::Remove)
1571            .tag_action(tags::ORDER_ENTERER_LOCATION, Action::Remove)
1572            .tag_action(tags::ORDER_CALLBACK_PHONE_NUMBER, Action::Remove)
1573            .tag_action(
1574                tags::PLACER_ORDER_NUMBER_IMAGING_SERVICE_REQUEST,
1575                Action::Hash(HashLength::new(16).ok()),
1576            )
1577            .tag_action(
1578                tags::FILLER_ORDER_NUMBER_IMAGING_SERVICE_REQUEST,
1579                Action::Hash(HashLength::new(16).ok()),
1580            )
1581            .tag_action(tags::IMAGING_SERVICE_REQUEST_COMMENTS, Action::Remove)
1582            .tag_action(
1583                tags::CONFIDENTIALITY_CONSTRAINT_ON_PATIENT_DATA_DESCRIPTION,
1584                Action::Remove,
1585            )
1586            .tag_action(
1587                tags::REFERENCED_GENERAL_PURPOSE_SCHEDULED_PROCEDURE_STEP_TRANSACTION_UID,
1588                Action::HashUID,
1589            )
1590            .tag_action(tags::SCHEDULED_STATION_NAME_CODE_SEQUENCE, Action::Remove)
1591            .tag_action(
1592                tags::SCHEDULED_STATION_GEOGRAPHIC_LOCATION_CODE_SEQUENCE,
1593                Action::Remove,
1594            )
1595            .tag_action(
1596                tags::PERFORMED_STATION_GEOGRAPHIC_LOCATION_CODE_SEQUENCE,
1597                Action::Remove,
1598            )
1599            .tag_action(tags::SCHEDULED_HUMAN_PERFORMERS_SEQUENCE, Action::Remove)
1600            .tag_action(tags::ACTUAL_HUMAN_PERFORMERS_SEQUENCE, Action::Remove)
1601            .tag_action(tags::HUMAN_PERFORMER_ORGANIZATION, Action::Remove)
1602            .tag_action(tags::HUMAN_PERFORMER_NAME, Action::Remove)
1603            .tag_action(tags::ENTRANCE_DOSE_INM_GY, Action::None)
1604            .tag_action(tags::REAL_WORLD_VALUE_MAPPING_SEQUENCE, Action::None)
1605            .tag_action(tags::LUT_LABEL, Action::None)
1606            .tag_action(tags::REAL_WORLD_VALUE_LAST_VALUE_MAPPED, Action::None)
1607            .tag_action(tags::REAL_WORLD_VALUE_LUT_DATA, Action::None)
1608            .tag_action(tags::REAL_WORLD_VALUE_FIRST_VALUE_MAPPED, Action::None)
1609            .tag_action(tags::REAL_WORLD_VALUE_INTERCEPT, Action::None)
1610            .tag_action(tags::REAL_WORLD_VALUE_SLOPE, Action::None)
1611            .tag_action(tags::RELATIONSHIP_TYPE, Action::None)
1612            .tag_action(tags::VERIFYING_ORGANIZATION, Action::Remove)
1613            .tag_action(
1614                tags::VERIFICATION_DATE_TIME,
1615                Action::HashDate(tags::PATIENT_ID),
1616            )
1617            .tag_action(
1618                tags::OBSERVATION_DATE_TIME,
1619                Action::HashDate(tags::PATIENT_ID),
1620            )
1621            .tag_action(tags::VALUE_TYPE, Action::None)
1622            .tag_action(tags::CONCEPT_NAME_CODE_SEQUENCE, Action::None)
1623            .tag_action(tags::CONTINUITY_OF_CONTENT, Action::None)
1624            .tag_action(tags::VERIFYING_OBSERVER_SEQUENCE, Action::Remove)
1625            .tag_action(tags::VERIFYING_OBSERVER_NAME, Action::Remove)
1626            .tag_action(tags::AUTHOR_OBSERVER_SEQUENCE, Action::Remove)
1627            .tag_action(tags::PARTICIPANT_SEQUENCE, Action::Remove)
1628            .tag_action(tags::CUSTODIAL_ORGANIZATION_SEQUENCE, Action::Remove)
1629            .tag_action(
1630                tags::VERIFYING_OBSERVER_IDENTIFICATION_CODE_SEQUENCE,
1631                Action::Remove,
1632            )
1633            .tag_action(tags::REFERENCED_WAVEFORM_CHANNELS, Action::None)
1634            .tag_action(tags::DATE_TIME, Action::HashDate(tags::PATIENT_ID))
1635            .tag_action(tags::DATE, Action::HashDate(tags::PATIENT_ID))
1636            .tag_action(tags::TIME, Action::None)
1637            .tag_action(tags::PERSON_NAME, Action::Remove)
1638            .tag_action(tags::UID, Action::HashUID)
1639            .tag_action(tags::TEMPORAL_RANGE_TYPE, Action::None)
1640            .tag_action(tags::REFERENCED_SAMPLE_POSITIONS, Action::None)
1641            .tag_action(tags::REFERENCED_FRAME_NUMBERS, Action::None)
1642            .tag_action(tags::REFERENCED_TIME_OFFSETS, Action::None)
1643            .tag_action(
1644                tags::REFERENCED_DATE_TIME,
1645                Action::HashDate(tags::PATIENT_ID),
1646            )
1647            .tag_action(tags::TEXT_VALUE, Action::None)
1648            .tag_action(tags::CONCEPT_CODE_SEQUENCE, Action::None)
1649            .tag_action(tags::ANNOTATION_GROUP_NUMBER, Action::None)
1650            .tag_action(tags::MODIFIER_CODE_SEQUENCE, Action::None)
1651            .tag_action(tags::MEASURED_VALUE_SEQUENCE, Action::None)
1652            .tag_action(tags::NUMERIC_VALUE, Action::None)
1653            .tag_action(tags::PREDECESSOR_DOCUMENTS_SEQUENCE, Action::None)
1654            .tag_action(tags::REFERENCED_REQUEST_SEQUENCE, Action::None)
1655            .tag_action(tags::PERFORMED_PROCEDURE_CODE_SEQUENCE, Action::None)
1656            .tag_action(
1657                tags::CURRENT_REQUESTED_PROCEDURE_EVIDENCE_SEQUENCE,
1658                Action::None,
1659            )
1660            .tag_action(tags::PERTINENT_OTHER_EVIDENCE_SEQUENCE, Action::None)
1661            .tag_action(tags::COMPLETION_FLAG, Action::None)
1662            .tag_action(tags::VERIFICATION_FLAG, Action::None)
1663            .tag_action(tags::CONTENT_TEMPLATE_SEQUENCE, Action::None)
1664            .tag_action(tags::IDENTICAL_DOCUMENTS_SEQUENCE, Action::None)
1665            .tag_action(tags::CONTENT_SEQUENCE, Action::Remove)
1666            .tag_action(tags::WAVEFORM_ANNOTATION_SEQUENCE, Action::None)
1667            .tag_action(tags::TEMPLATE_VERSION, Action::None)
1668            .tag_action(tags::TEMPLATE_LOCAL_VERSION, Action::None)
1669            .tag_action(tags::TEMPLATE_EXTENSION_FLAG, Action::None)
1670            .tag_action(tags::TEMPLATE_EXTENSION_ORGANIZATION_UID, Action::HashUID)
1671            .tag_action(tags::TEMPLATE_EXTENSION_CREATOR_UID, Action::HashUID)
1672            .tag_action(tags::REFERENCED_CONTENT_ITEM_IDENTIFIER, Action::None)
1673            .tag_action(tags::FIDUCIAL_UID, Action::HashUID)
1674            .tag_action(tags::STORAGE_MEDIA_FILE_SET_UID, Action::HashUID)
1675            .tag_action(tags::ICON_IMAGE_SEQUENCE, Action::Remove)
1676            .tag_action(tags::TOPIC_SUBJECT, Action::Remove)
1677            .tag_action(tags::TOPIC_AUTHOR, Action::Remove)
1678            .tag_action(tags::TOPIC_KEYWORDS, Action::Remove)
1679            .tag_action(tags::DIGITAL_SIGNATURE_UID, Action::HashUID)
1680            .tag_action(tags::TEXT_STRING, Action::Remove)
1681            .tag_action(tags::REFERENCED_FRAME_OF_REFERENCE_UID, Action::HashUID)
1682            .tag_action(tags::RELATED_FRAME_OF_REFERENCE_UID, Action::HashUID)
1683            .tag_action(tags::DOSE_REFERENCE_UID, Action::HashUID)
1684            .tag_action(tags::ARBITRARY, Action::Remove)
1685            .tag_action(tags::TEXT_COMMENTS, Action::Remove)
1686            .tag_action(tags::RESULTS_ID_ISSUER, Action::Remove)
1687            .tag_action(tags::INTERPRETATION_RECORDER, Action::Remove)
1688            .tag_action(tags::INTERPRETATION_TRANSCRIBER, Action::Remove)
1689            .tag_action(tags::INTERPRETATION_TEXT, Action::Remove)
1690            .tag_action(tags::INTERPRETATION_AUTHOR, Action::Remove)
1691            .tag_action(tags::INTERPRETATION_APPROVER_SEQUENCE, Action::Remove)
1692            .tag_action(tags::PHYSICIAN_APPROVING_INTERPRETATION, Action::Remove)
1693            .tag_action(tags::INTERPRETATION_DIAGNOSIS_DESCRIPTION, Action::Remove)
1694            .tag_action(tags::RESULTS_DISTRIBUTION_LIST_SEQUENCE, Action::Remove)
1695            .tag_action(tags::DISTRIBUTION_NAME, Action::Remove)
1696            .tag_action(tags::DISTRIBUTION_ADDRESS, Action::Remove)
1697            .tag_action(tags::INTERPRETATION_ID_ISSUER, Action::Remove)
1698            .tag_action(tags::IMPRESSIONS, Action::Remove)
1699            .tag_action(tags::RESULTS_COMMENTS, Action::Remove)
1700            .tag_action(tags::DIGITAL_SIGNATURES_SEQUENCE, Action::Remove)
1701            .tag_action(tags::DATA_SET_TRAILING_PADDING, Action::Remove)
1702    }
1703}
1704
1705#[cfg(test)]
1706mod tests {
1707    use super::*;
1708
1709    #[test]
1710    fn test_config_builder() {
1711        let config = ConfigBuilder::new()
1712            .tag_action(tags::PATIENT_NAME, Action::Empty)
1713            .build();
1714        let tag_action = config.get_action(&tags::PATIENT_NAME);
1715        assert_eq!(tag_action, &Action::Empty);
1716
1717        // tags without explicit action should be kept by default
1718        let tag_action = config.get_action(&tags::PATIENT_ID);
1719        assert_eq!(tag_action, &Action::Keep);
1720    }
1721
1722    #[test]
1723    fn test_uid_root_validation() {
1724        // Valid cases
1725        assert!(UidRoot::new("").is_ok());
1726        assert!(UidRoot::new("1").is_ok());
1727        assert!(UidRoot::new("1.2.3").is_ok());
1728        assert!(UidRoot::new("123.456.").is_ok());
1729        assert!(UidRoot::new(&"1".repeat(32)).is_ok());
1730
1731        // Invalid cases
1732        assert!(UidRoot::new("0123").is_err()); // starts with 0
1733        assert!(UidRoot::new("a.1.2").is_err()); // contains letter
1734        assert!(UidRoot::new("1.2.3-4").is_err()); // contains invalid character
1735        assert!(UidRoot::new(&"1".repeat(33)).is_err()); // too long
1736    }
1737
1738    #[test]
1739    fn test_uid_root_from_str() {
1740        // Valid cases
1741        let uid_root: Result<UidRoot, _> = "1.2.736.120".parse();
1742        assert!(uid_root.is_ok());
1743
1744        let uid_root: Result<UidRoot, _> = "".parse();
1745        assert!(uid_root.is_ok());
1746
1747        // Invalid cases
1748        let uid_root: Result<UidRoot, _> = "0.1.2".parse();
1749        assert!(uid_root.is_err());
1750
1751        let uid_root: Result<UidRoot, _> = "invalid".parse();
1752        assert!(uid_root.is_err());
1753    }
1754
1755    #[test]
1756    fn test_uid_root_as_ref() {
1757        // Test empty string
1758        let uid_root = UidRoot::new("").unwrap();
1759        assert_eq!(uid_root.as_ref(), "");
1760
1761        // Test normal UID root
1762        let uid_root = UidRoot::new("1.2.3").unwrap();
1763        assert_eq!(uid_root.as_ref(), "1.2.3");
1764
1765        // Test UID root with trailing dot
1766        let uid_root = UidRoot::new("1.2.3.").unwrap();
1767        assert_eq!(uid_root.as_ref(), "1.2.3.");
1768
1769        // Test using as_ref in a function that expects &str
1770        fn takes_str(_s: &str) {}
1771        let uid_root = UidRoot::new("1.2.3").unwrap();
1772        takes_str(uid_root.as_ref());
1773    }
1774
1775    #[test]
1776    fn test_is_private_tag() {
1777        // private tags
1778        assert!(is_private_tag(&Tag::from([1, 0])));
1779        assert!(is_private_tag(&Tag::from([13, 12])));
1780        assert!(is_private_tag(&Tag::from([33, 33])));
1781
1782        // non_private tags
1783        assert!(!is_private_tag(&tags::ACCESSION_NUMBER));
1784        assert!(!is_private_tag(&tags::PATIENT_ID));
1785        assert!(!is_private_tag(&tags::PIXEL_DATA));
1786    }
1787
1788    #[test]
1789    fn test_is_curve_tag() {
1790        // curve tags
1791        assert!(is_curve_tag(&Tag::from([0x5000, 0])));
1792        assert!(is_curve_tag(&Tag::from([0x5010, 0x0011])));
1793        assert!(is_curve_tag(&Tag::from([0x50FF, 0x0100])));
1794
1795        // non-curve tags
1796        assert!(!is_curve_tag(&Tag::from([0x5100, 0])));
1797        assert!(!is_curve_tag(&Tag::from([0x6000, 0])));
1798    }
1799
1800    #[test]
1801    fn test_is_overlay_tag() {
1802        // overlay tags
1803        assert!(is_overlay_tag(&Tag::from([0x6000, 0])));
1804        assert!(is_overlay_tag(&Tag::from([0x6010, 0x0011])));
1805        assert!(is_overlay_tag(&Tag::from([0x60FF, 0x0100])));
1806
1807        // non-overlay tags
1808        assert!(!is_overlay_tag(&Tag::from([0x6100, 0])));
1809        assert!(!is_overlay_tag(&Tag::from([0x5000, 0])));
1810    }
1811}