diff --git a/Laravel/app/Http/Controllers/API/Third/CSharpController.php b/Laravel/app/Http/Controllers/API/Third/CSharpController.php index 33b9f79..839ee58 100644 --- a/Laravel/app/Http/Controllers/API/Third/CSharpController.php +++ b/Laravel/app/Http/Controllers/API/Third/CSharpController.php @@ -15,7 +15,7 @@ class CSharpController extends Controller { public static $request; - public static $Url = 'http://192.168.5.117/WebServiceToHis_BS/AcceptMessage.ashx'; + public static $Url = 'http://192.168.5.198/WebServiceToHis_BS/AcceptMessage.ashx'; public function PacsSaveApplyInfo(Request $request) { @@ -34,10 +34,12 @@ public function SaveApply($orderNo) Log::info('推送申请单'.$orderNo); $entrust = DB::table('s_list')->where(['entrust_id' => $orderNo, 'list_status' => 2, 'is_nullify' => 0])->first(); $reservation_time=''; + $reservation_end_time=''; if(isset($entrust->roster_id) and !empty($entrust->roster_id)){ $plan= DB::table('s_source_roster_detail')->where(['id' => $entrust->roster_id])->first(); if(!!$plan){ $reservation_time=$plan->begin_time; + $reservation_end_time=$plan->end_time; } } @@ -53,7 +55,8 @@ public function SaveApply($orderNo) 'visitSqNo' => $entrust->episodeid, 'requestNo' => $entrust->app_num, 'visitTypeCode' => $patientHisTypeMap[$entrust->patient_type], - 'moOrder' => $entrust->entrust_id, + 'orderStatus'=>1 + //'feeFlag' => $entrust->is_pay == 0 ? 0 : 1, // 住院=0,其他=1 ]; $hisInfo=[]; $His = new HisController(); @@ -74,6 +77,7 @@ public function SaveApply($orderNo) $sex = 'U'; if ($entrust->user_sex == 1) $sex = 'M'; if ($entrust->user_sex == 2) $sex = 'F'; + $hisiteminfo = collect($hisInfo['itemList']??[])->firstWhere('termCode', $entrust->entrust_code); $send_data = [ 'Request' => [ 'Head' => [ @@ -90,39 +94,53 @@ public function SaveApply($orderNo) 'patientsex' => $sex, 'patientbirthday' => $entrust->user_brithday, 'age' => \Tools::calculateAge($entrust->user_brithday), + 'height' => '', + 'weight' => '', 'identifyid' => $entrust->idCardNumber, + 'healthcard' => '', + 'insurance_type' => '', 'mobilephone' => $entrust->user_phone, 'home_detail_address'=>$hisInfo['address']??'', 'visitinfo' => [ 'visitsqno' => $entrust->episodeid, - 'inpatientno'=>$hisInfo['patientNo']??'', + 'inpatientno'=>substr($entrust->episodeid, -10), // 取 visitsqno 后10位 'outpatientno'=>$hisInfo['cardNo']??'', 'caseno'=>$hisInfo['markNo']??'', 'source' => $patientTypeMap[$entrust->patient_type], + 'hospitalization_count' => '', 'bed_no' => $hisInfo['bedNo']??'', + 'roomnumber' => '', 'inpatientareacode' => $hisInfo['areaCode']??'', 'inpatientarea' => $hisInfo['areaName']??'', ], 'applyinfo' => -// [ -// 'accessionnumber' => $entrust->app_num, -// 'hisapplytime' => $entrust->reservation_date . ' ' . $reservation_time,//与pacs 张工沟通 传 预约的日期 -// 'hisapplydeptcode'=> $hisInfo['orderDeptCode']??'', -// 'hisapplydept'=> $hisInfo['orderDeptName']??'', -// 'hisapplydoctorcode'=> $hisInfo['orderPersonCode']??'', -// 'hisapplydoctor'=> $hisInfo['orderPersonName']??'', -// 'diagnosis'=> $hisInfo['diagnosisName']??'', -// 'applyorderinfo' => [ -// 'orderno' => $entrust->entrust_id, -// 'bodypartexamined' => $hisInfo['examPosiBigName']??'', -// 'studyclass1his' => $hisInfo['requestTypeName']??'', -// 'checkitemcode' => $entrust->entrust_code, -// 'checkitemname' => $entrust->entrust, -// 'factprice' =>$hisInfo['itemList'][0]['itemCost']??'', -// ], -// ], - $hisInfo - // 'hisinfo'=>$hisInfo + [ + 'accessionnumber' => $entrust->app_num, + 'hisapplytime' => $hisInfo['requestDate']??'', + 'hisapplydeptcode'=> $hisInfo['orderDeptCode']??'', + 'hisapplydept'=> $hisInfo['orderDeptName']??'', + 'hisapplydoctorcode'=> $hisInfo['orderPersonCode']??'', + 'hisapplydoctor'=> $hisInfo['orderPersonName']??'', + 'diagnosis'=> $entrust->diagnosisName, + 'isemergency'=> $entrust->his_is_emergency, + 'isarmyman'=> $hisInfo['armyFlag']??'', + 'vip_indicator'=> $hisInfo['vipFlag']??'', + 'applyorderinfo' => [ + 'orderno' => $entrust->entrust_id, + 'appoint_date' => $entrust->reservation_date . ' ' . substr($reservation_time, 0, 5), + 'register_date' => $entrust->reservation_date . ' ' . substr($reservation_end_time, 0, 5), + 'bodypartexamined' => $hisiteminfo['examPosiSmallName']??'', + 'studyclass1' => $hisInfo['requestTypeAlias']??'', + 'studyclass1his' => $hisiteminfo['execDeptName']??'', + 'studyclass1name' => $hisiteminfo['execDeptName']??'', + 'studyclass2hiscode' => $hisiteminfo['termCode']??'', + 'studyclass2his' => $hisiteminfo['termName']??'', + 'checkitemcode' => $entrust->entrust_code, + 'checkitemname' => $entrust->entrust, + 'factprice' =>$hisInfo['itemList'][0]['itemCost']??'', + ], + ] + // 'hisinfo'=>$hisInfo ] ] ] diff --git a/Laravel/app/Http/Controllers/API/Third/PacsController.php b/Laravel/app/Http/Controllers/API/Third/PacsController.php index 16db33b..e9658cf 100644 --- a/Laravel/app/Http/Controllers/API/Third/PacsController.php +++ b/Laravel/app/Http/Controllers/API/Third/PacsController.php @@ -62,7 +62,13 @@ public function GetEntrustInfo(){ "reservation_department_code", "doctor_code", - )->where(['reservation_date'=>$queryDate,'is_pay'=>1,'is_del'=>0,'is_nullify'=>0]); + )->where('reservation_date', $queryDate) + ->where('is_del', 0) + ->where('is_nullify', 0) + ->where(function($q) { + $q->where('patient_type', 0) // 住院类型不限制支付状态 + ->orWhere('is_pay', 1); // 其他类型必须已支付 + }); if(isset($dateRange)){ if(!is_array($dateRange)) return \Yz::JsonError("日期范围必须是数组"); $entrust_list=$entrust_list->whereBetween('entrust_date',[$dateRange[0],$dateRange[1]]); @@ -152,7 +158,7 @@ public function GetEntrustInfo(){ 'visitSqNo' => $entrust->episodeid, 'requestNo' => $entrust->app_num, 'visitTypeCode' => $patientHisTypeMap[$entrust->patient_type], - 'moOrder' => $entrust->entrust_id, + 'feeFlag' => $entrust->is_pay == 0 ? 0 : 1, // 住院=0,其他=1 ]; $entrust->requestTypeCode=''; $entrust->requestTypeName='';