Susan,
It isn't really an error message, but just a write to the LOG. You can eliminate that by dropping the statement that begins with "PUT". It was used for diagnostic information only.
The comparison isn't just to the first admission, but neither is it comparing all possible combinations. It starts out comparing to the first admission, but then resets the comparison date whenever a new admission date is encountered (for a given patient) that was not subject to deletion.
Please look at what happens for my made-up patient number one, and note what records are dropped versus kept. I'm really not sure what outcome you'd actually want to have in that case. The 16Feb09 wasn't dropped because it was more than 4 days from the 11th, but if the 15th hadn't been deleted, then the 16th would have been within 4 days of the 15Feb and therefore possibly subject to elimination.
Did you want to do comparisons between all admissions within a patient?