Ejemplo n.º 1
0
    private function getRealData($nowPage, $pageSize, $province)
    {/*{{{*/
            $options['hospitalGrade'] = Hospital::GRADE_6;
            $options['orderByDesc'] = 'fld_HospitalCommentCount';
            $options['province'] = $province;
            $hospitalList = HospitalClient::getInstance()->getHospitalByOption($nowPage, $pageSize, $options);

            $area = 'province'; //对省和市进行标记
            $realData[] = $this->buildData($nowPage, $pageSize, $hospitalList, $area);

            $cities = City::getProvinceCities($province);
            if(in_array(array_shift($cities), $this->directlyCities))
            {
                return $realData;
            }
            foreach($cities as $city)
            {
                $area = 'city';
                $options['city'] = $city;
                $hospitalList4City = HospitalClient::getInstance()->getHospitalByOption($nowPage, $pageSize, $options);
                $realData[] = $this->buildData($nowPage, $pageSize, $hospitalList4City, $area);
                unset($city);
            }
            BeanFinder::get('LocalCache')->removeAll(); 
            return $realData;
    }/*}}}*/
 protected function getData($nowPage, $pageSize)
 {/*{{{*/
     $hospitalList = DAL::get()->find_all_AllHospital4Sc('hospital', $nowPage, $pageSize); 
     $departmentDescription = array();
     foreach($hospitalList as $hospital)
     {
         $hospitalFacultyList = HospitalClient::getInstance()->getFacultyList($hospital->id);
         foreach($hospitalFacultyList as $hospitalFaculty)
         {
             if($hospitalFaculty->doctorCnt == 0)
                 continue;
             $tempDescription = array();
             $tempDescription['key'] = $hospital->commonName.$hospitalFaculty->name;
             $tempDescription['city'] = $hospital->city;
             $tempDescription['department'] = $hospitalFaculty->name;
             $tempDescription['hospital'] = $hospital->name;
             $tempDescription['doctors'] = $this->get3DoctorInfo($hospitalFaculty);
             $tempDescription['department_link'] = $hospitalFaculty->getTouchUrl();
             $tempDescription['site_name'] = '好大夫在线';
             $departmentDescription[] = array('item' => $tempDescription);
         }
         unset($hospital);
         unset($hospitalFacultyList);
         BeanFinder::get('LocalCache')->removeAll();
     }
     unset($hospitalList);
     BeanFinder::get('LocalCache')->removeAll();
     return $departmentDescription;
 }/*}}}*/
Ejemplo n.º 3
0
 private function getDiseaseHospital($diseaseIds)
 {/*{{{*/
     $resArray = array();
     $option['limit'] = 5;
     foreach ($diseaseIds as $diseaseId)
     {
         $resArray[$diseaseId] = array();
         $option['diseaseId'] = $diseaseId;
         $diseaseHospitals = HospitalClient::getInstance()->getDiseaseHospitalByOption($option);
         foreach ($diseaseHospitals as $diseaseHospital)
         {
             $resTmp = array(
                 'hospitalname' => $diseaseHospital->hospital->name,
                 'hospitalprovince' => $diseaseHospital->hospital->province,
                 'hospitalgrade' => $diseaseHospital->hospital->getGradeStr(),
                 'votecnt' => $diseaseHospital->rate1Count,
             );
             array_push($resArray[$diseaseId],$resTmp);
             unset($diseaseHospital);
         }
         unset($diseaseId);
         BeanFinder::get('LocalCache')->removeAll(); 
     }
     return $resArray;
 }/*}}}*/
 protected function getData($nowPage, $pageSize)
 {/*{{{*/
     $data = array();
     $options['isActivated'] = Hospital::ISACTIVATED_YES;
     $options['noTestData'] = true;
     $hospitalList = HospitalClient::getInstance()->getList($nowPage, $pageSize, $options);
     if($hospitalList && isset($hospitalList['list']))
     {
         foreach($hospitalList['list'] as $hospital)
         {
             $tmp = $this->getRealData($hospital);
             if($tmp['latitude'] =='' || $tmp['longtitude'] =='' )
             {
                 continue;
             }
             if($tmp)
             {
                 $data['item'] = $tmp;
                 $data['item']['lastmod'] = date("Y-m-d");
             }
             $res[] = $data;
             $data = null;
             unset($hospital);
         }
     }
     BeanFinder::get('LocalCache')->removeAll(); 
     return $res;
 }/*}}}*/
Ejemplo n.º 5
0
    private function getRealData(Hospital $hospital, $hospitalName = '')
    {/*{{{*/
        $res = array();
        if ($hospitalName)
        {
            $hsName = $hospitalName;
        }
        else
        {
            $hsName = $hospital->name;
        }

        $hospitals['item']['key'] = $hsName;
        $hospitals['item']['title'] = XString::truncate($hospital->commonName.'科室列表_门诊时间表_专家推荐_好大夫在线',59,'');
        $hospitals['item']['level'] = $hospital->getGradeStr();//
        $hospitals['item']['url'] = $hospital->getUrl();
        $hospitals['item']['address'] = strip_tags($hospital->address);
        $hospitals['item']['address_url'] = $hospital->getReMapUrl();
        $hospitals['item']['description'] = strip_tags($hospital->intro);
        $hospitals['item']['description_url'] = $hospital->getInfoUrl();
        $hospitals['item']['luxian'] = $hospital->addressinfo;
        $hospitals['item']['telephone'] = $hospital->phone;
        $hospitals['item']['online_doctors'] = $hospital->spaceCount;
        $hospitals['item']['online_doctors_url'] = $hospital->getDoctorUrl();
        $hospitals['item']['tel_doctors'] = HospitalClient::getInstance()->getHospitalDirectCallCount($hospital->id);
        $hospitals['item']['tel_doctors_url'] = $hospital->getTelDoctorUrl();
        $hospitals['item']['showurl'] = 'www.haodf.com/';

        $res[] = $hospitals;
        BeanFinder::get('LocalCache')->removeAll(); 
        return $res;

    }/*}}}*/
  private function prepareData($nowPage, $pageSize)
 {/*{{{*/
     $option['goodVoteCount'] = 10;
     $option['filterHospitalIds'] = BeanFinder::get('configs')->excludeHospitalIds;
     $option['filterKeys'] = BeanFinder::get('configs')->excludeDiseaseKeys;
     $hospitalList = HospitalClient::getInstance()->getDiseaseAreaHospitalGroupByOption($nowPage, $pageSize , $option);
     BeanFinder::get('LocalCache')->removeAll(); 
     return $this->getDisHospital($hospitalList);
 }/*}}}*/
 public function delete($request, $response)
 {
     self::clearCache($request->id);
     $result = HospitalClient::getInstance()->deleteHospitalAnnounce($request->id);
     $response->result = $result;
     $response->actionDesc = "删除";
     $response->id = $request->id;
     $response->_my_template = '/default/processmsg';
 }
Ejemplo n.º 8
0
 protected function getData($nowPage, $pageSize)
 {/*{{{*/
     $option['hospitalGrade'] = array(Hospital::GRADE_5, Hospital::GRADE_6);
     $option['hospitalFacultyCount'] = 5;
     $option['hospitalSpaceDoctorCount'] = 0;
     $datas = HospitalClient::getInstance()->getHospitalByOption($nowPage, $pageSize, $option);
     $res =  $this->buildData($datas);
     BeanFinder::get('LocalCache')->removeAll();
     return $res;
 }/*}}}*/
 private function prepareData($nowPage, $pageSize)
 {/*{{{*/
     $option['prov'] = Area::getProvinceNameList();
     $option['goodVoteCount'] = 10;
     $option['filterKeys'] = array('疼痛', '种牙齿医院', '种植牙齿医院', '种牙医院', '种植牙医院', '植牙医院', '牙齿种植医院');
     $option['orderby'] = " fld_DiseaseId asc ";
     $option['filterHospitalIds'] = BeanFinder::get('configs')->excludeHospitalIds;
     $option['filterKeys'] = BeanFinder::get('configs')->excludeDiseaseKeys;
     $hospitalList = HospitalClient::getInstance()->getDiseaseAreaHospitalGroupByOption($nowPage, $pageSize , $option);
     BeanFinder::get('LocalCache')->removeAll(); 
     if($hospitalList)
     {
         return $this->getDisHospital($hospitalList);
     }
     else 
     {
         return array();
     }
 }/*}}}*/
 protected function getData($nowPage, $pageSize)
 {/*{{{*/
     $hospitals = array();
     $hospitalList = HospitalClient::getInstance()->getHospitalByOption($nowPage, $pageSize, array());
     BeanFinder::get('LocalCache')->removeAll();
     if ($hospitalList)
     {
         foreach ($hospitalList as $hospital)
         {
             $realData = $this->getRealData($hospital);
             if ($realData)
             {
                 $hospitals[] = $realData;
             }
             unset($hospital);
         }
     }
     return $hospitals;
 }/*}}}*/
 protected function getData($nowPage, $pageSize)
 {/*{{{*/
     $hospitalList = DAL::get()->find_all_AllHospital4Sc('hospital', $nowPage, $pageSize); 
     $hospitalIntro = array();
     foreach($hospitalList as $hospital)
     {
         $tempIntroArray = array();
         $tempIntroArray['key'] = $hospital->commonName;
         $tempIntroArray['city'] = $hospital->city;
         $tempIntroArray['title'] = $hospital->name;
         $tempIntroArray['url'] = $hospital->getTouchUrl();
         $tempIntroArray['site_name'] = '好大夫在线';
         $tempIntroArray['deps_url'] = $hospital->getTouchUrl();
         $hospitalFacultyList = HospitalClient::getInstance()->getFacultyList($hospital->id);
         $hospitalFacultyList = array_slice($hospitalFacultyList, 0 ,10);
         $hospitalFacultyNames = '';
         foreach($hospitalFacultyList as $hospitalFaculty)
         {
             $hospitalFacultyNames .= " ".$hospitalFaculty->name;
         }
         $tempIntroArray['deps_names'] = $hospitalFacultyNames; 
         $tempIntroArray['dis_urls'] = $hospital->getTouchDiseaseUrl();
         $diseaseNames = '';
         $diseaseHospitalList = HospitalClient::getInstance()->getHotDiseaseList($hospital->id);
         foreach($diseaseHospitalList as $diseaseHospital)
         {
             if($diseaseHospital->disease->isNull())
             {
                 continue;
             }
             $diseaseNames .= " ".$diseaseHospital->disease->name;
         }
         $tempIntroArray['dis_names'] = $diseaseNames;
         $hospitalIntro[] = array('item' => $tempIntroArray);
         unset($hospital);
         unset($hospitalFacultyList);
     }
     unset($hospitalList);
     BeanFinder::get('LocalCache')->removeAll();
     return $hospitalIntro;
 }/*}}}*/
 protected function getData($nowPage, $pageSize)
 {/*{{{*/
     $options = array();
     $options['isActivated'] = self::HOSPITAL_ONLINE; 
     $options['hospitalIds'] = self::$hospitalIds; 
     $result = HospitalClient::getInstance()->getHospitals4BaiduMap($nowPage, $pageSize ,$options);
     $hospitals = array(); 
     foreach($result['hospitals'] as $hospital)
     {
         $res = array();
         $res['poi_name'] = $hospital->commonName;
         $res['hospital_level'] = $hospital->getGradeStr();
         $res['hospital_type'] = $hospital->categoryDesc();
         $res['hospital_capital'] = '国营医院';
         $res['hospital_medicare'] = '';
         $res['province'] = $hospital->province;
         $res['city'] = $hospital->city;
         $res['country'] = $hospital->district;
         $res['poi_address'] = $this->getAddress($hospital->address);
         $mapUrl = empty($hospital->mapUrl) ? array('', '') : explode(",", $hospital->mapUrl);
         $res['longitude'] = $mapUrl[0];
         $res['latitude'] = $mapUrl[1];
         $res['phone'] = $this->getPhone($hospital->phone);
         $res['category1'] = '医疗';
         $res['category2'] = '医院';
         $res['business_state'] = '1';
         $res['consult_URL_PC'] = $hospital->getDoctorUrl();
         $res['consult_URL_mobile'] = '';
         $res['register_URL_PC'] = $hospital->getJiaHaoUrl();
         $res['register_URL_mobile'] = ''; 
         $res['source_name'] = '好大夫在线'; 
         $res['source_url'] = $hospital->getUrl(); 
         $hospitals[] = array('poi' => $res);
         unset($hospital, $res);
     }
     unset($result);
     BeanFinder::get('LocalCache')->removeAll(); 
     return array($hospitals);
 }/*}}}*/
Ejemplo n.º 13
0
 protected function getData($nowPage, $pageSize)
 {/*{{{*/
     $options['isActivated'] = Hospital::ISACTIVATED_YES;
     $options['noTestData'] = true;
     $hospitalList = HospitalClient::getInstance()->getList($nowPage, $pageSize, $options);
     $hospitals = array();
     foreach ($hospitalList['list'] as $hospital)
     {
         $hospitalNames = $this->getAllNames($hospital);
         if (count($hospitalNames)>1)
         {
             foreach ($hospitalNames as $key => $hospitalName)
             {
                 $hospitals[] = $this->getRealData($hospital, $hospitalName);
             }
         }
         else
         {
             $hospitals[] = $this->getRealData($hospital);
         }
     }
     return $hospitals;
 }/*}}}*/
 protected function getData($nowPage, $pageSize)
 {/*{{{*/
     $hospitalRes = array();
     $content = "查询可网上预约的医生,可按地区、医院、科室等信息查询,根据您的实际情况进行网上预约专家的转诊机会,病情优先制的免费网上预约 ...";
     $hospitalList = HospitalClient::getInstance()->getJiahaoHospitals($nowPage, $pageSize);
     foreach($hospitalList as $hospital)
     {
         $keys = $this->getHospitalJiahaoKey($hospital);
         foreach($keys as $num=>$name)
         {
             $res['item'][$num]['content']['key'] = $name;
             $res['item'][$num]['content']['url'] = $hospital->getJiaHaoUrl();
             $res['item'][$num]['content']['title'] = $hospital->commonName."_网上预约挂号,门诊加号_好大夫在线"; 
             $res['item'][$num]['content']['showUrl'] = "www.haodf.com/";
             $res['item'][$num]['content']['pageSize'] = rand(60,60).'K';
             $res['item'][$num]['content']['date'] = date('Y-n-j',time());
             $res['item'][$num]['content']['content'] = $content;
         }
         $hospitalRes[] = $res;
         unset($hospital);
     }
     BeanFinder::get('LocalCache')->removeAll(); 
     return $hospitalRes;
 }/*}}}*/
Ejemplo n.º 15
0
 public function followupHospitalList($request, $response)
 {
     /*{{{*/
     $doAction = $request->doAction;
     $response->doAction = $doAction;
     $hospitalName = $request->hospitalName;
     $response->hospitalName = $hospitalName;
     $hospitalList = array();
     if ($doAction == "searchHospital" && false == empty($hospitalName)) {
         $hospitalList = HospitalClient::getInstance()->searchByName($hospitalName);
     }
     $response->hospitalList = $hospitalList;
     $fuHospitalList = FollowupClient::getInstance()->getFollowupHospital();
     $response->fuHospitalList = $fuHospitalList;
 }
Ejemplo n.º 16
0
 private function _searchHospital($result, $confirm, $key, $nowPage, $t, $type, $url, $frame)
 {
     $targetdesc = "医院";
     $pageLink = '';
     if ($confirm) {
         $result = HospitalClient::getInstance()->searchHospitals($key, $nowPage, 50);
         $pageLink = self::_pageInfo($result, $confirm, $key, $nowPage, $t, $type, $url, $frame);
     }
     return array($targetdesc, $result, $pageLink);
 }
 protected function getTotalDBTimes()
 {/*{{{*/
     $options['isActivated'] = Hospital::ISACTIVATED_YES;
     $options['noTestData'] = true;
     $res = HospitalClient::getInstance()->getList(1, $this->getStepLen(), $options);
     return $res['pageInfo']['pages'];
 }/*}}}*/
Ejemplo n.º 18
0
 public function ajaxHospitalByProvAndCity($request, $response)
 {
     /*{{{*/
     $request->convertToGBK();
     $city = Area::cityInfo();
     $provinceKey = $request->provinceKey;
     $cityName = $request->cityName;
     $provinceName = $city[$provinceKey]['Province'];
     $hospitalList = HospitalClient::getInstance()->getHospitalByProvinceAndCity($provinceName, $cityName);
     $response->hospitalList = $hospitalList;
 }
Ejemplo n.º 19
0
 public function updatePost($request, $response)
 {
     $id = $request->id;
     $vars = $request->getUnSafeData('vars');
     $vars['name'] = $request->name;
     DBC::requireNotEmptyString($id, '医院id不能为空');
     DBC::requireNotEmptyString($vars['name'], '医院名字不能为空');
     $hospital = HospitalClient::getInstance()->modify($id, $vars);
     if (!$hospital->isNull()) {
         self::clearCache($hospital);
         $response->setRedirect("/hospital/edit?msg=操作成功&id=" . $hospital->id);
     }
 }
Ejemplo n.º 20
0
    private function checkHospitalFacultyDoctorInfo()
    {/*{{{*/
        BeanFinder::get('LocalCache')->removeAll(); 
        $dir = "/home/avatar/system/webapps/openplatform/data/standard/hospitalfacultydoctorinfo/*";

        $options['isActivated'] = Hospital::ISACTIVATED_YES;
        $options['noTestData'] = true;
        $hospitalList = HospitalClient::getInstance()->getList(1, 10000, $options); 
        if(isset($hospitalList['list']))
        {
            foreach ($hospitalList['list'] as $hospital)
            {
                $hospitalRes = exec('grep "\['.$hospital->name.'\]" '.$dir);
                if(empty($hospitalRes))
                {
                    $this->content .= "HospitalFacultyDoctorInfo ". $hospital->name. " 信息未找到\n";
                }
            }
        }
        //$countItemRes = exec('grep "<item>" '.$dir.' |wc -l'); 
        //if(abs($countItemRes - count($hospitalList['list'])) > 2)
        //{
        //    $this->content .= "HospitalFacultyDoctorInfo XML文件条目 ".$countItemRes." 数据库条目 ".count($hospitalList['list'])."\n";
        //}
        echo "HospitalFacultyDoctorInfo数据源检查完毕\n";
    }/*}}}*/
Ejemplo n.º 21
0
    public function testHospitalSummary4Soso()
    {/*{{{*/
        //标准数据
        $fileList = $this->standardData(__FUNCTION__);

        //取某个文件 取其中一条数据
        $file = array_pop($fileList);
        $xmlHospital = $this->xmlData($file);

        //数据格式正确性
        $this->keyExists($xmlHospital, array('url','name','address','phone','pageSize','date','mapUrl','scheduleUrl','extTitle','extUrl','doctorUrl','infoUrl','aliases'));

        //xslt转换后数据
        $fileList = $this->completeData(__FUNCTION__);
        $file = array_pop($fileList);

        //取某个文件 取其中一条数据
        $xmlHospital = $this->xmlData($file, 'soso');

        //数据格式正确性
        $this->keyExists($xmlHospital, array('keyword', 'alias', 'url', 'creator', 'title', 'publishdate', 'content1', 
            'content2', 'linktext1', 'linktarget1', 'linktext2', 'linktarget2', 'linktext3',
            'linktarget3', 'linktext4', 'linktarget4', 'linktext5', 'linktarget5')); 
        $hospitalName = $xmlHospital['keyword'];
        $hospital = DAL::get()->find_by_commonName('hospital', $hospitalName);
        $this->assertTrue($hospital instanceof hospital);
        if ($xmlHospital['alias'])
        {
            $aliasArray = is_array($xmlHospital['alias'])?$xmlHospital['alias']:explode(",",$xmlHospital['alias']);
            $alias = array_pop($aliasArray);
            $aliasHospitals = HospitalClient::getInstance()->searchByName($alias);
            $aliasHospital = array_pop($aliasHospitals);
            $this->assertTrue($aliasHospital instanceof hospital);
            $this->assertEquals($hospital->id, $aliasHospital->id);
        }
    }/*}}}*/
Ejemplo n.º 22
0
	public function postHospitalLogo($request, $response)
	{
		$hospitalId = $request->getRequest('hospitalId');
		$hospitalName = $request->getRequest('hospitalName');
		$operate = $request->getRequest('operate');
		if($hospitalId > 0 && $operate == 'post')
		{
		 	if (isset($_FILES['hospitalLogo']) && $_FILES['hospitalLogo']['tmp_name'] != '')
		 	 {
                $imgId = TuClient::getInstance()->uploadImage($_FILES['hospitalLogo']);
	            HospitalClient::getInstance()->updateHospitalLogo($hospitalId, $imgId);
	            $msg = 't';
	        }else{
	        	$msg = 'f';
	        }
			$response->msg = $msg ;
		}
 		$hospital = DAL::get()->find('Hospital',$hospitalId);
		if($hospital != null && $hospital->isNull() == false && $hospital->logo!=null)
		{
			$logoUrl = TuClient::getInstance()->getThumbnailUrl($hospital->logo, 96, 96, TuClient::TYPE_ZOOM);
			$response->logo = $logoUrl;
			$hospitalName = $hospital->commonName;
		}
		$response->hospitalId = $hospitalId;
		$response->hospitalName = $hospitalName;
	}
Ejemplo n.º 23
0
 public function hospitalInfo($request, $response)
 {/*{{{*/
     $hospitalId = (int)Codec::getInstance()->decodeId($request->hospitalid); 
     $hospital = DAL::get()->find('hospital', $hospitalId);
     $provinceKey = area::getProvKeyByName($hospital->province);
     $response->provinceKey = $provinceKey;
     $openBookingCount = HospitalClient::getInstance()->getHospitalPlussignCount(array($hospital->id));
     $response->openBookingCount = $openBookingCount;
     $response->hospital = $hospital;
     $response->action = $request->action;
     $response->hospitalId = Codec::getInstance()->encodeId($request->hospitalid); 
 }/*}}}*/
Ejemplo n.º 24
0
<?php
require_once dirname(__FILE__).'/../init.php';

$hospitalAnnounceList = HospitalClient::getInstance()->getHospitalAnnounceList4HomePage(100);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=gb2312" http-equiv="Content-Type" />
<title>全国各大医院出诊/停诊公告列表</title>
<link href="http://i1.hdfimg.com/css/css.css?1303386395" rel="stylesheet" type="text/css" />
<link href="http://i1.hdfimg.com/css/frame.css?20131224" rel="stylesheet" type="text/css" />
<link href="http://i1.hdfimg.com/css/inside.css" rel="stylesheet" type="text/css" />
<link href="http://i1.hdfimg.com/nav/nav.css?1303460346" rel="stylesheet" type="text/css"/> 
<script type="text/javascript" src="http://i1.hdfimg.com/js/jquery-1.4.2.min.js"></script>
</head>

<body id='blue'>
<?php GlobalTemplete::getHeadNav('common'); ?>
<div style="margin: 10px auto 0;width: 960px;">
<table align="center" border="0" cellpadding="0" cellspacing="0" class="tab_white" width="980">
	<tr>
		<td>
		<table align="center" border="0" cellpadding="0" cellspacing="0" class="indexinfo" width="960">
			<tr>
				<td valign="top">
				<div class="box boxb" style="background-color:#FFFFFF;margin:auto; padding:0px 10px;">
					当前位置: <a href="//www.<?=URL_PREFIX?>haodf.com/">好大夫在线</a> 
					&gt; <a href="">最新出诊/停诊预报</a>
				</div>
Ejemplo n.º 25
0
 private function getSidePhoneServiceListByHospital($response)
 {
     $phoneDoctorList = array();
     $phoneDoctorIds = DAL::get()->queryDoctorIdsByHospital('DoctorOutLine', $this->_hospital->id, 5);
     $doctorSatisfactionList = array();
     if (false == empty($phoneDoctorIds))
     {
         $phoneDoctorList = DAL::get()->find('Doctor', $phoneDoctorIds);
         $doctorSatisfactionList = PaymentClient::getInstance()->getDoctorSatisfactionList($phoneDoctorIds);
     }
     $response->phoneDoctorList = $phoneDoctorList;
     $response->doctorSatisfactionList = $doctorSatisfactionList;
     $response->callServiceDoctorsCnt = HospitalClient::getInstance()->getHospitalDirectCallCount($this->_hospital->id);
 }
Ejemplo n.º 26
0
 private function getHospitalFacultyListByHospitalName($hospitalName)
 {
     /*{{{*/
     $hospitals = HospitalClient::getInstance()->searchByName($hospitalName, false);
     $hospital = array_shift($hospitals);
     if (isset($hospital) && false == $hospital->isNull()) {
         $hospitalFacultyList = HospitalFacultyClient::getInstance()->getListByHospitalId($hospital->id, $limit = 500);
     } else {
         $hospitalFacultyList = array();
     }
     return array($hospitalFacultyList, $hospital);
 }
    private function getFacultyList($request, $response)
    {/*{{{*/
        $hospitalId = $request->partnerConfig->hospitalId;
        $hospital = DAL::get()->find('hospital',$hospitalId);
        $tmpFacultyList = HospitalClient::getInstance()->getFacultyList($hospitalId);
        $facultyList = array();
        if ($hospitalId == 34)
        {
            $facultyList = $this->jishuitan;
            foreach($facultyList as $key => $config)
            {
                foreach($tmpFacultyList as $fkey => $faculty)
                {
                    if (false == $faculty->faculty->isNull() && array_key_exists($faculty->name, $config)) 
                    {
                        $facultyList[$key][$faculty->name] = $faculty;
                        unset($tmpFacultyList[$fkey]);
                    }
                }
            }
        }
		if($hospitalId == 72)
		{
			$facultyList = $this->zhongriyouhao;
			foreach($facultyList as $key => $config)
			{
			  foreach($tmpFacultyList as $fkey => $faculty)
			  {
                    if (false == $faculty->faculty->isNull() && array_key_exists($faculty->name, $config)) 
                    {
                     #  $name = $config[$faculty->name];
					 #  $facultyList[$key][$name] = $faculty;

                       $facultyList[$key][$faculty->name] = $faculty;
					   unset($tmpFacultyList[$fkey]);
			 		}
			  }

			}
			foreach($facultyList as $key => $config)
			{
				foreach($config as $k => $v)
				{
					if($v == '')
					{
							unset($facultyList[$key][$k]);
					}
				}
			}
       	    $response->facultyArray = $facultyList;
			return ;

		}
        if (false == empty($tmpFacultyList))
        {
            foreach ($this->_facultyConfig[$hospital->category] as $key => $config) 
            {
                foreach ($tmpFacultyList as $fkey => $faculty) 
                {
                    if (false == $faculty->faculty->isNull() && (in_array($faculty->faculty->parentId, $config) || in_array($faculty->faculty->id, $config))) 
                    {
                        $facultyList[$key][$faculty->name] = $faculty;
                        unset($tmpFacultyList[$fkey]);
                    }
                }
            }
            if (false == empty($tmpFacultyList))
            {
                foreach ($tmpFacultyList as $fkey => $faculty) 
                {
                    $facultyList['其他'][$faculty->name] = $faculty;
                }
            }
        }
        $response->facultyArray = $facultyList;
    }/*}}}*/
Ejemplo n.º 28
0
 public function sitemapHospitalList($request, $response)
 {/*{{{*/
     $provNameList = Area::getProvinceNameList();
     $hospitalList = HospitalClient::getInstance()->getListByProvinceAry($provNameList); 
     $provList = array();
     foreach ($hospitalList as $hospital)
     {
         $provList[$hospital->province][] = $hospital;
     }
     $response->provList = $provList;
 }/*}}}*/
Ejemplo n.º 29
0
    protected function prepareData($nowPage, $pageSize)
    {/*{{{*/
        $hospitalCount = 5;
        $exclude = array('疼痛', '种牙齿医院', '种植牙齿医院', '种牙医院', '种植牙医院', '植牙医院', '牙齿种植医院');
        $option['filterHospitalIds'] = BeanFinder::get('configs')->excludeHospitalIds;
        $ds = HospitalClient::getInstance()->getDiseaseAreaHospitalGroupByOption($nowPage, $pageSize, $option);
        $res = array();
        $hospitalListRes = array();
        foreach ($ds as $item)
        {
            $formData= array();
            $hospitalList = $item['hospital'];
            $disease = $item['disease'];

            $diseaseNames =array();
            if (count($hospitalList) == $hospitalCount)
            {
                foreach ($hospitalList as $n => $hospital)
                {
                    $formData[$n]['form']['hid'] = $hospital['hid'];
                    $formData[$n]['form']['hoscomname'] = $hospital['hoscomname'];
                    $formData[$n]['form']['hosprovince'] = $hospital['hosprovince'];
                    $formData[$n]['form']['hosgrade'] = self::$hospitalLevelList[$hospital['hosgrade']];
                    $formData[$n]['form']['votecnt'] = $hospital['votecnt'];
                    $formData[$n]['form']['doctorcnt'] = $hospital['doctorcnt'];
                    $formData[$n]['form']['hosprovince'] = $hospital['hosprovince'];
                    unset($hospital);
                }

                if (false == empty($disease['thesaurus']))
                {
                    $diseaseNames = $this->getAllNames($disease['thesaurus'], $disease['name']);
                    foreach ($diseaseNames as $key => $diseaseName)
                    {
                        if(false == in_array($diseaseName, $exclude))
                        {
                            $res['dataId'] = $disease['id'].'_'.$key;
                            $res['dkey'] = $disease['key'];
                            $res['dname'] = $diseaseName;
                            $res['formdata'] = $formData;
                            $hospitalListRes[] = $res;
                        }
                        unset($diseaseName);
                    }
                }
                else
                {
                    if(false == in_array($disease['name'], $exclude))
                    {
                        $res['dataId'] = $disease['id'];
                        $res['dkey'] = $disease['key'];
                        $res['dname'] = $disease['name'];
                        $res['formdata'] = $formData;
                        $hospitalListRes[] = $res;
                    }
                }

            }
            unset($item);
        }
        BeanFinder::get('LocalCache')->removeAll(); 
        return $hospitalListRes;
    }/*}}}*/
Ejemplo n.º 30
0
	public function commonInfo($request, $response)
	{
		$provInfos = Area::provDefineInfo();
		$provKey = $request->pro;
		$provKey = ($provKey == 'all') ? '' : $provKey;
		$HOSPITAL_COUNT = (empty($provKey)) ? 12 : 100;
		$defaultProvs = self::$DefaultProvs;
		$dspProv = '';
		$hasProv = true;
        $prov = array();
		if(empty($provKey))
		{
			$hasProv = false;
			$defaultKeys = $request->defaultProvs;
			$defaultProvs = ($defaultKeys != '') ? explode(',', $defaultKeys) : $defaultProvs;
			$provKey = $defaultProvs;
			foreach($provKey as $tempProv)
			{
				$tmpInfos = $provInfos[$tempProv];
				$pro = $tmpInfos['Province'];
				$prov[] = $pro;
			}
		}
		else
		{
			$tmpInfos = $provInfos[$provKey];
			$pro = $tmpInfos['Province'];
			$dspProv =$pro;
			$prov = array($pro);
		}
		$hospitalList = HospitalClient::getInstance()->getListByProvinceAry($prov, $limit=1000);
		$proHosptialList=array();
		foreach($hospitalList as $hospital)
		{
			if(in_array($hospital->province, $prov))
			{
				$city = $hospital->city;
				if($hospital->province == $hospital->city)
				{
					$city = $hospital->district;
				}
				if(isset($proHosptialList[$hospital->province][$city]))
				{
					$proHosptialList[$hospital->province][$city]['hospital'][] = $hospital;
					if($proHosptialList[$hospital->province][$city]['count'] > $HOSPITAL_COUNT){ continue; }
					$proHosptialList[$hospital->province][$city]['count']++;
				}
				else
				{
					$proHosptialList[$hospital->province][$city] = array('count'=>1,'hospital'=>array($hospital));
				}
			}
		}
		$dspProHosptialList = array();
		if($hasProv == false)
		{
			foreach($defaultProvs as $defaultProv)
			{
				$tmpInfos = $provInfos[$defaultProv];
				$pro = $tmpInfos['Province'];
				$dspProHosptialList[$pro] = $proHosptialList[$pro];
			}
		}
		else
		{
			$dspProHosptialList = $proHosptialList;
		}
		$response->proHosptialList = $dspProHosptialList;
		$response->dspProv = $dspProv;
	}