public function uploadByWeixin($request, $response) { $patientId = $request->patientId; $spaceId = $request->spaceId; $sourceType = $request->sourceType; $patient = DAL::get()->find('patient', $patientId); $weixUser = DAL::get()->find_by_userid('WeixUser', $patient->user->id); DBC::requireNotNull($weixUser, "绑定的微信用户还没有生成,请稍等..."); if($sourceType == 'PatientSignin') { $patientSignin = DAL::get()->find_by_spaceid_and_patientid('PatientSignin', $spaceId, $patientId); $weixDealingEvent = DAL::get()->find_by_weixuserid_and_sourceid("WeixDealingEvent", $weixUser->id, $patientSignin->id); if($weixDealingEvent->isNull()) { WeixClient::getInstance()->createWeixDealingEvent($weixUser, $patientSignin); } $str = "请在微信中拍照上传门诊病历,完成对".$patientSignin->space->name."的报到"; WeixApi::kefuTextMsg($weixUser, $str, WeixUser::WEIXINTYPE_PATIENT); } }
public function aliPayAccess($request, $response) { $hospital = DAL::get()->find('hospital', $request->hospitalid); DBC::requireNotNull($hospital, '医院不存在'); $response->title = $response->topTitle = $hospital->name; $response->aliUrl = array_key_exists($hospital->id, Hospital::$aliPayHospitalUrl) ? Hospital::$aliPayHospitalUrl[$hospital->id] : ''; }
public function submitSignin($request, $response) { $space = DAL::get()->find('space', $request->spaceId); DBC::requireNotNull($space, '医生不存在,或未开通空间'); $response->setRedirect($response->router->urlfor('user/register4signin', array('mobile'=>$request->mobile, 'forward'=>$request->forward, 'spaceId'=>$space->id))); }
public function patientUpload($request, $response) { /*{{{*/ $patientId = $request->patientId; $patientCaseId = $request->patientCaseId; $response->patientId = $patientId; $response->patientCaseId = $patientCaseId; $list = $this->getPatientCaseandBreadCrumbNavigation($patientCaseId, $patientId); $breadcrumbNavigation = $list['breadcrumbNavigation']; $patientCase = $list['patientCase']; $memList = $memberIds = array(); if (false == $patientCase->isNull()) { $patientCaseId = $patientCase->id; $patientIds = DAL::get()->queryValidPatientIds('patientcaseref', $patientCaseId); $doctorOwner = DAL::get()->find_by_sourceid('doctorowner', $this->space->id); if (false == empty($patientIds)) { $memIds = PatientClubClient::getInstance()->getMemberIdByPatientIdAndDoctorOwnerId($patientIds, $doctorOwner->id); $memList = DAL::get()->find('regroupmember', $memIds); } $patientIds = array(); foreach ($memList as $mem) { $patientIds[] = $mem->patient->id; } } else { $patientIds = array($patientId); } $patientList = DAL::get()->find('patient', $patientIds); $groupNames = array(); foreach ($patientList as $key => $patient) { $patientGroups = ForumClient::getInstance()->getGroupListByPatientIdAndSpaceId($patient->id, $this->space->id); foreach ($patientGroups as $patientGroup) { $groupName = $patientGroup->name; $groupNames[$key] = $groupName; } } $interactCounts = $members = array(); $doctorOwner = DAL::get()->find_by_sourceid('doctorowner', $this->space->id); DBC::requireNotNull($doctorOwner, 'doctorOwner不存在'); if (false == empty($patientIds)) { $memberIds = DAL::get()->queryMemberIdByPatientIdAndDoctorOwnerId('regroupmember', $patientIds, $doctorOwner->id); foreach ($memberIds as $map) { if (false == array_key_exists($map['patientid'], $members)) { $members[$map['patientid']] = DAL::get()->find('regroupmember', $map['id']); } } } foreach ($patientIds as $patientId) { $interactCount = DAL::get()->queryValidCountOfPatientHad('doctorpatientref', $patientId); $interactCounts[$patientId] = $interactCount; } $response->RecordPatientIds = DAL::get()->queryRecordListByPatientIds('PatientHealthRecord', $patientIds); $response->patientList = $patientList; $response->groupNames = $groupNames; $response->members = $members; $response->interactCounts = $interactCounts; $response->breadcrumbNavigation = $breadcrumbNavigation; }