Error ending patient consultation

Hi everyone, I am using openmrs 2.2.1 and appointment scheduling module 1.13.0. I am getting an error trying to end consultation for some of the patients. Below is the image of the error and a links to the log file. I need help please.