def replace_uids(parents)
      parents.each do |parent|
        parent.each_element do |element|
          if element.vr == ('UI') and !@static_uids[element.tag]
            original = element.value
            if original && original.length > 0
              # We have a UID value, go ahead and replace it:
              if @audit_trail
                # Check if the UID has been encountered already:
                replacement = @audit_trail.replacement('uids', original)
                unless replacement
                  # The UID has not been stored previously. Generate a new one:
                  replacement = DICOM.generate_uid(@uid_root, prefix(element.tag))
                  # Add this tag record to the audit trail:
                  @audit_trail.add_record('uids', original, replacement)
                end
                # Replace the UID in the DICOM object:
                element.value = replacement
              else
                # We don't care about preserving UID relations. Just insert a custom UID:
                element.value = DICOM.generate_uid(@uid_root, prefix(element.tag))
              end
            end
          end
        end
      end
    end
def replace_uids(parents)
      parents.each do |parent|
        parent.each_element do |element|
          if element.vr == ('UI') and !@static_uids[element.tag]
            original = element.value
            if original && original.length > 0
              # We have a UID value, go ahead and replace it:
              if @audit_trail
                # Check if the UID has been encountered already:
                replacement = @audit_trail.replacement('uids', original)
                unless replacement
                  # The UID has not been stored previously. Generate a new one:
                  replacement = DICOM.generate_uid(@uid_root, prefix(element.tag))
                  # Add this tag record to the audit trail:
                  @audit_trail.add_record('uids', original, replacement)
                end
                # Replace the UID in the DICOM object:
                element.value = replacement
              else
                # We don't care about preserving UID relations. Just insert a custom UID:
                element.value = DICOM.generate_uid(@uid_root, prefix(element.tag))
              end
            end
          end
        end
      end
    end
Replaces the UIDs of the given DICOM object.

 @note Empty UIDs are ignored (we don't generate new UIDs for these).
 @note If AuditTrail is set, the relationship between old and new UIDs are preserved,
   and the relations between files in a study/series should remain valid.
 @param [Array<DObject, Item>] parents dicom parent objects who's child elements will be investigated