public function saveLinkPhone($request, $response) { /*{{{*/ if ($this->curInspector->user == null || $this->curInspector->user->isNull() || !in_array($this->curInspector->user->name, FollowupAuditor::$linkPhoneAuditors)) { die("<font color='color'>你没有权限编辑!</font>"); } $saveType = $request->saveType; $vars = $request->vars; $customerId = $request->customerId; $linkPhoneId = ''; if ("add" == $saveType) { $linkPhoneId = LinkPhoneClient::getInstance()->addLinkPhone($vars, $customerId, $this->auditor); } else { if ("edit" == $saveType) { $linkPhoneId = $request->linkPhoneId; LinkPhoneClient::getInstance()->updateLinkPhone($linkPhoneId, $vars, $customerId, $this->auditor); } } // 给患者设置默认/决策电话 $fields['defaultCallPhone'] = $request->getRequest('defaultCallPhone', 0); $fields['defaultMessagePhone'] = $request->getRequest('defaultMessagePhone', 0); $fields['decisionPhone'] = $request->getRequest('decisionPhone', 0); FollowupClient::getInstance()->updatePhones($customerId, $linkPhoneId, $fields); $url = $response->router->urlfor('linkphone/editphone', array('linkPhoneId' => $linkPhoneId, 'saveType' => 'edit', 'saveMsg' => '保存成功!')); $response->setRedirect($url); }
public function before($context) {/*{{{*/ $user = $context->response->user; if ($user->isNull() || false == FollowupClient::getInstance()->userIsAssistant($user)) { die("<font color='color'>你没有权限访问!</font>"); } }/*}}}*/
public function before($context) {/*{{{*/ $context->response->newUser = $context->response->user; $isAssistant = false; if(false == $context->response->user->isNull()) { $isAssistant = FollowupClient::getInstance()->userIsAssistant($context->response->user); } $context->response->isAssistant = $isAssistant; }/*}}}*/
public function showPatientDiseaseInfo($request, $response) {/*{{{*/ $refId = $request->refid; $doctorPatientRef = DAL::get()->find('DoctorPatientRef', $refId); $followupOwner = $doctorPatientRef->user->getFollowupPatientSignin(); $response->followupOwner = $followupOwner; //获取初始信息 $categoryIds = $followupOwner->getNfsDisease()->getInitialInfoCategoryIds(); $categoryList = DAL::get()->find('HealthRecordProblemCategory', $categoryIds); $response->categoryList = $categoryList; //用药信息 $medicineSchemeList = MedicineClient::getInstance()->getUserCurrentMedicineScheme($followupOwner->user->id); $response->medicineSchemeList = $medicineSchemeList; $response->diseaseName_questionContent_answerContent = FollowupClient::getInstance()->getDiseaseInfo($followupOwner->user); }/*}}}*/
private function getPatientSigninCount($isCurrent = false) { /*{{{*/ $arrayResult = array(); $arrOption = array(); $arrOption['ownertype'] = 'FollowupOwner'; $arrayResult['auditPatientSigninCount'] = FollowupClient::getInstance()->getWaitingTicketsCountByAuditorId(0, $arrOption); //0为未捡取 if ($isCurrent) { $arrayResult['auditFlowCount'] = $arrayResult['auditPatientSigninCount']; $arrayResult['myAuditFlowCount'] = FollowupClient::getInstance()->getWaitingTicketsCountByAuditorId($this->auditor->id, $arrOption); $arrayResult['allAuditFlowCount'] = FollowupClient::getInstance()->getWaitingTicketsCount($arrOption); } return $arrayResult; }
<tr style="background-color: #FCEDDA"> <td width="30%">患者姓名</td> <td width="30%">患者用户名</td> <td width="30%">更新日期</td> <td width="10%">日记</td> </tr> <?php foreach ($diaryList as $diary) { if ($diary->user->isNull()) { continue; } $ticketId = NfsAuditClient::getInstance()->getMaxTaskTicketId($diary->user->id, 'User', 'MedicineDiary'); $patientSignin = new NullEntity(); $followupPatient = $diary->user->getFollowupPatient(); if (false == $followupPatient->isNull()) { $patientSignin = FollowupClient::getInstance()->getOneVipFollowupOwnerByPatientId($followupPatient->id); } $strV = ""; if ($patientSignin->isNull() == false) { $strV = "<span style='color:red;'>[V]</span>"; } ?> <tr style="background-color:#F8FCFD"> <td><?php echo $followupPatient->name; ?> </td> <td><?php echo $diary->user->name; echo $strV; ?>
private function doSaveSigninInfo($request, $response) { /*{{{*/ $signinId = $request->signinId; $option['hospitalCaseNO'] = $request->hospitalcaseno; $option['mobile'] = $request->mobile; $option['computerSkill'] = $request->computerSkill; $option['patientRelation'] = $request->patientRelation; $tmp = FollowupClient::getInstance()->updateFollowupOwnerInitialInfo($this->auditor, $signinId, $option); }
public function ajaxCalProteinNeededDaily($request, $response) { /*{{{*/ try { $proteinNeeded = FollowupClient::getInstance()->calProteinNeededDaily($request->age, $request->gender, $request->intensity); echo $proteinNeeded; } catch (Exception $e) { $msg = $e->getMessage(); echo $msg; } return parent::DIRECT_OUTPUT; }
public function searchCustomers($request, $response) { /*{{{*/ $page = $request->getRequest('page', 1); $options['customerName'] = $request->customerName; $options['userName'] = $request->userName; $res = FollowupClient::getInstance()->getCustomerList($page, 20, $options); $response->customers = $res['followupCustomerList']; $response->customerName = $request->customerName; $response->userName = $request->userName; $response->pageLink = ''; if (false == empty($res['pageInfo'])) { $response->pageLink = PageNav::getNavLink(PageNav::getPageNavTemplate('/nfsaudit/searchcustomers?customerName=' . $request->customerName . '&userName='******'&page='), $res['pageInfo']['nowpage'], $res['pageInfo']['pagesize'], $res['pageInfo']['total']); } }
/** * @brief 流对应的随访笔记添加修改表单提交 * @author lhl * @version branches/v2.14.23 * @date 2013-07-25 */ public function saveNote($request, $response) { /*{{{*/ $content = $request->content; $patientSigninId = $request->patientsigninid; $refId = $request->refid; $lastPostUser = $this->user; $followupNote = DAL::get()->find_by_patientsigninid('FollowupNote', $patientSigninId); if ($followupNote->isNull()) { $owner = DAL::get()->find('FollowupOwner', $patientSigninId); FollowupClient::getInstance()->addFollowupNote($content, $owner, $lastPostUser); } else { FollowupClient::getInstance()->modifyFollowupNote($content, $followupNote->id, $lastPostUser); } $response->setRedirect($response->router->urlfor('flow/followupnote', array('refid' => $refId))); }
public function followupInfo($request, $response) { /*{{{*/ $hospitalCaseNo = $request->hospitalcaseno; $response->hospitalCaseNo = $hospitalCaseNo; $realName = $request->realname; $response->realName = $realName; $userName = $request->username; $response->userName = $userName; $spaceId = $this->space->id; $currentDiseaseSpaceRef = DAL::get()->find_by_spaceid('NfsDiseaseSpaceRef', $spaceId); $ownerIds = array(); //如果什么都没填直接点击搜索 if (empty($hospitalCaseNo) && empty($realName) && empty($userName)) { $page = $request->getRequest('page', 1); $count = 15; $res = FollowupClient::getInstance()->getOwnerOfOneDiseaseBySpaceId($page, $count, $spaceId); $ownerIds = $res['ids']; if (false == empty($res['pageInfo'])) { $response->pagelink = PageNav::getNavLink(PageNav::getPageNavTemplate('/adminpatient/followupinfo?page='), $res['pageInfo']['nowpage'], $res['pageInfo']['pagesize'], $res['pageInfo']['total']); } } else { $ownerList = array(); //如果是点击列表中的链接 if (false == empty($userName)) { $user = UserClient::getInstance()->getByUserName($userName); $owner = FollowupClient::getInstance()->getOpenedFollowupOwnerByUser($user->id); $diseaseSpaceRef = DAL::get()->find_by_spaceid('NfsDiseaseSpaceRef', $owner->space->id); if ($diseaseSpaceRef->nfsDisease->id == $currentDiseaseSpaceRef->nfsDisease->id) { $ownerIds[] = $owner->id; } } else { $ownerIdArr = FollowupClient::getInstance()->getOwnerByHospitalCaseNOAndRealName($hospitalCaseNo, $realName); $ownerList = DAL::get()->find('FollowupOwner', $ownerIdArr); foreach ($ownerList as $owner) { $diseaseSpaceRef = DAL::get()->find_by_spaceid('NfsDiseaseSpaceRef', $owner->space->id); if ($diseaseSpaceRef->nfsDisease->id == $currentDiseaseSpaceRef->nfsDisease->id) { $ownerIds[] = $owner->id; } } } } $response->ownerIds = $ownerIds; if (1 == count($ownerIds)) { $owner = DAL::get()->find('FollowupOwner', $ownerIds[0]); $response->owner = $owner; $user = $owner->user; $res = FollowupClient::getInstance()->getOwnerOfOneDiseaseBySpaceId(0, 2000, $spaceId); $allOwnerIds = $res['ids']; $key = array_search($ownerIds[0], $allOwnerIds); $preKey = $key - 1; if ($preKey >= 0) { $preOwner = DAL::get()->find('FollowupOwner', $allOwnerIds[$preKey]); $preOwnerUserName = $preOwner->user->name; $response->preOwnerUserName = $preOwnerUserName; } $nextKey = $key + 1; if ($nextKey <= count($allOwnerIds) - 1) { $nextOwner = DAL::get()->find('FollowupOwner', $allOwnerIds[$nextKey]); $nextOwnerUserName = $nextOwner->user->name; $response->nextOwnerUserName = $nextOwnerUserName; } //PCI手术信息 $category = DAL::get()->find_by_name('HealthRecordProblemCategory', '二、PCI手术信息'); $healthProblems = $category->problems; $problemIds = array_keys($healthProblems); $answerList = HealthRecordClient::getInstance()->getHealthAnswerList4Initial($owner->user->id, $problemIds); $myAnswerList = array(); foreach ($answerList as $answer) { if ($answer->isNull() == false) { $myAnswerList[$answer->ref->problem->id] = $answer; } } $response->healthProblems = $healthProblems; $response->myAnswerList = $myAnswerList; //当前用药信息 $medicineUserSchemes = MedicineClient::getInstance()->getUserCurrentMedicineScheme($user->id); $response->medicineUserSchemes = $medicineUserSchemes; $ref = DAL::get()->find_by_spaceid_and_patientid('DoctorPatientRef', $owner->space->id, $owner->patient->id); $response->refId = $ref->getEncodeId(); //复查信息 if ($user->isNull()) { echo '操作的用户不存在'; return parent::DIRECT_OUTPUT; } $patientSignin = $user->getFollowupPatientSignin($spaceId); //随访已经关闭 if ($patientSignin->isNull() == false && $patientSignin->isCloseFollowup()) { echo '所操作的用户不是随访用户或随访已经关闭'; return parent::DIRECT_OUTPUT; } $response->ownerUser = $user; $response->patient = $patientSignin->patient; $ticketId = $request->ticketId; $checkupTaskArray = array(); $checkupQueues = array(); $customizeQueues = CheckupClient::getInstance()->getUserCustomizeQueue($user->id); if (empty($customizeQueues) == false) { $checkupQueues = $customizeQueues; } else { $checkupQueues = CheckupClient::getInstance()->getUserFollowupQueues($user->id); } foreach ($checkupQueues as $checkupQueue) { $filter = 'checkuptaskqueueid=' . $checkupQueue->id; $checkupTasks = array(); // 对任务排序 $taskArray = DAL::get()->find_all_by_condition('checkuptask', $filter); $queue = $checkupQueue; $nowTask = $queue->firstTask; $nextTaskId = $nowTask->nextTaskId; while ($nextTaskId != 0) { $nowTask = $taskArray[$nextTaskId]; $nextTaskId = $nowTask->nextTaskId; if ($nowTask->isUsed()) { $checkupTasks[] = $nowTask; } } $checkupTaskArray[$checkupQueue->id]['checkupTasks'] = $checkupTasks; } if (empty($ticketId)) { $tL = CheckupClient::getInstance()->getUserLastTickets($user->id); foreach ($tL as $t) { if ($t->task->isUsed() && ($t->task->isCustomizeTask() || $t->task->isFollowupTask() || $t->task->isTemporaryTask())) { $ticketId = $t->id; break; } } } // 读取临时任务 $tempTaskList = CheckupClient::getInstance()->getUserEffectedTemporaryTasks($user->id); $this->getTaskList($tempTaskList); $response->cycleTaskTimeMap = $cycleTaskTimeMap; if (empty($checkupTaskArray)) { echo '此患者没有复查任务'; return parent::DIRECT_OUTPUT; } $response->checkupTaskArray = $checkupTaskArray; $checkupTicket = DAL::get()->find('checkupticket', $ticketId); $response->ref = DAL::get()->find_by_spaceid_and_patientid('DoctorPatientRef', $patientSignin->space->id, $patientSignin->patient->id); $leaveHosDayArr = array(); if (false == $checkupTicket->isNull()) { $leaveHosDayArr = $patientSignin->getDiffLeaveHospitalDay($checkupTicket->startTime->addDay($checkupTicket->task->queue->noticeDay)); } //读取定制复查过去的任务 $pastTicketTasks = array(); $checkupPastTaskQueues = CheckupClient::getInstance()->getUserPastCustomizeQueue($user->id); foreach ($checkupPastTaskQueues as $queue) { $tasks = CheckupClient::getInstance()->getUserPastTicketTask($queue->id); foreach ($tasks as $task) { $pastTicketTasks[$queue->id][] = $task; } } $response->pastTicketTasks = $pastTicketTasks; $response->ticketId = $ticketId; $response->leaveHosDayArr = $leaveHosDayArr; $response->checkupTicket = $checkupTicket; } }
public function doNote4FollowupDoctor($spaceId, $content, $caseId, $patientSigninId) {/*{{{*/ $space = DAL::get()->find('space', $spaceId); $lastPostUser = $space->user; $followupNote = DAL::get()->find_by_patientsigninid('FollowupNote', $patientSigninId); $content = str_replace(array("\n"), array('</p><p>'), $content); $content = '<p>'.$content.'</p>'; $content = str_replace(array('<', '>'), array('<', '>'), $content); if($followupNote->isNull()) { $owner = DAL::get()->find('FollowupOwner', $patientSigninId); FollowupClient::getInstance()->addFollowupNote($content, $owner, $lastPostUser); } else { FollowupClient::getInstance()->modifyFollowupNote($content, $followupNote->id, $lastPostUser); } }/*}}}*/
public function sendOtherSMS($request, $response) { /*{{{*/ $categories = DAL::get()->find_all_by_CategoryName('label', LabelCategory::$typeArr[LabelCategory::AUDIT_MESSAGETEMPLATECATEGORY]); $response->categories = $categories; $response->mobiles4DiaryAnnotation = FollowupClient::getInstance()->getPhoneNumList4DiarySMS($request->followupCustomerId); }
public function index($request, $response) {/*{{{*/ $this->initialize($request, $response); //疾病页2013版 $diseasePage = DiseasePage::getByDiseaseId($this->disease->id); if($diseasePage instanceof DiseasePage && $diseasePage->isOnlineOrPreview()) { $ddCnt = DiseaseClient::getInstance()->getDiseaseDoctorCnt($this->disease->id); $response->diseasePage = $diseasePage; $disease=$diseasePage->disease; $response->previewId = $request->getRequest('previewId', 0); $title = $disease->name.','.$disease->name.'的症状、治疗_疾病查询_好大夫在线'; $keywords = $disease->name.",".$disease->name."的症状,".$disease->name."的治疗,".$disease->name."吃什么"; $description = "中国最大的医疗网站-好大夫在线疾病库详细介绍".$disease->name."病因,".$disease->name."症状,".$disease->name."治疗方式,如何护理".$disease->name."患者等。推荐".$ddCnt."位".$disease->name."专家、咨询".$disease->name."问题、预约".$disease->name."专家门诊。"; $response->title=$title; $response->keywords=$keywords; $response->description=$description; if (DiseasePage::isDiseaseWithNfs($diseasePage->disease->id)){ $response->nfsCount = FollowupClient::getInstance()->getFollowupOwnerCount(); $response->nfsDiseaseCount = FollowupClient::getInstance()->getPCINfsDiseaseCount(); $response->nfsDiseaseSpaceCount = FollowupClient::getInstance()->getPCINfsDiseaseSpaceCount(); $response->healthDiaryCount = HealthDiaryClient::getInstance()->getHealthDiaryCount(); } return 'diseasepage'; } //旧模板中的新模板 : newindex => /disease/newindex //目前 newindex 437个疾病 by sjp 20130806 if($this->disease->isNewDisease == 1){ $this->newIndex($request, $response); return 'newindex'; } //else 走到这里,是最旧的版本的模板: success => /disease/index //专题部分 list($openBooking, $topic, $doctor) = $this->getZhuanTi4Case(); //最新回复 $threads = $this->searchByDisease($this->disease, 3); $response->openBooking = $openBooking; $response->topic = $topic; $response->doctor = $doctor; $response->diseaseId = $this->disease->id; $response->diseaseParentId = $this->diseaseParent->id; $response->modifiedTriageCity = array(); $diseaseId = $this->disease->voteDisease->id; $this->getCurrencyMethod($request, $response, $diseaseId); $response->threads = $threads; $name = $this->disease->name; $response->diseaseName=$name; $commentCnt = DAL::get()->queryCommentCntByDiseaseId('doctorcomment', $this->disease->id); $diseaseDoctorCnt = DiseaseClient::getInstance()->getDiseaseDoctorCnt($this->disease->id); $response->desc = $commentCnt."篇".$name."患友亲历的看病经验、".$diseaseDoctorCnt."位大医院专家介绍".$name."症状、".$name."治疗方案等;各地".$name."专家排行; 直接向专家本人咨询。".$diseaseDoctorCnt."位大医院专家介绍".$name."症状、".$name."治疗方案等;各地".$name."专家排行;直接向专家本人咨询。". $name."症状、".$name."治疗方案等;各地".$name."专家排行;直接向专家本人咨询"; }/*}}}*/
public function saveNote($request, $response) {/*{{{*/ $doctorname = $request->uname; $content = $request->content; $patientSigninId = $request->patientsigninid; $refId = $request->refid; $lastPostUser = $this->_newUser; $followupNote = DAL::get()->find_by_patientsigninid('FollowupNote', $patientSigninId); if($followupNote->isNull()) { $owner = DAL::get()->find('FollowupOwner', $patientSigninId); FollowupClient::getInstance()->addFollowupNote($content, $owner, $lastPostUser); } else { FollowupClient::getInstance()->modifyFollowupNote($content, $followupNote->id, $lastPostUser); } $response->setRedirect("/api/adminsetup/ajaxfollowupnote?uname=$doctorname&refid=$refId"); }/*}}}*/
public function smsReceived($request, $response) { /*{{{*/ $smsList = array(); $smsReceivedList = DAL::get()->find_all_receivedByExtToday('smslog', SMSLog::TYPE_RECEIVE, SMSMD::EXT_8); foreach ($smsReceivedList as $smsReceived) { $smsList[$smsReceived->mobile]['received'] = $smsReceived; $smsReplyTo = DAL::get()->find_sentByExtToday('smslog', $smsReceived->mobile, SMSLog::TYPE_SEND, SMSMD::EXT_8); // find the closet $smsList[$smsReceived->mobile]['sent'] = $smsReplyTo; $followupCustomer = FollowupClient::getInstance()->getFollowupCustomerByMobile($smsReceived->mobile); $smsList[$smsReceived->mobile]['followupCustomer'] = $followupCustomer; } $response->smsList = $smsList; }
public function patientSignin($request, $response) {/*{{{*/ //有关patient的参数 $patientId = $request->patient['id']; if ($patientId > 0) { if (isset($this->user->patients[$patientId])) { $patient = $this->user->patients[$patientId]; } else { throw new BizException('未知患者信息'); } } else { $patientParams = $request->patient; $patientParams['birthday'] = $request->dateyear."-".$request->datemonth."-".$request->dateday; $patientParams['mobile'] = $request->patient['mobileOrEmail']; $patient = PatientClient::getInstance()->add($this->user, $patientParams); } $user = $this->user; $patientCardNO = $request->patientCardNO; $patientCard = DAL::get()->find_by_no('PatientCard', $patientCardNO); $spaceId = $patientCard->space->id; $patientSignin = DAL::get()->find_by_spaceid_and_patientid("followupOwner", $spaceId, $patient->id); $url = "myhealth/manhua"; //if($patientCard->isFuWai22ACard() || $patientCard->isBeiDaBreastCancerCard()) //{ // $url = "myhealth/consent"; //} //报道的过程,包括二次报道 if (false == $patientSignin->isNull()) {/*{{{*/ $msgSigninStatus = ""; //1.有了历史报到记录 if($patientSignin->isOpenFollowup()) { //开通了随访 $msgSigninStatus = "{$user->name} ,您已经是{$patientCard->space->name}大夫[{$patientCard->group->name}]的随访患者!"; } else if ($patientSignin->isRefused()) { //拒绝的患者再次申请 $msgSigninStatus = "{$user->name},您以前的随访报到申请未能审核通过!<div>如需开通随访,请联系我们,服务电话:400-6502-120!</div>"; } else { //审核中的 if($patientSignin->isNoticedYes()) { //已经同意条款 $msgSigninStatus = "{$user->name},您的随访报到申请正在审核,请耐心等待!<div>服务电话:010-65502908转9313!</div>"; } else { //不同意的和未确认的,进入知情同意书页面 $response->setRedirect($response->router->urlfor($url)); } } if( false == empty($msgSigninStatus)) { $forward = "http://".URL_PREFIX."passport.haodf.com/"; $msg = "<div style='margin:10px;height:60px;'> <img style='float:left;width: 36px; height: 33px;' src='//i1.hdfimg.com/zixun/images/zixun_overflow01.gif' alt='提示'/> <div style='float:left; margin:10px 0px 0px 10px; font-weight: bold;height:30px;'> $msgSigninStatus</div></div>"; $msg .= "<div style='margin:10px 0px;border-top:1px dashed #cccccc;height: 1px;overflow:hidden;'></div>"; $msg .= "本页面将在3秒内自动跳转到个人中心页面,如果没有跳转"; MsgHtml::msg($msg, $forward); } }/*}}}*/ else { //1.没有历史报到记录 $signinParams = $request->signinvars; $signinParams['mobile'] = $request->patient['mobileOrEmail']; $signinParams['height'] = $request->patient['height']; $signinParams['weight'] = $request->patient['weight']; FollowupClient::getInstance()->addFollowupOwner($patientCard->no, $patient->id, $signinParams); ForumClient::getInstance()->createGroupMember($patientCard->space, $user, $patient->id, $patientCard->group->id); $response->setRedirect($response->router->urlfor($url)); } }/*}}}*/
public function ajaxApplyVipUser($request,$response) {/*{{{*/ $signinId = $request->signinId; $signin = DAL::get()->find('FollowupOwner',$signinId); $signinApply = DAL::get()->find_by_userid_and_source('FollowupOwner',$signin->userid,FollowupOwner::SOURCE_VIPAPPLY); //若是付费用户和已经申请过,则直接跳过 $addVipApplyCondition = FollowupOwner::PAYING_YES != $signin->payingStatus && $signinApply->isNull() ; if($addVipApplyCondition) { $signinId = FollowupClient::getInstance()->vipApply4FollowupOwner($signin->user->id); } echo ($signinId)?1:0; return parent::DIRECT_OUTPUT; }/*}}}*/
public function modifyLinkPhonePost($request, $response) { /*{{{*/ $followupCustomer = DAL::get()->find("FollowupCustomer", $request->followupCustomerId); $linkPhone = DAL::get()->find("LinkPhone", $request->linkPhoneId); $vars = $request->vars; $projectOperator = $this->myProjectOperator; LinkPhoneClient::getInstance()->updateLinkPhone($linkPhone->id, $vars, $followupCustomer->id, $projectOperator->user); $fields['defaultCallPhone'] = $request->getRequest('defaultCallPhone', 0); $fields['defaultMessagePhone'] = $request->getRequest('defaultMessagePhone', 0); $fields['decisionPhone'] = $request->getRequest('decisionPhone', 0); FollowupClient::getInstance()->updatePhones($followupCustomer->id, $linkPhone->id, $fields); $preMsg = "电话号码为" . $linkPhone->phoneNum . "内容修改成功"; $response->setRedirect($response->router->urlfor('projectcustomermgr/modifylinkphone', array('followupCustomerId' => $followupCustomer->id, 'linkPhoneId' => $linkPhone->id, 'preMsg' => $preMsg))); }
public function ajaxGetPatientSignin($request, $response) {/*{{{*/ $owner = FollowupClient::getInstance()->getOpenedFollowupOwnerByUser($this->curUser->id); $result = '0'; if (false == $owner->isNull() && $owner->isValid()) { $result = '1'; } echo $result ; exit; }/*}}}*/
public function createPost($request, $response) {/*{{{*/ $ref = DAL::get()->find('DoctorPatientRef', $request->refid); if($ref->isNull()) { die('流关系不存在'); return; } if (false == FollowupAssistantClient::getInstance()->hasAssistRights($this->user->id, $ref->space->id)) { echo '没有权限发表'; exit; } $option = array(); $attachmentIds = ($request->attachmentIds != null) ? $request->attachmentIds : ''; $attachmentArr = explode(',', $attachmentIds); $option['attachmentIds'] = $attachmentArr; $content = $ref->space->name."大夫和您有新对话<a href='".$ref->url."' target='_blank'>点击查看详情</a>"; $title = $ref->space->name."大夫和您有新对话"; StationLetterClient::getInstance()->sendMsg(Message::AdminUserId, $ref->user->id, $title, $content); $postContent = $request->getRequest('content'); if(($postContent == '点击此处跟大夫对话!' || $postContent == '') && $attachmentIds <> '') { $postContent = '有新资料上传'; } $post = DoctorPatientPostClient::getInstance()->addPost($request->refid, $ref->space->user->id, $postContent, $option); DBC::requireFalse($post->isNull(), '系统繁忙,请稍后重试'); //系统日志 try{ FlowClient::getInstance()->addLog($ref,$ref->space->user, DoctorPatientLog::TYPE_SYSTEM_LOG, 'SuiFangController::createPost', $post); }catch(Exception $ex) {} //记录助理日志 if ($this->user->id != $ref->space->id) { FollowupClient::getInstance()->addFollowupLog($this->user->id, $post->id); SpaceLogClient::getInstance()->addLog($ref->space->user->id, SpaceLog::SPACE_LOG_TYPE_REPLY_FLOW, $ref->id, $ref->title); } $response->setRedirect('/suifang/taskdetail?refId='.$ref->id); }/*}}}*/
public function onlineBankPay($request,$response) { $bankid = $request->paycard; $spaceid = $request->spaceid; $productid = $request->productid; $fuProduct = DAL::get()->find('FollowupProduct', $productid); DBC::requireFalse($fuProduct->isNull(), '无效的随访商品'); $space = DAL::get()->find('space', $spaceid); DBC::requireFalse($space->isNull(), '无效的随访space'); $realPrice = 0;//$fuProduct->price; if($fuProduct->isNoPriceProduct()) { $realPrice = $request->price; DBC::requireTrue((int)$realPrice > 0, '无效的续费金额'); } $order = FollowupClient::getInstance()->getFollowupOrder($this->user->id, $productid, $spaceid, $realPrice); DBC::requireFalse($order->isNull(), '无效的订单'); $binds = array(); $binds['payType'] = FollowupOrder::PAYTYPE_ALIPAY; $form = ''; if ($bankid == 'alipay') { $form = $this->getAlipayForm4FollowupOrder($order); $binds['payType'] = FollowupOrder::PAYTYPE_ALIPAY; } else if($bankid == '00')//快钱 { $form = $this->getQpayForm4FollowupOrder($order, $bankid); $binds['payType'] = FollowupOrder::BANK_NAME_ONLLINE; //设置订单状态为网银支付 } else//网银(支付宝纯网关) { $callbackUrl = BeanFinder::get('configs')->alipay_gateway_callback_url; $frontUrl = BeanFinder::get('configs')->alipay_gateway_callback_returnurl; $price = $order->price;//原价 //dodo::zhb 创建充值单 $depositeOrder = OrderClient::getInstance()->createDepositeOrder($this->user, $price, DepositeOrder::RECHARGE_TYPE_ALIPAY, array($order)); $description = ''; $form = GatewayAlipay::getInstance()->getPayUrl($depositeOrder->id, Pay::TYPE_FOLLOWUPORDER, $price, $callbackUrl, $order->product->title, $order->product->title, $frontUrl, $bankid); $binds['payType'] = FollowupOrder::PAYTYPE_ALIPAY; } $response->form = $form; $response->orderId = $order->id; FollowupClient::getInstance()->updateFollowupOrder($order->id,$binds); unset($binds); }
/** * ajaxAddLabel * 新增标签 * @param mixed $request * @param mixed $response * @access public * @return void * todo::psq */ public function ajaxAddLabel($request, $response) { /*{{{*/ $categoryType = LabelCategory::TYPE_PATIENTFILE; $labelName = $request->labelname; $labelCategoryId = $request->labelcategoryid; $labelName = iconv('utf-8', 'gbk', $labelName); $labelId = FollowupClient::getInstance()->addLabel($labelName, $labelCategoryId); echo $labelId; return self::DIRECT_OUTPUT; }
?> <p><?php echo $log->getDisplayName(); ?> </p> <?php } } } ?> </div> <!-- start medicinediary --> <div> <?php $relationAnswerList = DAL::get()->find('HealthRecordAnswer', $diary->relationAnswerIds); $diaryContent = FollowupClient::getInstance()->getHealrecorDiaryByAnswers($relationAnswerList, $owner->patient); echo $diaryContent; ?> <?php if ($abnormalStatus[$diary->id] || false == $diary->flowable()) { ?> <div class="t2"><?php if (isset($unwellAnswer)) { echo HealthDiary::transform2Img($unwellAnswer->value); } ?> </div> <?php } if ($diary->isNormalHealthDiary()) {
private function _submit_chuzu($customer, $datas, EntityBase $sourceEntity) { /*{{{*/ $str = "\n===出组 begin==="; $followupCustomer = $customer; //转组 if (isset($datas['chuzu']) && $datas['chuzu'] == 1) { $chuzuRemark = $datas['chuzuRemark'] ? $datas['chuzuRemark'] : ''; $taskModelIdOfDangerMgr = $datas['taskModelIdOfDangerMgr']; $nextServiceAuditorId = $datas['nextServiceAuditorId']; //下一个责任人 //修改责任人 $nextServiceAuditor = DAL::get()->find('auditor', $nextServiceAuditorId); FollowupClient::getInstance()->markServiceAuditor($followupCustomer, $nextServiceAuditor, $this->auditor); $str .= "\n修改责任人为{$nextServiceAuditorId}."; //创建危险因素管理任务和出组交接任务 $modelIds = array($taskModelIdOfDangerMgr, 945482850); //危险因素管理的任务modelID $models = DAL::get()->find('nfstaskmodel', $modelIds); $sourceEntity = $followupCustomer; $space = $followupCustomer->space; $user = $followupCustomer->getBindUser(); $assigner = $this->auditor; if ($datas['deadline']) { $deadline = XDateTime::valueOf($datas['deadline']); } else { $deadline = XDateTime::today()->addDay(0); } $taskDesc = "首次工作单转组,危险因素管理任务和出组交接任务;备注:" . $chuzuRemark; $role = DAL::get()->find_by_name("followupAuditorRole", FollowupAuditorRole::NAME_ASSISTANTDOCTOROPERATION); $taskIds = TaskClient::getInstance()->addTask($models, $sourceEntity, $space, $user, $assigner, $deadline, $taskDesc, $role->id); $str .= "\n创建危险因素管理任务和出组交接任务:" . implode(',', $taskIds) . "."; } elseif (isset($datas['chuzu']) && $datas['chuzu'] == 2) { $followupOwner = $followupCustomer->getFollowupOwner(); $nfsDisease = $followupOwner->getNfsDisease(); //获取当前服务 $curService = null; try { $curService = FollowupClient::getInstance()->findCurrentFollowupService($followupCustomer->id, $nfsDisease->id); } catch (Exception $ex) { $str .= "\n不在收费服务期."; } if ($curService instanceof FollowupServiceDetail) { $endserviceid = $curService->id; $endtype = FollowupServiceDetail::ENDTYPE_REFUND; $endreason = $datas['endreason'] ? $datas['endreason'] : ''; $deadtime = null; FollowupClient::getInstance()->endFollowupService($endserviceid, $endtype, $this->auditor, $followupOwner->id, $endreason, $deadtime); $str .= "\n退费 : {$curService->id} : {$endreason} ."; } else { $str .= "\n没有找到当期有效收费服务段,跳过退费."; } $taskIds = TaskClient::getInstance()->markFinishedTaskOfCustomersWithAuditor(array($followupCustomer->id), $this->auditor); $str .= "\n关闭全部医助运营任务:" . implode(',', $taskIds) . "."; } else { $str .= "\n不出组"; } $str .= "\n===出组 end==="; return $str; }