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(); }
<?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 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; }
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; }
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; }
/** * @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); }
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)))); }/*}}}*/
{ $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];
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)); }
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"; }/*}}}*/
} ?> </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 {
/** * 初始化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); }
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; }
<?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) {
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; }