I seem to recall hearing at one point - if a cat poops outside the box, it is behavioral; if it pees outside, it is medical.

Twice I have had cats that pooped outside the box, and both times it was a behavior problem - not medical.