|
@@ -7,6 +7,7 @@ use app\api\servies\ZskkDefaultService;
|
|
|
use app\api\dao\xz\XzDao;
|
|
|
use app\api\servies\common\CommonService;
|
|
|
use app\api\utils\UUIDUtils;
|
|
|
+use think\Db;
|
|
|
use think\Exception;
|
|
|
use think\facade\Config;
|
|
|
use think\facade\Log;
|
|
@@ -115,7 +116,7 @@ class XzService extends ZskkDefaultService {
|
|
|
$studiesData = [
|
|
|
'ID'=>UUIDUtils::uuid(),
|
|
|
// 'STUDYUID'=>'1.3.6.1.4.1.30071.8.'.time().$v['clinicId'].$v['patientId'].$v['applicationFormNo'],
|
|
|
- 'STUDYUID'=>'1.3.6.1.4.1.30071.8.'.time().$v['clinicId'].$v['patientId'].rand(10000,99999),
|
|
|
+ 'STUDYUID'=>'1.3.6.1.4.1.30071.8.'.time().rand(10000,99999).rand(10000,99999),
|
|
|
'PATIENT_ID'=>$patientData['ID'],
|
|
|
'STUDYDATE'=>$v['startDate'],
|
|
|
'MODALITY'=> $v['modality'],
|
|
@@ -368,7 +369,8 @@ class XzService extends ZskkDefaultService {
|
|
|
'DEVICE_NAME'=>$params['device_name'] ?? '',
|
|
|
'PATIENT_NUM'=>$params['patient_num'],
|
|
|
'CREATEDAT'=>date('Y-m-d H:i:s',time()),
|
|
|
- 'EXAM_STATUS'=>3
|
|
|
+ 'EXAM_STATUS'=>3,
|
|
|
+ 'NAME'=>$params['name']
|
|
|
];
|
|
|
$this->xz->insertExam($data);
|
|
|
$id = $data['ID'];
|
|
@@ -392,6 +394,14 @@ class XzService extends ZskkDefaultService {
|
|
|
return $id;
|
|
|
}
|
|
|
|
|
|
+ public function sendTest($params)
|
|
|
+ {
|
|
|
+ $where = ['ACCESSION_NUM'=>$params['acc']];
|
|
|
+ $exam = $this->xz->getExams($where);
|
|
|
+ $return = $this->sendUrl($exam);
|
|
|
+ return $return;
|
|
|
+ }
|
|
|
+
|
|
|
public function sendUrl($exam)
|
|
|
{
|
|
|
$xml_url = ROOT_PATH.'/public/data.xml';
|
|
@@ -401,6 +411,7 @@ class XzService extends ZskkDefaultService {
|
|
|
$ip = $xml_array['remote_ip'] ?? '';
|
|
|
$serverIp = $xml_array['server_ip'];
|
|
|
$clientIp = $xml_array['client_ip'];
|
|
|
+ $res = '';
|
|
|
if(!empty($ip))
|
|
|
{
|
|
|
// ris调用 需通知远程端
|
|
@@ -419,7 +430,16 @@ class XzService extends ZskkDefaultService {
|
|
|
curl_setopt($ch,CURLOPT_POSTFIELDS,json_encode($data,JSON_UNESCAPED_SLASHES));
|
|
|
$res = curl_exec($ch);
|
|
|
curl_close($ch);
|
|
|
+ $return = json_decode($res,true);
|
|
|
+ if($return['status'] == '0')
|
|
|
+ {
|
|
|
+ if($exam['STUDYUID'] ?? '')
|
|
|
+ {
|
|
|
+ Db::table('WJ_WORKLIST')->where('EXAM_NO',$exam['ACCESSION_NUM'])->update(['RESULT_STATUS'=>2]);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+ return $res;
|
|
|
}
|
|
|
|
|
|
public function clpy()
|