public function registerAction()
 {
     $name = $this->_getParam('name');
     $avatar = $this->_getParam('avatar');
     $email = $this->_getParam('email');
     $phone = $this->_getParam('phone');
     $departments = $this->_getParam('departments');
     $type = $this->_getParam('type');
     $city = $this->_getParam('city');
     $label = $this->_getParam('label');
     $country = $this->_getParam('country');
     $area = $this->_getParam('area');
     $passwd = $this->_getParam('passwd');
     $introduction = $this->_getParam('introduction');
     $longitude = $this->_getParam('longitude');
     $latitude = $this->_getParam('latitude');
     if (!$passwd) {
         $out['errno'] = '3';
         $out['msg'] = Yy_ErrMsg_Hospital::getMsg('register', $out['errno']);
         Yy_Utils::jsonOut($out);
         return;
     }
     $validatorEmail = new Zend_Validate_EmailAddress();
     if ($validatorEmail->isValid($email)) {
         $bool = Application_Model_M_Hospital::fetchByEmail($email);
         if ($bool) {
             //已注册
             $out['errno'] = '1';
         } else {
             $out['errno'] = '0';
             $hospital = new Application_Model_O_Hospital();
             $hospital->setName($name)->setEmail($email)->setPasswd(md5($passwd))->setPhone($phone)->setDepartments($departments)->setType($type)->setCity($city)->setLabel($label)->setCountry($country)->setArea($area)->setIntroduction($introduction)->setLongitude($longitude)->setLatitude($latitude);
             $certified = ceil(count($hospital->getModifiedFields()) / 3);
             $hospital->setCertified($certified);
             $hospital->save();
             //保存医院头像
             $adapter = new Zend_File_Transfer_Adapter_Http();
             $wrdir = Yy_Utils::getWriteDir();
             $adapter->setDestination($wrdir);
             if (!$adapter->receive()) {
                 $messages = $adapter->getMessages();
                 //echo implode("\n", $messages);
             }
             $filename = $adapter->getFileName();
             if (is_string($filename)) {
                 $handle = fopen($filename, 'rb');
                 $avatar = addslashes(fread($handle, filesize($filename)));
                 fclose($handle);
                 Application_Model_M_Hospital::updateAvatar($hospital->getId(), $avatar);
             }
         }
     } else {
         $out['errno'] = '2';
     }
     $out['msg'] = Yy_ErrMsg_Hospital::getMsg('register', $out['errno']);
     Yy_Utils::jsonOut($out);
 }