This commit is contained in:
wucongxing 2023-04-25 20:51:07 +08:00
parent 2255d3a3a1
commit d215493859
4 changed files with 26 additions and 2 deletions

View File

@ -301,6 +301,22 @@ class UserDoctorController extends AbstractController
return $this->response->json($data); return $this->response->json($data);
} }
/**
* 检测是否可以开具处方
* @return ResponseInterface
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function checkOpenPrescription(): ResponseInterface
{
$request = $this->container->get(UserDoctorRequest::class);
$request->scene('getPrescriptionInfo')->validateResolved();
$UserDoctorService = new UserDoctorService();
$data = $UserDoctorService->getPrescriptionInfo();
return $this->response->json($data);
}
/** /**
* 获取医生名片 * 获取医生名片
* @return ResponseInterface * @return ResponseInterface

View File

@ -57,6 +57,9 @@ class UserDoctorRequest extends FormRequest
'getPrescriptionInfo' => [ // 获取处方详情 'getPrescriptionInfo' => [ // 获取处方详情
'order_inquiry_id', 'order_inquiry_id',
], ],
'checkOpenPrescription' => [ // 检测是否可以开具处方
'order_inquiry_id',
],
'putPrescription' => [ // 修改处方 'putPrescription' => [ // 修改处方
'order_prescription_id', 'order_prescription_id',
'prescription_icd',// 诊断疾病 'prescription_icd',// 诊断疾病

View File

@ -130,17 +130,23 @@ class CaService extends BaseService
return; return;
} }
dump(111);
$this->icd_name = ""; $this->icd_name = "";
$icd_name = array_column($order_prescription_icd->toArray(), 'icd_name'); $icd_name = array_column($order_prescription_icd->toArray(), 'icd_name');
dump($icd_name);
if (!empty($icd_name)) { if (!empty($icd_name)) {
if (count($icd_name) > 1) { if (count($icd_name) > 1) {
dump(22222);
$this->icd_name = implode(';', $icd_name); $this->icd_name = implode(';', $icd_name);
} else { } else {
dump(333);
$this->icd_name = $icd_name[0]; $this->icd_name = $icd_name[0];
} }
} }
}); });
dump($this->icd_name);
// 获取处方关联商品数据 // 获取处方关联商品数据
co(function () use ($wg,$channel,$order_prescription_id) { co(function () use ($wg,$channel,$order_prescription_id) {
defer(function() use ($wg) { defer(function() use ($wg) {
@ -197,7 +203,6 @@ class CaService extends BaseService
$params['order_inquiry_id'] = $order_inquiry_id; $params['order_inquiry_id'] = $order_inquiry_id;
$order_inquiry_case = OrderInquiryCase::getOne($params); $order_inquiry_case = OrderInquiryCase::getOne($params);
if (empty($order_inquiry_case)) { if (empty($order_inquiry_case)) {
dump(111);
$channel->push('处方病例数据错误'); $channel->push('处方病例数据错误');
return; return;
} }

View File

@ -161,7 +161,7 @@ Router::addGroup('/doctor', function () {
Router::post('', [UserDoctorController::class, 'addPrescription']); Router::post('', [UserDoctorController::class, 'addPrescription']);
// 检测是否可以开具处方 // 检测是否可以开具处方
Router::get('/check', [UserDoctorController::class, 'addPrescription']); Router::get('/check', [UserDoctorController::class, 'checkOpenPrescription']);
}); });
// 常用语 // 常用语