新增获取订单问诊评价
This commit is contained in:
parent
43e19756f4
commit
cfbbdbfe14
@ -74,6 +74,17 @@ class InquiryController extends AbstractController
|
|||||||
return $this->response->json($data);
|
return $this->response->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取订单问诊评价
|
||||||
|
* @return ResponseInterface
|
||||||
|
*/
|
||||||
|
public function getInquiryEvaluation(): ResponseInterface
|
||||||
|
{
|
||||||
|
$InquiryService = new InquiryService();
|
||||||
|
$data = $InquiryService->getInquiryEvaluation();
|
||||||
|
return $this->response->json($data);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取问诊最低价格
|
* 获取问诊最低价格
|
||||||
* @return ResponseInterface
|
* @return ResponseInterface
|
||||||
|
|||||||
@ -704,40 +704,47 @@ class TestController extends AbstractController
|
|||||||
$params['platform_audit_status'] = 1;
|
$params['platform_audit_status'] = 1;
|
||||||
$order_prescription = OrderPrescription::getOne($params);
|
$order_prescription = OrderPrescription::getOne($params);
|
||||||
|
|
||||||
$arg = array();
|
// 网络咨询(网络门诊)服务
|
||||||
$arg['thirdUniqueid'] = $order_inquiry['order_inquiry_id']; // 唯一标识
|
// $arg = array();
|
||||||
$arg['orgName'] = "成都金牛欣欣相照互联网医院"; // 机构名称
|
// $arg['thirdUniqueid'] = $order_inquiry['order_inquiry_id']; // 唯一标识
|
||||||
$arg['orgCode'] = "MA6CGUDA251010619D2112"; // 机构编码
|
// $arg['orgName'] = "成都金牛欣欣相照互联网医院"; // 机构名称
|
||||||
$arg['channelName'] = "成都金牛欣欣相照互联网医院";//平台名称
|
// $arg['orgCode'] = "MA6CGUDA251010619D2112"; // 机构编码
|
||||||
$arg['section'] = $hospital_department_custom['department_name'];//科室名称
|
// $arg['channelName'] = "成都金牛欣欣相照互联网医院";//平台名称
|
||||||
$arg['sectionCode'] = $hospital_department_custom['department_code'];//科室编码
|
// $arg['section'] = $hospital_department_custom['department_name'];//科室名称
|
||||||
$arg['docName'] = $user_doctor['user_name'];// 姓名(医师、护师、技师)
|
// $arg['sectionCode'] = $hospital_department_custom['department_code'];//科室编码
|
||||||
$arg['certificateNum'] = $user_doctor_info['qualification_cert_num']; // 执业资格证号
|
// $arg['docName'] = $user_doctor['user_name'];// 姓名(医师、护师、技师)
|
||||||
$arg['patientName'] = $order_inquiry['patient_name']; // 患者姓名
|
// $arg['certificateNum'] = $user_doctor_info['qualification_cert_num']; // 执业资格证号
|
||||||
$arg['patientAge'] = $order_inquiry['patient_age']; // 患者年龄
|
// $arg['patientName'] = $order_inquiry['patient_name']; // 患者姓名
|
||||||
$arg['patientSex'] = $order_inquiry['patient_sex'] == 0 ?: 1; // 患者性别
|
// $arg['patientAge'] = $order_inquiry['patient_age']; // 患者年龄
|
||||||
$arg['patientIdcardType'] = 1; // 证件类型
|
// $arg['patientSex'] = $order_inquiry['patient_sex'] == 0 ?: 1; // 患者性别
|
||||||
$arg['patientIdcardNum'] = $patient_family['id_number']; // 患者证件号码
|
// $arg['patientIdcardType'] = 1; // 证件类型
|
||||||
$arg['serviceType'] = 1; // 服务类型 1网络咨询 2网络门诊
|
// $arg['patientIdcardNum'] = $patient_family['id_number']; // 患者证件号码
|
||||||
$arg['consultNo'] = $order_inquiry['inquiry_no']; // 网络咨询或网络门诊编号 订单编号
|
// $arg['serviceType'] = 1; // 服务类型 1网络咨询 2网络门诊
|
||||||
$arg['consultType'] = 1; // 咨询类别 1、图文咨询 2语音咨询3、视频咨询
|
// $arg['consultNo'] = $order_inquiry['inquiry_no']; // 网络咨询或网络门诊编号 订单编号
|
||||||
$arg['consultApplyTime'] = $order_inquiry['created_at']; // 咨询申请时间
|
// $arg['consultType'] = 1; // 咨询类别 1、图文咨询 2语音咨询3、视频咨询
|
||||||
$arg['consultStartTime'] = $order_inquiry['reception_time']; // 咨询开始时间
|
// $arg['consultApplyTime'] = $order_inquiry['created_at']; // 咨询申请时间
|
||||||
$arg['consultEndTime'] = $order_inquiry['complete_time']; // 咨询结束时间
|
// $arg['consultStartTime'] = $order_inquiry['reception_time']; // 咨询开始时间
|
||||||
$arg['feeType'] = 1; // 费别 1自费 2医保
|
// $arg['consultEndTime'] = $order_inquiry['complete_time']; // 咨询结束时间
|
||||||
$arg['price'] = $order_inquiry['payment_amount_total']; // 咨询价格 元
|
// $arg['feeType'] = 1; // 费别 1自费 2医保
|
||||||
$arg['isReply'] = 1; //咨询是否回复 0未回复 1已回复
|
// $arg['price'] = $order_inquiry['payment_amount_total']; // 咨询价格 元
|
||||||
$arg['patientEvaluate'] = 1; //患者满意度 1-5 1代表非常满意 5代表非常不满意
|
// $arg['isReply'] = 1; //咨询是否回复 0未回复 1已回复
|
||||||
$arg['complainInfo'] = "无"; //投诉举报信息
|
// $arg['patientEvaluate'] = 1; //患者满意度 1-5 1代表非常满意 5代表非常不满意
|
||||||
$arg['disposeResult'] = "无"; //处理结果信息
|
// $arg['complainInfo'] = "无"; //投诉举报信息
|
||||||
$arg['isRiskWarn'] = 1; //是否进行诊前风险提示 0否 1是
|
// $arg['disposeResult'] = "无"; //处理结果信息
|
||||||
$arg['isPatientSign'] = 1; //是否确认患者为签约对象 0否 1是
|
// $arg['isRiskWarn'] = 1; //是否进行诊前风险提示 0否 1是
|
||||||
$arg['uploadTime'] = date('Y-m-d H:i:s',time()); //上传时间
|
// $arg['isPatientSign'] = 1; //是否确认患者为签约对象 0否 1是
|
||||||
$arg['medicalHistory'] = $order_inquiry_case['disease_desc']; //患者病史描述
|
// $arg['uploadTime'] = date('Y-m-d H:i:s',time()); //上传时间
|
||||||
$arg['docAdvice'] = $order_prescription['doctor_advice'] ?? "无"; // 医生建议描述 医嘱
|
// $arg['medicalHistory'] = $order_inquiry_case['disease_desc']; //患者病史描述
|
||||||
$arg['isMark'] = 1;//是否留痕 1:代表留痕;0代表未留痕
|
// $arg['docAdvice'] = $order_prescription['doctor_advice'] ?? "无"; // 医生建议描述 医嘱
|
||||||
|
// $arg['isMark'] = 1;//是否留痕 1:代表留痕;0代表未留痕
|
||||||
|
//
|
||||||
|
// $result = $regulatoryPlatform->uploadConsult($arg);
|
||||||
|
|
||||||
$result = $regulatoryPlatform->uploadConsult($arg);
|
//上报 网络复诊服务
|
||||||
|
$arg = array();
|
||||||
|
$arg['thirdUniqueid'] =
|
||||||
|
|
||||||
|
$result = $regulatoryPlatform->uploadFurtherConsult($arg);
|
||||||
dump($result);
|
dump($result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -536,6 +536,44 @@ class InquiryService extends BaseService
|
|||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取订单问诊评价
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getInquiryEvaluation(): array
|
||||||
|
{
|
||||||
|
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||||
|
$order_inquiry_id = $this->request->route('order_inquiry_id');
|
||||||
|
|
||||||
|
$result = array();
|
||||||
|
$result['is_evaluation'] = false;
|
||||||
|
$result['avg_score'] = 0;
|
||||||
|
|
||||||
|
$params = array();
|
||||||
|
$params['order_inquiry_id'] = $order_inquiry_id;
|
||||||
|
$params['patient_id'] = $user_info['client_user_id'];
|
||||||
|
$order_inquiry = OrderInquiry::getOne($params);
|
||||||
|
if (empty($order_inquiry)) {
|
||||||
|
return success($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 检测是否评价过
|
||||||
|
$params = array();
|
||||||
|
$params['doctor_id'] = $order_inquiry['doctor_id'];
|
||||||
|
$params['patient_id'] = $order_inquiry['patient_id'];
|
||||||
|
$params['order_inquiry_id'] = $order_inquiry_id;;
|
||||||
|
$order_evaluation = OrderEvaluation::getOne($params);
|
||||||
|
if (empty($order_evaluation)) {
|
||||||
|
return success($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
$result['avg_score'] = floor($order_evaluation['avg_score'] * 0.05);
|
||||||
|
$result['is_evaluation'] = true;
|
||||||
|
return success($result);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取问诊最低价格
|
* 获取问诊最低价格
|
||||||
* @return array
|
* @return array
|
||||||
|
|||||||
@ -237,6 +237,9 @@ Router::addGroup('/patient', function () {
|
|||||||
// 新增问诊评价
|
// 新增问诊评价
|
||||||
Router::post('/evaluation', [InquiryController::class, 'addInquiryEvaluation']);
|
Router::post('/evaluation', [InquiryController::class, 'addInquiryEvaluation']);
|
||||||
|
|
||||||
|
// 获取订单问诊评价
|
||||||
|
Router::get('/evaluation/{order_inquiry_id:\d+}', [InquiryController::class, 'getInquiryEvaluation']);
|
||||||
|
|
||||||
// 获取问诊最低价格
|
// 获取问诊最低价格
|
||||||
Router::get('/lowest-price', [InquiryController::class, 'getInquiryLowestPrice']);
|
Router::get('/lowest-price', [InquiryController::class, 'getInquiryLowestPrice']);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -91,11 +91,12 @@ class regulatoryPlatform
|
|||||||
/**
|
/**
|
||||||
* 上报 网络咨询(网络门诊)服务
|
* 上报 网络咨询(网络门诊)服务
|
||||||
* @param array $arg
|
* @param array $arg
|
||||||
* @return mixed
|
* @return array
|
||||||
* @throws ContainerExceptionInterface
|
* @throws ContainerExceptionInterface
|
||||||
* @throws NotFoundExceptionInterface
|
* @throws NotFoundExceptionInterface
|
||||||
*/
|
*/
|
||||||
public function uploadConsult(array $arg){
|
public function uploadConsult(array $arg): array
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
$this->redis = $this->container->get(Redis::class);
|
$this->redis = $this->container->get(Redis::class);
|
||||||
|
|
||||||
@ -120,7 +121,46 @@ class regulatoryPlatform
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $response['data'];
|
return $response;
|
||||||
|
} catch (GuzzleException $e) {
|
||||||
|
throw new BusinessException($e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上报 网络复诊服务
|
||||||
|
* @param array $arg
|
||||||
|
* @return array
|
||||||
|
* @throws ContainerExceptionInterface
|
||||||
|
* @throws NotFoundExceptionInterface
|
||||||
|
*/
|
||||||
|
public function uploadFurtherConsult(array $arg): array
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$this->redis = $this->container->get(Redis::class);
|
||||||
|
|
||||||
|
$access_token = $this->redis->get("regulatory_platform_access_token");
|
||||||
|
if (empty($access_token)) {
|
||||||
|
$access_token = $this->getAccessToken();
|
||||||
|
}
|
||||||
|
|
||||||
|
$arg['accessToken'] = $access_token;
|
||||||
|
$arg['clientId'] = $this->client_id;
|
||||||
|
|
||||||
|
$option = [
|
||||||
|
"json" => $arg
|
||||||
|
];
|
||||||
|
|
||||||
|
$response = $this->httpRequest($this->api_url . '/wjw/upload/uploadFurtherConsult', $option);
|
||||||
|
if (isset($response['status'])) {
|
||||||
|
if ($response['status'] != 0) {
|
||||||
|
if (!empty($response['message'])) {
|
||||||
|
throw new BusinessException($response['message']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $response;
|
||||||
} catch (GuzzleException $e) {
|
} catch (GuzzleException $e) {
|
||||||
throw new BusinessException($e->getMessage());
|
throw new BusinessException($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user