Ejemplo n.º 1
0
 public function deleteBingLi($request,$response)
 {/*{{{*/
     $patientAttachment = DAL::get()->find('PatientAttachment', $request->paid);
     DBC::requireEquals($this->user->id, $patientAttachment->user->id, '你不能删除别人的病历');
     $user = $this->user;
     $paId = $request->paid;
     $pageNum = $request->p;
     $pageNum = ($pageNum > 0) ? $pageNum : 1;
     $pageSize = 15;
     BingliClient::getInstance()->doDelete($paId);
     $res =  BingliClient::getInstance()->getAllAttachment($user->id, $request->patientid, $type='', $pageNum, $pageSize);
     if(empty($res['patientattachment']))
     {
         $pageNum = $pageNum-1;
     }
     $response->setRedirect($response->router->urlfor('mycase/binglilist',array('p'=>$pageNum,'patientid'=>$request->patientid)));
 }/*}}}*/
Ejemplo n.º 2
0
	public function myBingliOld($request, $response)
	{
		header('Content-Type: text/html; charset=gbk');
		$ids = trim($request->default_ids, ',');
		$ids = explode(',', $ids);
		$domain = $request->getRequest('domain', URL_PREFIX.'zixun.haodf.com');
		$response->domain = $domain;
		$bingLiList = BingliClient::getInstance()->getAll($this->_newUser->id);
		$response->myBingLiList = $bingLiList;
		$response->checkedIds = $ids;
	}
Ejemplo n.º 3
0
	public function myBingliOld($request, $response)
	{/*{{{*/
		header('Content-Type: text/html; charset=gbk');
		$ids = trim($request->default_ids, ',');
		$ids = explode(',', $ids);
		$domain = $request->getRequest('domain', URL_PREFIX.'zixun.haodf.com');
		$response->domain = $domain;
        $patientId = $request->patientId;
        $user = $this->_newUser;
        if(empty($patientId))
        {
            $patientId = PatientAttachment::DEFAULT_PATIENTID;
            
            $nfsUserId = $request->nfsUserId; //url 里传 userId
            if(false == empty($nfsUserId))
            {
                $patientId = -1; //真正的全部数据
                $user = DAL::get()->find('User', $nfsUserId);
            }
        }
        else
        {
            //传过来patient以后,要用patient的user
            $patient = DAL::get()->find('Patient', $patientId);
            $user = $patient->user;
        }
		$bingLiList = BingliClient::getInstance()->getAll($user->id, $patientId);
		$response->myBingLiList = $bingLiList;
		$response->checkedIds = $ids;
		//随访复查用
		$questionCategoryId = '';
		$questionCategoryId = $request->questionCategoryId;
		$response->questionCategoryId = $questionCategoryId;		
        if($request->bingli4space)
        {
            return 'space';
        }
        else if($request->questionsheet)
        {
            return "sheet";
        }
        else
        {
            return 'default';
        }
	}/*}}}*/
Ejemplo n.º 4
0
 public function getAttachmentListByUserId($userId,$pageId,$pageSize)
 {/*{{{*/
     $user = DAL::get()->find('user', $userId);
     if ($user->isNull())
     {
         $this->setErrorCode(107);
         return 0;
     }
     $this->_initPageInfo($pageId, $pageSize);
     $bingLiList = BingliClient::getInstance()->getAllAttachment($userId, 'all', PatientAttachment::TYPE_PIC,$pageId,$pageSize); 
     $this->pageInfo = $bingLiList['pageInfo'];
     $bingLiList = $bingLiList['patientattachment'];
     $bingLis = array();
     foreach($bingLiList as $bingLi)
     {
         if($bingLi->attachment->isNull() == false && preg_match('/\.(?:jpg|png|gif)/i', $bingLi->attachment->filePath))
         {
             $bingLiId = $bingLi->id;
             $bingLiName = $bingLi->attachment->fileName;
             // 附件的checkTime已经被转换成字符串型,无法正确转换时间戳。所以要停掉,客户端经查无处使用该字段,所以暂时返回0这样可以避免解析错误
             //$time = $bingLi->checkTime->getTime();
             $time = 0;
             $thumbnailUrl = TuClient::getInstance()->getThumbnailUrl($bingLi->attachment->filePath, 600, 400);
             $bingLis[] = array('id'=>$bingLiId, 'name'=>$bingLiName, 'time'=>$time,'thumbnailUrl'=>$thumbnailUrl);
         }
     }
     $this->content = $bingLis; 
 }/*}}}*/
Ejemplo n.º 5
0
 private function saveOrdinarySignin($spaceId, $patientId, $signinParams)
 {/*{{{*/
     /*
     $patientSignin = FlowClient::getInstance()->getOrdinaryPatientSignin($spaceId, $patientId); 
     $signinId = '';
     if(true == $patientSignin->isNull()) {
         $signinId = PatientSigninClient::getInstance()->addOrdinaryPatientSignin($spaceId, $patientId, $signinParams);
     } else {
         $params = $signinParams;
         $params['status'] = PatientSignin::STATUS_UNAUDITED;
         $signinId = PatientSigninClient::getInstance()->updateOrdinaryPatientSignin($patientSignin->id, $params, $patientSignin->userid);
     }
     */
     
     $signinId = PatientSigninClient::getInstance()->addOrdinaryPatientSignin($spaceId, $patientId, $signinParams);
     
     // 病历多患者
     if(isset($signinParams['attachmentIds']) && $patientId)
     {
         BingliClient::getInstance()->bindPatient4Attachment(implode(',', $signinParams['attachmentIds']), $patientId);
     }
     return $signinId;
 }/*}}}*/