新增自动开具处方。修改ca对接
This commit is contained in:
@@ -1378,7 +1378,7 @@ class UserDoctorService extends BaseService
|
||||
// 开具处方
|
||||
$OrderPrescriptionService = new OrderPrescriptionService();
|
||||
$prescription_open_result = $OrderPrescriptionService->openPrescription($order_prescription->order_prescription_id,$user_info['user_id']);
|
||||
if (empty($prescription_open_result['prescription_img_url']) || empty($prescription_open_result['file_id'])){
|
||||
if (empty($prescription_open_result['prescription_img_oss_path']) || empty($prescription_open_result['file_id'])){
|
||||
Db::rollBack();
|
||||
return fail(HttpEnumCode::SERVER_ERROR, "处方开具失败");
|
||||
}
|
||||
@@ -1394,6 +1394,7 @@ class UserDoctorService extends BaseService
|
||||
|
||||
// 修改处方表
|
||||
$data = array();
|
||||
$data['pharmacist_id'] = "534534546"; // 药师id 现固定为此用户,后续可以考虑开启队列
|
||||
$data['is_auto_phar_verify'] = $system_config['is_auto_phar_verify_prescription'];// 是否药师自动审核(0:否 1:是)
|
||||
$data['doctor_created_time'] = date('Y-m-d H:i:s',time());
|
||||
|
||||
@@ -1405,13 +1406,14 @@ class UserDoctorService extends BaseService
|
||||
$data = array();
|
||||
$data['order_prescription_id'] = $order_prescription->order_prescription_id;
|
||||
$data['doctor_ca_file_id'] = $prescription_open_result['file_id'];
|
||||
$data['doctor_img_oss_path'] = $prescription_open_result['prescription_img_url'];
|
||||
$data['prescription_img_oss_path'] = $prescription_open_result['prescription_img_oss_path'];
|
||||
$order_prescription_file = OrderPrescriptionFile::addOrderPrescriptionFile($data);
|
||||
if (empty($order_prescription_file)){
|
||||
Db::rollBack();
|
||||
return fail(HttpEnumCode::SERVER_ERROR, "处方开具失败");
|
||||
}
|
||||
|
||||
// 检测药师自动审核配置开启状态
|
||||
if ($system_config['is_auto_phar_verify_prescription'] == 1){
|
||||
// 添加药师自动签章审核队列
|
||||
$data = array();
|
||||
@@ -1432,18 +1434,6 @@ class UserDoctorService extends BaseService
|
||||
$ImService = new ImService();
|
||||
$ImService->pharmacistVerify($order_inquiry,(string)$order_prescription->order_prescription_id,$product_name,$user_doctor['user_id'],$order_inquiry['user_id']);
|
||||
|
||||
// 加入分配药师队列
|
||||
$data = array();
|
||||
$data['order_prescription_id'] = $order_prescription['order_prescription_id'];
|
||||
|
||||
$message = new AssignPharmacistProducer($data);
|
||||
$producer = ApplicationContext::getContainer()->get(Producer::class);
|
||||
$result = $producer->produce($message);
|
||||
if (!$result) {
|
||||
Db::rollBack();
|
||||
return fail(HttpEnumCode::SERVER_ERROR);
|
||||
}
|
||||
|
||||
Db::commit();
|
||||
} catch (\Exception $e) {
|
||||
Db::rollBack();
|
||||
@@ -1671,14 +1661,7 @@ class UserDoctorService extends BaseService
|
||||
$params['order_inquiry_id'] = $order_inquiry_id;
|
||||
OrderInquiry::edit($params,$data);
|
||||
|
||||
// 发送IM消息-医生接诊
|
||||
$imService = new ImService();
|
||||
$imService->doctorInquiry($order_inquiry,$user_info['user_id'],$order_inquiry['user_id']);
|
||||
|
||||
// 发送站内、订阅、短信消息-医生已接诊
|
||||
$MessagePush = new MessagePush($order_inquiry['user_id'],$order_inquiry['order_inquiry_id']);
|
||||
$MessagePush->patientAcceptedInquiry();
|
||||
|
||||
// 添加自动完成队列
|
||||
if ($order_inquiry['inquiry_type'] == 1 || $order_inquiry['inquiry_type'] == 3){
|
||||
// 专家问诊-公益问诊
|
||||
$time = 1000 * 60 * 60;
|
||||
@@ -1690,7 +1673,6 @@ class UserDoctorService extends BaseService
|
||||
$time = 1000 * 60 * 30;
|
||||
}
|
||||
|
||||
// 添加自动完成队列
|
||||
$data = array();
|
||||
$data['order_inquiry_id'] = $order_inquiry['order_inquiry_id'];
|
||||
|
||||
@@ -1708,6 +1690,18 @@ class UserDoctorService extends BaseService
|
||||
return fail(HttpEnumCode::SERVER_ERROR, $e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
// 发送IM消息-医生接诊
|
||||
$imService = new ImService();
|
||||
$imService->doctorInquiry($order_inquiry,$user_info['user_id'],$order_inquiry['user_id']);
|
||||
|
||||
// 发送站内、订阅、短信消息-医生已接诊
|
||||
$MessagePush = new MessagePush($order_inquiry['user_id'],$order_inquiry['order_inquiry_id']);
|
||||
$MessagePush->patientAcceptedInquiry();
|
||||
}catch(\Exception $e){
|
||||
return success([],HttpEnumCode::HTTP_SUCCESS,$e->getMessage());
|
||||
}
|
||||
|
||||
return success();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user