Пример #1
0
    public function getDoctorList4JiaHao($districtKey, $enHospitalId, $hosFacultyKey, $facultyId, $pageId, $pageSize)
    {/*{{{*/
        $this->_initPageInfo($pageId, $pageSize);
        $district = empty($districtKey) ? '北京' : $districtKey;
        $enHospitalName = '';
        if ($enHospitalId){
            $plussignChannel = DAL::get()->find_by_hospitalid('PlussignChannel', $enHospitalId );
            if ($plussignChannel->isNull() == false){
                $enHospitalName = $plussignChannel->hospitalName;
            }else
            {
                $this->setErrorCode('128');
                return 0;
            }
        }
        $facultyName = '';
        if (false == empty($hosFacultyKey))
        {
            $enFacultyList = FacultyList::getMainFacultyList();
            if (isset($enFacultyList[$hosFacultyKey]))
            {
                $facultyName = $enFacultyList[$hosFacultyKey];
            }else
            {
                $this->setErrorCode('134');
                return 0;
            }
        }	
        if (false == empty($facultyId))
        {
       		$enFaculty = DAL::get()->find('faculty', $facultyId);
            if($enFaculty->isNull())
            {
                $this->setErrorCode('130');
                return 0;
            }
       		$facultyName = $enFaculty->name;
        }

        $facultyArr = FacultyList::getList();
        $facultyNameList = isset($facultyArr[$facultyName]) ? $facultyArr[$facultyName]:array($facultyName);
        $result = PlussignChannelClient::getInstance()->pagingWithSpace($pageId, $pageSize, $district, $enHospitalName, $facultyName, '' , '', $enHospitalId, $hosFacultyKey, $facultyId);
        $spaces = DAL::get()->find('Space', $result['spaceIds']);

        $infos = array();
        $successOrderCounts = PlussignChannelClient::getInstance()->getOrderCntOfSpaces($result['spaceIds']);
        foreach($spaces as $spaceId => $space)
        {
            if($space->host instanceof Doctor && false == $space->host->hospitalfaculty->hospital->isInnerTestHospital())
            {
                $info = array();
                $info['doctorId'] = $space->host->id;
                $info['doctorName'] = $space->name; 
                $info['doctorImgUrl'] = $space->host->getHeadImageForMobile();
                $info['grade'] = $space->host->grade; 
                $info['educateGrade'] = $space->host->educateGrade;
                $info['hospitalCommonName'] = $space->host->hospitalfaculty->hospital->commonName;
                $info['hospitalFacultyName'] = $space->host->hospitalfaculty->name;
                $info['jiaHaoDisease'] = $result['requirements'][$spaceId]->disease;
                $info['jiaHaoTime'] = trim($result['appointTime'][$spaceId]);
                $info['successOrderCount'] = isset($successOrderCounts[$spaceId]) ? $successOrderCounts[$spaceId] : 0;
                $infos[] = $info;
            }
        }
        $this->pageInfo = $result['pageInfo'];
        $this->content = $infos;
    }/*}}}*/
Пример #2
0
 public function heZuo($request, $response)
 {/*{{{*/
     //$id = $this->param('id');
     $id = 1;//仅用于协和医院(若有其它合作医院在接受参数)
     $facultyName = $request->facultyName;
     $facultyKey = $request->getRequest('facultyKey','');
     if (false == empty($facultyKey))
     {
    		$FacultyList = FacultyList::getMainFacultyList();
    		if (isset($FacultyList[$facultyKey]))
    			$facultyName = $FacultyList[$facultyKey];
     }	
     $FacultyId = $request->getRequest('facultyId','');
     if (false == empty($enFacultyId))
     {
    		$Faculty = DAL::get()->find('faculty', $enFacultyId);
    		$facultyName = $Faculty->name;
     }
     if ($id && $facultyName){
     	$request->setRequest('id', $id);
         $request->setRequest('facultyName', $facultyName);
         $this->search($request, $response);
     }
     else if ($id){
     	$request->setRequest('id', $id);
         $this->search($request, $response);
     }
     $response->hezuoHospitalId = $id;
 }/*}}}*/
Пример #3
0
    public function search($request, $response)
    {/*{{{*/
    	$hezuoHospitalId = $request->getRequest('hezuoHospitalId', '');
        $hezuoFacultyName = $request->getRequest('hezuoFacultyName', '');
        $nowPage = $request->getRequest("page",1);
        $pageSize = 20;
        $enDistrictKey = $request->getRequest('district','beijing');
        if ($enDistrictKey == 'hezuo'){
        	//Context::jump("http://".URL_PREFIX."jiahao.haodf.com/hospital/hezuo/1.htm", false);
        	$this->heZuo($request, $response);
        }
        $provList = Area::provInfo4PlussignChannel();
        $enDistrict = isset($provList[$enDistrictKey]) ? $provList[$enDistrictKey]['Name'] : $request->getRequest('district','北京');
        $enHospitalId = Codec::getInstance()->decodeId($request->getRequest('hospitalId', ''));
        $enHospitalName = $request->getRequest('hospitalName','');
        if ($hezuoHospitalId){
            $plussignChannel = DAL::get()->find_by_hospitalid('PlussignChannel', $hezuoHospitalId );
            if ($plussignChannel->isNull() == false){
                $enHospitalName = $plussignChannel->hospitalName;
            }
        }
        if ($enHospitalId){
            $plussignChannel = DAL::get()->find_by_hospitalid('PlussignChannel', $enHospitalId );
            if ($plussignChannel->isNull() == false){
                $enHospitalName = $plussignChannel->hospitalName;
            }
        }
        $enFacultyName = $request->getRequest('facultyName','');
        $enFacultyId = $request->getRequest('facultyId','');
        if (false == empty($enFacultyId))
        {
       		$enFaculty = DAL::get()->find('faculty', $enFacultyId);
       		$enFacultyName = $enFaculty->name;
        }
        $facultyKey = $request->getRequest('facultyKey','');
        if (false == empty($facultyKey))
        {
       		$enFacultyList = FacultyList::getMainFacultyList();
       		if (isset($enFacultyList[$facultyKey]))
       			$enFacultyName = $enFacultyList[$facultyKey];
        }	
       	if ($hezuoFacultyName){
        	$enFacultyName = $hezuoFacultyName;
        }
        $district= rawurldecode ($enDistrict);
        $hospitalName = rawurldecode ($enHospitalName);
        $facultyName = rawurldecode ($enFacultyName); 
        $out = PlussignChannelClient::getInstance()->getAll();
        if($district =='北京'||$district =='上海'||$district =='广东')
        {
            $showBSG = $this->showHosptial($out[$district]['hospital'],$district);
            $response->showBSG = $showBSG;
        }
        $facultyArr = FacultyList::getList();
        $facultyNameList = isset($facultyArr[$facultyName]) ? $facultyArr[$facultyName]:array($facultyName);
        $doctorCount = PlussignChannelClient::getInstance()->getDoctorCountByCondition($district,$hospitalName,$facultyNameList);
        $facultyList = PlussignChannelClient::getInstance()->getFacultyListByCondition($out,$district,$hospitalName);
        if ($hezuoHospitalId){
        	$sets = PlussignChannelClient::getInstance()->pagingWithSpace($nowPage,$pageSize,$district,$hospitalName,$facultyName, $hezuoHospitalId, $hezuoFacultyName,$enHospitalId, $facultyKey, $enFacultyId);
        } else {
        	$sets = PlussignChannelClient::getInstance()->pagingWithSpace($nowPage,$pageSize,$district,$hospitalName,$facultyName, '' , '', $enHospitalId, $facultyKey, $enFacultyId);
        }
        $spaceIds = $sets['spaceIds'];

        $successOrderCount = PlussignChannelClient::getInstance()->getOrderCntOfSpaces($spaceIds);
        	
        $response->urlDistrict = $district;
        $response->urlHospitalName = $hospitalName;
        $response->urlFacultyName = $facultyName;
        $response->urlHospitalId = $enHospitalId;
        $response->doctorCount = $doctorCount;
        $response->districtList = $out;
        $response->facultyArr = $facultyArr;
        $response->facultyList = $facultyList;
        $response->spaces = DAL::get()->find('Space', $spaceIds);
        $response->requirements = $sets['requirements'];
        $response->appointTime = $sets["appointTime"];
        $response->pageLink = $sets["pageLink"];
        $response->successOrderCount = $successOrderCount;
		$response->type = 'search'; //返回页面类型,暂时用于控制二级导航
        //SEO
        $title = $hospitalName.$facultyName."转诊预约_".$district."_向专家本人申请转诊机会";
        if (empty($hospitalName) && empty($facultyName))
        {
            $title = $district."向专家本人申请转诊机会";
        }
        $response->title = $title;
    }/*}}}*/