新增患者处方管理
This commit is contained in:
parent
ad24a7ce91
commit
097f1da063
@ -126,4 +126,20 @@ class UserDoctorController extends AbstractController
|
||||
$data = $UserDoctorService->putDoctorBankCard();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取处方列表
|
||||
* @return ResponseInterface
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function getPrescriptionList(): ResponseInterface
|
||||
{
|
||||
$request = $this->container->get(UserDoctorRequest::class);
|
||||
$request->scene('getPrescriptionList')->validateResolved();
|
||||
|
||||
$UserDoctorService = new UserDoctorService();
|
||||
$data = $UserDoctorService->getPrescriptionList();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
}
|
||||
@ -14,19 +14,21 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
||||
* @property int $order_inquiry_id 订单-问诊id
|
||||
* @property int $doctor_id 医生id
|
||||
* @property int $pharmacist_id 药师id
|
||||
* @property int $icd_id 疾病id
|
||||
* @property int $icd_id 疾病id(icd)
|
||||
* @property string $icd_name 疾病名称(icd)
|
||||
* @property int $prescription_status 处方状态(1:待审核 3:待使用 4:已失效 5:已使用)
|
||||
* @property int $prescription_audit_status 处方审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
* @property int $pharmacist_audit_status 药师审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
* @property string $pharmacist_fail_reason 药师审核驳回原因
|
||||
* @property int $platform_audit_status 处方平台审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
* @property string $platform_fail_reason 处方平台驳回原因
|
||||
* @property int $is_delete 是否删除(0:否 1:是)
|
||||
* @property int $is_pass 处方平台是否审核通过(0:否 1:是)
|
||||
* @property string $prescription 处方编号
|
||||
* @property string $not_pass_reason 处方平台审核不通过原因
|
||||
* @property string $audit_fail_reason 审核驳回原因
|
||||
* @property string $prescription_code 处方编号
|
||||
* @property string $doctor_name 医生名称
|
||||
* @property string $patient_name 患者姓名-就诊人
|
||||
* @property int $patient_sex 患者性别-就诊人(1:男 2:女)
|
||||
* @property int $patient_age 患者年龄-就诊人
|
||||
* @property string $drugs_info 药品数据
|
||||
* @property string $disease_desc 病情描述(主诉)
|
||||
* @property string $prescription_img 处方图片
|
||||
* @property \Carbon\Carbon $created_at 创建时间
|
||||
* @property \Carbon\Carbon $updated_at 修改时间
|
||||
@ -43,12 +45,12 @@ class OrderPrescription extends Model
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['order_prescription_id', 'order_inquiry_id', 'doctor_id', 'pharmacist_id', 'icd_id', 'prescription_status', 'prescription_audit_status', 'is_delete', 'is_pass', 'prescription', 'not_pass_reason', 'audit_fail_reason', 'doctor_name', 'patient_name', 'patient_sex', 'patient_age', 'drugs_info', 'prescription_img', 'created_at', 'updated_at'];
|
||||
protected array $fillable = ['order_prescription_id', 'order_inquiry_id', 'doctor_id', 'pharmacist_id', 'icd_id', 'icd_name', 'prescription_status', 'pharmacist_audit_status', 'pharmacist_fail_reason', 'platform_audit_status', 'platform_fail_reason', 'is_delete', 'prescription_code', 'doctor_name', 'patient_name', 'patient_sex', 'patient_age', 'drugs_info', 'disease_desc', 'prescription_img', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*/
|
||||
protected array $casts = ['order_prescription_id' => 'integer', 'order_inquiry_id' => 'integer', 'doctor_id' => 'integer', 'pharmacist_id' => 'integer', 'icd_id' => 'integer', 'prescription_status' => 'integer', 'prescription_audit_status' => 'integer', 'is_delete' => 'integer', 'is_pass' => 'integer', 'patient_sex' => 'integer', 'patient_age' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
|
||||
protected array $casts = ['order_prescription_id' => 'integer', 'order_inquiry_id' => 'integer', 'doctor_id' => 'integer', 'pharmacist_id' => 'integer', 'icd_id' => 'integer', 'prescription_status' => 'integer', 'pharmacist_audit_status' => 'integer', 'platform_audit_status' => 'integer', 'is_delete' => 'integer', 'patient_sex' => 'integer', 'patient_age' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
|
||||
|
||||
protected string $primaryKey = "order_prescription_id";
|
||||
|
||||
@ -83,4 +85,5 @@ class OrderPrescription extends Model
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -40,6 +40,9 @@ class UserDoctorRequest extends FormRequest
|
||||
'city_id',
|
||||
'county_id',
|
||||
],
|
||||
'getPrescriptionList' => [ // 获取处方列表
|
||||
'prescription_status' // 处方审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
@ -66,6 +69,7 @@ class UserDoctorRequest extends FormRequest
|
||||
'province_id' => 'required|required_with:city_id,county_id',
|
||||
'city_id' => 'required|required_with:county_id',
|
||||
'county_id' => 'required',
|
||||
'prescription_status' => 'required|integer|min:0|max:2',
|
||||
];
|
||||
}
|
||||
|
||||
@ -99,6 +103,10 @@ class UserDoctorRequest extends FormRequest
|
||||
'city_id.required_with' => "请选择城市",
|
||||
'city_id.required' => "请选择城市",
|
||||
'county_id.required' => "请选择区县",
|
||||
'prescription_status.required' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||
'prescription_status.integer' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||
'prescription_status.min' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||
'prescription_status.max' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,44 +16,45 @@ class OrderPrescriptionService extends BaseService
|
||||
{
|
||||
$params = array();
|
||||
$params['doctor_id'] = $doctor_id;
|
||||
$params['prescription_audit_status'] = 2;//处方审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
$params['is_pass'] = 1;//处方平台是否审核通过(0:否 1:是)
|
||||
$params['pharmacist_audit_status'] = 2;// 处方审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
$params['platform_audit_status'] = 1;// 处方平台审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
$params['is_delete'] = 0;// 是否删除(0:否 1:是)
|
||||
return OrderPrescription::getExists($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取药师待审核处方-分页
|
||||
* @param string $pharmacist_id
|
||||
* 获取药师待审核处方-分页-存在问题,需修改
|
||||
* @param string $pharmacist_id 药师id
|
||||
* @return array
|
||||
*/
|
||||
public function getPharmacistWaitAuditPage(string $pharmacist_id): array
|
||||
{
|
||||
$params = array();
|
||||
$params['pharmacist_id'] = $pharmacist_id;
|
||||
$params['prescription_audit_status'] = 0; //处方审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
$params['pharmacist_audit_status'] = 0; //处方审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
|
||||
$fields = [
|
||||
"order_prescription_id",
|
||||
"order_inquiry_id",
|
||||
"doctor_id",
|
||||
"pharmacist_id",
|
||||
"prescription_status",
|
||||
"prescription_audit_status",
|
||||
"is_delete",
|
||||
"is_pass",
|
||||
"prescription_code",
|
||||
"not_pass_reason",
|
||||
"audit_fail_reason",
|
||||
"doctor_name",
|
||||
"patient_name",
|
||||
"patient_sex",
|
||||
"patient_age",
|
||||
"created_at",
|
||||
];
|
||||
// $fields = [
|
||||
// "order_prescription_id",
|
||||
// "order_inquiry_id",
|
||||
// "doctor_id",
|
||||
// "pharmacist_id",
|
||||
// "prescription_status",
|
||||
// "pharmacist_audit_status",
|
||||
// "is_delete",
|
||||
// "is_pass",
|
||||
// "prescription_code",
|
||||
// "not_pass_reason",
|
||||
// "audit_fail_reason",
|
||||
// "doctor_name",
|
||||
// "patient_name",
|
||||
// "patient_sex",
|
||||
// "patient_age",
|
||||
// "created_at",
|
||||
// ];
|
||||
|
||||
$page = $this->request->input('page', 1);
|
||||
$per_page = $this->request->input('per_page', 10);
|
||||
return OrderPrescription::getPage($params, $fields);
|
||||
}
|
||||
|
||||
}
|
||||
@ -8,7 +8,9 @@ use App\Model\BasicBank;
|
||||
use App\Model\DiseaseClassExpertise;
|
||||
use App\Model\DoctorBankCard;
|
||||
use App\Model\DoctorExpertise;
|
||||
use App\Model\DoctorInquiryConfig;
|
||||
use App\Model\OrderInquiry;
|
||||
use App\Model\OrderPrescription;
|
||||
use App\Model\UserDoctor;
|
||||
use App\Model\UserDoctorInfo;
|
||||
use App\Utils\Mask;
|
||||
@ -263,7 +265,11 @@ class UserDoctorService extends BaseService
|
||||
return success();
|
||||
}
|
||||
|
||||
public function putDoctorBankCard()
|
||||
/**
|
||||
* 更换医生银行卡
|
||||
* @return array
|
||||
*/
|
||||
public function putDoctorBankCard(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
@ -331,4 +337,70 @@ class UserDoctorService extends BaseService
|
||||
|
||||
return success();
|
||||
}
|
||||
|
||||
// 获取处方列表
|
||||
public function getPrescriptionList(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
$prescription_status = $this->request->route('prescription_status');
|
||||
$page = $this->request->input('page', 1);
|
||||
$per_page = $this->request->input('per_page', 10);
|
||||
|
||||
// 获取医生信息
|
||||
$params = array();
|
||||
$params['doctor_id'] = $user_info['client_user_id'];
|
||||
|
||||
$fields = [
|
||||
'doctor_id',
|
||||
'iden_auth_status',
|
||||
'idcard_status',
|
||||
'multi_point_status',
|
||||
];
|
||||
$user_doctor = UserDoctor::getOne($params, $fields);
|
||||
if (empty($user_doctor)) {
|
||||
return fail(HttpEnumCode::HTTP_ERROR, "非法医生");
|
||||
}
|
||||
|
||||
if ($user_doctor['iden_auth_status'] != 1) {
|
||||
return fail(HttpEnumCode::HTTP_ERROR, "请先完成身份认证");
|
||||
}
|
||||
|
||||
if ($user_doctor['idcard_status'] != 1) {
|
||||
return fail(HttpEnumCode::HTTP_ERROR, "请先完成实名认证");
|
||||
}
|
||||
|
||||
if ($user_doctor['multi_point_status'] != 1) {
|
||||
return fail(HttpEnumCode::HTTP_ERROR, "请先完成多点执业认证");
|
||||
}
|
||||
|
||||
// 获取医生问诊价格
|
||||
$params = array();
|
||||
$params['doctor_id'] = $user_info['client_user_id'];
|
||||
$params['inquiry_type'] = 1;
|
||||
$params['inquiry_mode'] = 1;
|
||||
$doctor_inquiry_config = DoctorInquiryConfig::getInquiryConfigOne($params);
|
||||
if (empty($doctor_inquiry_config)){
|
||||
return fail(HttpEnumCode::HTTP_ERROR, "请先设置在线问诊价格");
|
||||
}
|
||||
|
||||
// 获取处方数据
|
||||
$params = array();
|
||||
$params['doctor_id'] = $user_info['client_user_id'];
|
||||
$params['pharmacist_audit_status'] = $prescription_status;
|
||||
$params['is_delete'] = 0;
|
||||
$order_prescriptions = OrderPrescription::getPage($params);
|
||||
if (empty($order_prescriptions)){
|
||||
return success($order_prescriptions);
|
||||
}
|
||||
|
||||
// 处理数据
|
||||
foreach ($order_prescriptions as $$order_prescription){
|
||||
// 获取病情描述
|
||||
// 获取病情诊断名称,icd名称
|
||||
// 患病时长
|
||||
// 驳回原因
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -90,6 +90,12 @@ Router::addGroup('/doctor', function () {
|
||||
// 更换医生银行卡
|
||||
Router::put('/{bank_card_id:\d+}', [UserDoctorController::class, 'putDoctorBankCard']);
|
||||
});
|
||||
|
||||
// 处方
|
||||
Router::addGroup('/prescription', function () {
|
||||
// 获取处方列表
|
||||
Router::get('', [UserDoctorController::class, 'getPrescriptionList']);
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
@ -208,7 +214,7 @@ Router::addGroup('/oss', function () {
|
||||
Router::get('/sign', [SafeController::class, 'getOssSign']);
|
||||
});
|
||||
|
||||
// 医院
|
||||
// 基础数据
|
||||
Router::addGroup('/basic', function () {
|
||||
// 获取医院数据
|
||||
Router::get('/hospital', [BasicDataController::class, 'getHospital']);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user