added view patient function to controller