Exemplo n.º 1
0
    private function _getFlowPostsInfos($posts, $finalId)
    {/*{{{*/
        $postInfos = array();
        foreach($posts as $key => $post)
        {
            $postInfo = array();
            $postInfo['checkupInfo'] = array();
            $postInfo['contentHtml'] = '';
            $postInfo['contentWithTags'] = '';
            $postInfo['title'] = '';
            $postInfo['postContent'] = '';
            if($post instanceof BookingLog)
            {/*{{{*/
                $postInfo['postId'] = $post->id;
                $postInfo['userId'] = '';
                $postInfo['content'] = '预约了您的门诊';
                $postInfo['htmlContent'] = $this->getContentWithHTML($postInfo['content']);
                $postInfo['contentWithTags'] = '预约了您的门诊';
                $postInfo['postTime'] = substr($post->ctime, 0, 16);
                $postInfo['adminComment'] = '';
                $postInfo['latestId'] = $key;
                $postInfo['type'] = 'bookinglog';
                $postInfo['attachmentIds'] = ''; 
                $postInfo['attachments'] = array();
                $postInfo['presentImgUrl'] = ''; 
                $postInfo['isFinal'] = 0;
                if($key == $finalId)
                {
                    $postInfo['isFinal'] = 1;
                }
                $postInfos[] = $postInfo;
            }/*}}}*/
            else if($post instanceof DoctorRadioMessage)
            {/*{{{*/
                $postInfo['postId'] = $post->id;
                $postInfo['userId'] = $post->user->id;
                list($flowTitle, $flowContent) = $post->getFlowContentAndTitle();
                $postInfo['content'] = $flowContent;
                $postInfo['htmlContent'] = $this->getRadioMessageContent($post, $flowContent);
                $postInfo['contentWithTags'] = $flowContent;
                $postInfo['postTime'] = substr($post->ctime, 0, 16);
                $postInfo['adminComment'] = '';
                $postInfo['latestId'] = $key;
                $postInfo['type'] = 'post';
                $postInfo['attachmentIds'] = ''; 
                $postInfo['attachments'] = array();
                $postInfo['presentImgUrl'] = ''; 
                $postInfo['isFinal'] = 0;
                if($key == $finalId)
                {
                    $postInfo['isFinal'] = 1;
                }
                $postInfos[] = $postInfo;
            }/*}}}*/
            else if($post instanceof DoctorComment)
            {/*{{{*/
                $postInfo['postId'] = $post->id;
                $postInfo['userId'] = $post->userId;
                $postInfo['content'] = '给您写了一封感谢信';
                $postInfo['htmlContent'] = $this->getContentWithHTML($postInfo['content']);
                $postInfo['contentWithTags'] = '给您写了一封感谢信';
                $postInfo['postTime'] = substr($post->ctime, 0, 16);
                $postInfo['adminComment'] = '';
                $postInfo['latestId'] = $key;
                $postInfo['type'] = 'doctorComment';
                $postInfo['attachmentIds'] = ''; 
                $postInfo['attachments'] = array();
                $postInfo['presentImgUrl'] = ''; 
                $postInfo['isFinal'] = 0;
                if($key == $finalId)
                {
                    $postInfo['isFinal'] = 1;
                }
                $postInfos[] = $postInfo;
            }/*}}}*/
            else if($post instanceof Post)
            {/*{{{*/
                $postInfo['postId'] = $post->id;
                $postInfo['userId'] = $post->user->id;
                $postInfo['content'] = XString::getContentWithOutHtml($post->content);
                $postInfo['htmlContent'] = $this->getContentWithHTML($post->content, false, $post->thread->space);
                $postInfo['contentWithTags'] = $post->content;
                $postInfo['postTime'] = substr($post->ctime, 0, 16);
                $postInfo['adminComment'] = '';
                $postInfo['latestId'] = $key;
                $postInfo['type'] = 'post';
                $postInfo['presentImgUrl'] = ''; 
                $postInfo['attachmentIds'] = $post->attachmentIds;
                $postInfo['attachments'] = array();
                $attachmentIds = explode(",",$post->attachmentIds);
                foreach($attachmentIds as $attachmentId)
                {
                    if ($attachmentId)
                    {
                        $postInfo['attachments'][] = $this->getAttachmentInfoByAttachId($attachmentId);
                    }
                }

                $postInfo['isFinal'] = 0;
                if($key == $finalId)
                {
                    $postInfo['isFinal'] = 1;
                }
                $postInfos[] = $postInfo;
            }/*}}}*/
            else if($post instanceof Proposal)
            {/*{{{*/
                $postInfo['postId'] = $post->id;
                $postInfo['userId'] = $post->user->id;
                $content = $this->changePostContent($post);
                $postInfo['content'] = XString::getContentWithOutHtml($content);
                $postInfo['htmlContent'] = $this->getContentWithHTML($content, false, $post->getSpace());
                $postInfo['contentWithTags'] = $content;
                $postInfo['postTime'] = substr($post->ctime, 0, 16);
                $postInfo['adminComment'] = '';
                $postInfo['latestId'] = $key;
                $postInfo['type'] = 'proposal';
                $postInfo['attachmentIds'] = ''; 
                $postInfo['presentImgUrl'] = ''; 
                $postInfo['attachmentIds'] = implode($post->attachmentIds,",");
                $postInfo['attachments'] = array();
                foreach($post->attachmentIds as $attachmentId)
                {
                    $postInfo['attachments'][] = $this->getAttachmentInfoByAttachId($attachmentId);
                }

                $postInfo['isFinal'] = 0;
                if($key == $finalId)
                {
                    $postInfo['isFinal'] = 1;
                }
                $postInfos[] = $postInfo;
            }/*}}}*/
            else if(($post instanceof DoctorPatientPost) || $post instanceof ReGroupMember)
            {/*{{{*/
                if($post instanceof Post || $post instanceof DoctorPatientPost)
                {
                    $space = ($post instanceof Post)?$post->thread->space:$post->doctorPatientRef->space;
                    $postInfo['postId'] = $post->id;
                    $postInfo['userId'] = $post->user->id;
                    $pattern = array ( "/<!--[^!]*-->/i", "/&nbsp;/", "/&nbsp/", "/&#160;/", "/&lt;/", "/&gt;/", "/&#60;/", "/&#62;/"); 
                    $replace = array ( "", " ", " ", " ", '#lt;', '#gt;', '#lt;', '#gt;'); 

                    $tmpContent = '';
                    if ($post instanceof DoctorPatientPost) 
                    {
                        $tmpContent = $post->getContent(true, false, false);
                        if (false !== strpos($tmpContent, DoctorPatientPost::SOUND_VER_CONTENT)) 
                        {
                            $tmpContent =  (false !== strpos($_REQUEST['os'], 'android')) ? self::SOUND_NOT_SUPPORT_ANDROID : self::SOUND_NOT_SUPPORT_IOS;
                        }
                    }
                    $oldContent = (false == empty($tmpContent)) ? $tmpContent : $post->content;

                    $content = preg_replace($pattern, $replace, $oldContent); 
                    if($post instanceof DoctorPatientPost && $post->isHavePicture())
                    {
                        $postInfo['content'] = $postInfo['htmlContent'] = $postInfo['contentWithTags']= self::DOCTOR_POST_IMAGE;
                    }
                    else
                    {
                        $postInfo['content'] = XString::getContentWithOutHtml($content);
                        $postInfo['htmlContent'] = $this->getContentWithHTML($oldContent, $post->isSpaceReply(), $space);
                        $postInfo['contentWithTags'] = $oldContent;
                    }
                    $postInfo['postTime'] = substr($post->ctime, 0, 16);
                    $postInfo['adminComment'] = XString::getContentWithOutHtml($post->adminComment);
                    $postInfo['latestId'] = $key;
                    $postInfo['type'] = 'post';
                    $postInfo['attachmentIds'] = implode($post->attachmentIds,",");
                    $postInfo['attachments'] = array();
                    foreach ($post->attachmentIds as $attachmentId)
                    {
                        $postInfo['attachments'][] = $this->getAttachmentInfoByAttachId($attachmentId);
                    }
                    $postInfo['presentImgUrl'] = ''; 
                    $postInfo['isFinal'] = 0;
                    if($key == $finalId)
                    {
                        $postInfo['isFinal'] = 1;
                    }
                    $postInfos[] = $postInfo;
                }
                else if($post instanceof ReGroupMember)
                {
                    $postInfo['postId'] = $post->id;
                    $postInfo['userId'] = $post->user->id;
                    $postInfo['content'] = '加入了您的患有会';
                    $postInfo['htmlContent'] = $this->getContentWithHTML($postInfo['content']);
                    $postInfo['contentWithTags'] = '加入了您的患有会';
                    $postInfo['postTime'] = substr($post->ctime, 0, 16);
                    $postInfo['adminComment'] = '';
                    $postInfo['latestId'] = $key;
                    $postInfo['type'] = 'regroupMember';
                    $postInfo['attachmentIds'] = ''; 
                    $postInfo['attachments'] = array();
                    $postInfo['isFinal'] = 0;
                    if($key == $finalId)
                    {
                        $postInfo['isFinal'] = 1;
                    }
                    $postInfo['presentImgUrl'] = ''; 
                    $postInfos[] = $postInfo;
                }
            }/*}}}*/
            else if($post instanceof TelOrder)
            {/*{{{*/
                $postInfo['postId'] = $post->id;
                $postInfo['userId'] = $post->owner->id;
                $postInfo['content'] = '和您进行了电话咨询';
                $postInfo['htmlContent'] = $this->getContentWithHTML($postInfo['content']);
                $postInfo['contentWithTags'] = '和您进行了电话咨询';
                $postInfo['postTime'] = substr($post->ctime, 0, 16);
                $postInfo['adminComment'] = '';
                $postInfo['latestId'] = $key;
                $postInfo['type'] = 'telOrder';
                $postInfo['attachmentIds'] = ''; 
                $postInfo['attachments'] = array();
                $postInfo['presentImgUrl'] = ''; 
                $postInfo['isFinal'] = 0;
                if($key == $finalId)
                {
                    $postInfo['isFinal'] = 1;
                }
                $postInfos[] = $postInfo;
            }/*}}}*/
            else if($post instanceof TelVisit)
            {/*{{{*/
                $postInfo['postId'] = $post->id;
                $postInfo['userId'] = '';
                if($post->score == TelVisit::SCORE_GOOD && ($post->rank == TelVisit::RANK_TWO || $post->rank == TelVisit::RANK_THREE))
                {
                    $postInfo['content'] = $post->content;
                    $postInfo['contentWithTags'] = $post->content;
                }
                else
                {
                    $postInfo['content'] = '';
                    $postInfo['contentWithTags'] = '';
                }
                $postInfo['htmlContent'] = $this->getContentWithHTML($postInfo['content']);
                $postInfo['postTime'] = substr($post->ctime, 0, 16);
                $postInfo['adminComment'] = '';
                $postInfo['latestId'] = $key;
                $postInfo['type'] = 'telVisit';
                $postInfo['attachmentIds'] = ''; 
                $postInfo['attachments'] = array();
                $postInfo['presentImgUrl'] = ''; 
                $postInfo['isFinal'] = 0;
                if($key == $finalId)
                {
                    $postInfo['isFinal'] = 1;
                }
                if($postInfo['content'] !='')
                {
                    $postInfos[] = $postInfo;
                }
            }/*}}}*/
            else if($post instanceof PresentOrder)
            {/*{{{*/
                $postInfo['postId'] = $post->id;
                $postInfo['userId'] = $post->user->id;
                $postInfo['content'] = '赠送给您"'.$post->present->name.'"心意礼物';
                $postInfo['htmlContent'] = $this->getContentWithHTML($postInfo['content']);
                $postInfo['contentWithTags'] = '赠送给您"'.$post->present->name.'"心意礼物';
                $postInfo['postTime'] = substr($post->getSourceCtime4Flow(), 0, 16);
                $postInfo['adminComment'] = '';
                $postInfo['latestId'] = $key;
                $postInfo['type'] = 'presentOrder';
                $postInfo['attachmentIds'] = ''; 
                $postInfo['attachments'] = array();
                $tmp['thumbnailUrl'] = $post->present->getMiddleImage();
                $tmp['attachmentType'] = 'presentorder';
                $tmp['canClick'] = 0;
                $postInfo['attachments'][0] = $tmp;
                $postInfo['presentImgUrl'] = $post->present->getMiddleImage(); 
                $postInfo['isFinal'] = 0;
                if($key == $finalId)
                {
                    $postInfo['isFinal'] = 1;
                }
                $postInfos[] = $postInfo;
            }/*}}}*/
            else if($post instanceof PatientSignin || $post instanceof PatientApply)//诊后报到
            {/*{{{*/
                $postInfo['postId'] = $post->id;
                $postInfo['userId'] = $post->user->id;
                $postInfo['content'] = '诊后报到成功';
                $postInfo['htmlContent'] = $this->getContentWithHTML($postInfo['content']);
                $postInfo['contentWithTags'] = '诊后报到成功';
                $postInfo['postTime'] = substr($post->getSourceCtime4Flow(), 0, 16);
                $postInfo['adminComment'] = '';
                $postInfo['latestId'] = $key;
                $postInfo['type'] = 'patientSignin';
                $postInfo['attachmentIds'] = implode($post->attachmentIds,",");
                $postInfo['attachments'] = array();
                $postInfo['presentImgUrl'] = ''; 
                $postInfo['isFinal'] = 0;
                if($key == $finalId)
                {
                    $postInfo['isFinal'] = 1;
                }
                $postInfos[] = $postInfo;
            }        /*}}}*/
            else if($post instanceof FollowupOwner)//随访老患者报道
            {/*{{{*/
                $postInfo['postId'] = $post->id;
                $postInfo['userId'] = $post->user->id;
                $patient = $post->patient;
                $patientName = $patient->getPatientName4Mobile();
                $hospitalCaseNO = $post->hospitalCaseNO;
                if($hospitalCaseNO != "")
                {
                    $patientName .= "(".$hospitalCaseNO.")";
                }
                $postInfo['content'] = $patientName."成功报到为您的随访老患者。";
                $postInfo['htmlContent'] = $this->getContentWithHTML($postInfo['content']);
                $postInfo['postTime'] = substr($post->getSourceCtime4Flow(), 0, 16);
                $postInfo['adminComment'] = '';
                $postInfo['latestId'] = $key;
                $postInfo['type'] = 'followupowner';
                $postInfo['attachmentIds'] = implode($post->attachmentIds,",");
                $postInfo['attachments'] = array();
                $postInfo['presentImgUrl'] = ''; 
                $postInfo['isFinal'] = 0;
                if($key == $finalId)
                {
                    $postInfo['isFinal'] = 1;
                }
                $postInfos[] = $postInfo;
            }/*}}}*/
            else if($post instanceof AnswerNaire)//复查报告, 应该是不会再有这种情况了
            {/*{{{*/
                $postInfo['postId'] = $post->id;
                $postInfo['userId'] = $post->user->id;
                $naireTplDisplay = $post->questionNaire->questionNaireTpl;
                $postInfo['checkupInfo']['title'] = '患者: '.$post->user->realName.'('.$post->user->name.') 于'.$post->ctime->toShortString().'完成了'.$naireTplDisplay->getDisplayName().', 并填写了复查结果';
                $postInfo['content'] = '';
                $postInfo['htmlContent'] = $this->getContentWithHTML($postInfo['content']);
                $postInfo['postTime'] = substr($post->getSourceCtime4Flow(), 0, 16);
                $postInfo['adminComment'] = $post->isNormal()?'一切正常':'请您查看患者检查结果,如果需要处理,请及时给予患者合理指导。';
                $postInfo['latestId'] = $key;
                $postInfo['type'] = 'answernaire';
                $postInfo['attachmentIds'] = implode($post->attachmentIds,",");
                $postInfo['attachments'] = array();
                $postInfo['presentImgUrl'] = ''; 
                $postInfo['isFinal'] = 0;
                if($key == $finalId)
                {
                    $postInfo['isFinal'] = 1;
                }
                $checkupInfos = $this->_getCheckupInfo($post);
                $postInfo['checkupInfo']['infos'] = $checkupInfos;
             //   if($post->id == '617162454')
             //   {
             //       die(var_dump($postInfo['checkupInfo']['infos']));
             //   }
                $postInfos[] = $postInfo;
            }/*}}}*/
            else if($post instanceof FollowupPost)//新版复查报告
            {/*{{{*/
                $postInfo['postId'] = $post->id;
                $postInfo['userId'] = $post->followupOwner->user->id;
                $postInfo['checkupInfo']['title'] = '患者: '.$post->followupOwner->patient->name.'('.$post->followupOwner->user->name.') 于'.$post->ctime->toShortString().'完成了---复查报告结果';
                $postInfo['content'] = $post->content;
                $postInfo['htmlContent'] = $this->getContentWithHTML($postInfo['content']);
                $postInfo['postTime'] = substr($post->getSourceCtime4Flow(), 0, 16);
                $postInfo['adminComment'] = '请您查看患者检查结果,如果需要处理,请及时给予患者合理指导。';
                $postInfo['latestId'] = $key;
                $postInfo['type'] = 'followuppost';
                $postInfo['attachmentIds'] = implode($post->attachmentIds,",");
                $postInfo['attachments'] = array();
                foreach ($post->attachmentIds as $attachmentId)
                {
                    $postInfo['attachments'][] = $this->getAttachmentInfoByAttachId($attachmentId);
                }
                $postInfo['presentImgUrl'] = ''; 
                $postInfo['isFinal'] = 0;
                if($key == $finalId)
                {
                    $postInfo['isFinal'] = 1;
                }
                $checkupInfos = $this->_getFollowupPost($post);
                $postInfo['checkupInfo']['infos'] = $checkupInfos;
                $postInfos[] = $postInfo;
            }/*}}}*/
            else if($post instanceof HealthDiary)//健康日记
            {/*{{{*/
                $postInfo['postId'] = $post->id;
                $postInfo['userId'] = $post->user->id;
                $patientName = $post->user->name;
                $postInfo['content'] = "";
                $postInfo['htmlContent'] = $this->getContentWithHTML($postInfo['content']);
                $postInfo['contentHtml'] = $this->_getHealthDiaryHtml($post);
                $postInfo['postTime'] = substr($post->getSourceCtime4Flow(), 0, 16);
                $postInfo['adminComment'] = '';
                $postInfo['latestId'] = $key;
                $postInfo['type'] = 'healthdiary';
                $postInfo['attachmentIds'] = '';
                $postInfo['attachments'] = array();
                $postInfo['presentImgUrl'] = ''; 
                $postInfo['isFinal'] = 0;
                if($key == $finalId)
                {
                    $postInfo['isFinal'] = 1;
                }
                $postInfos[] = $postInfo;
            }/*}}}*/
            else if ($post instanceof ServiceCard)
            {/*{{{*/
                if (false == isset($chargeProduct) || false == isset($freeProduct)) 
                {
                    $chargeProduct = ProductClient::getInstance()->getDoctorChargeFlowProduct($post->space);
                    $freeProduct = ProductClient::getInstance()->getDoctorFreeFlowProduct($post->space);
                }
                if ($post->ware->product->id == $chargeProduct->id) 
                { 
                    $postInfo['postId'] = $post->id;
                    $postInfo['userId'] = $post->user->id;
                    $postInfo['content'] = '患者'.$post->user->name.'购买了'.$post->space->host->name.'大夫 '.$post->ware->product->amount.' 次咨询服务';
                    $postInfo['htmlContent'] = $this->getContentWithHTML($postInfo['content']);
                    $postInfo['contentWithTags'] = $postInfo['content'];
                    $postInfo['postTime'] = substr($post->ctime, 0, 16);
                    $postInfo['adminComment'] = '';
                    $postInfo['latestId'] = $key;
                    $postInfo['type'] = 'post';
                    $postInfo['presentImgUrl'] = ''; 
                    $postInfo['attachmentIds'] = '';
                    $postInfo['attachments'] = array();
                    $postInfo['isFinal'] = 0;
                    if($key == $finalId)
                    {
                        $postInfo['isFinal'] = 1;
                    }
                }
                else if ($post->ware->product->id == $freeProduct->id) 
                { 
                    $postInfo['postId'] = $post->id;
                    $postInfo['userId'] = $post->space->id;
                    $postInfo['content'] = $post->space->host->name.'大夫免费增加了患者'.$post->user->name." ".$post->ware->product->amount.' 次咨询服务';
                    $postInfo['htmlContent'] = $this->getContentWithHTML($postInfo['content']);
                    $postInfo['contentWithTags'] = $postInfo['content'];
                    $postInfo['postTime'] = substr($post->ctime, 0, 16);
                    $postInfo['adminComment'] = '';
                    $postInfo['latestId'] = $key;
                    $postInfo['type'] = 'post';
                    $postInfo['presentImgUrl'] = ''; 
                    $postInfo['attachmentIds'] = '';
                    $postInfo['attachments'] = array();
                    $postInfo['isFinal'] = 0;
                    if($key == $finalId)
                    {
                        $postInfo['isFinal'] = 1;
                    }
                }
                $postInfos[] = $postInfo;
            }/*}}}*/
        }
        return $postInfos;
    }/*}}}*/
Exemplo n.º 2
0
    ?>
", "<?php 
    echo implode(',', $attachmentIds);
    ?>
", "<?php 
    echo $space->id;
    ?>
");</script>
    <?php 
}
if ($flow->isNull() == false && $flow->adminComment) {
    ?>
                        <div class="pt5 pb20 pl15 pr15 bg_b1 lh180 gray2 adminComment">
                            <p class="s_hint">好大夫在线友情提示:</p>
                                <?php 
    echo XString::getContentWithOutHtml($flow->adminComment);
    ?>
                        </div>
    <?php 
}
?>
            </div>
            <div class="hz_advise_bottom"></div>
            <p class="pt10 pb5 gray3"><?php 
echo $flow->user->privateName;
?>
发表于 <?php 
echo $flow->ctime->toString();
if (false == $user->isNull() && $flow->user->id != $user->id) {
    include dirname(__FILE__) . '/_complaint.php';
}
 private function getArticleIntroDetail($article, $supportHtml="1")                        
 {/*{{{*/                                                                                                                          
     $supportHtml="1";
     $supportHtml = ($supportHtml === null) ? '0' : $supportHtml;                                                                  
     $htmlStr = "";
     if($supportHtml > 0)                                                                                                          
     {                                                                                                                             
         $type = 'article';                                                                                                        
         ob_start();                                                                                                               
         include(dirname(__FILE__).'/../../templates/doctor/article.php');                                            
         $htmlStr = ob_get_contents();                                                                                             
         error_log(print_r($htmlStr,true), 3, '/tmp/myerror.log');
         ob_end_clean();                                                                                                                                                                  }                                                                                                                             
     else                                                                                                                          
     {                                                                                                                     
         $htmlStr = XString::getContentWithOutHtml($article->content);                                                       
     }                                                                                                                             
     $info['article'] = $htmlStr;
     $this->content = $info;
 }/*}}}*/
Exemplo n.º 4
0
 public function getPhoneCallContractListByDoctorId($doctorId)
 {/*{{{*/
     $doctor = DAL::get()->find('doctor', $doctorId);
     if ($doctor->isNull())
     {
         $this->setErrorCode(119);
         return 0;
     }
     if ($doctor->space->isNull())
     {
         $this->setErrorCode(300);
         return 0;
     }
     $productList = ProductClient::getInstance()->getProducts($doctor->space, array(serviceDef::TYPE_TELORDER));;
     if (empty($productList))
     {
         $this->setErrorCode(300);
         return 0;
     }
     $infos = array();
     foreach($productList as $product)
     {
         $info['id'] = $product->id;
         $info['time'] = $product->duration;
         $info['price'] = $product->salePrice;
         $info['serviceTitle'] = XString::getContentWithOutHtml($product->name);
         $info['name'] = "";
         $infos[] = $info;
     }
     $this->content = $infos;
 }/*}}}*/
    /**
     * getBookingOrder 医生查看订单详情
     * @exampleUrl http://dev.mobile-api.haodf.com/doctorapi/bookingorder_getbookingorder?userId=105133781&bookingOrderId=1518927615&xdebug=1 
     * @param mixed $userId 
     * @param mixed $bookingOrderId 
     * @access public
     * @return void
     */
    public function getBookingOrder($userId, $bookingOrderId)
    {/*{{{*/
        $goals = array(1=>"检查/诊断", 2=>"治疗/手术", 3=>"检查/诊断 治疗/手术", 4=>"复诊", 5=>"检查/诊断 复诊", 
            6=>"治疗/手术 复诊", 7=>"检查/诊断 治疗/手术 复诊");

        $space = DAL::get()->find('space', $userId);
        if($space->isNull())
        {
            $this->setErrorCode(328);
            return 0;
        }
        $bookingOrder = DAL::get()->find('bookingorder', $bookingOrderId, true);
        if ($bookingOrder->isNull())
        {
            $this->setErrorCode(158);
            return 0;
        }
        if($bookingOrder->space->id != $userId)
        {
            $this->setErrorCode(159);
            return 0;
        }
        $flow = DAL::get()->find_by_patientid_and_spaceid('DoctorPatientRef', $bookingOrder->patient->id, $bookingOrder->space->id);
        $attachmentIds = BingLiDtoHelper::create($bookingOrder->getBingLiSource())->patientAttachment->makeArray()->patientAttachmentId;
        $result = array();
        $result['id'] = $bookingOrder->id;
        $result['schedule'] = date('Y-m-d H:i',strtotime($bookingOrder->schedule->toString()));
        $patient = $bookingOrder->patient;
        $result += $this->getBookingOrderPatientMessage($patient);
        $result += $this->getBingliDetail($bookingOrder->getBingLiSource()->id, get_class($bookingOrder->getBingLiSource()));
        $result['time'] = $bookingOrder->schedule; 
        $result['address'] = $bookingOrder->getAddressFromBusinessRequireIfNone(); 
        $helper = BingLiDtoHelper::create($bookingOrder->getBingLiSource());
        $result['disease'] = $helper->getDiseasesStr();
        $result['treatmentStatus'] = $helper->getLastUserCategory();//是否得到过该医生的诊治1是,0否
        $result['purpose'] = isset($goals[$helper->getLastGoal()]) ? $goals[$helper->getLastGoal()] : '';//本次预约的目的 1诊察/诊断  2治疗/手术  3复诊
        $result['lastTreatmentTitle'] = $helper->getLastUserCategoryDescription();//上次在大夫处就诊时间,最后一次就诊医院 两种情况
        $lastTreatmentInfo = str_replace("&#8226;", "", $helper->getLastHospitalOrLastTreatedTime());
        $result['lastTreatmentInfo'] = $lastTreatmentInfo;
        $result['recentTreatment'] = XString::getContentWithOutHtml($helper->getLastConditionDesc()); //病情描述
        $result['status'] = $this->getBookingOrderStatus($bookingOrder);
        $result['buttonstatus'] = $this->getBookingOrderStatus4Doctor($bookingOrder);
        $result['flowtitle'] = '';
        $result['flowId'] = '';
        if(false == empty($attachmentIds))
        {
            foreach($attachmentIds as $attachmentId)
            {
                $result['attachments'][] = MainDataBucket::getAttachmentInfoByAttachId($attachmentId);
            }
        }
        if(false == isset($result['attachments']))
        {
            $result['attachments'] = array();
        }
        if(false == $flow->isNull())
        {
            $result['flowtitle'] = $flow->title;
            $result['flowId'] = $flow->id;
            $result['userId'] = $flow->space->user->id;
            $result['patientId'] = $flow->patient->id;
        }

        $this->content = $result;
    }/*}}}*/
Exemplo n.º 6
0
 private function _getDoctorCommentInfo($comment)
 {/*{{{*/
     $commentInfo = array();
     if(false == $comment->isNull())
     {
         $commentInfo['id'] = $comment->id;
         $commentInfo['patient'] = $comment->displayNameByMask();
         $commentInfo['time'] = date('Y-m-d H:i', $comment->ctime->getTime());
         $commentInfo['tag'] = $comment->tag;
         $commentInfo['effect'] = $comment->skill == '-2' ? '' : $comment->getSkillStr();
         $commentInfo['attitude'] = $comment->attitude == '-2' ? '' : $comment->getAttitudeStr();
         $commentInfo['doctorName'] = $comment->doctor->name;
         $commentInfo['remedyMethod'] = $comment->remedy;
         $commentInfo['content'] = XString::getContentWithOutHtml($comment->content);
         $commentInfo['adminComment'] = XString::getContentWithOutHtml($comment->adminComment);
         $commentInfo['agreeCount'] = (int)($comment->agree);
         $commentInfo['postCount'] = (int)($comment->postCount);
         if($comment->isCureThankLetter())
         {
             $commentInfo['type'] = self::TYPE_THANKLETTER;
         }
         else if($comment->isCureExp())
         {
             $commentInfo['type'] = self::TYPE_PROCESS;
         }
     }
     return $commentInfo;
 }/*}}}*/
Exemplo n.º 7
0
    foreach($telTaskList as $tTask)
    {
        $i++;
?>
    <tr class="<?=($i%2==1)?'gray':''?>">
    <td><?=$i?></td>
    <td><?=$tTask->ctime->toStringByFormat("m-d H:i:s")?></br>
    <span class="gray2" title="分配时间"><?=$tTask->effectiveTime->isZero()?'':$tTask->effectiveTime->toStringByFormat("m-d H:i:s")?>
    </span>
    </td>
        <?php if($isForLeader || $isForMember) { ?>
            <td><?=$tTask->nextContactTime->isZero() == false  ? $tTask->nextContactTime->toStringByFormat("m-d H:i:s") : "-" ?></td>
        <?php }else{ ?>
            <td><?=$tTask->utime->isZero() == false ? $tTask->utime->toStringByFormat("m-d H:i:s") : "-" ?></td>
        <?php } ?>
    <td><a href="<?=$router->urlfor('teltask/showteltask',array('taskid'=>$tTask->id))?>" target="taskright" title="<?=XString::getContentWithOutHtml($tTask->executerDesc)?>"><?=$tTask->id?></a></td>
    <td><?=$tTask->getTaskTypeTitle()?><br/><span class="green"><?=$tTask->getProfessionalGroupTitle()?></span></td>
    <?php if($isForAllListItem == false) { ?>
        <td><a href="<?=$router->urlfor('teltask/teltasklist',array_merge($defaultArray,array('telNo'=>$tTask->telNo,'exeUserName'=>$tTask->executerUser->name)))?>"><?=$tTask->telNo?></a>
        <span style="color:red;">(<?=$tTask->queryCntByTelNoAndSaler($tTask->executerUser->id)?>)</span>
        </td>
        <td><a href="<?=$router->urlfor('teltask/teltasklist',array_merge($defaultArray,array('userName'=>$tTask->getTelOrder()->patient->user->name,'exeUserName'=>$tTask->executerUser->name)))?>"><?=$tTask->getTelOrder()->patient->user->name?></a></td>
    <?php }else{ ?>
        <td><a href="<?=$router->urlfor('teltask/teltasklist',array_merge($defaultArray,array('telNo'=>$tTask->telNo)))?>"><?=$tTask->telNo?></a></td>
        <td><a href="<?=$router->urlfor('teltask/teltasklist',array_merge($defaultArray,array('userName'=>$tTask->getTelOrder()->patient->user->name)))?>"><?=$tTask->getTelOrder()->patient->user->name?></a></td>
    <?php } ?>
    <?php if($isForAllListItem) { ?>
    <td>
        <?php if($tTask->executerUser->isNullSpace() == false) { ?>
        <a href="<?=$router->urlfor('teltask/teltasklist',array_merge($defaultArray,array('exeUserName'=>$tTask->executerUser->name)))?>"><?=$tTask->executerUser->name?></a>
        <?php } ?>
Exemplo n.º 8
0
 public function getBookingOrderByDoctorId($doctorId, $bookingOrderId)
 {/*{{{*/
     $paperstypes = array(0 => "身份证", 1=>"护照", 2=>"军人证", 3=>"台胞证", 4=>"港澳居民内地通行证");
     $sexs = array(0=>"女", 1=>"男");
     $goals = array(1=>"检查/诊断", 2=>"治疗/手术", 3=>"检查/诊断 治疗/手术", 4=>"复诊", 5=>"检查/诊断 复诊", 6=>"治疗/手术 复诊", 7=>"检查/诊断 治疗/手术 复诊");
     $doctor = DAL::get()->find('doctor', $doctorId);
     $res = $this->checkDoctorAndSpace($doctor);
     if($res)
     {
         $this->setErrorCode($res);
         return 0;
     }
     $bookingOrder = DAL::get()->find('bookingorder', $bookingOrderId);
     if ($bookingOrder->isNull())
     {
         $this->setErrorCode(158);
         return 0;
     }
     if($bookingOrder->space->host->id != $doctorId)
     {
         $this->setErrorCode(159);
         return 0;
     }
     $result = array();
     $result['id'] = $bookingOrder->id;
     $result['schedule'] = strtotime($bookingOrder->schedule);
     $result['address'] = $bookingOrder->address;
     $patient = $bookingOrder->patient;
     $result['patientName'] = $patient->name;
     $result['age'] = $patient->age == '' ? 0 : $patient->age;
     $result['birthday'] = XDateTime::isDate($patient->birthday) == false ? 0 : $patient->birthday;
     $result['sex'] = $sexs[$patient->sex];
     $result['idType'] = $paperstypes[$patient->paperstype];
     $result['idNumber'] = $patient->idcard;
     $result['province'] = $patient->province.$patient->city;
     if($patient->province == $patient->city)
     {
         $result['province'] = $patient->province;
     }
     $helper = BingLiDtoHelper::create($bookingOrder->getBingLiSource());
     $result['disease'] = $helper->getDiseasesStr();
     $result['treatmentStatus'] = $helper->getLastUserCategory();//是否得到过该医生的诊治1是,0否
     $result['purpose'] = $goals[$helper->getLastGoal()];//本次预约的目的 1诊察/诊断  2治疗/手术  3复诊
     $result['lastTreatmentTitle'] = $helper->getLastUserCategoryDescription();//上次在大夫处就诊时间,最后一次就诊医院 两种情况
     $result['lastTreatmentInfo'] = $helper->getLastHospitalOrLastTreatedTime();
     $result['recentTreatment'] = XString::getContentWithOutHtml($helper->getLastConditionDesc());
     $result['status'] = $this->getBookingOrderStatus4Doctor($bookingOrder);
     $result['canConfirm'] = 0;
     if (BookingOrder::STATUS_AUDIT == $bookingOrder->status && !$bookingOrder->isOverdue()) 
     {
         $result['canConfirm'] = 1;
     }
     $result['canDeny'] = 0;
     if (BookingOrder::STATUS_AUDIT == $bookingOrder->status)
     {
         $result['canDeny'] = 1;
     }
     $result['canFinish'] = 0;
     if (BookingOrder::STATUS_FINISHED == $bookingOrder->status) 
     {
         $result['canFinish'] = 1;
     }
     $this->content = $result;
 }/*}}}*/
Exemplo n.º 9
0
 /**
  * getProductList 取电话咨询产品列表 
  * 
  * @param mixed $userId 
  * @access public
  * @return void
  */
 public function getProductList($userId)
 {/*{{{*/
     $space = DAL::get()->find('space', $userId);
     $telOwner = DAL::get()->find_by_relatedObject('telowner', $space->user);
     $productApplyList = $productList = $res = $sortList = array();
     if($telOwner->isNull() == false)
     {
         $productApplyList =DAL::get()->find_all_by_spaceid_and_status_and_servicedef('ProductApply', $space->id, ProductApply::STATUS_INIT, ServiceDef::TYPE_TELORDER);
         $contract = DAL::get()->find_by_spaceid_and_type_and_status('contract', $space->id, ServiceDef::TYPE_TELORDER, Contract::STATUS_VALID);
         if ($contract instanceof Contract)
         {
             $productList = DAL::get()->find_all_by_contractid_and_status("Product", $contract->id, Product::STATUS_VALID);
         }
     }
     foreach($productApplyList as $productApply)
     {
         $out['utime'] = strtotime($productApply->utime);
         $out['id'] = $productApply->id;
         $out['name'] = '';
         $out['price'] = intval($productApply->price);
         $out['time'] = $productApply->duration;
         $out['status'] = 0;
         $out['remark'] = XString::getContentWithOutHtml($productApply->spaceRemark); 
         $res[] = $out;
         $sortList[] = $out['utime'];
     }
     $out = array();
     foreach($productList as $product)
     {
         $out['utime'] = strtotime($product->utime);
         $out['id'] = $product->id;
         $out['name'] = XString::getContentWithOutHtml($product->name);
         $out['price'] = intval($product->salePrice);
         $out['time'] = $product->duration;
         $out['status'] = 1;
         $out['remark'] = XString::getContentWithOutHtml($product->remark); 
         $res[] = $out;
         $sortList[] = $out['utime'];
     }
     array_multisort($sortList, SORT_DESC, $res);
     $res = $this->sortProductList($res);
     $this->content = $res;
     return $res;
 }/*}}}*/
Exemplo n.º 10
0
 private function _getFlowPostInfos($post, $key, $finalId) 
 {/*{{{*/
     $space = ($post instanceof Post)?$post->thread->space:$post->doctorPatientRef->space;
     $postInfo['postId'] = $post->id;
     $postInfo['title'] = '';
     $postInfo['userId'] = $post->user->id;
     $pattern = array ( "/<!--[^!]*-->/i", "/&nbsp;/", "/&nbsp/", "/&#160;/", "/&lt;/", "/&gt;/", "/&#60;/", "/&#62;/"); 
     $replace = array ( "", " ", " ", " ", '#lt;', '#gt;', '#lt;', '#gt;'); 
     $content = preg_replace($pattern, $replace, $post->content); 
     $request = new Request(); 
     $postInfo['content'] = $this->_getDoctorpatientpost(XString::getContentWithOutHtml($content));
     $postInfo['postTime'] = substr($post->ctime, 0, 16);
     $postInfo['contentTime'] = $post->getSoundPostTime();
     $postInfo['adminComment'] = $this->_getAdminComment(XString::getContentWithOutHtml($post->adminComment));
     $postInfo['latestId'] = $key;
     $postInfo['type'] = 'post';
     if($post->isHavePicture() && $post->isSpaceReply())
     {
         list($postAttachmentIds, $postPictureInfo) =  $this->getPicturePost($post);
         $postInfo['attachmentIds'] = $postAttachmentIds;
         $postInfo += $postPictureInfo;
     }
     else
     {
         $postInfo['attachmentIds'] = implode(array_filter($post->attachmentIds), ",");
         foreach ($post->attachmentIds as $attachmentId)
         {
             if($attachmentId)
             {
                 $postInfo['attachments'][] = MainDataBucket::getAttachmentInfoByAttachId($attachmentId);
             }
         }
     }
     if(false == isset($postInfo['attachments']))
     {
         $postInfo['attachments'] = array();
     }
     $postInfo['presentImgUrl'] = ''; 
     $postInfo['isFinal'] = 0;
     $postInfo['detailContent'] = '';
     if($key == $finalId)
     {
         $postInfo['isFinal'] = 1;
     }
     return $postInfo;
 }/*}}}*/
Exemplo n.º 11
0
    </div>
    <div class="h_mz_checkdoctor2"><span>加号状态:</span><?php include_once('proposal/_bookingstatus.php')?></div>
    <div class="h_mz_checkdoctor2"><span>加号时间:</span><?=$bookingDto->getRealBookingTime()?></div>
     <? } ?>

    <?php if($proposal->isFromThread() && $proposal->threadStatusDesc() != ''){ ?>
    <div class="h_mz_checkdoctor2"><span>服务状态:<?=$proposal->threadStatusDesc()?></span><?php ?></div>
     <? } ?>


    <?php if($proposal->hasSpace()){ ?>
    <div class="h_mz_checkdoctor2"><span>请求医生:</span><?=$proposal->space->realName?>(<?=$proposal->space->host->getHospitalName()?>/<?=$proposal->space->host->getHospitalFacultyName()?>)</div>
     <? } ?>

     <?php if($proposal->getAdminComment() != "") {?>
     <div class="h_mz_checkdoctor2"><span>管理员提示:</span><?=XString::getContentWithOutHtml($proposal->getAdminComment())?></div>
     <?php } ?>

        <ul class="h_mz_xq_bot">
        <!--患者信息 start-->
        <?php include('binglidetail/_patient.php');?>
        <!--患者信息 end-->


        <!--病例内容 start-->
        <?php include('binglidetail/_allbingli.php');?>
        <!--病例内容 start-->
        </ul>

</div>
        <!--附件信息 start-->
Exemplo n.º 12
0
 private function getCommonArticleInfos($articleList)
 {/*{{{*/
     $infos = array();
     foreach($articleList as $article)
     {
         if (trim(strip_tags($article->content)) == '')
         {
             continue;
         }
         $info = array();
         $info['articleId'] = $article->id;
         $info['doctorId'] = '';
         $info['logoUrl'] = '';
         if(!empty($article->space) && $article->space->host instanceof Doctor)
         {
             $info['doctorId'] = $article->space->host->id;
             $doctor = $article->space->host;
             $info['logoUrl'] = $doctor->getHeadImageForMobile();
         }
         $info['title'] = $article->title;
         $info['ctime'] = XDateTime::printTime4Touch($article->ctime->getTime(), 'Y-m-d');
         $info['readCount'] = $this->getHits($article);
         $info['intro'] = trim(mb_substr(XString::getContentWithOutHtml($article->content), 0, 90, 'gbk'));
         $infos[] = $info;
     }
     return $infos;
 }/*}}}*/