public function saveFollowupReportInfo($request, $response)
 {
     /*{{{*/
     $signinId = $request->signinId;
     $patientSignin = DAL::get()->find('FollowupOwner', $signinId);
     if ($patientSignin->isNull()) {
         echo "随访信息不存在!";
         return parent::DIRECT_OUTPUT;
     }
     $doAction = $request->doAction;
     $vars = $request->getUnSafeData('vars');
     if (empty($vars['title'])) {
         echo "随访总结标题不能为空!";
         return parent::DIRECT_OUTPUT;
     }
     if ($doAction == 'add') {
         $result = FollowupReportClient::getInstance()->addFollowupReport($this->auditor, $patientSignin, $vars['title'], $vars['content'], $vars['evaluation'], $vars['doctorComment']);
     } else {
         if ($doAction == 'edit') {
             $reportId = $request->reportId;
             $result = FollowupReportClient::getInstance()->updateFollowupReport($this->auditor, $reportId, $vars);
         }
     }
     //增加强制刷缓存
     $followupReport = DAL::get()->find('FollowupReport', $result);
     FlowClient::getInstance()->refreshFlowData($patientSignin->space->id, $patientSignin->patient->id, $followupReport);
     $response->setRedirect($response->router->urlfor('followup/followupreportlist', array('c' => 'nfsaudit', 'a' => 'followupreportlist', 'signinId' => $signinId)));
 }
    public function userStateSummaryInfo($request, $response)
    {/*{{{*/
        if($this->goUserHomePage($request->userid))
        {
            $response->setRedirect("http://".URL_PREFIX."passport.haodf.com");
        }

        $user = DAL::get()->find('user', $request->userid);
        $signin = $user->getFollowupPatientSignin();
        $response->owner = $signin;

        $followupReportList = FollowupReportClient::getInstance()->getFollowupReportList($signin->id);
        $response->followupReportList = $followupReportList; 
        
        $stateSummaryList = DAL::get()->find_all_by_followupownerid('FollowupStateSummary', $signin->id);
        ksort($stateSummaryList);
        $response->stateSummaryList = $stateSummaryList;

        $response->ref = DAL::get()->find_by_spaceid_and_patientid('DoctorPatientRef', $signin->space->id, $signin->patient->id);

        $curStateSummary = $this->getCurSummary($request->summaryid, $stateSummaryList);
        $response->curStateSummary = $curStateSummary;

        $key_category_items = $this->getAllCategoryItems($curStateSummary);
        $response->key_category_items = $key_category_items;

        $key_parentCategory_childCategoryList = $this->getChildCategoryFromItems($curStateSummary);
        $response->key_parentCategory_childCategoryList = $key_parentCategory_childCategoryList;

        $parentCategoryIds = array_keys($key_parentCategory_childCategoryList);
        sort($parentCategoryIds);
        $response->parentCategoryList = DAL::get()->find('FollowupSchemeCategory', $parentCategoryIds);
    }/*}}}*/