新增获取处方列表
This commit is contained in:
parent
7604576cd3
commit
5432819d20
76
app/Model/DiseaseClassIcd.php
Normal file
76
app/Model/DiseaseClassIcd.php
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Model;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
use Hyperf\Database\Model\Collection;
|
||||||
|
use Hyperf\Snowflake\Concern\Snowflake;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property int $icd_id 主键id
|
||||||
|
* @property string $icd_name 疾病分类名称
|
||||||
|
* @property string $icd_code icd编码
|
||||||
|
* @property string $icd_spell icd简拼
|
||||||
|
* @property int $icd_status 状态(0:删除 1:正常)
|
||||||
|
* @property int $icd_enable 是否启用(0:否 1:是)
|
||||||
|
* @property \Carbon\Carbon $created_at 创建时间
|
||||||
|
* @property \Carbon\Carbon $updated_at 修改时间
|
||||||
|
*/
|
||||||
|
class DiseaseClassIcd extends Model
|
||||||
|
{
|
||||||
|
use Snowflake;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The table associated with the model.
|
||||||
|
*/
|
||||||
|
protected ?string $table = 'disease_class_icd';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The attributes that are mass assignable.
|
||||||
|
*/
|
||||||
|
protected array $fillable = ['icd_id', 'icd_name', 'icd_code', 'icd_spell', 'icd_status', 'icd_enable', 'created_at', 'updated_at'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The attributes that should be cast to native types.
|
||||||
|
*/
|
||||||
|
protected array $casts = ['icd_id' => 'integer', 'icd_status' => 'integer', 'icd_enable' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
|
||||||
|
|
||||||
|
protected string $primaryKey = "icd_id";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取信息-单条
|
||||||
|
* @param array $params
|
||||||
|
* @param array $fields
|
||||||
|
* @return object|null
|
||||||
|
*/
|
||||||
|
public static function getOne(array $params, array $fields = ['*'],): object|null
|
||||||
|
{
|
||||||
|
return self::where($params)->first($fields);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取数据-多
|
||||||
|
* @param array $params
|
||||||
|
* @param array $fields
|
||||||
|
* @return Collection|array
|
||||||
|
*/
|
||||||
|
public static function getList(array $params = [], array $fields = ['*']): Collection|array
|
||||||
|
{
|
||||||
|
return self::where($params)->get($fields);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取数据-限制条数
|
||||||
|
* @param array $params
|
||||||
|
* @param int|string $limit
|
||||||
|
* @param array $fields
|
||||||
|
* @return Collection|array
|
||||||
|
*/
|
||||||
|
public static function getLimit(array $params = [],int|string $limit = 5, array $fields = ['*']): Collection|array
|
||||||
|
{
|
||||||
|
return self::where($params)->limit($limit)->get($fields);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -6,10 +6,12 @@ use App\Constants\HttpEnumCode;
|
|||||||
use App\Exception\BusinessException;
|
use App\Exception\BusinessException;
|
||||||
use App\Model\BasicBank;
|
use App\Model\BasicBank;
|
||||||
use App\Model\DiseaseClassExpertise;
|
use App\Model\DiseaseClassExpertise;
|
||||||
|
use App\Model\DiseaseClassIcd;
|
||||||
use App\Model\DoctorBankCard;
|
use App\Model\DoctorBankCard;
|
||||||
use App\Model\DoctorExpertise;
|
use App\Model\DoctorExpertise;
|
||||||
use App\Model\DoctorInquiryConfig;
|
use App\Model\DoctorInquiryConfig;
|
||||||
use App\Model\OrderInquiry;
|
use App\Model\OrderInquiry;
|
||||||
|
use App\Model\OrderInquiryCase;
|
||||||
use App\Model\OrderPrescription;
|
use App\Model\OrderPrescription;
|
||||||
use App\Model\UserDoctor;
|
use App\Model\UserDoctor;
|
||||||
use App\Model\UserDoctorInfo;
|
use App\Model\UserDoctorInfo;
|
||||||
@ -332,18 +334,21 @@ class UserDoctorService extends BaseService
|
|||||||
$data['city'] = $area['city']['area_name'];
|
$data['city'] = $area['city']['area_name'];
|
||||||
$data['county_id'] = $county_id;
|
$data['county_id'] = $county_id;
|
||||||
$data['county'] = $area['county']['area_name'];
|
$data['county'] = $area['county']['area_name'];
|
||||||
$data['updated_at'] = date('Y-m-d H:i:s',time());
|
$data['updated_at'] = date('Y-m-d H:i:s', time());
|
||||||
DoctorBankCard::editDoctorBankCard($params,$data);
|
DoctorBankCard::editDoctorBankCard($params, $data);
|
||||||
|
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取处方列表
|
/**
|
||||||
|
* 获取处方列表
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function getPrescriptionList(): array
|
public function getPrescriptionList(): array
|
||||||
{
|
{
|
||||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
$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);
|
$page = $this->request->input('page', 1);
|
||||||
$per_page = $this->request->input('per_page', 10);
|
$per_page = $this->request->input('per_page', 10);
|
||||||
|
|
||||||
@ -380,7 +385,7 @@ class UserDoctorService extends BaseService
|
|||||||
$params['inquiry_type'] = 1;
|
$params['inquiry_type'] = 1;
|
||||||
$params['inquiry_mode'] = 1;
|
$params['inquiry_mode'] = 1;
|
||||||
$doctor_inquiry_config = DoctorInquiryConfig::getInquiryConfigOne($params);
|
$doctor_inquiry_config = DoctorInquiryConfig::getInquiryConfigOne($params);
|
||||||
if (empty($doctor_inquiry_config)){
|
if (empty($doctor_inquiry_config)) {
|
||||||
return fail(HttpEnumCode::HTTP_ERROR, "请先设置在线问诊价格");
|
return fail(HttpEnumCode::HTTP_ERROR, "请先设置在线问诊价格");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -390,17 +395,61 @@ class UserDoctorService extends BaseService
|
|||||||
$params['pharmacist_audit_status'] = $prescription_status;
|
$params['pharmacist_audit_status'] = $prescription_status;
|
||||||
$params['is_delete'] = 0;
|
$params['is_delete'] = 0;
|
||||||
$order_prescriptions = OrderPrescription::getPage($params);
|
$order_prescriptions = OrderPrescription::getPage($params);
|
||||||
if (empty($order_prescriptions)){
|
if (empty($order_prescriptions)) {
|
||||||
return success($order_prescriptions);
|
return success($order_prescriptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理数据
|
// 处理数据
|
||||||
foreach ($order_prescriptions as $$order_prescription){
|
$result = array();
|
||||||
// 获取病情描述
|
|
||||||
// 获取病情诊断名称,icd名称
|
|
||||||
// 患病时长
|
|
||||||
// 驳回原因
|
|
||||||
|
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user