In a right triangle, the length of one side is a prime and the lengths of the other side and the hypotenuse are integral. The ratio of the triangle perimeter and the incircle diameter is also an integer. Find all possible side lengths of the triangle.