Exemplo n.º 1
0
 public function androidMedicineRemind($request, $response)
 {
     /*{{{*/
     $userId = $request->userId;
     $user = DAL::get()->find('user', $userId);
     $remoter = new RequestDelegate();
     $url = "http://" . URL_PREFIX . "mobile-api.haodf.com/followup/mobileapi/getMedicineRemindList";
     //"fa28bd37cd7f397fbd088649c1d09af8"为手机客户端followup对应密钥
     $cryptedUserId = $this->cryptWithKey(json_encode(array("userId" => $userId)), "fa28bd37cd7f397fbd088649c1d09af8");
     $args = array('os' => 'android', 'app' => 'followup', 'version' => 'fu1.0', '_s' => $cryptedUserId);
     $res = $remoter->request($url, 'get', $args);
     $res = json_decode($res);
     $todayRemindList = array();
     $remindList = $res->content;
     foreach ($remindList as &$remind) {
         $remind->problemTitle = mb_convert_encoding($remind->problemTitle, 'gbk', 'utf-8');
         if ($remind->remindIntervalDay == 1) {
             $todayRemindList[] = $remind;
         } else {
             $today = XDateTime::today();
             $checkTime = XDateTime::valueOf($remind->remindCheckTime);
             $dayDiff = XDateTime::dayDiff($today, $checkTime);
             $intervalDay = $remind->remindIntervalDay;
             if (fmod($dayDiff, $intervalDay) == 0) {
                 $todayRemindList[] = $remind;
             }
         }
     }
     $response->todayRemindList = $todayRemindList;
     $response->remindData = $remindList;
     $response->userId = $userId;
     $response->userName = $user->name;
 }
	public function updateBaseInfo($request, $response)
	{
		$vars = $request->var;
		if ($request->is_ajax) {
			$vars = XString::toGbkDeep($vars);
		}
		if (!empty($vars['birthday']))
			$vars['birthday'] = XDateTime::valueOf($vars['birthday']);
		DoctorClient::getInstance()->modifyByDoctor($this->_newSpace->host->id, $vars);
		
		//调用同步新浪微博接口(更新医生个人信息和修改医生资料)
		//MessageQueueClient::getInstance()->regEvent(new UpdateDoctorInformationSinaWeiboEvent($this->_newSpace->user->id));
		if ($request->is_ajax)
		{
			$results = array(
				'grade' => XString::convertToUnicode($this->_newSpace->host->grade),
				'educate_grade' => XString::convertToUnicode($this->_newSpace->host->educateGrade),
				'specialize' => XString::convertToUnicode($this->_newSpace->host->specialize),
				'intro' => XString::convertToUnicode(XString::truncate($this->_newSpace->host->intro, 100)),
				'status' => 0,
			);
			echo json_encode($results);
			exit;
		}
        $this->message('您的医生资料提交成功!将在1个工作日内审核后生效!', $response, array(
            'buttons' => array(
                array('text' => '继续修改', 'url' => $this->_newSpace->getUrl()."admindoctor/showbaseinfo"),
                array('text' => '进入个人网站', 'url' => $this->_newSpace->getUrl())
            ),
        ));
	
	}
Exemplo n.º 3
0
 public static function getShowTime($oldTime)
 {/*{{{*/
     $msg = '';
     $time = XDateTime::valueOf($oldTime)->getTime();
     $now = time();
     $time = $now - $time;
     if($time < 60)
     {
         $msg = '1分钟前';
     }
     else if($time < 3600 && $time >= 60)
     {
         $cnt = (int)floor($time / 60);
         $msg = $cnt."分钟前";
     }
     else if($time < 86400 && $time >= 3600)
     {
         $cnt = (int)floor($time / 3600);
         $msg = $cnt."小时前";
     }
     else if($time < 604800 && $time >= 86400)
     {
         $cnt = (int)floor($time / 86400);
         $msg = $cnt."天前";
     }
     else
     {
         $time = XDateTime::valueOf($oldTime);
         $msg = $time->getYear().'-'.$time->getMonth().'-'.$time->getDay().' '.$time->getHour().':'.$time->getMinute();
     }
     return $msg;
 }/*}}}*/
 public function sendVerificationCodeEmail($request, $response)
 {
     /*{{{*/
     if (false == RequestDelegate::isOfficeIp()) {
         echo '系统错误,请联系技术人员!!!';
         exit;
     }
     PrivilegeClient::getInstance()->sendVerificationCodeEmail($request->emailaddress, XDateTime::valueOf($request->starttime), XDateTime::valueOf($request->endtime));
     $response->setRedirect($response->router->urlfor('backyardauth/applytoken?st=ok'));
 }
 public function doAddTelOrderTask($request,$response)
 {/*{{{*/
     DBC::requireNotEmptyString($request->spaceId, 'spaceId 不能为空');
     DBC::requireNotEmptyString($request->taskType, 'taskType 不能为空');
     DBC::requireNotEmptyString($request->taskRemark, 'taskRemark 不能为空');
     DBC::requireNotEmptyString($request->executeGroup, 'executeGroup 不能为空');
     $orderId = $request->orderId ? $request->orderId : 0;
     $taskBeginTime = XDateTime::valueOf($request->taskBeginTime);
     $taskBeginTime = $taskBeginTime->before(XDateTime::now())?XDateTime::now()->toString() : $request->taskBeginTime;
     $taskId = TelOrderTaskClient::getInstance()->addTelOrderTask($request->priority, $this->curUser, $request->spaceId, $request->taskType, $this->curUser, $request->executeGroup, $taskBeginTime, $orderId, 0, $request->taskRemark);
     $task = DAL::get()->find('TelOrderTask', $taskId);
 }/*}}}*/
 public function ajaxPostDoctorInfo($request, $response)
 {
     /*{{{*/
     $vars = $request->getRequest('var', array());
     if (count($vars) > 0) {
         $vars = XString::toGbkDeep($vars);
         if ($vars['birthday']) {
             $vars['birthday'] = XDateTime::valueOf($vars['birthday']);
         }
         DoctorClient::getInstance()->modifyByDoctor($this->space->host->id, $vars);
         $results = array('res' => 'success', 'specialize' => XString::convertToUnicode($vars['specialize']), 'intro' => XString::convertToUnicode(XString::truncate($vars['intro'], 100)));
         echo json_encode($results);
     } else {
         echo '{"res":"failure", "msg":"请填写完整您的个人信息"}';
     }
     return self::DIRECT_OUTPUT;
 }
Exemplo n.º 7
0
 public function showTaskList($request, $response)
 {
     /*{{{*/
     $someDayDateStr = $request->getRequest('somedaydatestr', XDateTime::today()->toShortString());
     $queryType = $request->getRequest('querytype', 'num');
     $lastnum = $request->getRequest('lastnum', 100);
     $someDay = XDateTime::valueOf($someDayDateStr);
     if ($queryType == 'time') {
         $response->taskList = DAL::get()->find_all_byTaskTemplateIdAndCtimeBetween('QueueTask', $request->tasktemplateid, $someDay, $someDay->addDay(1));
     } else {
         $response->taskList = DAL::get()->find_all_InRecentTimes('QueueTask', $request->tasktemplateid, $lastnum);
     }
     $response->someDayDateStr = $someDayDateStr;
     $response->taskTemplate = DAL::get()->find('TaskTemplate', $request->tasktemplateid);
     $response->queryType = $queryType;
     $response->lastnum = $lastnum;
 }
 public function modifyPost($request, $response)
 {
     /*{{{*/
     $dotime = XDateTime::valueOf($request->dotime);
     $projectOperatorId = $this->myProjectOperator->id;
     $questionSheetId = $request->questionSheetId;
     $answerData = array();
     foreach ($request->qid as $qid => $q) {
         if ($q['sourcetype'] == 'RadioQuestion' && isset($q['optionIdArr'])) {
             $answerData[$qid]['optionIdArr'] = array($q['optionIdArr']);
             $answerData[$qid]['answerContent'] = '';
         } else {
             if ("TextQuestion" == $q['sourcetype']) {
                 $answerData[$qid]['optionIdArr'] = array();
                 $answerData[$qid]['answerContent'] = $q['content'];
             }
         }
     }
     ProjectEventClient::getInstance()->modifyEvent($request->projectEventId, $dotime, $answerData, $projectOperatorId);
     $msg = "修改事件成功!";
     $response->setRedirect($response->router->urlfor('projecteventmgr/modify', array('projectEventId' => $request->projectEventId, 'preMsg' => $msg)));
 }
Exemplo n.º 9
0
    public static function birthday2Age($birthday)
    {/*{{{*/
        $age = '';
        try 
        {
            $diff = XDateTime::valueOf($birthday)->getDateDiff(XDateTime::now());
        }
        catch (Exception $ex)
        {
            return '';
        }

        $year = $diff['year'];
        $month = $diff['month'];
        $day = $diff['day'];

        if($year>=10)
        {
            $age = $year."岁";
        }
        else
        {
            if ($day>1)
            {
                $month++;
            }

            if($year == 1 && $month == 0 && $day == 0)
            {
                $age = "12个月";
            }
            if ($year<10 && $year>=1)
            {
                if(12 == $month)
                {
                    $year++;
                    $month = 0;
                }
                $age = $year."岁".($month>0?($month."个月"):"");
            }
            else if($year == 0 && $month >1)
            {
                $age = $month."个月";
            }
            else if($year == 0 && $month = 1 && $day == 1)
            {
                $birthday = XDateTime::valueOf($birthday);
                if(XDateTime::now()->getMonth() != $birthday->getMonth())
                {
                    $age = "1个月";
                }
            }
            else if($year == 0 && $month = 1 && $day > 1)
            {
                $age = "{$day}天";
            }
            else 
            {
                $age = "";
            }
        }
        return $age;
    }/*}}}*/
Exemplo n.º 10
0
                    {
                        $addr = $article->space->host->hospitalfaculty->hospital->commonName . $article->space->host->hospitalfaculty->name;
                        $spaceName = $article->space->name;
                    }
                    else
                    {
                        $addr = $article->space->name;
						$spaceName = "";
                        $addr = XString::truncate($addr, 24);	
                    }
                }
                else
                {
                    continue;
                }
                $articleTime = XDateTime::valueOf($articleTime)->toShortString();
                ?>
                <li class="clearfix">
					<span class="fl">
                        <a href="<?=$articleUrl?>" target="_blank" class="f14"><?=$articleTitle.Article::$sourceDesc[$article->source]?></a>
                        <span class="gray2 ml10"><?=$articleTime?></span>
                    </span>
                    <?php if(isset($addr) && isset($articleDoctorUrl)){ ?>
                        <span class="fr">
							<a target="_blank" href="/faculty/<?=Codec::getInstance()->encodeId($article->space->host->hospitalfaculty->id)?>.htm" class="green"><?=$addr?>
							</a>
							<span class="green">|</span>
							<a target="_blank" href="<?=$articleDoctorUrl?>" class="green"><?=$spaceName?></a>
							 <span class="gray2 ml10">发表</span>

						</span>
Exemplo n.º 11
0
    public function pullDailyRecommendThreads($spaceId)
    {/*{{{*/
        $space = DAL::get()->find('space', $spaceId); 
        if($space->isNull())
        {
            $this->setErrorCode(328);
            return 0;
        }
        $firstLoginTime = '';
        $spaceexp= DAL::get()->find_by_userid('spaceexp', $space->user->id);
        if(false == $spaceexp->isNull())
        {
            $firstLoginTime = $spaceexp->firstLoginTime;
        }
        if(empty($firstLoginTime)
        || false == empty($firstLoginTime) && (XDateTime::hourDiff(XDateTime::valueOf($firstLoginTime),XDateTime::now()) > 24))
        {
            $proposalIds = ProposalClient::getInstance()->autoPullRecommends($space);
			error_log("[".XDateTime::now()."] ".$space->user->name."\n", 3, "/tmp/mobile_autopull.log");
            if (false == empty($proposalIds))
            {
                SpaceExpClient::getInstance()->createSpaceExp($space->user->id, XDateTime::now());
            } 
        } 
    }/*}}}*/
    public static function getAllQuestionTitleAndAnswerContentArrByPatient($patient, $pageId=1, $pageSize=10)
    {/*{{{*/
        DBC::requireTrue($patient instanceof Patient, '患者不存在');
        $result = PatientFileClient::getInstance()->getRecordListByPatientId($patient->id, $pageId, $pageSize);
        $arr = array();
        $res = array();
        $arr['pageInfo'] = $result['pageInfo'];
        foreach($result['list'] as $record)
        {
            $res[1][0] = 'time'; 
            $res[1][1] = XDateTime::valueOf($record->ctime)->getDateTime(); 

            $res[2][0] = 'week'; 
            $res[2][1] = XDateTime::valueOf($record->ctime)->getWeekDesc(); 

            $res[3][0] = 'abNormal'; 
            $res[3][1] = $record->isAbNormal(); 

            $res[4][0] = 'questionSheetTitle'; 
            $res[4][1] = $record->answerSheet->questionSheet->title;

            $res[$record->answerSheet->id][0] = 'answerSheetId'; 
            $res[$record->answerSheet->id][1] = $record->answerSheet->id; 

            $questionIdArr = $record->answerSheet->getQuestionId_answerArr();
            $i = 4;
            foreach($questionIdArr as $questionId => $answer)
            {/*{{{*/
                $question = DAL::get()->find('question', $questionId);
                $answerContent = $answer->getAnswerContent(); 
                if ($answerContent instanceof NullEntity)
                {
                    $answerContent = "";
                }

//                if ($question->isUpload())
//                {
//                    $ids = explode(',', $answerContent);
//                    $patientAttachment = DAL::get()->find('PatientAttachment', $ids);
//                    foreach ($patientAttachments as $patientAttachment)
//                    {
//                        if (false == $patientAttachment->isNull() && false == $patientAttachment->attachment->isNull() && $patientAttachment->attachment->filePath)
//                        {
//                            $imgUrl2 = TuClient::getInstance()->getThumbnailUrl($patientAttachment->attachment->filePath, 100, 100);
//                            $orgImgUrl = TuClient::getInstance()->getUrl($patientAttachment->attachment->filePath);
//                            $i ++;
//                            $res[$i]['name'] = $question->content."缩略图"; 
//                            $res[$i]['value'] = $orgImgUrl; 
//                            $i ++;
//                            $res[$i]['name'] = $question->content."原图"; 
//                            $res[$i]['value'] = $imgUrl2; 
//                        }
//                    }
//                }
//                else
                {
                    $res[$question->id][0] = $question->content; 
                    $res[$question->id][1] = $answerContent; 
                }
            }/*}}}*/
            $arr[] = $res;
        }
        return $arr;
    }/*}}}*/
 public function ajaxgetshittotalhashdata($request, $response)
 {/*{{{*/
     $lastTime = XDateTime::valueOf($request->lasttime);
     $startTime = $lastTime->addDay(-30);
     $response->shitJsonHashData = HealthRecordClient::getInstance()->getShitJsonHashData($request->userid, $startTime->toShortString(), $lastTime->toShortString());
 }/*}}}*/
Exemplo n.º 14
0
            <!-- start dd-article -->
            <div class="dd-article dd-box ">
            <ul class="pt15 lh180">
            <?php if(isset($papers)) { ?>
            <?php
            if (false == empty($papers))
            {
                $a = 0;
                foreach($papers as $paper) 
                {
                    $a++;
                ?>
 			<li class="thirdList clearfix">
                             <span class="fl">●</span>
                             <a class="black f14 fl" href="<?php echo $paper->getDetailUrl();?>" target="_blank" ><?=$paper->name?></a>
                            <span class="fr f12 gray2 thirdList ml20"><?=XDateTime::valueOf($paper->onlineTime)->getDateTime()?></span>
                        </li>
                    <?php if (!fmod($a, 5)) { ?> <li class="mt20"></li> <?php } ?>
                <?php 
                }
            }
            ?>
            <li  class="clearfix"><?=$pageLink ? $pageLink : ''?></li>
            <?php } else { ?>
            <?php foreach(CmsObjCategory::getDescArray4Paper() as $key=>$value) { ?>
                    <li class="clearfix">
                        <span class="fl thirdList">
                            <a href="/thesis/showtaglist?searchType=<?=$searchType?>&searchParam=<?=$key?>" class="black f14"><?=$value?></a>
                        </span>
                    </li>
            <?php } ?>
Exemplo n.º 15
0
<link href="http://i1.hdfimg.com/nfs/css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form method="post" action="">
<p class="mt20 ml20">
    <input type="text" name="month" value="<?php 
echo $month;
?>
"/>
    <input type="submit" value="查看"/>
</p>
</form>
<table class="list w700 ml20 mt10">
<tr>
    <td colspan=7><span class="fb f14">呼叫中心<?php 
echo XDateTime::valueOf($month)->toStringByFormat('Y年m月');
?>
呼入呼出量统计</span></td>
</tr>
<tr>
    <td>队列</td>
    <td>总时长</td>
    <td>呼出</td>
    <td>人均呼出</td>
    <td>呼入</td>
    <td>人均呼出</td>
    <td>队列人数</td>
</tr>
<?php 
if (false == empty($callInfos)) {
    $allout = $allin = $alloperator = 0;
Exemplo n.º 16
0
<p class="<?php 
echo $cssStyle;
?>
 bb_d3"><?php 
echo $statusInfo['title'];
?>
</p>
<?php 
if ($flow instanceof TelVisit) {
    $ctime = XDateTime::valueOf($flow->ctime);
} else {
    if ($flow instanceof PatientSignin) {
        $ctime = $flow->treatedTime;
    } else {
        if ($flow instanceof PresentOrder) {
            $ctime = XDateTime::valueOf($flow->ptime);
        }
    }
}
if ($flow instanceof FollowupPost) {
    $flowOwner = $flow->followupOwner->user;
} else {
    $flowOwner = $flow->user;
}
if ($flowOwner->id != $ref->space->id) {
    if ($ref->afterFollowedUp($ctime)) {
        /*{{{*/
        ?>
        <p class="pt10 pb10 tc">状态:<span class="green3">随访</span></p>
        <?php 
    } elseif ($ref->afterTreated($ctime)) {
<div class="yz-box ml30" id="jianyi">
<?php
$needSetUserRead = false; //无批注内容,不设置未读 
if($unReadAnnotationList)
{
	$needSetUserRead = true; //有批注,默认需要设置批注的未读状态
	foreach ($unReadAnnotationList as $unReadAnnotation) 
	{
		if ($unReadAnnotation->auditor->isNull()) continue;
		$headImageUrl = "http://i1.hdfimg.com/space/images/icondoctor48.gif";
		$strDate = XDateTime::valueOf($unReadAnnotation->ctime)->toStringByFormat('m月d日');
		$strDiary = '';
		if (($unReadAnnotation->hostEntity instanceof HealthDiary) && ($unReadAnnotation->hostEntity->type == HealthDiary::TYPE_MEDICATION)) 
		{
			$strDiary = '用药';
		}
	?>
		<div class="telDoc-share clearfix">
		   <div class="fl telDoc-share-l">
		     <a href="#"><img src="<?=$headImageUrl?>" width="55" height="55"></a>
		     <p class="tc">医生助理</p>
		   </div>
           <!-- dodo
		   <div class="fl telDoc-share-r">
           -->
		   <div class="fl" style="width:570px">
		     <!--start telsaybox-->
			<div class="tel-saybox ml15 pr">
			<div class="tel-saybox-tc">
			<div class="p10 f14 yellowarea">
			    <p class="fb pb5"><?=$strDate ?>,根据您的<?=$strDiary ?>近况,我建议:</p>
Exemplo n.º 18
0
 /**
  * flowReplyQualityMonitor 
  * 医生监控监控列表
  * @author wx 
  * @param mixed $request 
  * @param mixed $response 
  * @access public
  * @return void
  */
 public function flowReplyQualityMonitor($request, $response)
 {
     /*{{{*/
     $inspector = $this->curInspector;
     $spaceMarkMonitorId = $request->spaceMarkMonitorId;
     DBC::requireTrue($inspector->user->name == 'lyly006', '权限不足无法访问!');
     $status = $request->getRequest('status', 'INIT');
     $src = $request->getRequest('src', 'all');
     $doctorName = $request->doctorName;
     $userName = $request->userName;
     $startTime = $request->startTime;
     $endTime = $request->endTime;
     $page = $request->getRequest('page', '1');
     $pageSize = 20;
     $statusDesc = SpaceMarkMonitor::$statusDesc;
     $srcDesc = SpaceMarkMonitor::$srcDesc;
     if ($startTime && $endTime) {
         DBC::requireTrue(XDateTime::dayDiff(XDateTime::valueOf($startTime), XDateTime::valueOf($endTime)) >= 0, "日期范围不正确");
     }
     $spaceIds = $this->querySpaceIds($doctorName, $userName);
     list($spaceMarkIds, $pageInfo) = DAL::get()->querySpaceMarkMonitor('SpaceMarkMonitor', $status, $src, $spaceIds, $startTime, $endTime, $page, $pageSize);
     $spaceMarksList = DAL::get()->find('SpaceMarkMonitor', $spaceMarkIds);
     $response->pageLink = PageNav::getNavLink(PageNav::getPageNavTemplate('flowreplyqualitymonitor?startTime=' . $startTime . '&endTime=' . $endTime . '&doctorName=' . $doctorName . '&userName='******'&status=' . $status . '&src=' . $src . '&page='), $pageInfo['nowpage'], $pageInfo['pagesize'], $pageInfo['total']);
     $spaceMarkMonitor = DAL::get()->find('SpaceMarkMonitor', $spaceMarkMonitorId);
     $response->spaceMarksList = $spaceMarksList;
     $response->statusDesc = $statusDesc;
     $response->srcDesc = $srcDesc;
     $response->status = $status;
     $response->src = $src;
     $response->spaceMarkMonitor = $spaceMarkMonitor;
     $response->doctorName = $doctorName;
     $response->userName = $userName;
     $response->startTime = $startTime;
     $response->endTime = $endTime;
 }
Exemplo n.º 19
0
    public function index($request, $response)
    {/*{{{*/
        if (false == $this->isFromNotice())
        {
            $next = 'http://www.haodf.com';
            if (isset($_SERVER['HTTP_HOST']) && isset($_SERVER['REQUEST_URI']))
            {
                $next = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
            }
            $refer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : 'http://www.haodf.com';
            $response->setRedirect('http://'.URL_PREFIX.'jiahao.haodf.com/notice.htm?refer='.urlencode($refer).'&next='.urlencode($next));
            return parent::DIRECT_OUTPUT;
        }
        $month = XDateTime::valueOf(date('Y-m-d',(strtotime(XDateTime::now()) - 86400*30)));
        $day = XDateTime::valueOf(date('Y-m-d',(strtotime(XDateTime::now()))));
        $threeDay = XDateTime::valueOf(date('Y-m-d',(strtotime(XDateTime::now()) - 86400*3)));
        $oneYear = XDateTime::valueOf(date('Y-m-d',(strtotime(XDateTime::now()) - 86400*30*12)));

        $beijingHospital = array(
           '协和医院'=>1,
           '同仁医院'=>3,
           '301医院'=>335,
           '北医三院'=>142,
           '人民医院'=>21,
           '妇产医院'=>75,
           '儿童医院'=>24,
           '积水潭医院'=>34,
           '阜外医院'=>25,
           '宣武医院'=>55,
           '天坛医院'=>44,
           '北大肿瘤'=>148);

        $shanghaiHospital = array(
           '瑞金医院'=>424,
           '中山医院'=>420,
           '仁济医院'=>471,
           '华山医院'=>418,
           '新华医院'=>426,
           '长海医院'=>427,
           '上海第一'=>431,
           '红房子医院'=>416,
           '儿童医学中心'=>425,
           '上海九院'=>422,
           '五官科医院'=>419,
           '精神卫生中心'=>827);

        $guangdongHospital = array(
            '省人民医院'=>443,
            '省中医院'=>454,
            '中山一院'=>460,
            '中山二院'=>458,
            '中山三院'=>459,
            '广州市第一'=>446,
            '广医一院'=>453,
            '脑科医院'=>449,
            '广州儿童医院'=>447,
            '深圳北大医院'=>608);

        $otherAreaHospital = array(
            '天津总医院'=>487,
            '天津肿瘤'=>599,
            '天津血液病'=>1904,
            '华西医院'=>488,
            '四川省人民'=>507,
            '华西口腔'=>532,
            '江苏省人民'=>478,
            '南京鼓楼'=>497,
            '南京脑科'=>646,
            '武汉协和'=>494,
            '武汉同济'=>496,
            '湖北省人民'=>530);
        $otherAreaHospitalAddress = array(
            '天津总医院'=>'tianjin',
            '天津肿瘤'=>'tianjin',
            '天津血液病'=>'tianjin',
            '华西医院'=>'sichuan',
            '四川省人民'=>'sichuan',
            '华西口腔'=>'sichuan',
            '江苏省人民'=>'jiangsu',
            '南京鼓楼'=>'jiangsu',
            '南京脑科'=>'jiangsu',
            '武汉协和'=>'hubei',
            '武汉同济'=>'hubei',
            '湖北省人民'=>'hubei');

        $hospitalArray = array_merge($beijingHospital, $shanghaiHospital);
        $hospitalArray = array_merge($hospitalArray, $guangdongHospital);
        $hospitalArray = array_merge($hospitalArray, $otherAreaHospital);

        $hospitalDoctorCount = PlussignChannelClient::getInstance()->getDoctorCountByHospital($hospitalArray);

        $beijingCount = PlussignChannelClient::getInstance()->getDoctorCountByArea('北京');//北京地区开通加号医生总数目
        $shanghaiCount = PlussignChannelClient::getInstance()->getDoctorCountByArea('上海');
        $guangdongCount = PlussignChannelClient::getInstance()->getDoctorCountByArea('广东');

        $bjHospitalFactory = PlussignChannelClient::getInstance()->getFacultyListByCondition('','北京','');//北京地区各个科室开通加号医生数目
        $shHospitalFactory = PlussignChannelClient::getInstance()->getFacultyListByCondition('','上海','');
        $gdHospitalFactory = PlussignChannelClient::getInstance()->getFacultyListByCondition('','广东','');
        $otherHospitalFactory = PlussignChannelClient::getInstance()->getFacultyListByCondition('','其它地区','');
        if(isset($bjHospitalFactory['传染病科']))
        {
            unset($bjHospitalFactory['传染病科']);
        }
        if(isset($gdHospitalFactory['传染病科']))
        {
            unset($gdHospitalFactory['传染病科']);
        }
        if(isset($shHospitalFactory['传染病科']))
        {
            unset($shHospitalFactory['传染病科']);
        }

        $doctorNumber = PlussignChannelClient::getInstance()->getPlusSignDoctorCount();//全国开通加号医生总数目
        $patientNumber = SpaceClient::getInstance()->getPlusSignPatientCount();
        $otherCount = $doctorNumber-$beijingCount-$shanghaiCount-$guangdongCount;//其它地区开通加号医生总数目
        //预约成功患者
        $patientOrderList = PatientClient::getInstance()->getPatientOrderList(6);

        list($response->spacesOfNewContract, $response->newContracts) = BookingClient::getInstance()->getSpaceAndContract4newOpenBooking(20);

        $response->bjHospital = $beijingHospital;
        $response->shHospital = $shanghaiHospital;
        $response->gdHospital = $guangdongHospital;
        $response->otHospital = $otherAreaHospital;
        $response->otAreaHospital = $otherAreaHospitalAddress;
        $response->hospitalDoctorCount = $hospitalDoctorCount;

        $response->beijingCount = $beijingCount;
        $response->shanghaiCount = $shanghaiCount;
        $response->guangdongCount = $guangdongCount;

        $response->bjHospitalFactory = $bjHospitalFactory;
        $response->shHospitalFactory = $shHospitalFactory;
        $response->gdHospitalFactory = $gdHospitalFactory;
        $response->otherHospitalFactory = $otherHospitalFactory;

        $response->doctorNumber = $doctorNumber;
        $response->patientNumber = $patientNumber;
        $response->otherCount = $otherCount;
        $response->patientOrderList = $patientOrderList;
		$response->type = 'index'; //返回页面类型,暂时用于控制二级导航
    }/*}}}*/
Exemplo n.º 20
0
?>
            <!-- start dd-article -->
            <div class="dd-article dd-box ">
            <ul class="pt15 lh180">
            <?php
            if (false == empty($cmsList))
            {
                $a = 0;
                foreach($cmsList as $cms) 
                {
                    $a++;
                ?>
                    <li class="thirdList clearfix" >
                         <span class="fl">●</span>
                         <a class="fl black f14" href="<?=$cms->getUrl()?>" target="_blank"><?=$cms->title.Thesis::$sourceDesc[$cms->source]?></a>
                        <span class="fr f12 gray2 thirdList ml20"><?=XDateTime::valueOf($cms->ctime)->getDateTime()?> </span>
                    </li>
                    <?php if (!fmod($a, 5)) { ?> <li class="mt20"></li> <?php } ?>
                <?php 
                }
            }
            ?>
            <li  class="clearfix"><?=$pageLink ? $pageLink : ''?></li>
            </ul>
            </div>
            <!-- end dd-article -->
<?php
            }
?>
        </div>
        <div class="w300 fr">
 public function userInfoPost($request, $response)
 {
     /*{{{*/
     DBC::requireTrue($this->space->user->verifyToken($request->token), '验证码错误');
     DBC::requireTrue($request->password == $request->password2, '两次密码输入不一致');
     try {
         XDateTime::valueOf($request->birthday);
     } catch (Exception $ex) {
         throw new BizException('日期输入不正确,正确格式如:1980-01-01');
     }
     $password = $request->getRequest('password', '');
     $email = $request->getRequest('email', '');
     $mobile = $request->getRequest('mobile', '');
     $sex = $request->sex;
     $birthday = $request->birthday;
     $phone = $request->phone;
     $province = $request->province;
     $city = $request->city;
     $district = $request->district;
     UserClient::getInstance()->modifyInfo($this->space->id, $sex, $email, $phone, $mobile, $birthday, $province, $city, $district, $password);
     $this->message('账户信息修改成功', $response);
 }
 /**
  * setStopDiagnoseNote 
  * 发布停诊公告 noteValidTime要时间戳
  * @param mixed $userId 
  * @param mixed $note 
  * @param mixed $noteValidTime 
  * @access public
  * @return void
  */
 public function setStopDiagnoseNote($userId, $note, $noteValidTime)
 {/*{{{*/
     $noteValidTime = XDateTime::valueOf($noteValidTime)->getTime();
     if($noteValidTime<time()) 
     {
         $this->setErrorCode(157);
         return 0;
     }
     $space = DAL::get()->find('space', $userId); 
     $res = $this->checkSpace($space); 
     if($res)
     {
     	$this->setErrorCode($res);
         return 0;
     }
     SpaceClient::getInstance()->setProperties($space->id, 
         array('note1' => $note, 'offlineNoteValidTime' => $noteValidTime));
     $this->buildBookingTask($space, $note);
     $this->content = array('id'=>$userId);
 } /*}}}*/
Exemplo n.º 23
0
 public function auditPresentOrderList($request, $response)
 {
     /*{{{*/
     $params = array();
     $isaudited = $request->getRequest('isaudited', 'all');
     $response->isaudited = $isaudited;
     $params['isaudited'] = $isaudited;
     $presentName = $request->getRequest('presentName', '');
     $response->presentName = $presentName;
     if ($presentName) {
         $present = DAL::get()->find_by_name('Present', $presentName);
         if ($present->isNull()) {
             $params['presentId'] = -1;
         } else {
             $params['presentId'] = $present->id;
         }
     }
     $userName = $request->getRequest('userName', '');
     $response->userName = $userName;
     if ($userName) {
         $user = DAL::get()->find_by_name('User', $userName);
         if ($user->isNull()) {
             $params['userId'] = -1;
         } else {
             $params['userId'] = $user->id;
         }
     }
     $doctorName = $request->getRequest('doctorName', '');
     $response->doctorName = $doctorName;
     if ($doctorName) {
         $space = DAL::get()->find_by_fld_SpaceUserName_or_fld_SpaceHostName('space', $doctorName, $doctorName);
         if ($space->isNull()) {
             $params['spaceId'] = -1;
         } else {
             $params['spaceId'] = $space->id;
         }
     }
     $patientName = $request->getRequest('patientName', '');
     $response->patientName = $patientName;
     if ($patientName) {
         $patient = DAL::get()->find_all_by_fld_PatientName_or_fld_PatientMobile('Patient', $patientName, $patientName);
         if (empty($patient)) {
             $params['patientId'] = array(-1);
         } else {
             $params['patientId'] = array_keys($patient);
         }
     }
     $params['nowPage'] = $request->getRequest('page', 1);
     $params['pageSize'] = 18;
     $pStartTime = $request->getRequest('pStartTime', XDateTime::now()->addDay(-2)->toShortString());
     $response->pStartTime = $pStartTime;
     $params['pStartTime'] = XDateTime::valueOf($pStartTime);
     $pEndTime = $request->getRequest('pEndTime', XDateTime::now()->toShortString());
     $response->pEndTime = $pEndTime;
     $params['pEndTime'] = XDateTime::valueOf($pEndTime)->addDay(1);
     $params['notSpacePresentCate'] = false;
     $result = PresentClient::getInstance()->getPresentOrders($params);
     $response->presentOrders = $result['presentOrderList'];
     $pagelink = '';
     $urlParams = array('presentName' => $presentName, 'isaudited' => $isaudited, 'userName' => $userName, 'doctorName' => $doctorName, 'patientName' => $patientName, 'pStartTime' => $pStartTime, 'pEndTime' => $pEndTime);
     $url = '/present/auditpresentorderlist?' . http_build_query($urlParams, '&') . '&page=';
     if (isset($result['pageInfo'])) {
         $pagelink = Pager::getNavLink($url, $result['pageInfo']);
     }
     $response->pagelink = $pagelink;
 }
Exemplo n.º 24
0
    /**
     * statisticInfosAfterPayment 
     * 根据(备注中含有给定的搜索条件)查出某一天中的有关订单的信息
     * 页面显示相关的订单号,执行完成时间,订单状态,支付状态,医生,科室,医院,特定备注的时间,
     * 负责人,和订单的付款时间,和负责人,
     */
    public function statisticInfosAfterPayment($request, $response)
    {/*{{{*/
        $fromTime = $request->fromTime;
        $remarkSelected = trim($request->remarkSelected);
        $fromTime = empty($fromTime)?XDateTime::today()->addDay(-1)->toStringByFormat("Y-m-d"):$request->fromTime;
        $remarkSelected = empty($remarkSelected)?TelOrderLog::$orderTypeDef[TelOrderLog::TYPE_PAY]:$remarkSelected;
        $toTime = XDateTime::valueOf($fromTime)->addDay(1)->toStringByFormat("Y-m-d");
        $options = array();
        $options['fromTime'] = $fromTime;
        $options['remarkSelected'] = $remarkSelected;
        $options['toTime'] = $toTime;

        $allOrderRemarks = TelOrderClient::getInstance()->getReturnInfosAfterPayment($options);
        $response->fromTime = $fromTime;
        $response->remarkSelected = $remarkSelected;
        $response->allOrderRemarks = $allOrderRemarks;
    }/*}}}*/
</form>
</div>

<div class="ml40"> 
<h1>付费医生异常情况报警(周报)</h1>
<div class="f14">
    <div>异常情况指上周回复新咨询数超过100的</div>
</div>
<table border="1" cellpadding="4" style=" font-size:50px;margin-top:24px;width:400px;height:100px;text-align:center">
<tr>
<td style="font-size:20px">日期</td>
<td style="font-size:20px">医生总量</td>
</tr>
<?php 
foreach ($infos as $info) {
    $start = XDateTime::valueOf($info['week'])->addDay(-6)->toShortString();
    $urlStr = $url . "?from={$start}&to=" . $info['week'];
    ?>
<tr>
<td style="font-size:20px"><?php 
    echo $start;
    ?>
至<?php 
    echo $info['week'];
    ?>
</td>
<td style="font-size:20px"><a href="<?php 
    echo $urlStr;
    ?>
" target="_blank"><?php 
    echo $info['count'];
Exemplo n.º 26
0
 public function modifyWorkSheetInfo($request, $response)
 {
     /*{{{*/
     $workSheetId = $request->worksheetid;
     $workSheet = DAL::get()->find('worksheet', $workSheetId);
     if ($workSheet->isNull()) {
         throw new BizException('工作单不存在');
     }
     if ($workSheet->submit == WorkSheet::SUBMIT_YES) {
         echo "下一个工作单已经提交,修改下次联系内容已无意义";
         return parent::DIRECT_OUTPUT;
     }
     $response->workSheet = $workSheet;
     $task = DAL::get()->find_by_sourceid('nfstask', $workSheet->id);
     $itemNames = $workSheet->contactHealthItemNames;
     if ($itemNames == null) {
         $itemNames = array();
     }
     $auditorsRole = DAL::get()->find_by_name('followupauditorrole', FollowupAuditorRole::NAME_ASSISTANTDOCTOROPERATION);
     $response->followupAuditorList = FollowupAuditorClient::getInstance()->getAuditorListByRoleId($auditorsRole->id);
     $followupcustomerinforecord = DAL::get()->find_by_customerid('followupcustomerinforecord', $workSheet->customerid);
     $response->auditorId = $followupcustomerinforecord->auditorid;
     $response->itemNames = $itemNames;
     $response->contactTime = $task->deadline->toShortString();
     $userId = $workSheet->customer->userId;
     if (false == empty($workSheet->contactLabelIds)) {
         $response->labels = DAL::get()->find('label', $workSheet->contactLabelIds);
     }
     $lastCollectTimes = WorkSheetClient::getInstance()->getLastCollectTimes($userId);
     foreach ($lastCollectTimes as $key => $time) {
         if (empty($time)) {
             $collectDayStr[$key] = "<span class='fb'>没有采集记录</span>";
         } else {
             $time = XDateTime::valueOf($time);
             $collectDay = (strtotime(XDateTime::today()) - strtotime(XDateTime::valueOf($time->toShortString()))) / 3600 / 24;
             if ($collectDay < 14) {
                 $collectDayStr[$key] = "<span>距离上次采集" . $collectDay . "天</span>";
             } else {
                 $collectDayStr[$key] = "<span class='fb'>距离上次采集" . $collectDay . "天</span>";
             }
         }
     }
     $response->collectDayStr = $collectDayStr;
 }
    /**
     * modifyDoctorInfo 
     * 修改医生信息 
     * @param mixed $userId 
     * @param mixed $infos 
     * @access public
     * @return void
     */
    public function modifyDoctorInfo($userId, $key, $value)
    {/*{{{*/
        $doctorOwner = DAL::get()->find_by_userid('DoctorOwner', $userId);
        if($doctorOwner->isNull())
        {
            $this->setErrorCode(819);
            return 0;
        }
        if($key == "sex")
        {
            $value = $this->getSexValue($value);
            if($doctorOwner->isSpace() == false)
            {
                //user实体性别的定义和doctor相反
                $value = $value ? 0 : 1;
            }
        }
        $inputInfos = array('sex', 'birthday', 'grade', 'educateGrade', 'specialize', 'intro');
        $infos = array();
        foreach($inputInfos as $info)
        {
            if($info == $key)
            {
                $infos[$info] = $value;
            }
            else if($doctorOwner->isSpace())
            {
                $infos[$info] = $doctorOwner->source->getInfoDataByKey($info); 
            }
        }
        if($doctorOwner->isSpace())
        {
            $grade = $infos['grade'];
            $infos = XString::toGbkDeep($infos);
            if (isset($infos['grade']) && ($infos['grade'] == 'zhuyuanyishi' || $grade == '住院医师'))
            {
                $infos['grade'] = '住院医师';
            }
            if (isset($infos['birthday']) && $infos['birthday'])
            {
                $infos['birthday'] = XDateTime::valueOf($infos['birthday']);
            }
            if (isset($infos['educateGrade']) && $infos['educateGrade'] == '无职称')
            {
                $infos['educateGrade'] = '';
            }
            DoctorClient::getInstance()->modifyByDoctor($doctorOwner->source->host->id, $infos);
        }
        else
        {
            $user = $doctorOwner->source->user; 
            $sex = isset($infos['sex']) ? $infos['sex'] : $user->sex;
            $birthday = isset($infos['birthday']) ? $infos['birthday'] : $user->birthday;
			UserClient::getInstance()->modifyInfo($user->id,$sex,$user->email,$user->phone,
			$user->mobile,(string)$birthday,$user->province,$user->city,$user->district);
        }
        $this->content = array('UserId'=>$userId);
    }/*}}}*/
Exemplo n.º 28
0
</div>

<?php if( count($unSigninedList) + count($patientSignList) > 0){ ?>
<ul class="mydoc_box" id="myDoctorContent">
    <?php foreach($unSigninedList as $unSigninedScanedSpaceId => $unSignined) {
        $hrefTitle = '报到未完成,继续报到';
        $url = "checkpatient?userid={$weixUser->userId}&spaceid={$unSigninedScanedSpaceId}";
        $userShowName = $weixUser->getUser()->isNull()? $weixUser->nickname : $weixUser->getUser()->name;
     ?>
    <li>
    <a href="javascript:void(0)" onclick="clickdoctor('', '<?=$unSigninedScanedSpaceId?>', 'PatientSignin')">
        <div class="top clearfix mydoctoritem" >
            <div class="left_img"><span><img src="http://i1.hdfimg.com/touch/images/pic1.png" alt=""></span></div>
            <div class="right_con">
                <div class="doc_name"><?=$unSignined['space']->host->name?>大夫</div>
                <div class="others"><?=$userShowName?>&nbsp;&nbsp;扫码时间:<?=XDateTime::valueOf($unSignined['ctime'])->toShortString()?></div>
            </div>
        </div>
        <div class="bot" style="color:red;font-size:18px;">
        <?=$hrefTitle?>
        </div>
     </a>
    </li>
    <?php }?>

    <?php foreach($patientSignList as $patientSign) {?>
    <?php 
     $lastDoctorPatientSignId = $patientSign->id;
     if($patientSign->space->isNull()) 
         continue;
    ?>
Exemplo n.º 29
0
 public function ajaxGetNextRecommendThread($request, $response)
 {/*{{{*/
     header('Content-Type: application/json; charset=UTF-8');
     //判断是否推送的判断变量
     $isCanAutoPull = (false === empty($_COOKIE["userinfo"]["hosttype"]) 
         && 'Doctor' == $_COOKIE["userinfo"]['hosttype']) ;
     $cookie = new HdfCookie();
     $isSuccess = 0;
     if($isCanAutoPull 
         && (false === isset($_COOKIE['firstlogintime'])
         || (false == empty($_COOKIE['firstlogintime']) 
         && (XDateTime::hourDiff(XDateTime::valueOf($_COOKIE['firstlogintime']), XDateTime::now()) > 24))))
     {
         $auto = ThreadClient::getInstance()->autoPullRecommendThreads($this->_newUser);
         if ($auto)
         {
             $cookie->set("firstlogintime", XDateTime::now(), 7*24*3600);
             SpaceExpClient::getInstance()->createSpaceExp($this->_newUser->id, XDateTime::now());
             $isSuccess = 1;
         } 
     } 
     $unUnreadCaseCount = FlowClient::getInstance()->getUnReadCount($this->_newSpace->id);
     $callback = $request->callback;
     echo "\n".$callback.'(';
     echo Json::encode($unUnreadCaseCount);
     echo ');';
     //方便测试
     echo "\nisCanAuto:".$isCanAutoPull;
     echo "\nisSuccess:".$isSuccess;
     exit;
 }/*}}}*/
Exemplo n.º 30
0
    private function loadMoreDetail($patientSignin, $ref, $request, $response)
    {/*{{{*/
        //$userSelfIsLogin = (false == $this->user->isNull() && $this->user->id == $ref->user->id);
        $response->space = $patientSignin->space;
        $response->doctor = $patientSignin->space->host;
        $response->ref = $ref;
        $flowables[] = $patientSignin;

        if(false == $ref->isNull())
        {
            $diseaseTitle = '';
            list($title, $flowTitle, $navigatorTitle) = FlowClient::getInstance()->getFlowTitle($ref);
            $response->topTitle = XString::truncate($diseaseTitle, 20);

            $response->userPrivateName = str_replace('*', '', $ref->user->privateName);

            $nowPage = $request->getRequest('p', 1);
            $flowInfos = FlowClient::getInstance()->getFlowInfos($ref->id, $nowPage, 100, array('isBrowser'=>false, 'noUpdate' => true), $isSens = true);
            $flowObjects = $flowInfos['objects'];
            $flowables = array();
            $lastCtime = XDateTime::valueOf(XDateTime::DEFAULT_START_TIME);
            foreach ($flowObjects as $flowObject)
            {
                $ctime = $flowObject->ctime;
                if (false == $ctime instanceof XDateTime)
                {
                    $ctime = XDateTime::valueOf($flowObject->ctime);
                }
                $lastCtime = $ctime;
                $flowables[] = $flowObject;
            }
            $response->loadUrl = $response->touchUrl.'/case/loadmoredetail?refid='.$ref->id.'&lastposttime='.$lastCtime->getDateTime().'&p=';
            $response->firstFlowableEntity = isset($flowInfos['object'][0]) ? $flowInfos['objects'][0] : null;
            $response->nowPage = $flowInfos['pageInfo']['nowpage'];
            $response->pages = $flowInfos['pageInfo']['pages'];
        }
        $response->flowables = $flowables;
    }/*}}}*/