public function postTopic($request, $response) { $groupIds = $request->groupIds; if(!$groupIds) { $response->message = '没有选择话题所在的组!'; MsgHtml::msg($response->message, 'http://'.URL_PREFIX.'passport.haodf.com/mypatient/post', array('delay' => 6, 'button' => 'back')); return false; } $title = $request->title; $content = preg_replace("/<\/?a[^>]*>/i", "", $request->content); if(XString::cntrim($title) == '' || XString::cntrim($content) == '') { $response->message = '话题标题和内容都不能为空!'; MsgHtml::msg($response->message, 'http://'.URL_PREFIX.'passport.haodf.com/mypatient/post', array('delay' => 6, 'button' => 'back')); return false; } $groups = DAL::get()->find('regroup', $groupIds); foreach($groups as $group) { if($group->reboard->isNull() == false) { $member = ForumClient::getInstance()->getMemberByUserIdAndGroupId($this->user->id, $group->id); if($member->isNull() == false && $member->isForbiddened()) { $response->message = '您的发言没有成功,可能是已被禁止发言!服务电话:'.HdfPhoneNumber::PHONE_FENZHEN; MsgHtml::msg($response->message, 'http://'.URL_PREFIX.'passport.haodf.com/mypatient/index', array('delay' => 6, 'button' => 'back')); return false; } ResidentEvilClient::getInstance()->createTopic($group->space, $group->reboard, $this->user, $title, $content); } } $response->message = '话题发表成功!'; MsgHtml::msg($response->message, 'http://'.URL_PREFIX.'passport.haodf.com/mypatient/index', array('delay' => 6, 'button' => 'back')); }
public function ajaxDeleteGroupPost($request, $response) { /*{{{*/ $patientCategoryId = $request->category_id; ForumClient::getInstance()->deleteGroup($patientCategoryId); //$this->message('组已经被删除', $response, array('text' => '返回列表', 'url' => $response->router->urlfor('adminpatient/index'))); echo json_encode(array('status' => '0', 'content' => XString::convertToUnicode('组已经被删除'))); return parent::DIRECT_OUTPUT; }
public function deletePost($request, $response) { $patientCategoryId = $request->category_id; ForumClient::getInstance()->deleteGroup( $patientCategoryId ); $this->message('组已经被删除', $response, array( 'buttons' => array( array('text' => '返回列表', 'url' => $response->router->urlfor('adminpatient/index')) ), )); }
private function getArticleShareList($articleId, $response) { /*{{{*/ $groupList = array(); $article = DAL::get()->find('article', $articleId); if (false == $article->isNull() && $article->isAbleShare2ResidentEvil()) { $groupList = ForumClient::getInstance()->getAllGroupsBySpace($article->space->id); $groupList = $groupList['list']; } $response->article = $article; $response->groupList = $groupList; }
public function ajaxCancelMarkPatientForSpace($request, $response) { /*{{{*/ $spaceId = $request->spaceId; $patientId = $request->patientId; $space = DAL::get()->find("space", $spaceId); $patient = DAL::get()->find("patient", $patientId); FlowMarkClient::getInstance()->cancelPatientMarkForSpace($space, $patient, SpaceSymbol::TYPE_MSD); $defaultGroup = DAL::get()->find_by_spaceid_and_type('regroup', $spaceId, ReGroup::TYPE_2); $doctorOwner = DAL::get()->find_by_sourceid('doctorowner', $space->id); $memberIds = ForumClient::getInstance()->getMemberIdByPatientIdAndDoctorOwnerId('regroupmember', $patient->id, $doctorOwner->id); if (false == empty($memberIds)) { ForumClient::getInstance()->changeGroupMember($memberIds[0], $defaultGroup->id, $space->id); } else { ForumClient::getInstance()->createGroupMember($space, $patient->user, $patient->id, $defaultGroup->id, true); //新加的组 } echo "1"; return self::DIRECT_OUTPUT; }
public function ajaxAnnouncePost($request, $response) { /*{{{*/ $groupId = $request->groupid; $announceUtf8 = $request->announce; $announce = XString::convertToGbk($announceUtf8); ForumClient::getInstance()->modifyGroupInfo($groupId, array('announce' => $announce)); echo json_encode(array('status' => 0, 'announce' => nl2br($announceUtf8))); return parent::DIRECT_OUTPUT; }
/** * @brief 医生视角回复咨询时右侧患者信息管理等,ajax输出 * @author lhl * @version branches/v2.14.23 * @date 2013-07-25 */ public function ajaxSpacePatient($request, $response) { /*{{{*/ $ref = DAL::get()->find('DoctorPatientRef', $request->id); $groups = ForumClient::getInstance()->getGroupListByPatientIdAndSpaceId($ref->patient->id, $this->space->id); $response->groupList = $groups; $response->otherFlows = DAL::get()->find_all_by_patient_otherSpace('DoctorPatientRef', array($ref->patient->id), $this->space); //报道信息内容 $patientSignin = DAL::get()->find_by_patientid_and_spaceid('FollowupOwner', $ref->patient->id, $this->space->id); $signinProblems = array(); if (false == $patientSignin->isNull()) { $signinProblems = $patientSignin->getNfsDisease()->getSigninHealthProblems(); } $response->patientSignin = $patientSignin; $response->signinProblems = $signinProblems; $response->ref = $ref; $response->hasBooking = $request->b; $response->hasTel = $request->t; $doctorPatientRefId = $ref->id; $response->refid = $doctorPatientRefId; }
private function getPatientGroupName($spaceId, $patientId) {/*{{{*/ $id = $name = ''; $patientGroups = ForumClient::getInstance()->getGroupListByPatientIdAndSpaceId($patientId, $spaceId); $patientGroupList = array(); //只有1个组 foreach ($patientGroups as $patientGroup) { if ($patientGroup->type == 1) { $name = $patientGroup->name; $id = $patientGroup->id; } } if(empty($id)) { $id = ForumClient::getInstance()->defaultGroupMember($spaceId); $defaultGroup = DAL::get()->find('regroup', $id); $id = $defaultGroup->id; $name = '默认分组'; } return array($name, $id); }/*}}}*/
public function spacePatient($request, $response) {/*{{{*/ $ref = DAL::get()->find('DoctorPatientRef', $request->id); $groups = ForumClient::getInstance()->getGroupListByPatientIdAndSpaceId($ref->patient->id, $this->_newSpace->id); $response->groupList = $groups; $response->otherThreads = ThreadClient::getInstance()->getOtherRelatedThreads4Patient($ref->patient->id, $this->_newSpace->id); //报道信息内容 $patientSignin = DAL::get()->find_by_patientid_and_spaceid('FollowupOwner', $ref->patient->id, $this->_newSpace->id); $signinProblems = array(); if($patientSignin->isNull() == false) { $signinProblems = $patientSignin->getNfsDisease()->getSigninHealthProblems(); } $response->signinProblems = $signinProblems; $response->ref = $ref; $response->hasBooking = $request->b; $response->hasTel = $request->t; $doctorPatientRefId = $ref->id; $response->refid = $doctorPatientRefId; $doctorPatientRef = DAL::get()->find('DoctorPatientRef', $doctorPatientRefId); $patientRealName = $doctorPatientRef->patient->name; $response->patientRealName = $patientRealName; $patientId = $doctorPatientRef->patient->id; $spaceId = $doctorPatientRef->space->id; $followupOwner = DAL::get()->find_by_spaceid_and_patientid("followupowner", $spaceId, $patientId); $followupNote = DAL::get()->find_by_patientsigninid('FollowupNote', $followupOwner->id); $response->patientSigninId = $followupOwner->id; $response->content = $followupNote->content; }/*}}}*/
<ul class="clearfix pa_friend_list pb10"> <?php $i = 0; foreach ($myGroups as $myGroup) { $i++; //超过两行 输入隐藏的li if ($i > 6) { echo "<li class='dn'>"; } else { echo "<li>"; } ?> <span class="pa_friend_leader"> <?php if (isset($cntsInfo[$myGroup->id]) && (int) $cntsInfo[$myGroup->id] > 0) { $leaders = ForumClient::getInstance()->getLeadersByGroupId($myGroup->id); //患友会首页浮动显示爱心组长 ?> <img alt="爱心小组长" src="http://i1.hdfimg.com/doctorzone/images/leader.png" title="爱心组长:<?php foreach ($leaders as $leader) { echo $leader->user->name . " "; } ?> "/> <?php } ?> </span> <a href="<?php echo $space->url; ?>
public function taskDetail($request, $response) {/*{{{*/ if ($request->refId === null) { exit; } $response->refId = $request->refId; $doctorPatientRef = DAL::get()->find('DoctorPatientRef', $request->refId); $response->doctorUserName = $doctorPatientRef->space->user->name; if ($doctorPatientRef->isNull()) { echo '请指定流关系'; exit; } $this->recordLoginInfo($doctorPatientRef->space); $response->doctorPatientRef = $doctorPatientRef; //随访信息,目前一个医生有一个随访卡,但未来会有多个,暂时只查询一条显示(产品gjb确认) $patientCard = DAL::get()->find_by_spaceid('PatientCard', $doctorPatientRef->space->id); if (false == $patientCard->isNull()) { $patientSignin = DAL::get()->find_by_spaceid_and_patientid('FollowupOwner', $doctorPatientRef->space->id, $doctorPatientRef->patient->id); $response->patientSignin = $patientSignin; } $ref = $doctorPatientRef; $nowPage = $request->getRequest('p', 1); $pageSize = 10; $pagelink = ''; $spaceAttr = DAL::get()->find_by_fld_spaceuserid_and_name('spaceAttribute', $ref->space->id, Space::ATTR_FLOW_ORDER); $flowOrder = SpaceAttribute::FLOW_ORDER_DESC; $response->displayOrder = $flowOrder; $options = array('curUserId'=>$ref->space->id, 'flowOrder'=>$flowOrder); if(SpaceAttribute::FLOW_ORDER_ASC == $flowOrder && $request->p == null) { $options['endPage'] = 1; } $res = FlowClient::getInstance()->getFlowInfos($ref->id, $nowPage, $pageSize, $options); if ($ref->postCount <= 0) { throw new BizException('此医患关系不存在!'); } if(empty($res['pageInfo']) == false) { $pageInfo = $res['pageInfo']; $pagelink = PageNav::getNavLink(PageNav::getPageNavTemplate('?refId='.$ref->id.'&p='), $pageInfo['nowpage'], $pageInfo['pagesize'], $pageInfo['total']); } $response->flowList = $res['objects']; $response->pagelink = $pagelink; List($hasBooking, $hasTel, $bookingOrder, $telCase) = $this->getUnFinishedService($res['objects']); $response->hasBooking = $hasBooking; $response->hasTel = $hasTel; $groups = ForumClient::getInstance()->getGroupByUserId($ref->user->id, $ref->space->id); $response->groupList = $groups['list']; $nextRef = FlowClient::getInstance()->getSpaceUnreadFlow($ref->space->id); $response->nextRef = $nextRef; $response->newSpace = $ref->space; $response->newUser = $ref->space->user; $response->ref = $ref; $opendFollowupOwner = FollowupClient::getInstance()->getOpenedFollowupOwner($ref->patient->id,$ref->space->id); $response->patientSigninRefExists = $opendFollowupOwner->isNull() == false; $response->thisUser = $this->user; }/*}}}*/
private function getPodRelatedInfo($pod, $response) {/*{{{*/ $podrefs = $pod->podpatientref; $patientIds = array(); foreach($podrefs as $podref) { $userNames[] = $podref->patient->user->name; $flows[] = DAL::get()->find_by_spaceid_and_patientid('doctorpatientref', $podref->pod->space->id, $podref->patient->id); $patientIds[] = $podref->patient->id; } $userNames = array_filter($userNames); $userName = implode(',', $userNames); $response->userName = $userName; $response->flows = $flows; $flow = FlowClient::getInstance()->getFirstIstreateFlow($pod->space->id, $patientIds); $response->treatedTime = $flow->treatedTime->toShortString(); $phoneServiceInfo = TelOwnerClient::getInstance()->getPhoneServiceCnt('telorder', $patientIds, $pod->space->id); $response->phoneServiceCnt = $phoneServiceInfo[0]['cnt']; $response->phoneServiceCtime = $phoneServiceInfo[0]['ctime']; $bookingOrderInfo = BookingClient::getInstance()->getBookingOrderCntByPodref('bookingorder', $pod->space->id, $patientIds); $response->bookingOrderCnt = $bookingOrderInfo[0]['cnt']; $response->bookingOrderCtime = $bookingOrderInfo[0]['ctime']; $response->regroups = ForumClient::getInstance()->getGroupListByPatientIdAndSpaceId($patientIds, $pod->space->id); }/*}}}*/
" target="blank"><?php echo $space->host->name; ?> 大夫</a>: <span> <?php $Hospital = $space->host->hospitalfaculty->hospital->name; $Department = $space->host->hospitalfaculty->name; echo $Hospital . ' ' . $Department; ?> </span> <?php $i = 0; foreach ($groupInfo[$space->id] as $group) { $i++; $member = ForumClient::getInstance()->getMemberByUserIdAndGroupId($searchUser->id, $group->id); if (!$member) { continue; } $patientName = "[]"; if (false == $member->patient->isNull()) { $patientName = "[{$member->patient->name}]"; } ?> <div style="padding: 1px 20px; "><?php echo $i; ?> .<a href="<?php echo $group->getUrl(); ?> " target="blank"><?php
public function exportContacts($request, $response) { /*{{{*/ $pageSize = 20; $pagelink = ''; $groups = array(); $doctorName = $request->doctorname; if ($doctorName) { $spaces = SpaceClient::getInstance()->getSpacesByName($doctorName); if (false == empty($spaces)) { $ids = XString::arrayKeys($spaces, 'id'); } $nowPage = $request->getRequest('p', 1); if (false == empty($ids)) { $res = ForumClient::getInstance()->getAllGroupsBySpaceIds($ids, $nowPage, $pageSize); $groups = $res['list']; } $pageInfo = $res['pageInfo']; if (false == empty($pageInfo)) { $pagelink = PageNav::getNavLink(PageNav::getPageNavTemplate("/residentevil/exportcontacts?doctorname={$doctorName}&p="), $pageInfo['nowpage'], $pageInfo['pagesize'], $pageInfo['total']); } } $response->groups = $groups; $response->pagelink = $pagelink; }
echo Account::infoUrl(); ?> " target="_blank">了解积分(咨询点)详情</a></p> </div> <?php if ($message->user->city) { ?> <p class="pt10 pb10 gray2 lh180">所在地区:<br/><?php echo $message->user->city; ?> </p> <?php } ?> <?php $groups = ForumClient::getInstance()->getGroupByUserId($message->user->id, $space->id); if (empty($groups['list']) == false) { ?> <p class="pb10 gray2 lh180">所在分组: <?php foreach ($groups['list'] as $group) { ?> <br/><a href="http://<?php echo URL_PREFIX; echo $space->userName; ?> .haodf.com/huanyouhui/group/<?php echo $group->id; ?> .htm" target="_blank"><?php echo $group->name;
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)); } }/*}}}*/
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; }
public function caseGroup($request, $response) {/*{{{*/ header('Content-Type: text/html; charset=gbk'); $spaceId = $this->_newSpace->id; $patientId = $request->patientid; $groups = array(); if ($patientId) { $groups = DAL::get()->find_all_by_spaceid('ReGroup', $spaceId); } $patientGroups = ForumClient::getInstance()->getGroupListByPatientIdAndSpaceId($patientId, $spaceId); $patientGroupList = array(); foreach ($patientGroups as $patientGroup) { $patientGroupList[] = $patientGroup->id; } $response->groups = $groups; $response->patientGroupList = $patientGroupList; $response->patientId = $patientId; $response->userId = $request->userid; }/*}}}*/
private function isResidentEvil($userId) { /*{{{*/ return ForumClient::getInstance()->isResidentEvil($this->space->id, $userId); }
private function getPatientInfoForPatient($response, $thread) {/*{{{*/ /** 患友会分组*/ if ($this->_newSpace->isDoctor() && $this->_newSpace->isPatientOpened()) { $isResidentEvil = ForumClient::getInstance()->isResidentEvil($this->_newSpace->id, $thread->user->id); //成员数 $memberCount = PatientClubClient::getInstance()->getResidentEvilMemberCount('regroup', $this->_newSpace->id); //所有组(去掉默认组) $groupList = DAL::get()->find_all_by_spaceid_and_type('ReGroup', $this->_newSpace->id, ReGroup::TYPE_1); //用户所在组 $groups = ForumClient::getInstance()->getGroupByUserId($thread->user->id, $this->_newSpace->id); $reboardIdArr = array(); $spaceTopic = array(); if (empty($groups['list']) == false){ foreach($groups['list'] as $group) { if ($group->reboard->isNull() == false) $reboardIdArr[] = $group->reboard->id; } } //取话题 if (empty($reboardIdArr) == false) $spaceTopic = DAL::get()->find_all_by_reboardid_and_spaceid('ReTopic', $reboardIdArr, $this->_newSpace->id, 5); $groupList = ForumClient::getInstance()->getResidentEvilSpaceByUserId($thread->user->id); list($groupInfo, $reSpaceList) = SpaceClient::getInstance()->sortGroupBySpace($groupList); if(isset($reSpaceList[$thread->space->id])) unset($reSpaceList[$thread->space->id]); $response->reSpaceList = $reSpaceList; $response->groups = $groups; $response->spaceTopic = $spaceTopic; $response->isResidentEvil = $isResidentEvil; $response->memberCount = $memberCount; } }/*}}}*/
public function ajaxDeleteGroup($request, $response) { /*{{{*/ $group = DAL::get()->find('regroup', $request->groupId); if ($group->isNull()) { echo 2; return parent::DIRECT_OUTPUT; } $patientCaseMember = DAL::get()->find_all_by_regroupid('regrouppatientcasemember', $group->id); if (ReGroup::TYPE_1 == $group->type && $group->reGroupMemberCount == 0 && empty($patientCaseMember)) { ForumClient::getInstance()->deleteGroup($group->id); echo 1; } else { echo 0; } return parent::DIRECT_OUTPUT; }