Added the class casting from object to integer in the hospital agent.