function for hospital management system