Lattice model for polymer hydration: Collapse of poly(N-isopropylacrylamide)