I would move this assignment inside the loop, so that it is instantiated new for each patient.