新增病例禁忌字段
This commit is contained in:
parent
f3881322f0
commit
88a04aa4e8
@ -7,6 +7,7 @@ use App\Constants\DoctorTitleCode;
|
|||||||
use App\Constants\HttpEnumCode;
|
use App\Constants\HttpEnumCode;
|
||||||
use App\Exception\BusinessException;
|
use App\Exception\BusinessException;
|
||||||
use App\Model\Hospital;
|
use App\Model\Hospital;
|
||||||
|
use App\Model\MessageIm;
|
||||||
use App\Model\OrderInquiry;
|
use App\Model\OrderInquiry;
|
||||||
use App\Model\OrderInquiryCoupon;
|
use App\Model\OrderInquiryCoupon;
|
||||||
use App\Model\OrderInquiryRefund;
|
use App\Model\OrderInquiryRefund;
|
||||||
@ -612,7 +613,7 @@ class CallBackController extends AbstractController
|
|||||||
// 验证消息重复性
|
// 验证消息重复性
|
||||||
$params = array();
|
$params = array();
|
||||||
$params['message_key'] = $request_params['MsgKey'];
|
$params['message_key'] = $request_params['MsgKey'];
|
||||||
$message = \App\Model\MessageIm::getExists($params);
|
$message = MessageIm::getExists($params);
|
||||||
if ($message){
|
if ($message){
|
||||||
// 消息重复
|
// 消息重复
|
||||||
Log::getInstance()->info("Im回调数据处理失败:消息重复");
|
Log::getInstance()->info("Im回调数据处理失败:消息重复");
|
||||||
@ -673,7 +674,7 @@ class CallBackController extends AbstractController
|
|||||||
$message_content = $request_params['MsgBody'][0]['MsgContent'];
|
$message_content = $request_params['MsgBody'][0]['MsgContent'];
|
||||||
$data['message_content'] = json_encode($message_content,JSON_UNESCAPED_UNICODE);
|
$data['message_content'] = json_encode($message_content,JSON_UNESCAPED_UNICODE);
|
||||||
$data['message_custom_content'] = $request_params['CloudCustomData'] ?? "";
|
$data['message_custom_content'] = $request_params['CloudCustomData'] ?? "";
|
||||||
$message = \App\Model\MessageIm::addMessage($data);
|
$message = MessageIm::addMessage($data);
|
||||||
if (empty($message)){
|
if (empty($message)){
|
||||||
Log::getInstance()->error("Im回调数据处理失败:存储数据库失败");
|
Log::getInstance()->error("Im回调数据处理失败:存储数据库失败");
|
||||||
return $this->wxPayErrorReturn("存储数据库失败");
|
return $this->wxPayErrorReturn("存储数据库失败");
|
||||||
|
|||||||
@ -10,7 +10,6 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @property int $inquiry_case_id 主键id
|
* @property int $inquiry_case_id 主键id
|
||||||
* @property int $inquiry_cases_id 主键id
|
|
||||||
* @property int $user_id 用户id
|
* @property int $user_id 用户id
|
||||||
* @property int $patient_id 患者id
|
* @property int $patient_id 患者id
|
||||||
* @property int $order_inquiry_id 订单-问诊id
|
* @property int $order_inquiry_id 订单-问诊id
|
||||||
@ -33,6 +32,7 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
|||||||
* @property string $family_history 家族病史描述
|
* @property string $family_history 家族病史描述
|
||||||
* @property int $is_pregnant 是否备孕、妊娠、哺乳期(0:否 1:是)
|
* @property int $is_pregnant 是否备孕、妊娠、哺乳期(0:否 1:是)
|
||||||
* @property string $pregnant 备孕、妊娠、哺乳期描述
|
* @property string $pregnant 备孕、妊娠、哺乳期描述
|
||||||
|
* @property int $is_taboo 是否存在禁忌药物(0:否 1:是)问诊购药时存在
|
||||||
* @property \Carbon\Carbon $created_at 创建时间
|
* @property \Carbon\Carbon $created_at 创建时间
|
||||||
* @property \Carbon\Carbon $updated_at 修改时间
|
* @property \Carbon\Carbon $updated_at 修改时间
|
||||||
* @property-read BasicJob $BasicJob
|
* @property-read BasicJob $BasicJob
|
||||||
@ -51,12 +51,7 @@ class OrderInquiryCase extends Model
|
|||||||
/**
|
/**
|
||||||
* The attributes that are mass assignable.
|
* The attributes that are mass assignable.
|
||||||
*/
|
*/
|
||||||
protected array $fillable = ['inquiry_case_id', 'inquiry_cases_id', 'user_id', 'patient_id', 'order_inquiry_id', 'family_id', 'relation', 'status', 'name', 'sex', 'age', 'height', 'weight', 'disease_class_id', 'disease_class_name', 'diagnosis_date', 'disease_desc', 'diagnose_images', 'is_allergy_history', 'allergy_history', 'is_family_history', 'family_history', 'is_pregnant', 'pregnant', 'created_at', 'updated_at'];
|
protected array $fillable = ['inquiry_case_id', 'user_id', 'patient_id', 'order_inquiry_id', 'family_id', 'relation', 'status', 'name', 'sex', 'age', 'height', 'weight', 'disease_class_id', 'disease_class_name', 'diagnosis_date', 'disease_desc', 'diagnose_images', 'is_allergy_history', 'allergy_history', 'is_family_history', 'family_history', 'is_pregnant', 'pregnant', 'is_taboo', 'created_at', 'updated_at'];
|
||||||
|
|
||||||
/**
|
|
||||||
* The attributes that should be cast to native types.
|
|
||||||
*/
|
|
||||||
protected array $casts = ['inquiry_case_id' => 'integer', 'inquiry_cases_id' => 'integer', 'user_id' => 'integer', 'patient_id' => 'integer', 'order_inquiry_id' => 'integer', 'family_id' => 'integer', 'relation' => 'integer', 'status' => 'integer', 'sex' => 'integer', 'age' => 'integer', 'disease_class_id' => 'integer', 'is_allergy_history' => 'integer', 'is_family_history' => 'integer', 'is_pregnant' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
|
|
||||||
|
|
||||||
protected string $primaryKey = "inquiry_case_id";
|
protected string $primaryKey = "inquiry_case_id";
|
||||||
|
|
||||||
|
|||||||
@ -72,6 +72,11 @@ class InquiryService extends BaseService
|
|||||||
return fail(HttpEnumCode::HTTP_ERROR, "请您到线下问诊");
|
return fail(HttpEnumCode::HTTP_ERROR, "请您到线下问诊");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 是否存在禁忌
|
||||||
|
if (!empty($request_params['is_taboo'])) {
|
||||||
|
return fail(HttpEnumCode::HTTP_ERROR, "无法为您开具药物");
|
||||||
|
}
|
||||||
|
|
||||||
// 检测所患疾病是否正确
|
// 检测所患疾病是否正确
|
||||||
$params = array();
|
$params = array();
|
||||||
$params['disease_class_id'] = $request_params['disease_class_id'];
|
$params['disease_class_id'] = $request_params['disease_class_id'];
|
||||||
@ -83,26 +88,26 @@ class InquiryService extends BaseService
|
|||||||
|
|
||||||
// 获取当前问诊医生信息
|
// 获取当前问诊医生信息
|
||||||
// 专家问诊-公益问诊
|
// 专家问诊-公益问诊
|
||||||
// if ($request_params['inquiry_type'] == 3 || $request_params['inquiry_type'] == 1) {
|
if ($request_params['inquiry_type'] == 3 || $request_params['inquiry_type'] == 1) {
|
||||||
// if (empty($request_params['doctor_id'])) {
|
if (empty($request_params['doctor_id'])) {
|
||||||
// return fail(HttpEnumCode::HTTP_ERROR, "未选择医生");
|
return fail(HttpEnumCode::HTTP_ERROR, "未选择医生");
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// $params = array();
|
$params = array();
|
||||||
// $params['doctor_id'] = $request_params['doctor_id'];
|
$params['doctor_id'] = $request_params['doctor_id'];
|
||||||
// $doctor = UserDoctor::getOne($params);
|
$doctor = UserDoctor::getOne($params);
|
||||||
// if (empty($doctor)) {
|
if (empty($doctor)) {
|
||||||
// return fail(HttpEnumCode::HTTP_ERROR, "未知医生");
|
return fail(HttpEnumCode::HTTP_ERROR, "未知医生");
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// if ($doctor['idcard_status'] != 1) {
|
if ($doctor['idcard_status'] != 1) {
|
||||||
// return fail(HttpEnumCode::HTTP_ERROR, "当前医生无法接诊,请重新选择");
|
return fail(HttpEnumCode::HTTP_ERROR, "当前医生无法接诊,请重新选择");
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// if ($doctor['iden_auth_status'] != 1) {
|
if ($doctor['iden_auth_status'] != 1) {
|
||||||
// return fail(HttpEnumCode::HTTP_ERROR, "当前医生无法接诊,请重新选择");
|
return fail(HttpEnumCode::HTTP_ERROR, "当前医生无法接诊,请重新选择");
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
// 获取问诊价格
|
// 获取问诊价格
|
||||||
$DoctorInquiryService = new DoctorInquiryService();
|
$DoctorInquiryService = new DoctorInquiryService();
|
||||||
@ -185,6 +190,7 @@ class InquiryService extends BaseService
|
|||||||
$data['is_family_history'] = $request_params['is_family_history'] ?: 0; // 是否存在家族病史(0:否 1:是)
|
$data['is_family_history'] = $request_params['is_family_history'] ?: 0; // 是否存在家族病史(0:否 1:是)
|
||||||
$data['family_history'] = $request_params['family_history'] ?? null; // 家族病史描述
|
$data['family_history'] = $request_params['family_history'] ?? null; // 家族病史描述
|
||||||
$data['is_pregnant'] = $request_params['is_pregnant'] ?: 0; // 是否备孕、妊娠、哺乳期(0:否 1:是)
|
$data['is_pregnant'] = $request_params['is_pregnant'] ?: 0; // 是否备孕、妊娠、哺乳期(0:否 1:是)
|
||||||
|
$data['is_taboo'] = $request_params['is_taboo'] ?: 0; // 是否存在禁忌药物(0:否 1:是)问诊购药时存在
|
||||||
$order_inquiry_case = OrderInquiryCase::addOrderInquiryCase($data);
|
$order_inquiry_case = OrderInquiryCase::addOrderInquiryCase($data);
|
||||||
if (empty($order_inquiry_case)) {
|
if (empty($order_inquiry_case)) {
|
||||||
Db::rollBack();
|
Db::rollBack();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user