修正检测是否可接诊、新增问诊订单属性获取
This commit is contained in:
parent
6926137b5e
commit
ebe6911fb8
@ -331,4 +331,16 @@ class UserDoctorController extends AbstractController
|
|||||||
$data = $UserDoctorService->getDoctorMessageList();
|
$data = $UserDoctorService->getDoctorMessageList();
|
||||||
return $this->response->json($data);
|
return $this->response->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取医生问诊消息用户属性
|
||||||
|
* @return ResponseInterface
|
||||||
|
*/
|
||||||
|
public function getDoctorMessageAttrList(): ResponseInterface
|
||||||
|
{
|
||||||
|
$UserDoctorService = new UserDoctorService();
|
||||||
|
$data = $UserDoctorService->getDoctorMessageAttrList();
|
||||||
|
return $this->response->json($data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -251,4 +251,16 @@ class OrderInquiry extends Model
|
|||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取信息-多条
|
||||||
|
* @param array $params
|
||||||
|
* @param array $in_params
|
||||||
|
* @param array $fields
|
||||||
|
* @return object|null
|
||||||
|
*/
|
||||||
|
public static function getInList(array $params, array $in_params,array $fields = ['*']): object|null
|
||||||
|
{
|
||||||
|
return self::where($params)->whereIn('order_inquiry_id',$in_params)->get($fields);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,6 +23,8 @@ class PatientOrderRequest extends FormRequest
|
|||||||
"order_no"// 订单编号
|
"order_no"// 订单编号
|
||||||
],
|
],
|
||||||
'addPatientProductOrder' => [ // 创建药品订单
|
'addPatientProductOrder' => [ // 创建药品订单
|
||||||
|
"order_prescription_id",
|
||||||
|
"address_id",
|
||||||
],
|
],
|
||||||
'getPatientPrescriptionOrderList' => [ // 获取处方订单列表
|
'getPatientPrescriptionOrderList' => [ // 获取处方订单列表
|
||||||
],
|
],
|
||||||
@ -64,6 +66,9 @@ class PatientOrderRequest extends FormRequest
|
|||||||
|
|
||||||
'order_type' => 'required|integer|min:1|max:2',
|
'order_type' => 'required|integer|min:1|max:2',
|
||||||
'order_no' => 'required',
|
'order_no' => 'required',
|
||||||
|
|
||||||
|
'order_prescription_id' => 'required',
|
||||||
|
'address_id' => 'required',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,6 +116,8 @@ class PatientOrderRequest extends FormRequest
|
|||||||
'order_type.min' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
'order_type.min' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||||
'order_type.max' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
'order_type.max' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||||
'order_no.required' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
'order_no.required' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||||
|
'order_prescription_id.required' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||||
|
'address_id.required' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -370,11 +370,19 @@ class PatientDoctorService extends BaseService
|
|||||||
$inquiry_mode = $this->request->input('inquiry_mode');
|
$inquiry_mode = $this->request->input('inquiry_mode');
|
||||||
$doctor_id = $this->request->input('doctor_id','');
|
$doctor_id = $this->request->input('doctor_id','');
|
||||||
|
|
||||||
|
$result = array();
|
||||||
|
$result['data'] = [];
|
||||||
|
$result['message'] = "可接诊";
|
||||||
|
$result['status'] = 1;
|
||||||
|
|
||||||
// 检测是否存在未完成的问诊订单
|
// 检测是否存在未完成的问诊订单
|
||||||
$UserPatientService = new UserPatientService();
|
$UserPatientService = new UserPatientService();
|
||||||
$res = $UserPatientService->getNotFinishedOrdeInquiry($user_info['client_user_id']);
|
$res = $UserPatientService->getNotFinishedOrdeInquiry($user_info['client_user_id']);
|
||||||
if (!empty($res)){
|
if (!empty($res)){
|
||||||
return fail(HttpEnumCode::HTTP_ERROR,"当前有未完成服务,不允许再次购买",[$res]);
|
$result['status'] = 2;
|
||||||
|
$result['data'] = $res;
|
||||||
|
$result['message'] = "存在未完成的问诊订单";
|
||||||
|
return success($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($doctor_id)){
|
if (!empty($doctor_id)){
|
||||||
@ -397,23 +405,30 @@ class PatientDoctorService extends BaseService
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 检测医生身份认证
|
// 检测医生身份认证
|
||||||
$UserDoctorService = new UserDoctorService();
|
if ($user_doctor['iden_auth_status'] != 1) {
|
||||||
$res = $UserDoctorService->checkDoctorAuth($user_doctor);
|
return fail();
|
||||||
if ($res !== true) {
|
}
|
||||||
|
|
||||||
|
if ($user_doctor['idcard_status'] != 1) {
|
||||||
return fail();
|
return fail();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user_doctor['is_img_expert_reception'] != 1) {
|
if ($user_doctor['is_img_expert_reception'] != 1) {
|
||||||
return fail(HttpEnumCode::HTTP_ERROR, "医生未开通在线问诊服务");
|
return fail(HttpEnumCode::HTTP_ERROR, "医生未开通在线问诊服务");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 检测医生今日接诊数量
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($inquiry_type == 2 || $inquiry_type == 4){
|
if ($inquiry_type == 2 || $inquiry_type == 4){
|
||||||
// 快速问诊-问诊购药
|
// 获取快速、购药问诊可分配医生
|
||||||
$UserDoctorService = new UserDoctorService();
|
$UserDoctorService = new UserDoctorService();
|
||||||
$doctor_id = $UserDoctorService->getInquiryAssignDoctor($inquiry_type);
|
$doctor_id = $UserDoctorService->getInquiryAssignDoctor($inquiry_type);
|
||||||
if (empty($doctor_id)){
|
if (empty($doctor_id)){
|
||||||
return fail();
|
$result['status'] = 3;
|
||||||
|
$result['data'] = "";
|
||||||
|
$result['message'] = "目前暂无可接诊医生";
|
||||||
|
return success($result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -704,7 +704,45 @@ class PatientOrderService extends BaseService
|
|||||||
return success($result);
|
return success($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addPatientProductOrder(){
|
// 创建药品订单
|
||||||
|
public function addPatientProductOrder(): array
|
||||||
|
{
|
||||||
|
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||||
|
|
||||||
|
$order_prescription_id = $this->request->input('order_prescription_id');
|
||||||
|
$address_id = $this->request->input('address_id');
|
||||||
|
|
||||||
|
// 获取处方数据
|
||||||
|
$params = array();
|
||||||
|
$params['order_prescription_id'] = $order_prescription_id;
|
||||||
|
$params['patient_id'] = $user_info['client_user_id'];
|
||||||
|
$params['is_delete'] = 0;
|
||||||
|
$order_prescription = OrderPrescription::getOne($params);
|
||||||
|
if (empty($order_prescription)){
|
||||||
|
return fail();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证处方状态
|
||||||
|
if ($order_prescription['prescription_status'] == 1){
|
||||||
|
return fail(HttpEnumCode::HTTP_ERROR,"处方未审核");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($order_prescription['prescription_status'] == 3){
|
||||||
|
return fail(HttpEnumCode::HTTP_ERROR,"已失效");
|
||||||
|
}
|
||||||
|
if ($order_prescription['prescription_status'] == 4){
|
||||||
|
return fail(HttpEnumCode::HTTP_ERROR,"已使用");
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (¥)
|
||||||
|
|
||||||
|
|
||||||
|
// 检测是否已经存在药品订单数据
|
||||||
|
// 新增药品订单
|
||||||
|
// 新增药品订单详情
|
||||||
|
// 修正处方使用状态
|
||||||
|
// 新增取消订单队列
|
||||||
|
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -852,7 +890,40 @@ class PatientOrderService extends BaseService
|
|||||||
return success($result);
|
return success($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deletePatientPrescriptionOrder(){
|
/**
|
||||||
|
* 删除处方订单记录
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function deletePatientPrescriptionOrder(): array
|
||||||
|
{
|
||||||
|
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||||
|
|
||||||
|
$order_prescription_id = $this->request->route('order_prescription_id');
|
||||||
|
|
||||||
|
$params = array();
|
||||||
|
$params['order_prescription_id'] = $order_prescription_id;
|
||||||
|
$params['patient_id'] = $user_info['client_user_id'];
|
||||||
|
$order_prescription = OrderPrescription::getOne($params);
|
||||||
|
if (empty($order_prescription)){
|
||||||
|
return fail();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证处方状态
|
||||||
|
if ($order_prescription['prescription_status'] == 1){
|
||||||
|
return fail(HttpEnumCode::HTTP_ERROR,"处方无法删除");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($order_prescription['is_delete'] == 1){
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
$data = array();
|
||||||
|
$data['is_delete'] = 1;
|
||||||
|
|
||||||
|
$params = array();
|
||||||
|
$params['order_prescription_id'] = $order_prescription['order_prescription_id'];
|
||||||
|
OrderPrescription::edit($params,$data);
|
||||||
|
|
||||||
|
return success();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1363,6 +1363,39 @@ class UserDoctorService extends BaseService
|
|||||||
return success($result);
|
return success($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getDoctorMessageAttrList(): array
|
||||||
|
{
|
||||||
|
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||||
|
|
||||||
|
$order_inquiry_ids = $this->request->input('order_inquiry_ids');
|
||||||
|
if (empty($order_inquiry_ids)){
|
||||||
|
return fail();
|
||||||
|
}
|
||||||
|
|
||||||
|
$order_inquiry_ids = explode(',',$order_inquiry_ids);
|
||||||
|
|
||||||
|
$fields = [
|
||||||
|
'order_inquiry_id',
|
||||||
|
'patient_name',
|
||||||
|
'patient_sex',
|
||||||
|
'patient_age',
|
||||||
|
'inquiry_status',
|
||||||
|
];
|
||||||
|
|
||||||
|
$params =array();
|
||||||
|
$params['doctor_id'] = $user_info['client_user_id'];
|
||||||
|
$order_inquiry = OrderInquiry::getInList($params,$order_inquiry_ids,$fields);
|
||||||
|
if (empty($order_inquiry)){
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = array();
|
||||||
|
foreach ($order_inquiry as $value){
|
||||||
|
$result[$value['order_inquiry_id']] = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return success($result);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检测医生身份认证
|
* 检测医生身份认证
|
||||||
@ -1378,19 +1411,19 @@ class UserDoctorService extends BaseService
|
|||||||
throw new BusinessException();
|
throw new BusinessException();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($user_doctor['iden_auth_status'])) {
|
if ($is_iden_auth) {
|
||||||
if ($user_doctor['iden_auth_status'] != 1) {
|
if ($user_doctor['iden_auth_status'] != 1) {
|
||||||
return "请先完成身份认证";
|
return "请先完成身份认证";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($user_doctor['idcard_status'])) {
|
if ($is_idcard) {
|
||||||
if ($user_doctor['idcard_status'] != 1) {
|
if ($user_doctor['idcard_status'] != 1) {
|
||||||
return "请先完成实名认证";
|
return "请先完成实名认证";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($user_doctor['multi_point_status'])) {
|
if ($is_multi_point) {
|
||||||
if ($user_doctor['multi_point_status'] != 1) {
|
if ($user_doctor['multi_point_status'] != 1) {
|
||||||
return "请先完成多点执业认证";
|
return "请先完成多点执业认证";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -78,6 +78,9 @@ Router::addGroup('/doctor', function () {
|
|||||||
|
|
||||||
// 获取医生问诊消息列表
|
// 获取医生问诊消息列表
|
||||||
Router::get('/message', [UserDoctorController::class, 'getDoctorMessageList']);
|
Router::get('/message', [UserDoctorController::class, 'getDoctorMessageList']);
|
||||||
|
|
||||||
|
// 获取医生问诊消息用户属性
|
||||||
|
Router::post('/message/attr', [UserDoctorController::class, 'getDoctorMessageAttrList']);
|
||||||
});
|
});
|
||||||
|
|
||||||
//银行卡
|
//银行卡
|
||||||
@ -311,7 +314,7 @@ Router::addGroup('/patient', function () {
|
|||||||
// 删除药品订单
|
// 删除药品订单
|
||||||
Router::delete('/{order_product_id:\d+}', [PatientOrderController::class, 'deletePatientProductOrder']);
|
Router::delete('/{order_product_id:\d+}', [PatientOrderController::class, 'deletePatientProductOrder']);
|
||||||
|
|
||||||
// 创建药品订单-未开发
|
// 创建药品订单
|
||||||
Router::post('', [PatientOrderController::class, 'addPatientProductOrder']);
|
Router::post('', [PatientOrderController::class, 'addPatientProductOrder']);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user