def enumerated_value(original, j)
      # Is enumeration requested for this tag?
      if @enumerations[j]
        if @audit_trail
          # Check if the UID has been encountered already:
          replacement = @audit_trail.replacement(@tags[j], at_value(original))
          unless replacement
            # This original value has not been encountered yet. Determine the index to use.
            index = @audit_trail.records(@tags[j]).length + 1
            # Create the replacement value:
            if @values[j].is_a?(String)
              replacement = @values[j] + index.to_s
            else
              replacement = @values[j] + index
            end
            # Add this tag record to the audit trail:
            @audit_trail.add_record(@tags[j], at_value(original), replacement)
          end
        else
          # Retrieve earlier used anonymization values:
          previous_old = @enum_old_hash[@tags[j]]
          previous_new = @enum_new_hash[@tags[j]]
          p_index = previous_old.length
          if previous_old.index(original) == nil
            # Current value has not been encountered before:
            replacement = @values[j]+(p_index + 1).to_s
            # Store value in array (and hash):
            previous_old << original
            previous_new << replacement
            @enum_old_hash[@tags[j]] = previous_old
            @enum_new_hash[@tags[j]] = previous_new
          else
            # Current value has been observed before:
            replacement = previous_new[previous_old.index(original)]
          end
        end
      else
        replacement = @values[j]
      end
      return replacement
    end
def enumerated_value(original, j)
      # Is enumeration requested for this tag?
      if @enumerations[j]
        if @audit_trail
          # Check if the UID has been encountered already:
          replacement = @audit_trail.replacement(@tags[j], at_value(original))
          unless replacement
            # This original value has not been encountered yet. Determine the index to use.
            index = @audit_trail.records(@tags[j]).length + 1
            # Create the replacement value:
            if @values[j].is_a?(String)
              replacement = @values[j] + index.to_s
            else
              replacement = @values[j] + index
            end
            # Add this tag record to the audit trail:
            @audit_trail.add_record(@tags[j], at_value(original), replacement)
          end
        else
          # Retrieve earlier used anonymization values:
          previous_old = @enum_old_hash[@tags[j]]
          previous_new = @enum_new_hash[@tags[j]]
          p_index = previous_old.length
          if previous_old.index(original) == nil
            # Current value has not been encountered before:
            replacement = @values[j]+(p_index + 1).to_s
            # Store value in array (and hash):
            previous_old << original
            previous_new << replacement
            @enum_old_hash[@tags[j]] = previous_old
            @enum_new_hash[@tags[j]] = previous_new
          else
            # Current value has been observed before:
            replacement = previous_new[previous_old.index(original)]
          end
        end
      else
        replacement = @values[j]
      end
      return replacement
    end
Handles the enumeration for the given data element tag.
 If its value has been encountered before, its corresponding enumerated
 replacement value is retrieved, and if a new original value is encountered,
 a new enumerated replacement value is found by increasing an index by 1.

 @param [String, Integer, Float] original the original value of the tag to be anonymized
 @param [Integer] j the index of this tag in the tag-related instance arrays
 @return [String, Integer, Float] the replacement value which is used for the anonymization of the tag