def shift_dates(seconds)
      # Iterate over fields
      fields.keys.each do |field|
        # Check if field is a DateTime
        if send(field).is_a? DateTime
          send(field + '=', (send(field).to_time + seconds.seconds).to_datetime)
        end
        # Check if field is an Interval
        if (send(field).is_a? Interval) || (send(field).is_a? DataElement)
          send(field + '=', send(field).shift_dates(seconds))
        end

        # Special case for facility locations
        if field == 'facilityLocations'
          send(field).each do |facility_location|
            shift_facility_location_dates(facility_location, seconds)
          end
        elsif field == 'facilityLocation'
          facility_location = send(field)
          unless facility_location.nil?
            shift_facility_location_dates(facility_location, seconds)
            send(field + '=', facility_location)
          end
        end
      end
    end
def shift_dates(seconds)
      # Iterate over fields
      fields.keys.each do |field|
        # Check if field is a DateTime
        if send(field).is_a? DateTime
          send(field + '=', (send(field).to_time + seconds.seconds).to_datetime)
        end
        # Check if field is an Interval
        if (send(field).is_a? Interval) || (send(field).is_a? DataElement)
          send(field + '=', send(field).shift_dates(seconds))
        end

        # Special case for facility locations
        if field == 'facilityLocations'
          send(field).each do |facility_location|
            shift_facility_location_dates(facility_location, seconds)
          end
        elsif field == 'facilityLocation'
          facility_location = send(field)
          unless facility_location.nil?
            shift_facility_location_dates(facility_location, seconds)
            send(field + '=', facility_location)
          end
        end
      end
    end
Shift all fields that deal with dates by the given value.
 Given value should be in seconds. Positive values shift forward, negative
 values shift backwards.