新增获取处方列表
This commit is contained in:
@@ -6,10 +6,12 @@ use App\Constants\HttpEnumCode;
|
||||
use App\Exception\BusinessException;
|
||||
use App\Model\BasicBank;
|
||||
use App\Model\DiseaseClassExpertise;
|
||||
use App\Model\DiseaseClassIcd;
|
||||
use App\Model\DoctorBankCard;
|
||||
use App\Model\DoctorExpertise;
|
||||
use App\Model\DoctorInquiryConfig;
|
||||
use App\Model\OrderInquiry;
|
||||
use App\Model\OrderInquiryCase;
|
||||
use App\Model\OrderPrescription;
|
||||
use App\Model\UserDoctor;
|
||||
use App\Model\UserDoctorInfo;
|
||||
@@ -332,18 +334,21 @@ class UserDoctorService extends BaseService
|
||||
$data['city'] = $area['city']['area_name'];
|
||||
$data['county_id'] = $county_id;
|
||||
$data['county'] = $area['county']['area_name'];
|
||||
$data['updated_at'] = date('Y-m-d H:i:s',time());
|
||||
DoctorBankCard::editDoctorBankCard($params,$data);
|
||||
$data['updated_at'] = date('Y-m-d H:i:s', time());
|
||||
DoctorBankCard::editDoctorBankCard($params, $data);
|
||||
|
||||
return success();
|
||||
}
|
||||
|
||||
// 获取处方列表
|
||||
/**
|
||||
* 获取处方列表
|
||||
* @return array
|
||||
*/
|
||||
public function getPrescriptionList(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
$prescription_status = $this->request->route('prescription_status');
|
||||
$prescription_status = $this->request->input('prescription_status');
|
||||
$page = $this->request->input('page', 1);
|
||||
$per_page = $this->request->input('per_page', 10);
|
||||
|
||||
@@ -380,7 +385,7 @@ class UserDoctorService extends BaseService
|
||||
$params['inquiry_type'] = 1;
|
||||
$params['inquiry_mode'] = 1;
|
||||
$doctor_inquiry_config = DoctorInquiryConfig::getInquiryConfigOne($params);
|
||||
if (empty($doctor_inquiry_config)){
|
||||
if (empty($doctor_inquiry_config)) {
|
||||
return fail(HttpEnumCode::HTTP_ERROR, "请先设置在线问诊价格");
|
||||
}
|
||||
|
||||
@@ -390,17 +395,61 @@ class UserDoctorService extends BaseService
|
||||
$params['pharmacist_audit_status'] = $prescription_status;
|
||||
$params['is_delete'] = 0;
|
||||
$order_prescriptions = OrderPrescription::getPage($params);
|
||||
if (empty($order_prescriptions)){
|
||||
if (empty($order_prescriptions)) {
|
||||
return success($order_prescriptions);
|
||||
}
|
||||
|
||||
// 处理数据
|
||||
foreach ($order_prescriptions as $$order_prescription){
|
||||
// 获取病情描述
|
||||
// 获取病情诊断名称,icd名称
|
||||
// 患病时长
|
||||
// 驳回原因
|
||||
$result = array();
|
||||
|
||||
foreach ($order_prescriptions['data'] as $order_prescription) {
|
||||
$data = array();
|
||||
$data['patient_name'] = $order_prescription['patient_name'];
|
||||
$data['patient_sex'] = $order_prescription['patient_sex'];
|
||||
$data['patient_age'] = $order_prescription['patient_age'];
|
||||
$data['created_at'] = $order_prescription['created_at']; // 开方时间
|
||||
$data['pharmacist_audit_status'] = $order_prescription['pharmacist_audit_status'];// 药师审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
$data['pharmacist_fail_reason'] = $order_prescription['pharmacist_fail_reason'];// 驳回原因
|
||||
$data['platform_audit_status'] = $order_prescription['platform_audit_status'];// 处方平台审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
$data['platform_fail_reason'] = $order_prescription['platform_fail_reason'];// 处方平台驳回原因
|
||||
|
||||
// 获取病例信息
|
||||
$params = array();
|
||||
$params['order_inquiry_id'] = $order_prescription['order_inquiry_id'];
|
||||
$params['status'] = 1;
|
||||
$order_inquiry_case = OrderInquiryCase::getOne($params);
|
||||
if (empty($order_inquiry_case)) {
|
||||
return fail(HttpEnumCode::SERVER_ERROR);
|
||||
}
|
||||
|
||||
// 病情描述
|
||||
$data['disease_desc'] = $order_inquiry_case['disease_desc'];
|
||||
|
||||
// 获取icd诊断疾病信息
|
||||
$params = array();
|
||||
$params['icd_id'] = $order_prescription['icd_id'];
|
||||
$disease_class_icd = DiseaseClassIcd::getOne($params);
|
||||
if (empty($disease_class_icd)){
|
||||
return fail(HttpEnumCode::SERVER_ERROR);
|
||||
}
|
||||
|
||||
// 获取病情诊断名称,icd名称
|
||||
$data['icd_name'] = $disease_class_icd['icd_name'];
|
||||
|
||||
// 患病时长
|
||||
if (empty($order_inquiry_case['diagnosis_date'])){
|
||||
$data['diagnosis_date'] = "未知";
|
||||
}else{
|
||||
$data['diagnosis_date'] = date('Y-m-d',strtotime($order_inquiry_case['diagnosis_date']));
|
||||
}
|
||||
|
||||
|
||||
$result[] = $data;
|
||||
}
|
||||
|
||||
unset($order_prescriptions['data']);
|
||||
$order_prescriptions['data'] = $result;
|
||||
|
||||
return success($order_prescriptions);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user