Exemplo n.º 1
0
 public function __construct($request, $response)
 {
     /*{{{*/
     parent::__construct($request, $response);
     $response->imgTimestamp = BeanFinder::get('configs')->imgTimestamp;
     $spaceUserName = WebUtil::getSpaceUserName($request);
     $this->space = SpaceClient::getInstance()->getSpaceByUserName($spaceUserName);
     if ($this->space->isNull()) {
         header('Location: http://www.haodf.com');
         exit;
     }
     if ($this->space->isHospitalFaculty()) {
         $requestUri = $_SERVER['REQUEST_URI'];
         header('Location: http://' . URL_PREFIX . $this->space->user->name . '.haodf.com' . $requestUri);
         exit;
     }
     $this->user = NullEntity::create();
     $userId = UserClient::getInstance()->getCheckedSeed('id');
     if ($userId) {
         $this->user = DAL::get()->find('user', $userId);
     }
     $response->space = $this->space;
     $response->user = $this->user;
     //未登录 或者 站外链接访问 skips
     if ($this->user->isNull() || false == $request->isQueryFromHDF()) {
         $this->skips($response);
     }
     $this->initModules($request, $response);
     $this->spaceIsLogin = $this->isSpaceLogin();
     $response->spaceIsLogin = $this->spaceIsLogin;
     $response->isSpaceUser = $this->isSpaceUser();
     $response->unreadCaseCount = $this->getUnReadCaseCount();
     if ($this->space->modulecase->isNull()) {
         SpaceModuleCaseClient::getInstance()->initModuleCase($this->space);
     }
     $this->accessLog();
     $configs = BeanFinder::get('configs');
     $response->imgUrl = $configs->imgUrl;
     $response->spaceStyleId = $request->view_style_id ? $request->view_style_id : $this->space->getSpaceStyleId();
     $response->_window_id = $request->window_id;
     $response->spaceBaseUrl = URL_PREFIX . $this->space->userName . '.haodf.com';
     $response->title = $this->space->name . '大夫个人网站';
     $response->scripts = array();
     $response->spaceHits = $this->getSpaceHits($request);
     $response->goodDoctorList = $this->getGoodDoctorListOf2013();
     $response->patientGoodDoctorList = $this->getPatientGoodDoctorListOf2013();
 }
Exemplo n.º 2
0
<?php

if (false == is_object($group)) {
    $group = NullEntity::create();
}
?>
<div id='addtaskdiv' title="生成任务" class="none popdialog">
    <div class="popdialog-text">
        <div>
	<table>
	    <tr >
           <td><span class='tb'>类别:</span></td>
            <?php 
$parentGroup = $group->getParent();
?>
			<?php 
if ($group instanceof SaleInspectGroup || $group instanceof InitialInspectGroup || $group instanceof BuInspectGroup && $group->isService() == false) {
    $svcchecked = '';
    if ($group instanceof InitialInspectGroup) {
        $svcchecked = 'checked';
    }
    ?>
	      <td width="100px"><input type='radio' class='togroupid taskservice' name='togroupid' value="" <?php 
    echo $svcchecked;
    ?>
>服务任务</td>
            <?php 
}
?>
            <?php 
if ($group instanceof BuInspectGroup) {
Exemplo n.º 3
0
 /**
  * @brief 拿到加号和电话的流
  * @author lhl
  * @version branches/v2.14.23
  * @date 2013-07-25
  */
 private function getUnFinishedService($flowList)
 {
     /*{{{*/
     $hasBooking = false;
     $hasTel = false;
     $telCase = $bookingOrder = NullEntity::create();
     foreach ($flowList as $flow) {
         if ($flow instanceof BookingOrder && $flow->isValid()) {
             if (false == $hasBooking) {
                 $hasBooking = true;
                 $bookingOrder = $flow;
             }
         } else {
             if ($flow instanceof TelOrder && $flow->isValid()) {
                 if (false == $hasTel) {
                     $hasTel = true;
                     $telCase = $flow;
                 }
             }
         }
     }
     return array($hasBooking, $hasTel, $bookingOrder, $telCase);
 }
Exemplo n.º 4
0
 private function mergeResult($orgIds, $resultInCache, $resultInDb) {
     $result = array();
     foreach ($orgIds as $orgId) {
         if (isset($resultInCache[$orgId]))
             $result[$orgId] = $resultInCache[$orgId];
         elseif (isset($resultInDb[$orgId]))
             $result[$orgId] = $resultInDb[$orgId];
         else
             $result[$orgId] = NullEntity::create();
     }
     return $result;
 }
Exemplo n.º 5
0
    }
    else
    {
        $legalDoctor = $doctor2;
        if(0 >= $dvotes && isset($goodVoteCount[$doctor2->id]) && 0 < $goodVoteCount[$doctor2->id])
        {
            $dvotes = $goodVoteCount[$doctor2->id];
        }
    }
    if($legalDoctor->user->isNull() == false)
    {
        $space = isset($spaceList[$legalDoctor->user->id]) ? $spaceList[$legalDoctor->user->id] : new NullEntity();
    }
    else
    {
        $space = new NullEntity();
    }	            
    $hfname = $legalDoctor->hospitalfaculty->hospital->commonName . $legalDoctor->hospitalfaculty->name;
    $dtitle = (string)$legalDoctor->grade? $legalDoctor->grade : '';
    $dgrade = (string)$legalDoctor->educateGrade? $legalDoctor->educateGrade : '';
    $dspecialilze = (string)($space->isNull() == false && $space->commonCaseNote) ? $space->commonCaseNote : $legalDoctor->specialize;
    $dspecialilze = XString::truncate($dspecialilze, 84);
    if($space->isNull() == false)
    {
        $postCount = isset($spacePostCntInfos[$space->id]) ? $spacePostCntInfos[$space->id] : 0;
    }
?>
<tr class="gray">
    <td>
		<table>
		    <tr>
 private function flowAndFollowUpMessage($request, $response)
 {
     /*{{{*/
     $doctorPatientRef = DAL::get()->find('doctorPatientRef', $request->refId);
     $ticketId = $request->ticketId;
     $response->repealServiceCards = DAL::get()->find_all_by_SpaceAndPatientOfRepealServiceCard('servicecard', $doctorPatientRef->space, $doctorPatientRef->patient, ServiceDef::TYPE_FLOW);
     $nowPage = $request->getRequest('p', 1);
     $allFlowInfos = FlowClient::getInstance()->getAllFlowInfos($doctorPatientRef->space->id, $doctorPatientRef->patient->id, array('includeDeleteData' => true));
     $doctorPatientRef->checkRefCnt();
     $isFlow = $request->isFlow ? 15 : 10;
     $pageSize = $request->page ? count($allFlowInfos) : $isFlow;
     $response->page = $request->page ? $request->page : 0;
     $showAll = true;
     if (false == $response->page && count($allFlowInfos) > $isFlow) {
         $showAll = false;
     }
     $response->showAll = $showAll;
     $options = array();
     $options['flowOrder'] = SpaceAttribute::FLOW_ORDER_DESC;
     $options['isAll'] = true;
     $options['noUpdate'] = true;
     $flowList = FlowClient::getInstance()->getFlowInfos($doctorPatientRef->id, $nowPage, $pageSize, $options);
     $response->flowList = $flowList['objects'];
     //通过流id取到收费postIds
     $response->chargePostIds = ServiceCardClient::getInstance()->querySameServiceTypeAndUnfreeServiceAppIds($doctorPatientRef->space, $doctorPatientRef->patient, ServiceDef::TYPE_FLOW);
     $response->doctorPatientRef = $doctorPatientRef;
     $scoreAmounts = ScoreClient::getInstance()->getScoreByUserIdGroupByCate($doctorPatientRef->user->id);
     $response->scoreAmount = $scoreAmounts[Account::CATE_INTEGRAL][Account::TYPE_PRESENT] + $scoreAmounts[Account::CATE_INTEGRAL][Account::TYPE_NORMAL];
     $ticket = DAL::get()->find('Ticket', $ticketId);
     $response->ticket = $ticket;
     //标注异常
     $response->abnormalStatus = $this->getAbnormalStatus($flowList['objects']);
     $page = $request->page;
     if (empty($page)) {
         $page = 1;
     }
     $params = array();
     $params['doctorpatientrefid'] = $doctorPatientRef->id;
     $params['nowPage'] = $page;
     $params['pageSize'] = $pageSize;
     $res = DoctorPatientPostClient::getInstance()->getPostList($params);
     $postList = $res['postList'];
     $postIds = array_keys($postList);
     $response->keyWords = array();
     $response->postList = $postList;
     $response->pageLink = '';
     if (false == empty($res['pageInfo']) && $ticketId) {
         $response->pageLink = PageNav::getNavLink(PageNav::getPageNavTemplate('/nfsaudit/nexttask?ticketId=' . $ticketId . '&page='), $res['pageInfo']['nowpage'], $res['pageInfo']['pagesize'], $res['pageInfo']['total']);
     }
     $proposalIds = DAL::get()->querySpacePatientProposals('proposal', $doctorPatientRef->space, array($doctorPatientRef->user->id), $doctorPatientRef->patient->id);
     $threadParentCategoryName = '未知';
     $proposal = NullEntity::create();
     if (false == empty($proposalIds)) {
         $proposal = DAL::get()->mustFind('proposal', array_pop($proposalIds));
         $threadParentCategory = DAL::get()->find('ThreadCategory', $proposal->category->parentId);
         if (false == $threadParentCategory->isNull()) {
             $threadParentCategoryName = $threadParentCategory->name;
         }
     }
     $response->proposal = $proposal;
     $response->threadParentCategoryName = $threadParentCategoryName;
     //随访信息,目前一个医生有一个随访卡,但未来会有多个,暂时只查询一条显示(产品gjb确认)
     $patientCard = DAL::get()->find_by_spaceid('PatientCard', $doctorPatientRef->space->id);
     if (false == $patientCard->isNull()) {
         $response->followupAuditor = DAL::get()->find_by_auditorid('FollowupAuditor', $this->auditor->id);
         $owner = DAL::get()->find_by_spaceid_and_patientid('FollowupOwner', $patientCard->space->id, $doctorPatientRef->patient->id);
         $userScheme = new NullEntity();
         if ($owner->isNull() == false) {
             $userScheme = HealthRecordClient::getInstance()->getPatientSigninScheme($owner->id);
         }
         $response->userScheme = $userScheme;
         if ($doctorPatientRef->space->isOpenFollowup()) {
             $response->owner = $owner;
         }
     }
     $postTicketList = $response->postTicketList == null ? array() : $response->postTicketList;
     $this->attachmentList($request, $response, $postList, $postTicketList);
     $response->postTicketList = $postTicketList;
 }
Exemplo n.º 7
0
 public function weixinSetRedirect($request, $response)
 {/*{{{*/
     UserClient::clearSeed();
     $openid = $request->openid;
     $weixUser = DAL::get()->find_by_openid_and_weixintype("WeixUser", $openid, WeixUser::WEIXINTYPE_PATIENT, true);
     $spaceId = $request->spaceId;
     $userId = $weixUser->userId;
     setcookie("WeixUserId", $weixUser->id, time()+3600*24*365*20, "/", "haodf.com");
     if($userId != 0)
     {
         UserClient::getInstance()->login4Weix($weixUser->userId);
         setcookie("WeixUserId", $weixUser->id, time()+3600*24*365*20, "/", "haodf.com");
         $patientSignin = DAL::get()->find_by_ForWeiXinSignin('PatientSignin', $spaceId, 0, $userId);
     }
     else
     {
         $patientSignin = new NullEntity();
     }
     if($patientSignin->isNull())
     {
         if($weixUser->userId != 0)
         {
             $url = $response->router->urlfor('weixin/checkpatient',  array('userid'=>$weixUser->userId, 'spaceid'=>$spaceId, 'patientName'=>$request->patientName, 'disease'=>$request->disease));
         }
         else
         {
             $url = $response->router->urlfor('weixin/reportinfo',  array('wxUserId'=>$weixUser->id, 'spaceid'=>$spaceId));
         }
     }
     else
     {
         $patientId = $patientSignin->patient->id;
         $attachmentIds = $patientSignin->attachmentIds;
         $hasPatientSigninContent = (false == empty($attachmentIds)) || ('' != trim($patientSignin->treatment));
         if($hasPatientSigninContent)
         {
             $url = $response->router->urlfor('weixin/wxflowdetail',  array('patientid'=>$patientId, 'spaceid'=>$spaceId));
         }
         else
         {
             $url = $response->router->urlfor('attach/weixinconfirmattach',  array('patientId'=>$patientId, 'spaceId'=>$spaceId));
         }
     }
     $response->setRedirect($url);
 }/*}}}*/
Exemplo n.º 8
0
 /*{{{*/
 if ($dto->record) {
     $doctorComment = $item;
     if (isset($showtype) && $showtype) {
         $doctorComment = InspectorDoctorCommentListHelper::getDoctorComment($item);
     }
 } else {
     $doctorComment = $item;
 }
 if ($doctorComment->isNull()) {
     continue;
 }
 if (isset($spaceList[$doctorComment->userId]) && !$spaceList[$doctorComment->userId]->isNull()) {
     $space = $spaceList[$doctorComment->userId];
 } else {
     $space = new NullEntity();
 }
 $ip = $doctorComment->ip;
 $templ = XIpLocation::getLocation($ip);
 $ipLocation = "{$templ['country']} {$templ['area']}";
 $ipTrashCnt = 0;
 $ipGoodCnt = 0;
 if (isset($ipCommentStatInfos['ip'][$ip])) {
     $ipTrashCnt = $ipCommentStatInfos['ip'][$ip]['trashcnt'];
     $ipGoodCnt = $ipCommentStatInfos['ip'][$ip]['goodcnt'];
 }
 $ipSegment = preg_match('/^(\\d+\\.\\d+\\.\\d+)\\.\\d+$/', $ip, $matches) ? $matches[1] : "";
 $ipSegmentGoodCnt = 0;
 $ipSegmentTrashCnt = 0;
 if (isset($ipCommentStatInfos['ipsegment'][$ipSegment])) {
     $ipSegmentGoodCnt = $ipCommentStatInfos['ipsegment'][$ipSegment]['goodcnt'];
 public function recordDetail($request, $response)
 {
     /*{{{*/
     $record = DAL::get()->find('PatientHealthRecord', $request->id);
     $answerArr = $wrapperCntArr = $wrapperArr = $uploadArr = array();
     foreach ($record->answerSheet->answers as $answer) {
         if ($answer->getAnswerContent() == '') {
             continue;
         }
         if ($answer->question->isUpload()) {
             $uploadArr[] = $answer->getAnswerContent();
         }
         $answerArr[$answer->question->id] = $answer;
         $question = $answer->question;
         if (array_key_exists($question->wrapperid, $wrapperCntArr)) {
             $wrapperCntArr[$question->wrapperid]++;
         } else {
             $wrapperCntArr[$question->wrapperid] = 1;
         }
     }
     $questionIdAnswerArr = $record->answerSheet->getQuestionId_answerArr();
     $answerSheetQuestionIds = array_keys($questionIdAnswerArr);
     $questionSheetQuestionIds = array_keys($record->answerSheet->questionSheet->questions);
     $deleteQuestionIds = array_diff($answerSheetQuestionIds, $questionSheetQuestionIds);
     $questionIds = array_merge($questionSheetQuestionIds, $deleteQuestionIds);
     $questions = DAL::get()->find('question', $questionIds);
     foreach ($questions as $question) {
         $wrapperArr[$question->wrapperid][] = $question;
     }
     //判断是否是MSD患者
     $msdPatients = DAL::get()->find_all_by_patientid_and_type("spacepatientmark", $record->patient->id, SpaceSymbol::TYPE_MSD);
     $response->msdPatientAmount = count($msdPatients);
     $response->msdPatients = $msdPatients;
     //判断是否有健康日记
     $response->recordPatientIds = DAL::get()->queryRecordListByPatientIds('PatientHealthRecord', $record->patient->id);
     $response->followUpOwner = NullEntity::create();
     //判断是否是PCI患者
     $followUpOwner = $record->patient->user->getFollowupPatientSignin();
     if (false == $followUpOwner->isNull() && $followUpOwner->patient->id == $record->patient->id && $followUpOwner->isOpenFollowup()) {
         $response->followUpOwner = $followUpOwner;
     }
     $response->record = $record;
     $response->apply = $record;
     $response->patient = $record->patient;
     $response->answerArr = $answerArr;
     $response->wrapperArr = $wrapperArr;
     $response->wrapperCntArr = $wrapperCntArr;
     $response->uploadArr = empty($uploadArr) ? $uploadArr : explode(',', implode(',', $uploadArr));
 }
Exemplo n.º 10
0
 /**
  * 初始化logger
  * 
  * @static
  * @access public
  * @return void
  */
 public static function setUp($channel)
 {
     /*{{{*/
     $configs = BeanFinder::get('configs');
     if (isset($configs->logLevel) && $configs->logLevel && isset($configs->logPath) && $configs->logPath) {
         $logger = new static($channel, $configs->logPath, $configs->logLevel);
     } else {
         $logger = NullEntity::create();
     }
     BeanFinder::register('logger', $logger);
 }
Exemplo n.º 11
0
}
?>
    </div>
    <div class="fr tb">
        <?php 
if (false == $dto->order->isNUll()) {
    ?>
            <a href="/serviceorder/showdetail?id=<?php 
    echo $dto->order->id;
    ?>
" target="_blank">查看订单</a>
        <?php 
}
if (isset($readOnly) == false) {
    $tmpTicketId = isset($ticket) ? $ticket->id : 0;
    $task = isset($task) ? $task : NullEntity::create();
    if ($dto->canModifyBy($_proposalHistory_group, $task, $curInspector)) {
        ?>

    <?php 
        if (false == $task->isSystemMake() && $dto->proposal->isPending()) {
            ?>
        <a class="fancyboxOpen" href="ajaxunpendproposal?proposalId=<?php 
            echo $dto->proposal->id;
            ?>
&groupId=<?php 
            echo (int) $task->inspectGroup->id;
            ?>
">恢复</a>
    <?php 
        } else {
Exemplo n.º 12
0
	            }
               
            }
            if(false == empty($spaceIds))
			{
				$isaskedfull = SpaceModuleCaseClient::getInstance()->isAskedFullBySpaceIds($spaceIds);
			}
            $spaceList = DAL::get()->find('space', $spaceIds);
            foreach ($doctorList2 as $doctor2) {
	            if($doctor2 instanceof Doctor)
	            {
	                if($doctor2->hasSpace())
	                {
	                	$space = isset($spaceList[$doctor2->space->id]) ? $spaceList[$doctor2->space->id] : new NullEntity();
	                }else{
	                	$space = new NullEntity();
	                }	            
		            $hfname = $doctor2->hospitalfaculty->hospital->commonName . $doctor2->hospitalfaculty->name;
                    $hospitalFacultyUrl = $doctor2->hospitalfaculty->getUrl();
		            $dtitle = (string)$doctor2->grade ? '<br />' . $doctor2->grade : '';
		            $dgrade = (string)$doctor2->educateGrade ? '<br/>' . $doctor2->educateGrade : '';
		            $dspecialilze = (string)($space->isNull() == false && $space->commonCaseNote) ? $space->commonCaseNote : $doctor2->specialize;
		            $dspecialilze = XString::truncate($dspecialilze, 84);
	            }else{
	            	$space =  ($doctor2->doctor->hasSpace() && empty($spaceList) == false ) && isset($spaceList[$doctor2->doctor->space->id]) ? $spaceList[$doctor2->doctor->space->id] : new NullEntity();
	                $hfname = $doctor2->doctor->hospitalfaculty->hospital->commonName . $doctor2->doctor->hospitalfaculty->name;
                    $hospitalFacultyUrl = $doctor2->doctor->hospitalfaculty->getUrl();
	                $dtitle = (string)$doctor2->doctor->grade ? '<br />' . $doctor2->doctor->grade : '';
	                $dgrade = (string)$doctor2->doctor->educateGrade ? '<br/>' . $doctor2->doctor->educateGrade : '';
	                $dspecialilze = (string)($space->isNull() == false && $space->commonCaseNote) ? $space->commonCaseNote : $doctor2->doctor->specialize;
	                $dspecialilze = XString::truncate($dspecialilze, 84);
Exemplo n.º 13
0
 private final function load($sql, $bind = array())
 {
     $sql = $this->makeSqlIsolated($sql);
     $rowSet = $this->getDb()->query($sql, $bind);
     if (empty($rowSet)) {
         if (is_callable(array($this->className, 'getNotExistMsg'))) {
             $msg = call_user_func(array($this->className, 'getNotExistMsg'));
         } else {
             $msg = NullEntity::getNotExistMsg();
         }
         return new NullEntity($msg);
     }
     $identityMap = BeanFinder::get('LocalCache');
     $entity = $identityMap->find($this->className, $rowSet[0][$this->getIdColumn()]);
     if (empty($entity)) {
         $entity = $this->row2Object($rowSet[0]);
         $identityMap->update($this->className, $entity->id, $entity);
     }
     return $entity;
 }
 public function ajaxChangeGroup($request, $response)
 {
     /*{{{*/
     $doctorComment = DoctorCommentClient::getInstance()->getDoctorCommentSubClass($request->id);
     if (false == $doctorComment->isNull()) {
         $ticket = DAL::get()->find_waiting_ticket('ticket', $doctorComment);
     } else {
         $ticket = NullEntity::create();
     }
     $contentGroup = DAL::get()->find_by_name('CommentInspectGroup', DoctorCommentInspectRule::GROUP_DOCTORCOMMENT_CONTENT);
     //内容组没有重新审核权限,并且内容组的工单在绑定状态下不能被重新审核
     if ($contentGroup->isIn($this->inspector) || $ticket->isBind() && $ticket->inspectGroupId == $contentGroup->id) {
         $res = false;
         echo json_encode($res);
         return parent::DIRECT_OUTPUT;
     }
     $textGroup = DAL::get()->find_by_name('CommentInspectGroup', DoctorCommentInspectRule::GROUP_DOCTORCOMMENT);
     //设置点评为待审核,更新点评库
     DoctorCommentClient::getInstance()->setInValid($doctorComment);
     $res = InspectClient::getInstance()->getBackTicket($ticket, $textGroup, $this->inspector);
     echo json_encode($res);
     return parent::DIRECT_OUTPUT;
 }
Exemplo n.º 15
0
 public function taskList($request, $response)
 {
     /*{{{*/
     $page = $request->getRequest('page', 1);
     $pageSize = 20;
     $response->buParentGroupList = DAL::get()->find_all_parent('buinspectgroup');
     $response->initialParentGroupList = DAL::get()->find_all_parent('initialinspectgroup');
     $response->saleParentGroupList = DAL::get()->find_all_parent('saleinspectgroup');
     $dto = $this->getTaskDto($request);
     $res = SearchIndexClient::getInstance()->getIntentionTaskList($dto, $page, $pageSize);
     $response->taskDtoList = $res['list'];
     $response->pageInfo = $res['pageInfo'];
     $response->pageLink = $this->getTaskListPageLink($res, $request);
     $response->status = $request->status;
     $response->groupName = $request->groupname;
     $response->groupType = $request->grouptype;
     $response->userName = $request->username;
     $response->mobile = $request->mobile;
     $response->src = $request->tasksrc;
     $response->inspectorName = $request->inspectorname;
     $response->bindTime = $request->bindtime;
     $response->createInspectorName = $request->createinspectorname;
     $curGroup = NullEntity::create();
     $groupName = $request->groupname;
     $groupType = $request->grouptype;
     if (false == empty($groupName) && false == empty($groupType)) {
         $curGroup = DAL::get()->find_by_name_and_type('inspectgroup', $groupName, $groupType);
     }
     $response->curGroup = $curGroup;
 }
Exemplo n.º 16
0
	public function simpleDetail($request, $response)
	{/*{{{*/
		header('Content-Type: text/html; charset=gb2312');
        $spaceId = $request->getRequest('spaceId', 0);
        $response->spaceId = $spaceId;
        $from = $request->getRequest('from', '');

		$idStr = $request->ids;
		$ids = explode(',', $idStr);
		
		$paList = DAL::get()->find('PatientAttachment', $ids);
        $canViewPa = false;
        $anyPa = NullEntity::create();
		foreach($paList as $index => $pa)
		{
			if($pa->isNull() || $pa->isDeleted() && empty($spaceId))
				unset($paList[$index]);
            $anyPa = $pa;
		}
        //医生和患者本人可以看到附件
        if (false == $this->_newUser->isNull() && false == $anyPa->isNull())
        {
            if ($this->_newUser->id == $pa->user->id || $this->_newUser->id === $spaceId)
            {
                $canViewPa = true;
            }
            else if (RequestDelegate::isOfficeIp() && self::isAuditorPage())
            {
                //管理员在公司ip内也可以看到
                $curInspector = DAL::get()->find_by_userid('inspector', $this->_newUser->id); 
                if ($curInspector instanceOf inspector)
                {
                    $canViewPa = true;
                }
            }
        }
        $response->canViewPa = $canViewPa;
		$response->paList = $paList;
        if ($from)
        {
            return "detail4dzone";
        }
        return "default";
	}/*}}}*/
    public function modifyTelOwner($request, $response)
    {/*{{{*/
        $params = $request->vars;
        $options = array(
            'bankName'=>$params['bankName'],
            'bankAccountNo'=>$params['bankAccountNo'],
            'bankUserName'=>$params['bankUserName'],
            'bankMark'=>$params['bankMark'],
        ); 

        $telOwnerId = $request->telOwnerId;
        $patientExt = new NullEntity();
        $optionExts = array();
        if (false == $this->patient->isNull())
        {
            $optionExts = array(
                'phone1'=>$params['phone1'],
                'phone2'=>$params['phone2'],
            );
            if ($patientExt->isNull())
            {
                $patientExtId = TelOwnerClient::getInstance()->createPatientExt($patient, $optionExts);
                $patientExt = DAL::get()->find('telowner', $patientExtId);
            }
        }
        TelOwnerClient::getInstance()->modifyOwner($telOwnerId, $patientExt, $options, $optionExts);
        $response->setRedirect($response->router->urlfor('telpayment/showrefund'));
    }/*}}}*/
Exemplo n.º 18
0
 public function uploadAttachment($request, $response)
 {/*{{{*/
     $source = $request->getRequest('source', self::UPLOAD_SOURCE_MUTI);
     $file = $this->getFile($source);
     $bingLi = NullEntity::create();
     if ($file['error']==0 && $this->user instanceof User)
     {
         $attach = Uploader::file2attach($this->user, $file);
         $patientId = $request->patientId;
         $bingLi = $this->attach2bingli($attach, $patientId);
     }
     $attachIds = explode(",", $request->attachIds);
     $attachIds[] = $bingLi->id;
     if($bingLi->isNull())
     {
         $response->msg = "上传文件失败";
     }
     $response->setRedirect($response->router->urlfor('attach/uploadattach4signin', array('patientId' => $request->patientId, 'spaceId' => $request->spaceId, 'attachIds' => implode(',', $attachIds))));
 }/*}}}*/
Exemplo n.º 19
0
            else
                $space = new NullEntity();
            
            $hfname = $doctor2->hospitalfaculty->hospital->commonName . $doctor2->hospitalfaculty->name;
            $hospitalFacultyUrl = $doctor2->hospitalfaculty->getUrl();
            $dtitle = (string)$doctor2->grade ? '<br />' . $doctor2->grade : '';
            $dgrade = (string)$doctor2->educateGrade ? '<br/>' . $doctor2->educateGrade : '';
            $dspecialilze = (string)($space->isNull() == false && $space->commonCaseNote) ? $space->commonCaseNote : $doctor2->specialize;
            $dspecialilze = XString::truncate($dspecialilze, 84);
			}
			else
			{
				if($doctor2->doctor->hasSpace())
                $space = isset($spaceList[$doctor2->doctor->space->id]) ? $spaceList[$doctor2->doctor->space->id] : new NullEntity();
	            else
	                $space = new NullEntity();
	            
	            $hfname = $doctor2->doctor->hospitalfaculty->hospital->commonName . $doctor2->doctor->hospitalfaculty->name;
                $hospitalFacultyUrl = $doctor2->doctor->hospitalfaculty->getUrl();
	            $dtitle = (string)$doctor2->doctor->grade ? '<br />' . $doctor2->doctor->grade : '';
	            $dgrade = (string)$doctor2->doctor->educateGrade ? '<br/>' . $doctor2->doctor->educateGrade : '';
	            $dspecialilze = (string)($space->isNull() == false && $space->commonCaseNote) ? $space->commonCaseNote : $doctor2->doctor->specialize;
	            $dspecialilze = XString::truncate($dspecialilze, 84);
			}
		?>
		<tr>
			<td>
			<?php if(false == ($doctor2 instanceof Doctor)){?>
                <li><a target="_blank" href="<?=$hpUrl?>/doctor/<?=$doctor2->doctor->getEncodeId() ?>.htm" title="<?=$doctor2->doctor->name?>"><?=$doctor2->doctor->name?></a>
                <?php if ($doctor2->doctor->hasSpace()) { ?>
                    <a href="<?=$doctor2->doctor->space->getUrl()?>" title="<?=$doctor2->doctor->name?>大夫的个人网站" target="_blank">
Exemplo n.º 20
0
    $spacePostCntInfos = SpaceClient::getInstance()->getSpacePostCntInfo($spaceIds);
}
$spaceList = DAL::get()->find('space', $spaceIds);
$flag = 0;
foreach($doctorList2 as $doctor2)
{
	$flag++;
	$trcss = 'active';
    $postCount = 0;
    if($doctor2->hasSpace() && $doctor2->space->user->isNull() == false)
    {
        $space = isset($spaceList[$doctor2->space->user->id]) ? $spaceList[$doctor2->space->user->id] : new NullEntity();
    }
    else
    {
        $space = new NullEntity();
    }	            
    $dtitle = (string)$doctor2->grade? $doctor2->grade : '';
	$dgrade = (string)$doctor2->educateGrade? $doctor2->educateGrade : '';
	if(false == empty($dtitle) && false == empty($dgrade))
	{
		$dtitle .= "/";
	}
    $dspecialilze = (string)($space->isNull() == false && $space->commonCaseNote) ? $space->commonCaseNote : $doctor2->specialize;
    $dspecialilze = XString::truncate($dspecialilze, 84);
    if($space->isNull() == false)
    {
        $spaceUrl = $space->getUrl();
        $postCount = isset($spacePostCntInfos[$space->id]) ? $spacePostCntInfos[$space->id] : 0;
    }
    else
Exemplo n.º 21
0
    public static function getQRCode4PhoneClient($curUser, $nowSpaceUser = '')
    {/*{{{*/
        if(empty($nowSpaceUser))
        {
            $nowSpaceUser = new NullEntity;
        }
        //患者和未登录用户
        if(false == $curUser->hasSpace())
        {
            echo '<script type="text/javascript"  src="http://i1.hdfimg.com/space/js/twodimension.js?20131118"></script>';
        }

        //医生登录
        if($curUser->hasSpace() && false == $nowSpaceUser->isNull() && $curUser->id == $nowSpaceUser->id && false == $curUser->space->hasLoginMobileTerminal() && $curUser->space->isConfirmed())
        {
           //echo '<script type="text/javascript"  src="http://i1.hdfimg.com/space/js/twodimension_doc.js?20131118"></script>';
        }
        //微信医生服务号二维码
        if($curUser->hasSpace() && false == $nowSpaceUser->isNull() && $curUser->id == $nowSpaceUser->id && $curUser->space->isConfirmed())
        {
            $doc_scene = DAL::get()->find_by_spaceid("weixdoctorqrcodescene", $nowSpaceUser->id);
            if(false == $doc_scene->isNull())
            {
                $sceneId = $doc_scene->sceneId;
            }
            else
            {
                $sceneId = WeixClient::getInstance()->queryMaxSceneId(); 
                WeixClient::getInstance()->createDoctorScene($sceneId, $nowSpaceUser->id);
            }
            $ticket = WeixApi::getTicket($sceneId, WeixUser::WEIXINTYPE_SPACE);
            if(false == empty($ticket))
            {
                $codeUrl = 'https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=' . urlencode($ticket);
                echo '<script type="text/javascript"  src="http://i1.hdfimg.com/space/js/twodimension_wxdoc.js?20141105"></script>';
                echo "<script>loadTwoDimension('{$codeUrl}'); scrollx({id: 'two_dimen'}) </script>";
            }
        }

    }/*}}}*/
Exemplo n.º 22
0
    {
        $hospitalIds[] = $dto->treatedHospitalId;
    }
    if($dto->patientAttachmentId)
    {
        $attachmentIds[] = $dto->patientAttachmentId;
    }
}
$hospitals = NodeClient::getInstance()->getHospitalBingLiByIds($hospitalIds);
$attachments = DAL::get()->find('patientAttachment', $attachmentIds);
?>
<?php foreach($patientAttachments as $dto){
    $hospitalOrNull = isset($hospitals[$dto->treatedHospitalId])?$hospitals[$dto->treatedHospitalId]:null; 
    $hospitalName = (!$hospitalOrNull || empty($hospitalOrNull->hospitalName)) ? "未填写" : $hospitalOrNull->hospitalName;
    $facultyName = (!$hospitalOrNull || empty($hospitalOrNull->facultyName)) ? " " : $hospitalOrNull->facultyName;
    $attachmentOrNull = NullEntity::create();
    foreach($attachments as $attachment)
    {
        if($attachment->id == $dto->patientAttachmentId)
        {
            $attachmentOrNull = $attachment;
        }
    }
    if($attachmentOrNull->isNull())
    {
        continue;
    }
    else
    {
        $checkProgram = $attachmentOrNull->itemName;
        $typeDesc = PatientAttachment::$typeList[$attachmentOrNull->type];
Exemplo n.º 23
0
 private function getTelOrderAndTelVisit(Proposal $proposal)
 {/*{{{*/
     $telOrder = current($proposal->getExecutions());
     if (empty($telOrder))
     {
         $telOrder = new NullEntity();
     }
     $telVisit = new NullEntity();
     if (false == $telOrder->isNull())
     {
         $telVisit = DAL::get()->find_by_orderid('TelVisit', $telOrder->id);
     }
     return array($telOrder, $telVisit);
 }/*}}}*/
Exemplo n.º 24
0
    public function healthdiary($request, $response)
    {/*{{{*/
        $user = $this->user;
        $signin = $this->user->getFollowupPatientSignin();
       

        if($signin->isNull() || ($signin->isNull() == false && false == $signin->isOpenFollowup() && $signin->isSuspendedFollowup() == false))
        {
            $response->setRedirect("http://".URL_PREFIX."passport.haodf.com");
        }
            $response->signin = $signin;

              
        //默认不弹出
        $nofirst = $request->getRequest('nofirst', 0);
        $isDisplay = $request->getRequest('isDisplay', 0);
		$success = $request->getRequest('success',0);
        if($signin->isNull() && $signin->isSuspendedFollowup())
        {
            $isDisplay = 0; 
        }
        $response->isDisplay = $isDisplay;
		$response->saveresult = $success;

        $response->lastSpacePosts = DoctorPatientPostClient::getInstance()->getLastSpacePostForPayedUser($signin->space->id,30);
        $response->signin = $signin;

        // 患教课堂部分
        $this->_patientsTech($request, $response);

        $response->ref = DAL::get()->find_by_spaceid_and_patientid('DoctorPatientRef', $signin->space->id, $signin->patient->id);

        $ticketId = $request->ticketId;
        if(empty($ticketId) == false)
        {
            $checkupTicket = DAL::get()->find('checkupticket', $ticketId);
        }
        else
        {
            // 先出临时任务,出定期临时,再出复查任务,只显示正在进行中的任务
            $checkupTickets = CheckupClient::getInstance()->getUserWaitingTickets($this->user->id);
            $checkupTicket = new NullEntity();
            $followupCnt = 0; $cycleTemporaryCnt = 1000; $temporaryCnt = 2000; $customizeCnt = 3000;
            $sortTicketList = array();
            foreach ($checkupTickets as $t) {
                if ($t->task->isFollowupTask()) {
                    $sortTicketList[$followupCnt++] = $t;
                } else if ($t->task->isTemporaryTask()) {
                    $sortTicketList[$temporaryCnt++] = $t;
                } else if ($t->task->isCycleTemporaryTask()) {
                    $sortTicketList[$cycleTemporaryCnt++] = $t;
                } else if ($t->task->isCustomizeTask()){
                    $sortTicketList[$customizeCnt++] = $t;
                }
            }
            if ($temporaryCnt - 2000 > 0) {
                $checkupTicket = $sortTicketList[$temporaryCnt - 1];
            } else if ($cycleTemporaryCnt - 1000 > 0) {
                $checkupTicket = $sortTicketList[$cycleTemporaryCnt - 1];
            } else if ($followupCnt - 0 > 0) {
                $checkupTicket = $sortTicketList[$followupCnt - 1];
            } else if ($customizeCnt - 3000 > 0){
                $checkupTicket = $sortTicketList[$customizeCnt - 1];
            }
        }
        $response->checkupTicket = $checkupTicket;

        $healthProblemList = DAL::get()->find_all_userAllHealth('HealthRecordProblem', $user->id);
        $response->healthProblemList = $healthProblemList;

        $lastDiaryList = HealthDiaryClient::getInstance()->getLastDiarys($user->id, 2);
        $response->lastDiaryList = $lastDiaryList;
        $diaryIds = array_keys($lastDiaryList);
        $abnormalStatus = array();
        if(empty($diaryIds) == false) {
            $abnormalStatus = PatientCaseHistoryClient::getInstance()->getAbnormalStatusByEntityIds($diaryIds);
        }
        $response->abnormalStatus = $abnormalStatus;


        //吃药
        $userCurrentMedicineSchemeList = MedicineClient::getInstance()->getUserCurrentMedicineScheme($user->id); 
        $response->userCurrentMedicineSchemeList = $userCurrentMedicineSchemeList;

        $medicineId_dotime_answer = $this->medicineId_dotime_answer(MedicineClient::getInstance()->getLastSomeDaysCurrentMedicineAnswerList($user->id, 5));
        $response->medicineId_dotime_answer = $medicineId_dotime_answer;

                // 获取复查任务 显示下次复查时间,只查复查的
        $checkupTicketList = CheckupClient::getInstance()->getUserLastFollowupTickets($user->id);
        $nextTask = new NullEntity();
        $nextTaskTime = new NullEntity();
        foreach ($checkupTicketList as $ticket) {
            $nt = CheckupClient::getInstance()->getNextTask($ticket->id);
            $ntt = CheckupClient::getInstance()->getNextTaskTime($ticket->id);
            if ($nt->isNull() == false) {
                if ($nextTask->isNull()
                    || XDateTime::dayDiff($ntt, $nextTaskTime) > 0) {
                        $nextTask = $nt;
                        $nextTaskTime = $ntt;
                    }
            }
        }
        $response->nextTask = $nextTask;
        $response->nextTaskTime = $nextTaskTime;
        $response->noFirst = $nofirst;

        //医生助理其他批注  
        $response->unReadAnnotationList = DAL::get()->find_all_byUserId_hosttype_read('NfsAnnotation', $user->id, array('HealthDiary','DoctorPatientPost'), NfsAnnotation::IS_USER_READ_NO);
    }/*}}}*/
Exemplo n.º 25
0
<?php

if (false == isset($doctorMark)) {
    if (isset($doctorPatientRef)) {
        $doctorMark = DAL::get()->find_by_doctorid('DoctorMark', $doctorPatientRef->space->host->id);
    } else {
        $doctorMark = NullEntity::create();
    }
}
$canCreateDoctorOverPromotionTask = false;
if (isset($doctorPatientRef)) {
    $canCreateDoctorOverPromotionTask = DoctorOverPromotionTask::hasUnfinishedTask($doctorPatientRef->space->host->id) ? false : true;
}
if ($doctorMark->isNull() || false == $doctorMark->isOverPublicize()) {
    ?>
    <input type="button" value="标记过度推广" act='set' id="doctorIsOverPublicize" onclick="showCreateTask(<?php 
    echo $doctorPatientRef->id;
    ?>
, 'DoctorOverPromotionTask')"/>
<?php 
} else {
    ?>
    <input type="button" value="取消过度推广" class="red" act='cancel' id="doctorIsOverPublicize" onclick="modifyDoctorIsOverPublicize(<?php 
    echo $doctorPatientRef->id;
    ?>
, this)"/>
<?php 
}
if ($doctorMark->isNull() || DoctorMark::REPLY_QUALITY_GOOD == $doctorMark->doctorReplyQuality || DoctorMark::REPLY_QUALITY_UNSET == $doctorMark->doctorReplyQuality) {
    ?>
    <input type="button" value="标记回复质量差" quality='<?php 
 private function getPatientCaseandBreadCrumbNavigation($patientCaseId, $patientId)
 {
     /*{{{*/
     $breadcrumbNavigation = true;
     $patientCase = DAL::get()->find('patientcase', $patientCaseId);
     if (false == $patientCase->isNull()) {
         $breadcrumbNavigation = true;
     } else {
         $patient = DAL::get()->find('patient', $patientId);
         DBC::requireFalse($patient->isNull(), '非法参数传入');
         $patientGroups = ForumClient::getInstance()->getGroupListByPatientIdAndSpaceId($patientId, $this->space->id);
         if (true == empty($patientGroups)) {
             $breadcrumbNavigation = false;
             $patientCase = NullEntity::create();
         } else {
             $breadcrumbNavigation = true;
             $doctorOwner = DAL::get()->find_by_sourceid('doctorowner', $this->space->id);
             $patientCaseIds = DAL::get()->queryValidPatientCaseIds('patientcaseref', $patientId, $doctorOwner->id);
             $patientCase = DAL::get()->find('patientcase', end($patientCaseIds));
         }
     }
     $list['patientCase'] = $patientCase;
     $list['breadcrumbNavigation'] = $breadcrumbNavigation;
     return $list;
 }