新增患者历史问诊表
This commit is contained in:
parent
9bda0e130f
commit
3c05dd76ff
@ -13,6 +13,7 @@ use App\Services\DoctorInquiryService;
|
||||
use App\Services\ImService;
|
||||
use App\Services\UserDoctorService;
|
||||
use Extend\TencentIm\Account;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hyperf\Amqp\Producer;
|
||||
use Hyperf\DbConnection\Db;
|
||||
use Hyperf\Snowflake\IdGeneratorInterface;
|
||||
@ -373,6 +374,7 @@ class UserDoctorController extends AbstractController
|
||||
/**
|
||||
* 结束问诊
|
||||
* @return ResponseInterface
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function putDoctorFinishInquiry(): ResponseInterface
|
||||
{
|
||||
|
||||
@ -189,4 +189,14 @@ class PatientHistoryInquiry extends Model
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param array $data
|
||||
* @return \Hyperf\Database\Model\Model|PatientHistoryInquiry
|
||||
*/
|
||||
public static function addPatientHistoryInquiry(array $data): \Hyperf\Database\Model\Model|PatientHistoryInquiry
|
||||
{
|
||||
return self::create($data);
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,6 +26,7 @@ use App\Model\OrderPrescription;
|
||||
use App\Model\OrderPrescriptionIcd;
|
||||
use App\Model\OrderPrescriptionProduct;
|
||||
use App\Model\OrderProductItem;
|
||||
use App\Model\PatientHistoryInquiry;
|
||||
use App\Model\Product;
|
||||
use App\Model\ProductPlatformAmount;
|
||||
use App\Model\SystemInquiryConfig;
|
||||
@ -1649,6 +1650,7 @@ class UserDoctorService extends BaseService
|
||||
Db::beginTransaction();
|
||||
|
||||
try {
|
||||
// 修改问诊订单表
|
||||
$data = array();
|
||||
$data['inquiry_status'] = 5;// 问诊订单状态(1:待支付 2:待分配 3:待接诊 4:已接诊 5:已完成 6:已结束 7:已取消)
|
||||
$data['complete_time'] = date('Y-m-d H:i:s',time());// 订单完成时间(问诊完成时间)
|
||||
@ -1657,6 +1659,20 @@ class UserDoctorService extends BaseService
|
||||
$params['order_inquiry_id'] = $order_inquiry_id;
|
||||
OrderInquiry::edit($params,$data);
|
||||
|
||||
// 新增患者历史问诊表-问诊完成后添加
|
||||
$data = array();
|
||||
$data['patient_id'] = $order_inquiry['patient_id'];
|
||||
$data['doctor_id'] = $order_inquiry['doctor_id'];
|
||||
if (!empty($order_inquiry['pharmacist_id'])){
|
||||
$data['pharmacist_id'] = $order_inquiry['pharmacist_id'];
|
||||
}
|
||||
$data['history_status'] = 1;
|
||||
$patient_history_inquiry = PatientHistoryInquiry::addPatientHistoryInquiry($data);
|
||||
if (empty($patient_history_inquiry)){
|
||||
Db::rollBack();
|
||||
return fail(HttpEnumCode::SERVER_ERROR, "添加患者历史问诊表失败");
|
||||
}
|
||||
|
||||
// 发送问诊消息
|
||||
$ImService = new ImService();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user