删除自动开方时增加上报处方数据。增加自动结束时上报处方数据,修改上报处方脚本
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Model\OrderPrescription;
|
||||
use App\Model\ReportRegulatory;
|
||||
|
||||
/**
|
||||
@@ -15,22 +16,34 @@ class ReportRegulatoryService extends BaseService
|
||||
* @param string $order_prescription_id
|
||||
* @return bool
|
||||
*/
|
||||
protected function addReportRegulatory(string $order_inquiry_id,string $order_prescription_id): bool
|
||||
public function addReportRegulatory(string $order_inquiry_id): bool
|
||||
{
|
||||
// 检测是否已添加
|
||||
// 检测是否已添加数据
|
||||
$params = array();
|
||||
$params['order_inquiry_id'] = $order_inquiry_id;
|
||||
$res = ReportRegulatory::getExists($params);
|
||||
if ($res) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$data = array();
|
||||
$data['order_inquiry_id'] = $order_inquiry_id;
|
||||
$data['order_prescription_id'] = $order_prescription_id;
|
||||
$report_regulatory = ReportRegulatory::addReportRegulatory($data);
|
||||
$report_regulatory = ReportRegulatory::getOne($params);
|
||||
if (empty($report_regulatory)){
|
||||
return false;
|
||||
// 检测是否存在处方
|
||||
$params = array();
|
||||
$params['order_inquiry_id'] = $order_inquiry_id;
|
||||
$params['pharmacist_audit_status'] = 1;
|
||||
$params['platform_audit_status'] = 1;
|
||||
$order_prescription = OrderPrescription::getOne($params);
|
||||
|
||||
// 添加数据
|
||||
$data = array();
|
||||
$data['order_inquiry_id'] = $order_inquiry_id;
|
||||
if (!empty($order_prescription)){
|
||||
$data['order_prescription_id'] = $order_prescription['order_prescription_id'];
|
||||
$data['is_further_consult'] = 1;
|
||||
$data['is_prescription'] = 1;
|
||||
}
|
||||
$report_regulatory = ReportRegulatory::addReportRegulatory($data);
|
||||
if (empty($report_regulatory)){
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user