修正医生处方列表参数错误问题,新增获取处方列表接口
This commit is contained in:
@@ -157,4 +157,20 @@ class PatientOrderController extends AbstractController
|
||||
$data = $PatientOrderService->addPatientProductOrder();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取处方订单列表
|
||||
* @return ResponseInterface
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function getPatientPrescriptionOrderList(): ResponseInterface
|
||||
{
|
||||
$request = $this->container->get(PatientOrderRequest::class);
|
||||
$request->scene('getPatientPrescriptionOrderList')->validateResolved();
|
||||
|
||||
$PatientOrderService = new PatientOrderService();
|
||||
$data = $PatientOrderService->getPatientPrescriptionOrderList();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,8 @@ use Extend\TencentIm\Group;
|
||||
use Extend\TencentIm\Message;
|
||||
use Extend\TencentIm\MessageParams;
|
||||
use Extend\TencentIm\Profile;
|
||||
use Extend\VerifyDun\BankCard;
|
||||
use Extend\VerifyDun\IdCard;
|
||||
use Extend\Wechat\Wechat;
|
||||
use Extend\Wechat\WechatPay;
|
||||
use Hyperf\Amqp\Producer;
|
||||
@@ -220,7 +222,17 @@ class UserController extends AbstractController
|
||||
// $imService = new ImService();
|
||||
// $imService->addRecentContactRecordCache("491925054779883520", 2, 10004, $data);
|
||||
|
||||
|
||||
// 银行卡三要素认证
|
||||
// $BankCard = new BankCard();
|
||||
//
|
||||
// $params = array();
|
||||
// $params['bankCardNo'] = "6217000010175646317";
|
||||
// $params['name'] = "吴从兴";
|
||||
// $params['idCardNo'] = "372929199610075412";
|
||||
// $res = $BankCard->checkBankCard($params);
|
||||
// if (!empty($res)) {
|
||||
// return fail(HttpEnumCode::HTTP_ERROR, $res);
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
||||
* @property int $doctor_id 医生id
|
||||
* @property int $patient_id 患者id
|
||||
* @property int $pharmacist_id 药师id
|
||||
* @property int $prescription_status 处方状态(1:待审核 3:待使用 4:已失效 5:已使用)
|
||||
* @property int $prescription_status 处方状态(1:待审核 2:待使用 3:已失效 4:已使用)
|
||||
* @property int $pharmacist_audit_status 药师审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
* @property string $pharmacist_fail_reason 药师审核驳回原因
|
||||
* @property int $platform_audit_status 处方平台审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
@@ -52,13 +52,29 @@ class OrderPrescription extends Model
|
||||
protected string $primaryKey = "order_prescription_id";
|
||||
|
||||
/**
|
||||
* 关联处方病例表
|
||||
* 关联处方疾病表
|
||||
*/
|
||||
public function OrderPrescriptionIcd(): HasMany
|
||||
{
|
||||
return $this->HasMany(OrderPrescriptionIcd::class, 'order_prescription_id','order_prescription_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联处方商品表
|
||||
*/
|
||||
public function OrderPrescriptionProduct(): HasMany
|
||||
{
|
||||
return $this->HasMany(OrderPrescriptionProduct::class, 'order_prescription_id','order_prescription_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联医生表
|
||||
*/
|
||||
public function UserDoctor(): HasOne
|
||||
{
|
||||
return $this->hasOne(UserDoctor::class, 'doctor_id','doctor_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取信息-单条
|
||||
* @param array $params
|
||||
@@ -168,4 +184,33 @@ class OrderPrescription extends Model
|
||||
return self::where($params)->count();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页
|
||||
* 处方疾病表
|
||||
* 处方商品表
|
||||
* @param array $params
|
||||
* @param array $fields
|
||||
* @param int|null $page
|
||||
* @param int|null $per_page
|
||||
* @return array
|
||||
*/
|
||||
public static function getWithPage(array $params, array $fields = ["*"], int $page = null, ?int $per_page = 10): array
|
||||
{
|
||||
$raw = self::with([
|
||||
"UserDoctor:doctor_id,user_name,doctor_title",
|
||||
"OrderPrescriptionIcd:prescription_icd_id,order_prescription_id,icd_name",
|
||||
"OrderPrescriptionProduct:prescription_product_id,order_prescription_id,product_name,product_spec"
|
||||
])
|
||||
->where($params)->paginate($per_page, $fields, "page", $page);
|
||||
|
||||
$data = array();
|
||||
$data['current_page'] = $raw->currentPage();// 当前页码
|
||||
$data['total'] = $raw->total();//数据总数
|
||||
$data['data'] = $raw->items();//数据
|
||||
$data['per_page'] = $raw->perPage();//每页个数
|
||||
$data['last_page'] = $raw->lastPage();//最后一页
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,6 +24,8 @@ class PatientOrderRequest extends FormRequest
|
||||
],
|
||||
'addPatientProductOrder' => [ // 创建药品订单
|
||||
],
|
||||
'getPatientPrescriptionOrderList' => [ // 获取处方订单列表
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@@ -41,7 +41,7 @@ class UserDoctorRequest extends FormRequest
|
||||
'county_id',
|
||||
],
|
||||
'getPrescriptionList' => [ // 获取处方列表
|
||||
'prescription_status' // 处方审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
'pharmacist_audit_status' // 药师审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
],
|
||||
'getDoctorWords' => [ // 获取常用语列表
|
||||
'words_type'
|
||||
@@ -98,7 +98,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',
|
||||
'pharmacist_audit_status' => 'required|integer|min:0|max:2',
|
||||
'words_type' => 'required|integer|min:1|max:3',
|
||||
'words' => 'required',
|
||||
'doctor_id' => 'required',
|
||||
@@ -145,10 +145,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),
|
||||
'pharmacist_audit_status.required' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||
'pharmacist_audit_status.integer' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||
'pharmacist_audit_status.min' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||
'pharmacist_audit_status.max' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||
'words_type.required' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||
'words_type.integer' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||
'words_type.min' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||
|
||||
@@ -484,9 +484,13 @@ class InquiryService extends BaseService
|
||||
return success();
|
||||
}
|
||||
|
||||
public function getInquiryLowestPrice(){
|
||||
/**
|
||||
* 获取问诊最低价格
|
||||
* @return array
|
||||
*/
|
||||
public function getInquiryLowestPrice(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
$doctor_id = $this->request->input('doctor_id');
|
||||
|
||||
// 快速
|
||||
$quick_inquiry_price = 0;
|
||||
@@ -525,7 +529,6 @@ class InquiryService extends BaseService
|
||||
}
|
||||
|
||||
// 公益问诊
|
||||
$welfare_inquiry_price = 0;
|
||||
$params = array();
|
||||
$params['inquiry_type'] = 1;
|
||||
$params['inquiry_mode'] = 1;
|
||||
|
||||
@@ -100,7 +100,7 @@ class OrderPrescriptionService extends BaseService
|
||||
/**
|
||||
* 获取患者某一状态下的处方数量
|
||||
* @param string $patient_id 患者id
|
||||
* @param int $prescription_status 处方状态(1:待审核 3:待使用 4:已失效 5:已使用)
|
||||
* @param int $prescription_status 处方状态(1:待审核 2:待使用 3:已失效 4:已使用)
|
||||
* @return int
|
||||
*/
|
||||
public function getPatientPrescriptionWithStatus(string $patient_id,int $prescription_status): int
|
||||
|
||||
@@ -705,4 +705,28 @@ class PatientOrderService extends BaseService
|
||||
public function addPatientProductOrder(){
|
||||
return success();
|
||||
}
|
||||
|
||||
public function getPatientPrescriptionOrderList(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
$page = $this->request->input('page',1);
|
||||
$per_page = $this->request->input('per_page',10);
|
||||
|
||||
// 获取处方数据
|
||||
$params = array();
|
||||
$params['patient_id'] = $user_info['client_user_id'];
|
||||
$params['pharmacist_audit_status'] = 1;
|
||||
$params['platform_audit_status'] = 1;
|
||||
$params['is_delete'] = 0;
|
||||
$order_prescription = OrderPrescription::getWithPage($params,['*'],$page,$per_page);
|
||||
if (!empty($order_prescription['data'])){
|
||||
foreach ($order_prescription['data'] as &$item){
|
||||
if (!empty($item['UserDoctor'])){
|
||||
$item['UserDoctor']['doctor_title'] = DoctorTitleCode::getMessage($item['UserDoctor']['doctor_title']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return success($order_prescription);
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,6 @@ class SystemService extends BaseService
|
||||
return fail();
|
||||
}
|
||||
|
||||
|
||||
$time = [];
|
||||
foreach ($system_inquiry_time as $item){
|
||||
$time[] = $item['start_time'] . '-' . $item['end_time'];
|
||||
|
||||
@@ -376,7 +376,7 @@ class UserDoctorService extends BaseService
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
$prescription_status = $this->request->input('prescription_status');
|
||||
$pharmacist_audit_status = $this->request->input('pharmacist_audit_status');
|
||||
$page = $this->request->input('page', 1);
|
||||
$per_page = $this->request->input('per_page', 10);
|
||||
|
||||
@@ -410,7 +410,7 @@ class UserDoctorService extends BaseService
|
||||
// 获取处方数据
|
||||
$params = array();
|
||||
$params['doctor_id'] = $user_info['client_user_id'];
|
||||
$params['pharmacist_audit_status'] = $prescription_status;
|
||||
$params['pharmacist_audit_status'] = $pharmacist_audit_status;
|
||||
$params['is_delete'] = 0;
|
||||
$order_prescriptions = OrderPrescription::getWithIcdPage($params,$page,$per_page);
|
||||
if (empty($order_prescriptions)) {
|
||||
@@ -939,7 +939,7 @@ class UserDoctorService extends BaseService
|
||||
}
|
||||
|
||||
// 检测处方状态
|
||||
if ($order_prescription['prescription_status'] == 5) {
|
||||
if ($order_prescription['prescription_status'] == 4) {
|
||||
// 已使用
|
||||
return fail(HttpEnumCode::HTTP_ERROR, "处方已使用,无法更改");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user