You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
94 lines
2.9 KiB
94 lines
2.9 KiB
<?php
|
|
declare(strict_types = 1);
|
|
|
|
namespace App\Http\Logics\Message;
|
|
|
|
use App\Exceptions\GeneralException;
|
|
use App\Models\Patient;
|
|
use App\Utils\Traits\Logger;
|
|
use App\Utils\Traits\SendSubscribeMessage;
|
|
use Illuminate\Http\JsonResponse;
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
|
|
class TriggerLogic
|
|
{
|
|
use Logger;
|
|
use SendSubscribeMessage;
|
|
|
|
private Patient $patient_model;
|
|
|
|
/**
|
|
* TriggerLogic Construct
|
|
*/
|
|
public function __construct(){
|
|
$this->patient_model = new Patient();
|
|
}
|
|
|
|
|
|
/**
|
|
* 挂号停诊
|
|
* @param string $patient_id
|
|
* @param string $reg_date
|
|
* @param string $begin_time
|
|
* @param string $end_time
|
|
* @param string $dept_name
|
|
* @param string $doctor_name
|
|
* @param string $tips_message
|
|
* @return array
|
|
*/
|
|
public function registerStopRemind(string $patient_id, string $reg_date, string $begin_time, string $end_time, string $dept_name, string $doctor_name, string $tips_message): array
|
|
{
|
|
$info = $this->patient_model->getPatientInfoByPatientId($patient_id);
|
|
if (empty($info)) {
|
|
return [false, '未找到该患者绑定信息'];
|
|
}
|
|
|
|
$this->sendRegistrationStopRemindMessage($info, $reg_date, $begin_time, $end_time, $dept_name, $doctor_name, $tips_message);
|
|
|
|
return [true, '成功,已加入推送队列。'];
|
|
}
|
|
|
|
/**
|
|
* 待缴费提醒
|
|
* @param string $patient_id
|
|
* @param string $dept_name
|
|
* @param string $fee
|
|
* @param string $fee_type
|
|
* @param string $tips_message
|
|
* @return array
|
|
*/
|
|
public function pendingPaymentRemind(string $patient_id, string $dept_name, string $fee, string $fee_type, string $tips_message): array
|
|
{
|
|
$info = $this->patient_model->getPatientInfoByPatientId($patient_id);
|
|
if (empty($info)) {
|
|
return [false, '未找到该患者绑定信息'];
|
|
}
|
|
|
|
$this->sendPendingPaymentRemindMessage($info, $dept_name, $fee, $fee_type, $tips_message);
|
|
|
|
return [true, '成功,已加入推送队列。'];
|
|
}
|
|
|
|
/**
|
|
* 报告发布提醒
|
|
* @param string $patient_id
|
|
* @param int $report_type
|
|
* @param string $item_name
|
|
* @param string $report_time
|
|
* @param string $report_serial_no
|
|
* @param string $dept_name
|
|
* @param string $remark
|
|
* @return array
|
|
*/
|
|
public function reportReleaseRemind(string $patient_id, int $report_type, string $item_name, string $report_time, string $report_serial_no, string $dept_name, string $remark = ''): array
|
|
{
|
|
$info = $this->patient_model->getPatientInfoByPatientId($patient_id);
|
|
if (empty($info)) {
|
|
return [false, '未找到该患者绑定信息'];
|
|
}
|
|
|
|
$this->sendReportReleaseRemindMessage($info, $report_type, $item_name, $report_time, $report_serial_no, $dept_name, $remark);
|
|
|
|
return [true, '成功,已加入推送队列。'];
|
|
}
|
|
}
|
|
|