1051
public function getDeptInfoAction(){
//==============获得前台请求==============
$input = file_get_contents("php://input"); //接收POST数据
$req = simplexml_load_string($input); //提取POST数据为simplexml对象
//==============封装HIS请求==============
$TradeCode = "1012";
$ExtOrgCode = "南方医务通";
$ExtUserID = "NFYWT";
$ClientType = "";
$HospitalId = "";
$DepartmentType = "";
$DepartmentCode = $req->deptId;
//================调用自己WS===============
$postData = "$TradeCode$ExtOrgCode$ClientType$HospitalId$DepartmentType$DepartmentCode$ExtUserID";
$postData = str_replace(' ','%20',$postData);
$wsdl = "http://yygh1.dept.nfyy.com/csp/oep/DHC.OEP.BS.OEPSTANWebService.cls?soap_method=QueryDepartment&Input=";
$result = file_get_contents($wsdl.$postData);
Log::soaphis("getDoctorInfo:req\r\n".$postData);
$res = call_user_func(array($_ENV["commonClass"],"SoapToXml"),$result,"QueryDepartment");
Log::soaphis("getDoctorInfo:res\r\n".$res);
$res = simplexml_load_string($res);
//==============处理返回==============
$refxml = "";
$ParentId = "";
$xmldata = $res->Departments->Department;
$refxml .= "";
//$refxml .= "".$res->ResultCode."".$res->ResultContent."";
//如果为空,则分组出来
//提取相同的分组列表
$arr = array();
foreach($xmldata as $key=>$v){
if($v->ParentId != $ParentId){
$arr[] =$v->ParentId;
$ParentId = $v->ParentId;
}
}
$arr=array_unique($arr);
foreach($arr as $key=>$v){
$refxml .="".$v."".$v."-1";
}
foreach($xmldata as $key=>$v){
$refxml .="".$v->DepartmentCode."".$v->DepartmentName."".$v->ParentId."".$v->DepartmentAddress."".$v->Description."";
}
$refxml .= "";
echo $refxml;
}
//科室信息查询接口
//1051
public function getDoctorInfoAction(){
//==============获得前台请求==============
$input = file_get_contents("php://input"); //接收POST数据
$req = simplexml_load_string($input); //提取POST数据为simplexml对象
//==============封装HIS请求==============
$TradeCode = "1013";
$ExtOrgCode = "南方医务通";
$ExtUserID = "NFYWT";
$ClientType = "";
$HospitalId = "";
$DoctorName = $req->doctorId;
$DepartmentCode = $req->deptId;
//================调用自己WS===============
$postData = "$TradeCode$ExtOrgCode$ClientType$HospitalId$ExtUserID$DepartmentCode$DoctorName";
$postData = str_replace(' ','%20',$postData);
$wsdl = "http://yygh1.dept.nfyy.com/csp/oep/DHC.OEP.BS.OEPSTANWebService.cls?soap_method=QueryDoctor&Input=";
$result = file_get_contents($wsdl.$postData);
Log::soaphis("getDoctorInfo:req\r\n".$postData);
$res = call_user_func(array($_ENV["commonClass"],"SoapToXml"),$result,"QueryDoctor");
Log::soaphis("getDoctorInfo:res\r\n".$res);
$res = simplexml_load_string($res);
//==============处理返回==============
$refxml = "";
$xmldata = $res->Doctors->Doctor;
$refxml .= "";
$refxml .= "".$res->ResultCode."".$res->ResultContent."";
foreach($xmldata as $key=>$v){
$refxml .="".$v->DoctorCode."".$v->DoctorName."".$v->DepartmentCode."".$v->DoctorTitleCode."100".$v->DoctorSpec."".$v->ImageUrl."";
}
$refxml .= "";
echo $refxml;
}
//医生号源信息查询接口
//105121010104362013-03-222013-03-29
public function getRegInfoAction(){
//==============获得前台请求==============
$input = file_get_contents("php://input"); //接收POST数据
$req = simplexml_load_string($input); //提取POST数据为simplexml对象
$TradeCode = "1004";
$ExtOrgCode = "南方医务通";
$ExtUserID = "NFYWT";
$ClientType ="";
$HospitalId ="";
$DeptType = "";
$DoctorCode = $req->doctorId;
$SessType = "";
$StartDate = $req->startDate;
$EndDate = $req->endDate;
$RBASSessionCode = "";
$ServiceCode = "";
$StopScheduleFlag = "";
$DepartmentCode = $req->deptId;
$SearchCode = "";
$postData = "$HospitalId$ExtOrgCode$ExtUserID$ClientType$TradeCode$DeptType$DoctorCode$SessType$StartDate$EndDate$RBASSessionCode$ServiceCode$StopScheduleFlag$DepartmentCode$SearchCode";
$postData = str_replace(' ','%20',$postData);
$wsdl = "http://yygh1.dept.nfyy.com/csp/oep/DHC.OEP.BS.OEPSTANWebService.cls?soap_method=QuerySchedule&Input=";
$result = file_get_contents($wsdl.$postData);
Log::soaphis("getRegInfo:req\r\n".$postData);
Log::soaphis("getRegInfo:req\r\n".$result);
$res = call_user_func(array($_ENV["commonClass"],"SoapToXml"),$result,"QuerySchedule");
Log::soaphis("getRegInfo:res\r\n".$res);
$res = simplexml_load_string($res);
//==============处理返回==============
//ScheduleStatus N 才可以预约 没有过滤
$refxml = "";
$refxml .= "";
$refxml .= "".$res->ResultCode."".$res->ResultContent."";
$refxml .= $res->Schedules->asXML();
$refxml .= "";
echo $refxml;
}
//医生号源分时信息查询接口
//105170342294462013-03-291
public function getTimeRegInfoAction(){
//==============获得前台请求==============
$input = file_get_contents("php://input"); //接收POST数据
$req = simplexml_load_string($input); //提取POST数据为simplexml对象
$TradeCode = "10041";
$ExtOrgCode = "南方医务通";
$ExtUserID = "NFYWT";
$ClientType = "";
$HospitalId = "";
$RBASSessionCode = $req->timeFlag;
$ScheduleItemCode = "";
$DepartmentCode = $req->deptId;
$DoctorCode = $req->doctorId;
$ServiceDate = $req->regDate;
$postData = "$TradeCode$ExtOrgCode$ClientType$HospitalId$ExtUserID$DepartmentCode$DoctorCode$RBASSessionCode$ScheduleItemCode$ServiceDate";
$postData = str_replace(' ','%20',$postData);
$wsdl = "http://yygh1.dept.nfyy.com/csp/oep/DHC.OEP.BS.OEPSTANWebService.cls?soap_method=QueryScheduleTimeInfo&Input=";
$result = file_get_contents($wsdl.$postData);
Log::soaphis("getTimeRegInfo:req\r\n".$postData);
$res = call_user_func(array($_ENV["commonClass"],"SoapToXml"),$result,"QueryScheduleTimeInfo");
Log::soaphis("getTimeRegInfo:res\r\n".$res);
$res = simplexml_load_string($res);
//==============处理返回==============
$refxml = "";
$refxml .= "";
//$refxml .= "".$res->ResultCode."".$res->ResultContent."";
$xmldata = $res->TimeRanges->TimeRange;
foreach($xmldata as $key=>$v){
$refxml .="".$v->ScheduleItemCode."".$v->StartTime."".$v->EndTime."".$v->AvailableTotalNum."".$v->AvailableLeftNum."";
}
$refxml .= "";
echo $refxml;
}
//医院用户信息绑定就诊卡接口
//1051440507XXXXXXXX0021XXX
public function confirmPatientAction(){
//==============获得前台请求==============
$input = file_get_contents("php://input"); //接收POST数据
$req = simplexml_load_string($input); //提取POST数据为simplexml对象
//==============封装HIS请求==============
$TradeCode ="3300";
$ExtOrgCode = "南方医务通";
$ExtUserID = "NFYWT";
$ClientType = "";
$HospitalId = "";
$TransactionId = "";
$TerminalID = "";
$PatientCard = "";
$CardType = "";
$Phone = "";
$IDCardType = "02";
$PatientID = "";
$IDNo = $req->userIdCard;
$PatientName = $req->username;
//================调用自己WS===============
$postData = "$TradeCode$ExtOrgCode$ClientType$HospitalId$ExtUserID$TransactionId$TerminalID$PatientCard$CardType$PatientID$Phone$IDCardType$IDNo$PatientName";
$postData = str_replace(' ','%20',$postData);
$wsdl = "http://yygh2.dept.nfyy.com/csp/oep/DHC.OEP.BS.OEPSTANWebService.cls?soap_method=GetPatInfo&Input=";
$result = file_get_contents($wsdl.$postData);
Log::soaphis("confirmPatient:req\r\n".$postData);
$res = call_user_func(array($_ENV["commonClass"],"SoapToXml"),$result,"GetPatInfo");
Log::soaphis("confirmPatient:res\r\n".$res);
try{
$res = simplexml_load_string($res);
//==============处理返回==============
$refxml = "";
if($res->ResultCode=="0")
{
$refxml ="0用户存在".$res->DOB."".$res->Sex."".$res->PatientID."".$res->CardNo."".$res->Mobile."1";
}else{
$refxml ="1输入的身份证号和姓名与医院登记不符0";
}
}catch(Exception $e) {
$refxml ="1输入的身份证号和姓名与医院登记不符0";
}
/*$refxml ="0用户存在1986-02-02男12345678123456180117701851";
echo $refxml; */
}
//医院用户信息绑定就诊卡接口
//1051440507XXXXXXXX00214401000000000000
public function cardMoneyAction(){
//==============获得前台请求==============
$input = file_get_contents("php://input"); //接收POST数据
$req = simplexml_load_string($input); //提取POST数据为simplexml对象
//==============封装HIS请求==============
$TradeCode ="3300";
$ExtOrgCode = "南方医务通";
$ExtUserID = "NFYWT";
$ClientType = "";
$HospitalId = "";
$TransactionId = "";
$TerminalID = "";
$PatientCard = "";
$CardType = "";
$Phone = "";
$IDCardType = "";
$PatientID = $req->patientId;
$IDNo = "";
$PatientName = "";
//================调用自己WS===============
$postData = "$TradeCode$ExtOrgCode$ClientType$HospitalId$ExtUserID$TransactionId$TerminalID$PatientCard$CardType$PatientID$Phone$IDCardType$IDNo$PatientName";
$postData = str_replace(' ','%20',$postData);
$wsdl = "http://yygh2.dept.nfyy.com/csp/oep/DHC.OEP.BS.OEPSTANWebService.cls?soap_method=GetPatInfo&Input=";
$result = file_get_contents($wsdl.$postData);
Log::soaphis("cardMoney:req\r\n".$postData);
$res = call_user_func(array($_ENV["commonClass"],"SoapToXml"),$result,"GetPatInfo");
Log::soaphis("cardMoney:res\r\n".$res);
try{
$res = simplexml_load_string($res);
//==============处理返回==============
$refxml = "";
if($res->ResultCode=="0")
{
$refxml ="0查询成功".$res->ParentlifeAccount."1";
}else{
$refxml ="1$res->ResultContent0";
}
}catch(Exception $e) {
$refxml ="1系统出错0";
}
echo $refxml;
}
//医院用户信息绑定就诊卡接口
// 1051440507XXXXXXXX0021XXXF4401000000000000
public function confirmCardAction(){
//==============获得前台请求==============
$input = file_get_contents("php://input"); //接收POST数据
$req = simplexml_load_string($input); //提取POST数据为simplexml对象
//==============封装HIS请求==============
$TradeCode ="3300";
$ExtOrgCode = "南方医务通";
$ExtUserID = "NFYWT";
$ClientType = "";
$HospitalId = "";
$TransactionId = "";
$TerminalID = "";
$PatientCard = $req->userCard;
$CardType = "02";
$Phone = "";
$IDCardType = "";
$PatientID = "";
$IDNo = $req->userIdCard;
$PatientName = $req->username;
//================调用自己WS===============
$postData = "$TradeCode$ExtOrgCode$ClientType$HospitalId$ExtUserID$TransactionId$TerminalID$PatientCard$CardType$PatientID$Phone$IDCardType$IDNo$PatientName";
$postData = str_replace(' ','%20',$postData);
$wsdl = "http://yygh2.dept.nfyy.com/csp/oep/DHC.OEP.BS.OEPSTANWebService.cls?soap_method=GetPatInfo&Input=";
$result = file_get_contents($wsdl.$postData);
Log::soaphis("confirmCard:req\r\n".$postData);
$res = call_user_func(array($_ENV["commonClass"],"SoapToXml"),$result,"GetPatInfo");
Log::soaphis("confirmCard:res\r\n".$res);
try{
$res = simplexml_load_string($res);
//==============处理返回==============
$refxml = "";
if($res->ResultCode=="0")
{
if($PatientName==strval($res->PatientName)){
$refxml ="0用户存在".$res->PatientID."1";
}else{
$refxml ="1姓名或身份证与医院信息不对,请到医院补录后,再绑定0";
}
}else{
$refxml ="1病人信息不存在或信息不全,请到医院补录后,再绑定0";
}
}catch(Exception $e) {
$refxml ="1系统出错0";
}
echo $refxml;
}
//{I_hospitalId}{D_idNo}{D_trueName}{D_sex}{D_birthDay}{D_phone}{D_nation}
//新建病人主索引(3014,3011)
public function createPatientAction(){
//==============获得前台请求==============
$input = file_get_contents("php://input"); //接收POST数据
$req = simplexml_load_string($input); //提取POST数据为simplexml对象
$TradeCode = "3014";
$ExtUserID = "NFYWT";
$PatientType = "07";
$PatientName = $req->username;
$Sex = (strval($req->sex) == "男" ? "1":"2");
$DOB = $req->birthDay;
$MaritalStatus = "";
$Nation = "";
$Occupation = "";
$Nationality = "";
$IDType ="01";
$IDNo = $req->userIdCard;
$Address = $req->address;
$AddressLocus = "";
$Zip ="";
$Company = "";
$CompanyAddr = "";
$CompanyZip = "";
$CompanyTelNo = "";
$TelephoneNo = "";
$Mobile = $req->phone;
$ContactName = "";
$ContactAddress = "";
$Relation = "";
$Zip = "";
$ContactTelNo = "";
$InsureCardFlag = "";
$InsureCardNo= "";
//================调用自己WS===============
$postData = "$TradeCode$ExtUserID$PatientType$PatientName$Sex$DOB$MaritalStatus$Nation$Occupation$Nationality$IDType$IDNo$Address$AddressLocus$Zip$Company$CompanyAddr$CompanyZip$CompanyTelNo$TelephoneNo$Mobile$ContactName$ContactAddress$Relation$ContactTelNo$InsureCardFlag$InsureCardNo";
$postData = str_replace(' ','%20',$postData);
$wsdl = "http://yygh2.dept.nfyy.com/csp/oep/DHC.OEP.BS.OEPSTANWebService.cls?soap_method=SavePatientCard&Input=";
$result = file_get_contents($wsdl.$postData);
Log::soaphis("createPatient:req\r\n".$postData);
$res = call_user_func(array($_ENV["commonClass"],"SoapToXml"),$result,"SavePatientCard");
Log::soaphis("createPatient:res\r\n".$res);
$res = simplexml_load_string($res);
//==============处理返回==============
$refxml .= "";
if($res->ResultCode=="0") {
$refxml .="0";
}
else{
$refxml .="1";
}
$refxml .="".$res->ResultContent."".$res->PatientID."";
$refxml .= "";
echo $refxml;
}
//1477445948625197100018034251803
//2016-10-27S08:3009:00445122198607155233
//陈礼洪M180117701831986-07-15
//445122198607155233陈礼洪陈礼洪033043014
//2016-10-26 09:39:07100300
//预约(1000)
public function addOrderAction(){
//==============获得前台请求==============
$input = file_get_contents("php://input"); //接收POST数据
$req = simplexml_load_string($input); //提取POST数据为simplexml对象
//==============封装HIS请求==============
$TradeCode = "1000";
$ExtOrgCode = "南方医务通";
$ExtUserID = "NFYWT";
$ClientType = "";
$HospitalId ="";
$TransactionId = $req->orderId;
$ScheduleItemCode = $req->scheduleCode;
$CardType = "02";
$CredTypeCode ="01";
$IDCardNo =$req->userIdCard;
$TelePhoneNo = "";
$MobileNo = $req->userMobile;
$PatientName = $req->userName;
$PayFlag ="";
$PayModeCode ="";
$PayBankCode = "";
$PayCardNo ="";
$PayFee =strval(((float)(strval($req->RegFee))/100)+((float)(strval($req->CheckupFee))/100));
$PayInsuFee ="";
$PayInsuFeeStr="";
$PayTradeNo ="";
$LockQueueNo ="";
$Gender ="";
$Address ="";
$HISApptID ="";
$SeqCode ="";
$AdmitRange ="";
$StartTime =$req->startTime;
$EndTime =$req->endTime;
$PatientID = $req->patCardId;
//================调用自己WS===============
$postData = "$TradeCode$ExtOrgCode$ClientType$HospitalId$ExtUserID$TransactionId$ScheduleItemCode$CardNo$CardType$CredTypeCode$IDCardNo$TelePhoneNo$MobileNo$PatientName$PayFlag$PayModeCode$PayBankCode$PayCardNo$PayFee$PayInsuFee$PayInsuFeeStr$PayTradeNo$LockQueueNo$Gender$Address$HISApptID$SeqCode$AdmitRange$StartTime$EndTime$PatientID";
$postData = str_replace(' ','%20',$postData);
$wsdl = "http://yygh2.dept.nfyy.com/csp/oep/DHC.OEP.BS.OEPSTANWebService.cls?soap_method=BookService&Input=";
$result = file_get_contents($wsdl.$postData);
Log::soaphis("addOrder:req\r\n".$postData);
/*$wsdl = "yygh2.wsdl";//webservice服务的地址
$client=new SoapClient($wsdl);
$param = array(array("Input"=>$postData));
$result = $client->__soapCall('BookService', $param);
$res = reset($result); */
$res = call_user_func(array($_ENV["commonClass"],"SoapToXml"),$result,"BookService");
Log::soaphis("addOrder:res\r\n".$res);
$res = simplexml_load_string($res);
//==============处理返回==============
$refxml = "";
$refxml .= "";
if($res->ResultCode=="0") {
$refxml .="0";
}
else{
$refxml .="1";
}
$refxml .="".$res->ResultContent."".$res->OrderCode."".$res->SeqCode."".$res->RegFee."".$res->AdmitRange."".$res->AdmitAddress."".$res->OrderContent."".$res->TransactionId."";
$refxml .= "";
echo $refxml;
/* $refxml .= "";
$refxml .="0";
$refxml .="成功112331151234";
$refxml .= "";
echo $refxml; */
}
//105191303204249270913032042492702013-03-22 10:50:06临时有事
public function cancelOrderAction(){
//==============获得前台请求==============
$input = file_get_contents("php://input"); //接收POST数据
$req = simplexml_load_string($input); //提取POST数据为simplexml对象
//1108南方医务通NFYWT2700||599||1
//==============封装HIS请求==============
$TradeCode ="1108";
$ExtOrgCode = "南方医务通";
$ExtUserID = "NFYWT";
$ClientType = "";
$HospitalId = "";
$TransactionId =$req->orderId;
$OrderCode =$req->orderIdHis;
//================调用自己WS===============
$postData = "$TradeCode$ExtOrgCode$ClientType$HospitalId$ExtUserID$TransactionId$OrderCode";
$postData = str_replace(' ','%20',$postData);
$wsdl = "http://yygh2.dept.nfyy.com/csp/oep/DHC.OEP.BS.OEPSTANWebService.cls?soap_method=CancelOrder&Input=";
$result = file_get_contents($wsdl.$postData);
Log::soaphis("cancelOrder:req\r\n".$postData);
$res = call_user_func(array($_ENV["commonClass"],"SoapToXml"),$result,"CancelOrder");
Log::soaphis("cancelOrder:res\r\n".$res);
/* Log::soaphis("cancelOrder:req\r\n".$postData);
$wsdl = "yygh2.wsdl";//webservice服务的地址
$client=new SoapClient($wsdl);
$param = array(array("Input"=>$postData));
$result = $client->__soapCall('CancelOrder', $param);
$res = reset($result);
Log::soaphis("cancelOrder:res\r\n".$res); */
$res = simplexml_load_string($res);
//==============处理返回==============
$refxml = "";
$refxml .= "";
if($res->ResultCode=="0") {
$refxml .="0";
}
else{
$refxml .="1";
}
$refxml .="".$res->ResultContent."";
$refxml .= "";
echo $refxml;
}
///
/// 105191303224689772913032246897729130322468977291303224689772
/// 002373700
/// 42013-03-22 10:57:430
///
//病人取号确认(2001)
public function payOrderAction(){
//==============获得前台请求==============
$input = file_get_contents("php://input"); //接收POST数据
$req = simplexml_load_string($input); //提取POST数据为simplexml对象
//1108南方医务通
//NFYWT0
//CPP
//2016-09-232016092311404623||223||1
//
//3304301420160923114046
//==============封装HIS请求==============
$TradeCode = "2001";
$ExtOrgCode = "南方医务通";
$ExtUserID = "NFYWT";
$ClientType = "";
$HospitalId = "";
$OrderCode = $req->orderIdHis;
$PatientID = $req->patientId;
$PayOrderId = "";
$PayAmt = strval((float)(strval($req->payAmout))/100);
$PayModeCode = "CPP";
$OrgHISTradeNo = "";
$PayCardNo= "";
$RevTranFlag = "";
$BankDate = "";
$BankAccDate = "";
$TransactionId = $req->orderId;
$BankTradeNo= "";
$PayDate = "";
$PayTime = $req->payTime;
$PayTradeStr = "";
$BankCode = "";
$OrgPaySeqNo = "";
$PayInsuFeeStr = "";
$ResultContent = "";
$PayOrderId = "";
$PayTradeNo = $req->orderIdPAY;
//================调用自己WS===============
$postData = "$TradeCode$ExtOrgCode$ClientType$HospitalId$ExtUserID$OrgHISTradeNo$PayCardNo$RevTranFlag$BankDate$BankAccDate$PayModeCode$TransactionId$BankTradeNo$PayDate$PayTime$PayTradeStr$OrderCode$BankCode$ResultCode$OrgPaySeqNo$PayInsuFeeStr$PayAmt$PayTradeNo$ResultContent$PatientID$PayOrderId";
$postData = str_replace(' ','%20',$postData);
$wsdl = "http://yygh2.dept.nfyy.com/csp/oep/DHC.OEP.BS.OEPSTANWebService.cls?soap_method=OPAppArrive&Input=";
$result = file_get_contents($wsdl.$postData);
Log::soaphis("payOrder:req\r\n".$postData);
$res = call_user_func(array($_ENV["commonClass"],"SoapToXml"),$result,"OPAppArrive");
Log::soaphis("payOrder:res\r\n".$res);
/* Log::soaphis("payOrder:req\r\n".$postData);
$wsdl = "yygh2.wsdl";//webservice服务的地址
$client=new SoapClient($wsdl);
$param = array(array("Input"=>$postData));
$result = $client->__soapCall('OPAppArrive', $param);
$res = reset($result);
Log::soaphis("payOrder:res\r\n".$res); */
$res = simplexml_load_string($res);
//==============处理返回==============
$refxml = "";
$refxml .= "";
if($res->ResultCode=="0") {
$refxml .="0";
}
else{
$refxml .="1";
}
$refxml .="".$res->ResultContent."".$res->SeqCode."".$res->AdmNo."";
$refxml .= "";
echo $refxml;
/*
$refxml = "";
$refxml .= "";
$refxml .="0";
$refxml .="成功1113333";
$refxml .= "";
echo $refxml;*/
}
//
//904 116
///
/// 105191303204353987913032246897729130322468977291303204353987400
/// 2013-03-22 10:46:53没有时间00
///
//退号(1003)
public function returnPayAction(){
//==============获得前台请求==============
$input = file_get_contents("php://input"); //接收POST数据
$req = simplexml_load_string($input); //提取POST数据为simplexml对象
//1108南方医务通
//NFYWTTF299CPP
//44
//==============封装HIS请求==============
$TradeCode = "1108";
$ExtOrgCode = "南方医务通";
$ExtUserID = "NFYWT";
$ClientType = "";
$HospitalId = "";
$TransactionId = $req->orderId;
$AdmNo = $req->clinicCode;
$RefundType = "TF";
$BankCode = "";
$BankDate = "";
$BankTradeNo = "";
$ResultCode = "";
$ResultContent = "";
$PayCardNo = "";
$BankAccDate = "";
$RevTranFlag = "";
$PatientID = $req->patientId;
$PayAmt = "";
$OrgHISTradeNo = "";
$OrgPaySeqNo = "";
$PayOrderId = $req->orderIdPay;
$PayAmt = strval((float)(strval($req->returnFee))/100);
$PayModeCode = "CPP";
//================调用自己WS===============
$postData = "$TradeCode$ExtOrgCode$ClientType$HospitalId$ExtUserID$AdmNo$TransactionId$RefundType$BankCode$BankDate$BankTradeNo$ResultCode$ResultContent$PayCardNo$BankAccDate$RevTranFlag$PatientID$PayAmt$OrgHISTradeNo$OrgPaySeqNo$PayOrderId$PayTime$PayModeCode";
$postData = str_replace(' ','%20',$postData);
$wsdl = "http://yygh2.dept.nfyy.com/csp/oep/DHC.OEP.BS.OEPSTANWebService.cls?soap_method=CancelReg&Input=";
$result = file_get_contents($wsdl.$postData);
Log::soaphis("returnPay:req\r\n".$postData);
$res = call_user_func(array($_ENV["commonClass"],"SoapToXml"),$result,"CancelReg");
Log::soaphis("returnPay:res\r\n".$res);
/*Log::soaphis("returnPay:req\r\n".$postData);
$wsdl = "yygh2.wsdl";//webservice服务的地址
$client=new SoapClient($wsdl);
$param = array(array("Input"=>$postData));
$result = $client->__soapCall('CancelReg', $param);
$res = reset($result);
Log::soaphis("returnPay:res\r\n".$res); */
$res = simplexml_load_string($res);
//==============处理返回==============
$refxml = "";
$refxml .= "";
if($res->ResultCode=="0") {
$refxml .="0";
}
else{
$refxml .="1";
}
$refxml .="".$res->ResultContent."";
$refxml .= "";
echo $refxml;
}
//913032043914911051
//最近一次就诊日期
public function getLastClinicDateAction(){
//==============获得前台请求==============
$input = file_get_contents("php://input"); //接收POST数据
$req = simplexml_load_string($input); //提取POST数据为simplexml对象
//1104南方医务通
//NFYWT33043014
//2016-09-112016-09-28
//HQTJ 可以查询全部渠道的挂号记录
//==============封装HIS请求==============
$TradeCode = "1104";
$ExtOrgCode ="南方医务通";
$ExtUserID = "HQTJ";
$ClientType = "";
$HospitalId = "";
$CardType = "";
$PatientCard = "";
$PatientID = $req->patientId;
$StartDate = date("Y-m-d",strtotime("-1 month"));
$EndDate = date("Y-m-d",time());
//================调用自己WS===============
$postData = "$TradeCode$ExtOrgCode$ClientType$HospitalId$ExtUserID$CardType$PatientCard$PatientID$StartDate$EndDate";
$postData = str_replace(' ','%20',$postData);
$wsdl = "http://yygh2.dept.nfyy.com/csp/oep/DHC.OEP.BS.OEPSTANWebService.cls?soap_method=QueryAdmOPReg&Input=";
$result = file_get_contents($wsdl.$postData);
Log::soaphis("getLastClinicDate:req\r\n".$postData);
$res = call_user_func(array($_ENV["commonClass"],"SoapToXml"),$result,"QueryAdmOPReg");
Log::soaphis("getLastClinicDate:res\r\n".$res);
$res = simplexml_load_string($res);
//==============处理返回==============
$refxml = "";
$refxml .= "";
if($res->ResultCode=="0") {
$refxml .="0";
}
else{
$refxml .="1";
}
$refxml .="".$res->ResultContent."";
$xmldata = $res->Orders->Order;
//提取相同的分组列表
$arr = array();
foreach($xmldata as $key=>$v){
if($v->Status=="正常"){
$arr[] = array("RegId"=>$v->RegID,"AdmitDate"=>$v->AdmitDate);
}
}
$arr = end($arr);
if($arr!=null){
$refxml .="".$arr[AdmitDate]."".$arr[RegId]."";
}else{
$refxml .="";
}
$refxml .= "";
echo $refxml;
}
//10519130320439149191303204391491
//检验报告列表查询
public function labTestListAction(){
//==============获得前台请求==============
$input = file_get_contents("php://input"); //接收POST数据
$req = simplexml_load_string($input); //提取POST数据为simplexml对象
//==============封装HIS请求==============
$ClinicSeq = $req->clinicCode;
//================调用自己WS===============
$postData = "$ClinicSeq";
$postData = str_replace(' ','%20',$postData);
$wsdl = "http://yygh2.dept.nfyy.com/csp/oep/DHC.OEP.BS.OEPSTANWebService.cls?soap_method=LISgetReport&Input=";
$result = file_get_contents($wsdl.$postData);
Log::soaphis("labTestList:req\r\n".$postData);
$res = call_user_func(array($_ENV["commonClass"],"SoapToXml"),$result,"LISgetReport");
Log::soaphis("labTestList:res\r\n".$res);
$res = simplexml_load_string($res);
/* Log::soaphis("labTestList:req\r\n".$postData);
$wsdl = "yygh2.wsdl";//webservice服务的地址
$client=new SoapClient($wsdl);
$param = array(array("Input"=>$postData));
$result = $client->__soapCall('LISgetReport', $param);
$res = reset($result);
Log::soaphis("labTestList:res\r\n".$res);
$res = simplexml_load_string($res); */
//==============处理返回==============
//$res = "0成功1000005482||B002||1心肌酶谱2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B004||1电解质三项2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B005||1肝功12016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B008||1血酯四项2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B010||1血糖测定2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B034||1肾功五项2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B002||1心肌酶谱2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B004||1电解质三项2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B005||1肝功12016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B008||1血酯四项2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B010||1血糖测定2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B034||1肾功五项2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B002||1心肌酶谱2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B004||1电解质三项2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B005||1肝功12016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B008||1血酯四项2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B010||1血糖测定2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B034||1肾功五项2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B002||1心肌酶谱2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B004||1电解质三项2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B005||1肝功12016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B008||1血酯四项2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B010||1血糖测定2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B034||1肾功五项2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B002||1心肌酶谱2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B004||1电解质三项2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B005||1肝功12016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B008||1血酯四项2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B010||1血糖测定2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B034||1肾功五项2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005483||B027||1糖化血红蛋白2016-09-21 00:10:481曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病谢传珍1331000005482||B002||1心肌酶谱2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B004||1电解质三项2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B005||1肝功12016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B008||1血酯四项2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B010||1血糖测定2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005482||B034||1肾功五项2016-09-21 00:11:301曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病纪婷婷1331000005484||C123||1泌乳素(PRL)2016-09-21 00:12:091曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病罗敏1331000005485||A083||1血细胞分析(五分类)2016-09-21 00:10:051曾令清55岁女HQXXGNKMZ-惠侨心血管内科门诊高血压病刘志伟133";
//$res = "0成功800000003087||A083||1血细胞分析(五分类)2016-12-27 00:17:501蔡丽焕24岁女中医内科门诊腰痹病demodemo1243812438";
$refxml = "";
$refxml .= "";
$xmldata = $res->AdmList->Report;
foreach($xmldata as $key=>$v){
if($v->InspectionId!=""){
$refxml .="".$v->InspectionId."".$v->InspectionName."".(strval($v->Status) == "1" ? "0":"1")."".$v->InspectionDate."".$v->InspectionDate."";
}
}
$refxml .= "";
echo $refxml;
}
// 1000151202646107
//医院检验结果列表
public function labTestInfoAction(){
//==============获得前台请求==============
$input = file_get_contents("php://input"); //接收POST数据
$req = simplexml_load_string($input); //提取POST数据为simplexml对象
//==============封装HIS请求==============
$InspectionId =$req->testNo;
//================调用自己WS===============
$postData = "$InspectionId";
$postData = str_replace(' ','%20',$postData);
$wsdl = "http://yygh2.dept.nfyy.com/csp/oep/DHC.OEP.BS.OEPSTANWebService.cls?soap_method=LISgetReportItem&Input=";
$result = file_get_contents($wsdl.$postData);
Log::soaphis("labTestInfo:req\r\n".$postData);
$res = call_user_func(array($_ENV["commonClass"],"SoapToXml"),$result,"LISgetReportItem");
Log::soaphis("labTestInfo:res\r\n".$res);
$res = simplexml_load_string($res);
/*Log::soaphis("labTestInfo:req\r\n".$postData);
$wsdl = "yygh2.wsdl";//webservice服务的地址
$client=new SoapClient($wsdl);
$param = array(array("Input"=>$postData));
$result = $client->__soapCall('LISgetReportItem', $param);
$res = reset($result);
Log::soaphis("labTestInfo:res\r\n".$res);
$res = simplexml_load_string($res); */
//==============处理返回==============
//$res = "0成功- AST天门冬氨酸氨基转移酶031U/L15~402016-09-21 00:11:30NAST血清
- LDH乳酸脱氢酶0151U/LH0~2482016-09-21 00:11:30LDH血清
- HBDHa-羟丁酸脱氢酶0107U/LH90~1802016-09-21 00:11:30HBDH血清
- CK肌酸激酶0110U/LH38~1742016-09-21 00:11:30CK血清
- CK_MB心型肌酸激酶010U/LH0~242016-09-21 00:11:30CK_MB血清
";
//$res = simplexml_load_string($res);
$refxml = "";
$refxml .= "";
$xmldata = $res->Item;
//abnormalIndicator 高低 暂时无 ItemRef范围要拆分
foreach($xmldata as $key=>$v){
$limit =explode('~',$v->ItemRef);
$abtemp = "";
if ($v->ResultFlag == "L")
{
$abtemp = "↓";
}
else if ($v->ResultFlag == "H")
{
$abtemp = "↑";
}
else
{
$abtemp = "";
}
$refxml .="".$v->ItemId."".$v->ItemName."".$abtemp."".$v->TestResult."".$v->Unit."".$limit[0]."".$limit[1]."";
}
$refxml .= "";
echo $refxml;
}
//10519130320439149191303204391491
//医院检查结果列表
public function examListAction(){
//==============获得前台请求==============
$input = file_get_contents("php://input"); //接收POST数据
$req = simplexml_load_string($input); //提取POST数据为simplexml对象
//==============封装HIS请求==============
$ClinicSeq = $req->clinicCode;
//================调用自己WS===============
$postData = "$ClinicSeq";
$postData = str_replace(' ','%20',$postData);
$wsdl = "http://yygh2.dept.nfyy.com/csp/oep/DHC.OEP.BS.OEPSTANWebService.cls?soap_method=PACSgetReport&Input=";
$result = file_get_contents($wsdl.$postData);
Log::soaphis("examList:req\r\n".$postData);
$res = call_user_func(array($_ENV["commonClass"],"SoapToXml"),$result,"PACSgetReport");
Log::soaphis("examList:res\r\n".$res);
$res = simplexml_load_string($res);
//==============处理返回==============
//$res = "0成功13460腰椎正侧位片2016-09-221何春1978-04-022407";
//$res = simplexml_load_string($res);
$refxml = "";
$refxml .= "";
$xmldata = $res->AdmList->Report;
foreach($xmldata as $key=>$v){
$refxml .="".$v->ReportId."".$v->ReportTitle."".(strval($v->Status) == "1" ? "0":"1")."".$v->ReportDate."".$v->ReportDate."";
}
$refxml .= "";
echo $refxml;
}
//1000151202646107
//医院检验结果列表
public function examInfoAction(){
//==============获得前台请求==============
$input = file_get_contents("php://input"); //接收POST数据
$req = simplexml_load_string($input); //提取POST数据为simplexml对象
//==============封装HIS请求==============
$ReportId = $req->examNo;
//================调用自己WS===============
$postData = "$ReportId";
$postData = str_replace(' ','%20',$postData);
$wsdl = "http://yygh2.dept.nfyy.com/csp/oep/DHC.OEP.BS.OEPSTANWebService.cls?soap_method=PACSgetReportDetail&Input=";
$result = file_get_contents($wsdl.$postData);
Log::soaphis("examInfo:req\r\n".$postData);
$res = call_user_func(array($_ENV["commonClass"],"SoapToXml"),$result,"PACSgetReportDetail");
Log::soaphis("examInfo:res\r\n".$res);
$res = simplexml_load_string($res);
//==============处理返回==============
//$res = "0成功- 惠侨脊柱骨科门诊()腰椎生理曲度变直;椎列连续;部分腰椎椎体缘见唇状骨质增生影;第五腰椎横突肥大,左侧与骶骨形成假关节;其余椎体、附件及椎间隙未见异常;软组织未见异常;其它:未见异常。2016-09-22 16:48:312016-09-22 16:48:31张耀旋
";
//$res = simplexml_load_string($res);
$refxml = "";
$refxml .= "";
$xmldata = $res->Item;
//abnormal 阳阴性无 recommedation 建议无 examClass 检查项目无
foreach($xmldata as $key=>$v){
$refxml .="".$v->Diagnosis."".$v->Examination."".$v->ExaminationDate."";
}
$refxml .= "";
echo $refxml;
}
//913032043914911051
//最近一次发票信息
public function getGuideListAction(){
//==============获得前台请求==============
$input = file_get_contents("php://input"); //接收POST数据
$req = simplexml_load_string($input); //提取POST数据为simplexml对象
//HQTJ 可以查询全部渠道的挂号记录
//==============封装HIS请求==============
$TradeCode = "1104";
$TradeCode1 = "90020";
$ExtOrgCode ="南方医务通";
$ExtOrgCode1 ="医务通";
$ExtUserID = "HQTJ";
$ExtUserID1 = "NFYWT";
$ClientType = "";
$HospitalId = "";
$CardType = "";
$PatientCard = "";
$PatientID = $req->patientId;
$StartDate = date("Y-m-d",time());
$EndDate = date("Y-m-d",time());
//================调用自己WS===============
$postData = "$TradeCode$ExtOrgCode$ClientType$HospitalId$ExtUserID$CardType$PatientCard$PatientID$StartDate$EndDate";
$postData = str_replace(' ','%20',$postData);
$wsdl = "http://yygh2.dept.nfyy.com/csp/oep/DHC.OEP.BS.OEPSTANWebService.cls?soap_method=QueryAdmOPReg&Input=";
$result = file_get_contents($wsdl.$postData);
Log::soaphis("getLastClinicDate:req\r\n".$postData);
$res = call_user_func(array($_ENV["commonClass"],"SoapToXml"),$result,"QueryAdmOPReg");
Log::soaphis("getLastClinicDate:res\r\n".$res);
$res = simplexml_load_string($res);
//==============处理返回==============
$refxml = "";
$refxml .= "";
if($res->ResultCode=="0") {
$refxml .="0";
$refxml .="查询成功";
$xmldata = $res->Orders->Order;
//提取相同的分组列表
$arr = array();
foreach($xmldata as $key=>$v){
if($v->Status=="正常"){
$arr[] = array("RegId"=>$v->RegID,"AdmitDate"=>$v->AdmitDate);
}
}
$arr = end($arr);
if($arr!=null){
//$refxml .="".$arr[AdmitDate]."".$arr[RegId]."";
$postData = "$TradeCode1$ExtOrgCode1".$arr[RegId]."";
$postData = str_replace(' ','%20',$postData);
$wsdl = "http://yygh2.dept.nfyy.com/csp/oep/DHC.OEP.BS.OEPSTANWebService.cls?soap_method=GetDirectListByAdm&Input=";
$result = file_get_contents($wsdl.$postData);
Log::soaphis("GetDirectListByAdm:req\r\n".$postData);
$res = call_user_func(array($_ENV["commonClass"],"SoapToXml"),$result,"GetDirectListByAdm");
Log::soaphis("GetDirectListByAdm:res\r\n".$res);
$res = simplexml_load_string($res);
if($res->resultCode=="0") {
$refxml .= $res->invoiceList->asXML();
}else{
$refxml .="1";
$refxml .="".$res->errorMsg."";
}
}
}
else{
$refxml .="1";
$refxml .="".$res->ResultContent."";
}
/* $refxml = "";
$refxml .= "";
$res ="0成功ZA00001zhangd男23自费1000doctorLi感冒张溜2016-09-09 09:09:09血清请您到门诊二楼采血室采血不用禁食血清333请您到门诊二楼采血室采血3333333不用禁食3333333肝胆,脾彩超检查----111200----1112016-09-09----111外科门诊----111请您到外科门诊B超室做检查----111门诊四楼B超室----111去除膏药等体外异物。----111肝胆,脾彩超检查----222200----2222016-09-09----222外科门诊----222请您到外科门诊B超室做检查----222门诊四楼B超室----222去除膏药等体外异物。----222肝胆,脾彩超检查----333200----3332016-09-09----333外科门诊----333请您到外科门诊B超室做检查----333门诊四楼B超室----333去除膏药等体外异物。----333皮肤科门诊--11请您到门诊四楼皮肤科门诊区 皮肤科门诊---11光动力治疗---3334次23皮肤科门诊--22请您到门诊四楼皮肤科门诊区 皮肤科门诊---22光动力治疗---3334次23磁共振室--1请您到第一医技楼磁共振室--1注射液--112支11注射液--223支12注射液--334支13磁共振室--2请您到第一医技楼磁共振室--2注射液--112支11注射液--223支12注射液--334支13磁共振室--3请您到第一医技楼磁共振室--3注射液--112支11注射液--223支12注射液--334支13磁共振室--4请您到第一医技楼磁共振室--4注射液--112支11注射液--223支12注射液--334支13西药、中成药请您到门诊一楼门诊药房5号窗口请先到自助机报到后,再等待取药中草药请您到门诊一楼草药房7号窗口请先到自助机报到后,再等待取药ZA00001zhangd男23自费1000doctorLi感冒张溜2016-09-09 09:09:09血清请您到门诊二楼采血室采血不用禁食血清333请您到门诊二楼采血室采血3333333不用禁食3333333肝胆,脾彩超检查----111200----1112016-09-09----111外科门诊----111请您到外科门诊B超室做检查----111门诊四楼B超室----111去除膏药等体外异物。----111肝胆,脾彩超检查----222200----2222016-09-09----222外科门诊----222请您到外科门诊B超室做检查----222门诊四楼B超室----222去除膏药等体外异物。----222肝胆,脾彩超检查----333200----3332016-09-09----333外科门诊----333请您到外科门诊B超室做检查----333门诊四楼B超室----333去除膏药等体外异物。----333皮肤科门诊--11请您到门诊四楼皮肤科门诊区 皮肤科门诊---11光动力治疗---3334次23皮肤科门诊--22请您到门诊四楼皮肤科门诊区 皮肤科门诊---22光动力治疗---3334次23磁共振室--1请您到第一医技楼磁共振室--1注射液--112支11注射液--223支12注射液--334支13磁共振室--2请您到第一医技楼磁共振室--2注射液--112支11注射液--223支12注射液--334支13磁共振室--3请您到第一医技楼磁共振室--3注射液--112支11注射液--223支12注射液--334支13磁共振室--4请您到第一医技楼磁共振室--4注射液--112支11注射液--223支12注射液--334支13西药、中成药请您到门诊一楼门诊药房5号窗口请先到自助机报到后,再等待取药中草药请您到门诊一楼草药房7号窗口请先到自助机报到后,再等待取药";
$res = simplexml_load_string($res);
if($res->resultCode=="0") {
$refxml .="0";
$refxml .="查询成功";
$refxml .= $res->invoiceList->asXML();
}else{
$refxml .="1";
$refxml .="".$res->errorMsg."";
}*/
$refxml .= "";
echo $refxml;
}
//913032043914911051
//排队候诊(4001)
public function waitingQueueAction(){
//==============获得前台请求==============
$input = file_get_contents("php://input"); //接收POST数据
$req = simplexml_load_string($input); //提取POST数据为simplexml对象
//HQTJ 可以查询全部渠道的挂号记录
//==============封装HIS请求==============
$TradeCode = "1104";
$TradeCode1 = "4001";
$ExtOrgCode ="南方医务通";
$ExtUserID = "HQTJ";
$ExtUserID1 = "NFYWT";
$ClientType = "";
$HospitalId = "";
$CardType = "";
$PatientCard = "";
$PatientID = $req->patientId;
$StartDate = date("Y-m-d",time());
$EndDate = date("Y-m-d",time());
//================调用自己WS===============
$postData = "$TradeCode$ExtOrgCode$ClientType$HospitalId$ExtUserID$CardType$PatientCard$PatientID$StartDate$EndDate";
$postData = str_replace(' ','%20',$postData);
$wsdl = "http://yygh2.dept.nfyy.com/csp/oep/DHC.OEP.BS.OEPSTANWebService.cls?soap_method=QueryAdmOPReg&Input=";
$result = file_get_contents($wsdl.$postData);
//$result = call_user_func(array($_ENV["commonClass"],"sendDataByCurl"),$postUrl,$postData);
Log::soaphis("QueryAdmOPRe:req\r\n".$postData);
$res = call_user_func(array($_ENV["commonClass"],"SoapToXml"),$result,"QueryAdmOPReg");
Log::soaphis("QueryAdmOPRe:res\r\n".$res);
$res = simplexml_load_string($res);
//==============处理返回==============
$refxml = "";
$refxml .= "";
if($res->ResultCode=="0") {
$refxml .="0";
$refxml .="查询成功";
$xmldata = $res->Orders->Order;
//提取相同的分组列表
$arr = array();
foreach($xmldata as $key=>$v){
if($v->Status=="正常"){
$arr[] = array("RegId"=>$v->RegID,"AdmitDate"=>$v->AdmitDate);
}
}
$arr = end($arr);
if($arr!=null){
$refxml .="".$arr[AdmitDate]."".$arr[RegId]."";
$postData = "$TradeCode1".$arr[RegId]."$ExtUserID1";
$postData = str_replace(' ','%20',$postData);
$wsdl = "http://yygh2.dept.nfyy.com/csp/oep/DHC.OEP.BS.OEPSTANWebService.cls?soap_method=WaitingQueue&Input=";
$result = file_get_contents($wsdl.$postData);
Log::soaphis("WaitingQueue:req\r\n".$postData);
$res = call_user_func(array($_ENV["commonClass"],"SoapToXml"),$result,"WaitingQueue");
Log::soaphis("WaitingQueue:res\r\n".$res);
$res = simplexml_load_string($res);
if($res->ResultCode=="0") {
$refxml .="".$res->PatName."".$res->AdmLoc."".$res->AdmDoc."".$res->WaitingNumber."";
}else{
$refxml .="1";
$refxml .="".$res->ResultContent."";
}
}
}
else{
$refxml .="1";
$refxml .="".$res->ResultContent."";
}
$refxml .= "";
echo $refxml;
/*$refxml = "";
$refxml .= "";
$refxml .="0";
$refxml .="查询成功";
$refxml .="2017-01-0420测试姓名就诊科室就诊医生12";
$refxml .= "";
echo $refxml; */
}
}