签到+调用PACS

main
鹿和sa0ChunLuyu 1 week ago
parent e7be0ad77c
commit 728fc15fec

@ -15,7 +15,7 @@
class CSharpController extends Controller class CSharpController extends Controller
{ {
public static $request; 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) public function PacsSaveApplyInfo(Request $request)
{ {
@ -34,10 +34,12 @@ public function SaveApply($orderNo)
Log::info('推送申请单'.$orderNo); Log::info('推送申请单'.$orderNo);
$entrust = DB::table('s_list')->where(['entrust_id' => $orderNo, 'list_status' => 2, 'is_nullify' => 0])->first(); $entrust = DB::table('s_list')->where(['entrust_id' => $orderNo, 'list_status' => 2, 'is_nullify' => 0])->first();
$reservation_time=''; $reservation_time='';
$reservation_end_time='';
if(isset($entrust->roster_id) and !empty($entrust->roster_id)){ if(isset($entrust->roster_id) and !empty($entrust->roster_id)){
$plan= DB::table('s_source_roster_detail')->where(['id' => $entrust->roster_id])->first(); $plan= DB::table('s_source_roster_detail')->where(['id' => $entrust->roster_id])->first();
if(!!$plan){ if(!!$plan){
$reservation_time=$plan->begin_time; $reservation_time=$plan->begin_time;
$reservation_end_time=$plan->end_time;
} }
} }
@ -53,7 +55,8 @@ public function SaveApply($orderNo)
'visitSqNo' => $entrust->episodeid, 'visitSqNo' => $entrust->episodeid,
'requestNo' => $entrust->app_num, 'requestNo' => $entrust->app_num,
'visitTypeCode' => $patientHisTypeMap[$entrust->patient_type], 'visitTypeCode' => $patientHisTypeMap[$entrust->patient_type],
'moOrder' => $entrust->entrust_id, 'orderStatus'=>1
//'feeFlag' => $entrust->is_pay == 0 ? 0 : 1, // 住院=0其他=1
]; ];
$hisInfo=[]; $hisInfo=[];
$His = new HisController(); $His = new HisController();
@ -74,6 +77,7 @@ public function SaveApply($orderNo)
$sex = 'U'; $sex = 'U';
if ($entrust->user_sex == 1) $sex = 'M'; if ($entrust->user_sex == 1) $sex = 'M';
if ($entrust->user_sex == 2) $sex = 'F'; if ($entrust->user_sex == 2) $sex = 'F';
$hisiteminfo = collect($hisInfo['itemList']??[])->firstWhere('termCode', $entrust->entrust_code);
$send_data = [ $send_data = [
'Request' => [ 'Request' => [
'Head' => [ 'Head' => [
@ -90,39 +94,53 @@ public function SaveApply($orderNo)
'patientsex' => $sex, 'patientsex' => $sex,
'patientbirthday' => $entrust->user_brithday, 'patientbirthday' => $entrust->user_brithday,
'age' => \Tools::calculateAge($entrust->user_brithday), 'age' => \Tools::calculateAge($entrust->user_brithday),
'height' => '',
'weight' => '',
'identifyid' => $entrust->idCardNumber, 'identifyid' => $entrust->idCardNumber,
'healthcard' => '',
'insurance_type' => '',
'mobilephone' => $entrust->user_phone, 'mobilephone' => $entrust->user_phone,
'home_detail_address'=>$hisInfo['address']??'', 'home_detail_address'=>$hisInfo['address']??'',
'visitinfo' => [ 'visitinfo' => [
'visitsqno' => $entrust->episodeid, 'visitsqno' => $entrust->episodeid,
'inpatientno'=>$hisInfo['patientNo']??'', 'inpatientno'=>substr($entrust->episodeid, -10), // 取 visitsqno 后10位
'outpatientno'=>$hisInfo['cardNo']??'', 'outpatientno'=>$hisInfo['cardNo']??'',
'caseno'=>$hisInfo['markNo']??'', 'caseno'=>$hisInfo['markNo']??'',
'source' => $patientTypeMap[$entrust->patient_type], 'source' => $patientTypeMap[$entrust->patient_type],
'hospitalization_count' => '',
'bed_no' => $hisInfo['bedNo']??'', 'bed_no' => $hisInfo['bedNo']??'',
'roomnumber' => '',
'inpatientareacode' => $hisInfo['areaCode']??'', 'inpatientareacode' => $hisInfo['areaCode']??'',
'inpatientarea' => $hisInfo['areaName']??'', 'inpatientarea' => $hisInfo['areaName']??'',
], ],
'applyinfo' => 'applyinfo' =>
// [ [
// 'accessionnumber' => $entrust->app_num, 'accessionnumber' => $entrust->app_num,
// 'hisapplytime' => $entrust->reservation_date . ' ' . $reservation_time,//与pacs 张工沟通 传 预约的日期 'hisapplytime' => $hisInfo['requestDate']??'',
// 'hisapplydeptcode'=> $hisInfo['orderDeptCode']??'', 'hisapplydeptcode'=> $hisInfo['orderDeptCode']??'',
// 'hisapplydept'=> $hisInfo['orderDeptName']??'', 'hisapplydept'=> $hisInfo['orderDeptName']??'',
// 'hisapplydoctorcode'=> $hisInfo['orderPersonCode']??'', 'hisapplydoctorcode'=> $hisInfo['orderPersonCode']??'',
// 'hisapplydoctor'=> $hisInfo['orderPersonName']??'', 'hisapplydoctor'=> $hisInfo['orderPersonName']??'',
// 'diagnosis'=> $hisInfo['diagnosisName']??'', 'diagnosis'=> $entrust->diagnosisName,
// 'applyorderinfo' => [ 'isemergency'=> $entrust->his_is_emergency,
// 'orderno' => $entrust->entrust_id, 'isarmyman'=> $hisInfo['armyFlag']??'',
// 'bodypartexamined' => $hisInfo['examPosiBigName']??'', 'vip_indicator'=> $hisInfo['vipFlag']??'',
// 'studyclass1his' => $hisInfo['requestTypeName']??'', 'applyorderinfo' => [
// 'checkitemcode' => $entrust->entrust_code, 'orderno' => $entrust->entrust_id,
// 'checkitemname' => $entrust->entrust, 'appoint_date' => $entrust->reservation_date . ' ' . substr($reservation_time, 0, 5),
// 'factprice' =>$hisInfo['itemList'][0]['itemCost']??'', 'register_date' => $entrust->reservation_date . ' ' . substr($reservation_end_time, 0, 5),
// ], 'bodypartexamined' => $hisiteminfo['examPosiSmallName']??'',
// ], 'studyclass1' => $hisInfo['requestTypeAlias']??'',
$hisInfo 'studyclass1his' => $hisiteminfo['execDeptName']??'',
// 'hisinfo'=>$hisInfo 'studyclass1name' => $hisiteminfo['execDeptName']??'',
'studyclass2hiscode' => $hisiteminfo['termCode']??'',
'studyclass2his' => $hisiteminfo['termName']??'',
'checkitemcode' => $entrust->entrust_code,
'checkitemname' => $entrust->entrust,
'factprice' =>$hisInfo['itemList'][0]['itemCost']??'',
],
]
// 'hisinfo'=>$hisInfo
] ]
] ]
] ]

@ -62,7 +62,13 @@ public function GetEntrustInfo(){
"reservation_department_code", "reservation_department_code",
"doctor_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(isset($dateRange)){
if(!is_array($dateRange)) return \Yz::JsonError("日期范围必须是数组"); if(!is_array($dateRange)) return \Yz::JsonError("日期范围必须是数组");
$entrust_list=$entrust_list->whereBetween('entrust_date',[$dateRange[0],$dateRange[1]]); $entrust_list=$entrust_list->whereBetween('entrust_date',[$dateRange[0],$dateRange[1]]);
@ -152,7 +158,7 @@ public function GetEntrustInfo(){
'visitSqNo' => $entrust->episodeid, 'visitSqNo' => $entrust->episodeid,
'requestNo' => $entrust->app_num, 'requestNo' => $entrust->app_num,
'visitTypeCode' => $patientHisTypeMap[$entrust->patient_type], 'visitTypeCode' => $patientHisTypeMap[$entrust->patient_type],
'moOrder' => $entrust->entrust_id, 'feeFlag' => $entrust->is_pay == 0 ? 0 : 1, // 住院=0其他=1
]; ];
$entrust->requestTypeCode=''; $entrust->requestTypeCode='';
$entrust->requestTypeName=''; $entrust->requestTypeName='';

Loading…
Cancel
Save