public function delete($request, $response)
	{
		$id = $request->id;
		BingLiClient::getInstance()->doDelete($id);
		exit();
	}
 public function deleteAttachment($request, $response)
 {
     /*{{{*/
     $userId = $request->userId;
     $attachmentId = $request->attachmentId;
     BingLiClient::getInstance()->doDelete($attachmentId);
     $url = $response->router->urlfor('intention/patient', array('userId' => $userId, 'showcontent' => 1));
     $response->setRedirect($url);
 }
Example #3
0
        ?>
)</span>&nbsp;&nbsp;
            	<a href="<?php 
        echo $picturePost->getPictureUrl();
        ?>
" target="_blank">查看</a>&nbsp;&nbsp;
            	<a	rel="del" value ="<?php 
        echo $picturePost->id;
        ?>
" href="javascript:;" >删除</a>&nbsp;&nbsp;
            </td>
        </tr>
    <?php 
    }
} else {
    $attachments = BingLiClient::getInstance()->getAll($post->user->id, $post->doctorPatientRef->patient->id);
    $allTypes = PatientAttachment::$typeList;
    ?>
    <?php 
    if (false == empty($attachments)) {
        foreach ($attachments as $pa) {
            ?>
        <tr>
        <td width="100">&nbsp;</td>
        <td style="padding-left:10px;">
            <input type="checkbox" name="attachment[]" value="<?php 
            echo $pa->id;
            ?>
" id="<?php 
            echo $pa->id;
            ?>
    public function deleteAttach($request, $response)
	{/*{{{*/
		$id = $request->id;
        $attachement = DAL::get()->find('patientattachment', $id);
        if($attachement->isNull())
        {
            MsgHtml::msg("你操作的附件不存在");
        }
        if($this->user->id != $attachement->user->id)
        {
            MsgHtml::msg("你无权操作别人的附件");
        }
		$res= BingLiClient::getInstance()->doDelete($id);
        return self::DIRECT_OUTPUT;
	}/*}}}*/
            (<?php 
            echo $checkupAnswerSheet->ctime;
            ?>
)
        </span>
        <a href=<?php 
            echo $router->urlfor('checkup/inputcheckupanswersheet', array('sourceId' => $checkupAnswerSheet->id));
            ?>
 target="_blank">查看</a>
        </td>
        </tr>
<?php 
        }
    }
}
$attachments = BingLiClient::getInstance()->getAll($post->followupOwner->user->id, $post->followupOwner->patient->id);
$allTypes = PatientAttachment::$typeList;
?>
 
        <tr>
        <th width="100">病历资料</th>
        </tr>
<?php 
if (false == empty($attachments)) {
    foreach ($attachments as $pa) {
        ?>
        <tr>
        <td width="100">&nbsp;</td>
        <td style="padding-left:10px;">
            <input type="checkbox" name="attachmentIds[]" value="<?php 
        echo $pa->id;
    private function attach2bingli($patientId, $file)
    {/*{{{*/
        $patient = DAL::get()->find('Patient', $patientId);
        DBC::requireTrue(false == $this->_newUser->isNull(), 'user 不能为空');
        $user = $patient->isNull()? $this->_newUser: $patient->user;
        $attach = Uploader::file2attach($user, $file);
        $pa = BingLiClient::getInstance()->addBingLi($user->id, $patient->id, '', PatientAttachment::TYPE_PIC, 0, '', '', $attach->id);

        return $pa;
    }/*}}}*/
Example #7
0
 public function deleteAttachment($attachmentId, $userId)
 {/*{{{*/
     $user = DAL::get()->find('user', $userId);
     if ($user->isNull())
     {    
         $this->setErrorCode(107);
         return 0;
     }    
     $attachment = DAL::get()->find('patientAttachment', $attachmentId);
     if($attachment->isNull())
     {
         $this->setErrorCode(162);
         return 0;
     }
     if($attachment->user->id != $userId)
     {
         $this->setErrorCode(163);
         return 0;
     }
     BingLiClient::getInstance()->doDelete($attachmentId);
 }/*}}}*/
Example #8
0
<?php

if ($flow instanceof DoctorPatientPost) {
    $aids = array();
    $aids_all = array();
    $attachmentIds = $flow->getDisplayAttachmentIds();
    if ($flow->isSpaceReply()) {
        $picturePostId = DAL::get()->find_id_by_doctorpatientpostid("picturepost", $flow->id);
        if (false == empty($picturePostId)) {
            foreach ($flow->picturePosts as $picturePost) {
                $aids_all[] = $picturePost->attachmentid;
            }
            $aids = DAL::get()->find('attachment', $aids_all);
        }
    } else {
        $aids_all = BingLiClient::getInstance()->getAll($flow->user->id, $flow->doctorPatientRef->patient->id);
        if (false == empty($attachmentIds)) {
            foreach ($attachmentIds as $attachId) {
                $attach = isset($attachments[$attachId]) ? $attachments[$attachId] : null;
                if ($attach) {
                    $aids[] = $attachId;
                }
            }
        }
    }
    if (false == empty($aids)) {
        ?>
            <div style="padding:10px;">
            <span>[сп╦╫╪Ч(<?php 
        echo count($aids);
        ?>
    public function uploadFUAttachment($userId, $checkupTicketId)
    {/*{{{*/
        $user = DAL::get()->find('user', $userId);
        if($user->isNull())
        {
            $this->setErrorCode(107);
            return 0;
        }
        if(empty($checkupTicketId))
        {
            $this->setErrorCode(401);
            return 0;
        }
        $followupOwner = $user->getFollowupPatientSignin();
        if (false == $followupOwner->isNull())
        {
            $patient = $followupOwner->patient;
        }
        if (isset($_FILES['content']))
        {
			$file = $_FILES['content'];
            if ($file['error']==0)
            {
                $file['name'] = XString::convertToGbk($file['name']);
                $file['name'] = TuClient::getInstance()->checkFileSuffixName($file);
                $filePath = TuClient::getInstance()->uploadAttach($file);
				$attach = AttachClient::getInstance()->addAttach($userId, $file['name'], $filePath, $file['type'], $file['size'], Attachment::TYPE_JPG, '', '');
				$bingLi = BingLiClient::getInstance()->addBingLi($userId, $patient->id, '', PatientAttachment::TYPE_PIC, 0, '', '', $attach->id);
                NfsClient::getInstance()->addAttachmentCheckupReportFromMbi($followupOwner, $bingLi->id, $checkupTicketId);
            }
            else
            {
                $this->setErrorCode('165');
                return 0;
            }
        }
        else
        {
            $this->setErrorCode('164');
            return 0;
        }
    }/*}}}*/
 public function attachmentListofPatient($request, $response)
 {
     /*{{{*/
     $user = DAL::get()->find("user", $request->userid);
     $response->attachments = BingLiClient::getInstance()->getAll($user->id, PatientAttachment::SEARCH_ALL_PATIENTID);
     $response->allTypes = PatientAttachment::$typeList;
     $response->user = $user;
 }