feat: 添加hospital信息模块, 修改缴费及Notify逻辑

master
Rmiku 1 month ago
parent b8f34743b4
commit 1531ad9f01
  1. 163
      app/Http/Controllers/Hospital/IntroduceController.php
  2. 24
      app/Http/Controllers/Registration/ScheduleController.php
  3. 32
      app/Http/Logics/Notify/NotifyLogic.php
  4. 56
      app/Http/Logics/Outpatient/PaymentLogic.php
  5. 19
      app/Http/Logics/Outpatient/PendingLogic.php
  6. 48
      app/Http/Resources/Outpatient/Pending/PendingDetailsResource.php
  7. 41
      app/Http/Resources/Outpatient/Pending/PendingListsResource.php
  8. 61
      app/Http/Resources/Registration/Schedule/DeptListsResource.php
  9. 14
      app/Http/Resources/Registration/Schedule/DoctorListsResource.php
  10. 43
      app/Models/Department.php
  11. 29
      app/Models/DepartmentCategory.php
  12. 55
      app/Models/DepartmentTip.php
  13. 33
      app/Models/Doctor.php
  14. 55
      app/Models/Navigation.php
  15. 2
      app/Services/HisHttp/Client.php
  16. 7
      app/Utils/Transfer/HisHttpClient/ClientMockHttpTransfer.php
  17. 18
      routes/api.php

@ -0,0 +1,163 @@
<?php
declare(strict_types = 1);
namespace App\Http\Controllers\Hospital;
use App\Exceptions\GeneralException;
use App\Http\Controllers\Controller;
use App\Models\Department;
use App\Models\DepartmentCategory;
use App\Models\Doctor;
use App\Models\Navigation;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
class IntroduceController extends Controller
{
/**
* 获取科室列表
* @return JsonResponse
*/
public function deptLists(): JsonResponse
{
$category_lists = DepartmentCategory::select('id as category_id', 'name as category_name')
->orderBy('sort', 'DESC')
->orderBy('id', 'ASC')
->get();
$category_lists = $category_lists->keyBy('category_id')->map(function ($value) { return (array)$value; })->toArray();
$department_lists = Department::select('dept_id', 'dept_name', 'category_id')
->where('is_enable', 1)
->orderBy('sort', 'DESC')
->orderBy('id', 'ASC')
->get();
foreach ($department_lists as $v) {
$category_lists[$v->category_id]['item_lists'][] = [
'dept_id' => $v->dept_id,
'dept_name' => $v->dept_name,
'introduction' => $v->introduction ?: ''
];
}
return jsonResponse(Response::HTTP_OK, 'success.', array_values($category_lists));
}
/**
* 科室详情
* @param Request $request
* @param string $dept_id
* @return JsonResponse
* @throws GeneralException
*/
public function deptDetails(Request $request, string $dept_id): JsonResponse
{
$department_details = Department::where('dept_id', $dept_id)
->where('is_enable', 1)
->first();
if (empty($department_details)) {
throw new GeneralException('找不到该科室信息');
}
$details = [
'dept_id' => $department_details->dept_id,
'dept_name' => $department_details->dept_name,
'category_id' => $department_details->category_id,
'category_name' => $department_details->departmentCategory->name,
'introduction' => $department_details->introduction ?: '',
];
return jsonResponse(Response::HTTP_OK, 'success.', $details);
}
/**
* 获取医生列表
* @return JsonResponse
*/
public function doctorLists(): JsonResponse
{
$doctor_lists = Doctor::select(
'doctors.dept_id',
'departments.dept_name',
'doctors.doctor_id',
'doctors.doctor_name',
'doctors.doctor_title',
'doctors.doctor_specialty',
'doctors.avatar as doctor_avatar',
'doctors.is_expert',
'doctors.sort',
)
->join('departments', 'doctors.dept_id', '=', 'departments.dept_id')
->where('doctors.is_enable', 1)
->orderBy('doctors.sort', 'DESC')
->orderBy('doctors.is_expert', 'DESC')
->orderBy('doctors.id', 'ASC')
->get()
->toArray();
foreach ($doctor_lists as $k => $v) {
$doctor_lists[$k]['doctor_avatar'] = $v['doctor_avatar'] ?: '';
}
return jsonResponse(Response::HTTP_OK, 'success.', $doctor_lists);
}
/**
* 获取医生详情
* @param Request $request
* @param string $doctor_id
* @return JsonResponse
* @throws GeneralException
*/
public function doctorDetails(Request $request, string $doctor_id): JsonResponse
{
$doctor_details = Doctor::where('doctor_id', $doctor_id)
->where('is_enable', 1)
->first();
if (empty($doctor_details)) {
throw new GeneralException('找不到该科室信息');
}
$details = [
'dept_id' => $doctor_details->dept_id,
'dept_name' => $doctor_details->department->dept_name,
'doctor_id' => $doctor_details->doctor_id,
'doctor_name' => $doctor_details->doctor_name,
'doctor_title' => $doctor_details->doctor_title,
'doctor_specialty' => $doctor_details->doctor_specialty,
'avatar' => $doctor_details->avatar ?: '',
'introduction' => $doctor_details->introduction ?: '',
'is_expert' => $doctor_details->is_expert,
];
return jsonResponse(Response::HTTP_OK, 'success.', $details);
}
/**
* 获取医院导航信息
* @throws GeneralException
*/
public function navigationDetails(Request $request): JsonResponse
{
$navigation_details = Navigation::select('area_id', 'area_name', 'longitude', 'latitude', 'address', 'telephone', 'traffic', 'guide')
->where('area_id', 1)
->where('is_enable', 1)
->first();
if (empty($navigation_details)) {
throw new GeneralException('找不到导航信息');
}
$details = $navigation_details->toArray();
$details['traffic'] = !empty($details['traffic']) ? html_entity_decode($details['traffic']) : '';
$details['guide'] = !empty($details['guide']) ? html_entity_decode($details['guide']) : '';
return jsonResponse(Response::HTTP_OK, 'success.', $details);
}
}

@ -9,6 +9,8 @@ use App\Http\Resources\Registration\Schedule\DeptListsResource;
use App\Http\Resources\Registration\Schedule\DoctorListsResource; use App\Http\Resources\Registration\Schedule\DoctorListsResource;
use Illuminate\Http\JsonResponse; use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Redis;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
class ScheduleController class ScheduleController
@ -44,6 +46,28 @@ class ScheduleController
return jsonResponse(Response::HTTP_OK, 'success', DeptListsResource::make($response)->toArray()); return jsonResponse(Response::HTTP_OK, 'success', DeptListsResource::make($response)->toArray());
} }
/**
* 获取科室提示
* @return JsonResponse
*/
public function deptTips(): JsonResponse
{
if (Redis::exists('department.tips')) {
$tips_lists = Redis::get('department.tips');
$tips_lists = json_decode($tips_lists, true);
} else {
$tips_lists = DB::connection('mysql_admin')->table('department_tips')
->select('dept_id', 'title', 'message')
->where('is_enable', 1)
->get()
->toArray();
Redis::setex('department.tips', 4 * 3600, json_encode($tips_lists, JSON_UNESCAPED_UNICODE));
}
return jsonResponse(Response::HTTP_OK, 'success', $tips_lists);
}
/** /**
* 获取医生排班列表 * 获取医生排班列表
* @param Request $request * @param Request $request

@ -139,7 +139,7 @@ class NotifyLogic
$record->dept_id, $record->dept_id,
$record->docttor_id, $record->docttor_id,
$record->reg_id, $record->reg_id,
$extra['SHIFT']['RANKID'], $extra['scheduleInfo']['rankId'],
$record->visit_date, $record->visit_date,
PayType::WECHAT_PAY->hisCode(), PayType::WECHAT_PAY->hisCode(),
$order_info->order_id, $order_info->order_id,
@ -158,11 +158,11 @@ class NotifyLogic
$order_info->orderConfirm($order_info->order_id, $response['visitNo'], $response); $order_info->orderConfirm($order_info->order_id, $response['visitNo'], $response);
// 支付平台业务确认 // 支付平台业务确认
$this->unifyConfirm($notify['out_trade_no'], $response['VISITNO'], $notify['openid'], $notify['transaction_id']); $this->unifyConfirm($notify['out_trade_no'], $response['visitNo'], $notify['openid'], $notify['transaction_id']);
// 推送成功 // 推送成功
$this->sendRegistrationSuccessMessage($order_info); $this->sendRegistrationSuccessMessage($order_info);
} else if (isset($response['success'])) { } else if (isset($response['success']) && $response['success'] === false) {
// 失败流程 // 失败流程
$this->handleOrderReverse($order_info, $response['msg'] ?? ''); $this->handleOrderReverse($order_info, $response['msg'] ?? '');
@ -188,15 +188,21 @@ class NotifyLogic
// 挂号确认 // 挂号确认
$patient = $order_info->patient; $patient = $order_info->patient;
$record = $order_info->outpatientPaymentRecord; $record = $order_info->outpatientPaymentRecord;
$extra = json_decode($record->extra_info, true); $extra = json_decode(reset($order_info->outpatientPaymentRecord), true);
$pay_time = strtotime($notify->time_end); $pay_time = strtotime($notify->time_end);
foreach ($record as $v) {
$extra_info = json_decode($v->extra_info, true);
$prescription_ids[] = $extra_info['prescriptionId'];
}
$data = [ $data = [
$order_info->patient_id, $order_info->patient_id,
'0', '0',
date('Y-m-d', $extra['JSRQ']), date('Y-m-d', $extra['visitDate']),
$extra['prescription_ids'], implode(',', $prescription_ids),
$extra['TREAID'], $extra['visitNumber'],
'', '',
$order_info->order_id, $order_info->order_id,
PayType::WECHAT_PAY->hisCode(), PayType::WECHAT_PAY->hisCode(),
@ -207,18 +213,18 @@ class NotifyLogic
$this->info('缴费订单出入参:'.$order_info->order_id, [$data, $response]); $this->info('缴费订单出入参:'.$order_info->order_id, [$data, $response]);
// 保存返回信息 // 保存返回信息
if (isset($response['ResultCode']) && $response['ResultCode'] === '0') { if (isset($response['success']) && $response['success'] === true) {
// 成功流程 // 成功流程
$order_info->orderConfirm($order_info->order_id, $response['HOSTRANNO'], $response); $order_info->orderConfirm($order_info->order_id, $response['hosTranNo'], $response);
// 支付平台业务确认 // 支付平台业务确认
$this->unifyConfirm($notify['out_trade_no'], $response['HOSTRANNO'], $notify['openid'], $notify['transaction_id']); $this->unifyConfirm($notify['out_trade_no'], $response['hosTranNo'], $notify['openid'], $notify['transaction_id']);
// 推送成功 // 推送成功
$this->sendOutpatientPaymentSuccessMessage($order_info); $this->sendOutpatientPaymentSuccessMessage($order_info);
} else if (isset($response['ResultCode'])) { } else if (isset($response['success']) && $response['success'] === false) {
// 失败流程 // 失败流程
$this->handleOrderReverse($order_info, $response['ERRORMSG']); $this->handleOrderReverse($order_info, $response['msg']);
// 推送失败 // 推送失败
$this->sendOutpatientPaymentFailureMessage($order_info); $this->sendOutpatientPaymentFailureMessage($order_info);
@ -298,7 +304,6 @@ class NotifyLogic
* 订单加锁 * 订单加锁
* @param string $order_id * @param string $order_id
* @return false|string * @return false|string
* @throws RedisException
*/ */
protected function addLockOrder(string $order_id): false|string protected function addLockOrder(string $order_id): false|string
{ {
@ -313,7 +318,6 @@ class NotifyLogic
* @param string $order_id * @param string $order_id
* @param string $lock_id * @param string $lock_id
* @return bool * @return bool
* @throws RedisException
*/ */
protected function unlockOrder(string $order_id, string $lock_id): bool protected function unlockOrder(string $order_id, string $lock_id): bool
{ {

@ -48,22 +48,22 @@ class PaymentLogic
/** /**
* 支付 * 支付
* @param string $patient_id * @param string $patient_number
* @param string $prescription_ids * @param string $prescription_ids
* @return array * @return array
* @throws GeneralException * @throws GeneralException
*/ */
public function payment(string $patient_id, string $prescription_ids): array public function payment(string $patient_number, string $prescription_ids): array
{ {
// 基础信息 // 基础信息
$patient_info = $this->getPatientInfo($patient_id, $this->open_id); $patient_info = $this->getPatientInfo($this->open_id, $patient_number);
$pending_info = $this->getPendingPrescriptionDetails($patient_id, $prescription_ids); $pending_info = $this->getPendingPrescriptionDetails($patient_info['patientId'], $prescription_ids);
// 创建订单 // 创建订单
$order_type = Type::OUTPATIENT_PAYMENT; $order_type = Type::OUTPATIENT_PAYMENT;
$pay_type = PayType::WECHAT_PAY; $pay_type = PayType::WECHAT_PAY;
$order_id = $this->order_model->getOrderId($pay_type, 'M'); $order_id = $this->order_model->getOrderId($pay_type, 'M');
$total_fee = (float)(string) array_sum(array_column($pending_info, 'CFFYJE')); $total_fee = (float)(string) array_sum(array_column($pending_info, 'prescriptionAmount'));
$order = $this->createOrder($order_id, $pay_type, $total_fee, $order_type, $patient_info, $pending_info); $order = $this->createOrder($order_id, $pay_type, $total_fee, $order_type, $patient_info, $pending_info);
@ -78,21 +78,21 @@ class PaymentLogic
/** /**
* 获取患者信息 * 获取患者信息
* @param string $patient_id
* @param string $open_id * @param string $open_id
* @param string $patient_number
* @return mixed * @return mixed
* @throws GeneralException * @throws GeneralException
*/ */
protected function getPatientInfo(string $patient_id, string $open_id): mixed protected function getPatientInfo(string $open_id, string $patient_number): mixed
{ {
$info = $this->patient_model->getBindPatientInfo($open_id, $patient_id); $info = $this->patient_model->getBindPatientInfoByPatientNumber($open_id, $patient_number);
if (empty($info)) { if (empty($info)) {
throw new GeneralException('找不到患者信息,请重新再试!', Response::HTTP_BAD_REQUEST); throw new GeneralException('找不到患者信息,请重新再试!', Response::HTTP_BAD_REQUEST);
} }
$patient_info = $this->his_client->getPatientInfo($info['patient_id'], CardType::OUTPATIENT_NO, $info['name']); $response = $this->his_client->getPatientInfo($info['patient_id'], CardType::OUTPATIENT_NO, $info['name']);
if (!isset($patient_info['success']) || !$patient_info['success']) { if (!isset($response['success']) || !$response['success']) {
throw new GeneralException($patient_info['msg'] ?? '找不到患者信息,请重新再试!', Response::HTTP_SERVICE_UNAVAILABLE); throw new GeneralException($response['msg'] ?? '找不到患者信息,请重新再试!', Response::HTTP_SERVICE_UNAVAILABLE);
} }
// 添加Patient 表ID // 添加Patient 表ID
@ -115,14 +115,13 @@ class PaymentLogic
{ {
$response = $this->his_client->getPendingLists($patient_id); $response = $this->his_client->getPendingLists($patient_id);
if (!isset($response['RESULTCODE']) || $response['RESULTCODE'] !== '0') { if (!isset($response['success']) || !$response['success']) {
throw new GeneralException($response['ERRORMSG'] ?? '暂无相关缴费记录!', Response::HTTP_SERVICE_UNAVAILABLE); throw new GeneralException($response['msg'] ?? '暂无相关缴费记录!', Response::HTTP_SERVICE_UNAVAILABLE);
} }
// 获取具体的缴费详情 // 获取具体的缴费详情
$response = xmlArrayToListByKey($response, 'ITEM'); foreach ($response['response'] as $v) {
foreach ($response['ITEM'] as $v) { if (str_contains($prescription_ids, $v['prescriptionId'])) {
if (str_contains($prescription_ids, $v['CFID'])) {
$lists[] = $v; $lists[] = $v;
} }
} }
@ -131,16 +130,17 @@ class PaymentLogic
throw new GeneralException('查询不到待缴费处方,请重新再试!', Response::HTTP_SERVICE_UNAVAILABLE); throw new GeneralException('查询不到待缴费处方,请重新再试!', Response::HTTP_SERVICE_UNAVAILABLE);
} }
foreach ($lists as $k => $v) { foreach ($lists as $k => $v) {
$response = $this->his_client->getPendingDetails($v['CFID'], $v['JZXH'], $v['REGID'] ?: ''); $response = $this->his_client->getPendingDetails($v['prescriptionId'], $v['visitNumber'], $v['regId'] ?: '');
if (!isset($response['RESULTCODE']) || $response['RESULTCODE'] !== '0') { if (!isset($response['success']) || !$response['success']) {
throw new GeneralException($response['ERRORMSG'] ?? '暂无相关缴费记录!', Response::HTTP_SERVICE_UNAVAILABLE); throw new GeneralException($response['msg'] ?? '暂无相关缴费记录!', Response::HTTP_SERVICE_UNAVAILABLE);
} }
$response = xmlArrayToListByKey($response, 'ITEM'); $lists[$k]['prescription_lists'] = $response['response'];
$lists[$k]['prescription_lists'] = $response['ITEM'];
} }
$this->info('缴费处方信息', $lists);
return $lists; return $lists;
} }
@ -163,12 +163,12 @@ class PaymentLogic
foreach ($pending_info as $v) { foreach ($pending_info as $v) {
$pay_record_data[] = [ $pay_record_data[] = [
'relate_patient_id' => $patient_info['id'], 'relate_patient_id' => $patient_info['id'],
'dept_id' => $v['BQDM'], 'dept_id' => $v['treatmentDepartment'],
'dept_name' => $v['BQMC'], 'dept_name' => $v['departmentName'],
'doctor_id' => $v['YSGH'], 'doctor_id' => reset($v['prescription_lists'])['doctorNumber'] ?? '',
'doctor_name' => $v['YSMC'], 'doctor_name' => $v['doctorName'],
'visit_date' => date('Y-m-d', strtotime($v['JZRQ'])), 'visit_date' => date('Y-m-d', strtotime($v['visitDate'])),
'total_amount' => $total_fee, 'total_amount' => $v['prescriptionAmount'] * 100,
'pre_settle_status' => 0, 'pre_settle_status' => 0,
'extra_info' => json_encode($v, JSON_UNESCAPED_UNICODE), 'extra_info' => json_encode($v, JSON_UNESCAPED_UNICODE),
]; ];
@ -181,7 +181,7 @@ class PaymentLogic
$total_fee * 100, $total_fee * 100,
0, 0,
$this->open_id, $this->open_id,
$patient_info['patientNumber'], $patient_info['patientId'],
$patient_info['name'], $patient_info['name'],
$order_type, $order_type,
SourceId::MINI_PROGRAM, SourceId::MINI_PROGRAM,

@ -38,12 +38,12 @@ class PendingLogic
{ {
$response = $this->his_client->getPendingLists($patient_id); $response = $this->his_client->getPendingLists($patient_id);
if (!isset($response['RESULTCODE']) || $response['RESULTCODE'] !== '0') { if (!isset($response['success']) || !$response['success']) {
throw new GeneralException($response['ERRORMSG'] ?? '暂无相关缴费记录!', Response::HTTP_SERVICE_UNAVAILABLE); throw new GeneralException($response['msg'] ?? '暂无相关缴费记录!', Response::HTTP_SERVICE_UNAVAILABLE);
} }
// 缓存2小时 // 缓存2小时
Cache::set('Outpatient.Pending.'. $this->open_id.'.'. $patient_id, json_encode($response, JSON_UNESCAPED_UNICODE), 2 * 60 * 60); Cache::set('outpatient.pending.'. $this->open_id.'.'. $patient_id, json_encode($response, JSON_UNESCAPED_UNICODE), 2 * 60 * 60);
return $response; return $response;
} }
@ -62,8 +62,8 @@ class PendingLogic
$response = $this->his_client->getPendingDetails($prescription_ids, $serial_no, $reg_id); $response = $this->his_client->getPendingDetails($prescription_ids, $serial_no, $reg_id);
if (!isset($response['RESULTCODE']) || $response['RESULTCODE'] !== '0') { if (!isset($response['success']) || !$response['success']) {
throw new GeneralException($response['ERRORMSG'] ?? '暂无相关缴费详情!', Response::HTTP_SERVICE_UNAVAILABLE); throw new GeneralException($response['msg'] ?? '暂无相关缴费详情!', Response::HTTP_SERVICE_UNAVAILABLE);
} }
return $response; return $response;
@ -78,18 +78,17 @@ class PendingLogic
*/ */
protected function getCachePendingLists(string $patient_id, string $serial_no): mixed protected function getCachePendingLists(string $patient_id, string $serial_no): mixed
{ {
$cache_key = 'Outpatient.Pending.'. $this->open_id.'.'. $patient_id; $cache_key = 'outpatient.pending.'. $this->open_id.'.'. $patient_id;
$pending_lists = Cache::get($cache_key); $pending_lists = Cache::get($cache_key);
if (empty($pending_lists)) { if (empty($pending_lists)) {
throw new GeneralException($response['ERRORMSG'] ?? '查询不到缴费记录,请重新再试!', Response::HTTP_SERVICE_UNAVAILABLE); throw new GeneralException('查询不到缴费记录,请重新再试!', Response::HTTP_SERVICE_UNAVAILABLE);
} }
$pending_lists = json_decode($pending_lists, true); $pending_lists = json_decode($pending_lists, true);
// 获取具体的缴费详情 // 获取具体的缴费详情
$pending_lists = xmlArrayToListByKey($pending_lists, 'ITEM'); foreach ($pending_lists['response'] as $v) {
foreach ($pending_lists['ITEM'] as $v) { if ($v['visitNumber'] === $serial_no) {
if ($v['JZXH'] === $serial_no) {
$info = $v; $info = $v;
break; break;
} }

@ -16,40 +16,24 @@ class PendingDetailsResource extends JsonResource
public function toArray(Request $request = null): array public function toArray(Request $request = null): array
{ {
$lists = []; $lists = [];
$this->resource = xmlArrayToListByKey($this->resource, 'ITEM');
foreach ($this->resource['ITEM'] as $v) { foreach ($this->resource['response'] as $v) {
$lists[] = [ $lists[] = [
'fee_date' => $v['FYRQ'], 'fee_date' => $v['feeDate'],
'item_id' => $v['XMXH'], 'item_id' => $v['itemNo'],
'item_code' => $v['XMBH'], 'item_code' => $v['projectNumber'],
'item_name' => $v['XMMC'], 'item_name' => $v['entryName'],
'price' => (float) $v['JG'], 'price' => (float) $v['unitPrice'],
'quantity' => $v['MCYL'], 'quantity' => $v['quantity'],
'total_price' => $v['JE'], 'unit' => $v['company'],
'package_name' => $v['ZTMC'], 'spec' => $v['projectSpecifications'],
'self_pay_ratio' => $v['ZFBL'], 'total_price' => $v['money'],
'self_pay_fee' => (float) $v['ZFJE'], 'prescription_id' => $v['prescriptionNumber'],
'prescription_id' => $v['CFID'], 'prescription_type' => $v['prescriptionType'],
'unit' => $v['UNIT'], 'dept_id' => $v['treatmentDepartment'],
'prescription_type' => $v['CFTYPE'], 'dept_name' => $v['departmentName'],
'dept_id' => $v['BQDM'], 'doctor_id' => $v['doctorNumber'],
'dept_name' => $v['BQMC'], 'doctor_name' => $v['doctorName'],
'doctor_id' => $v['YSGH'],
'doctor_name' => $v['YSMC'],
// 冗余字段
'national_catalog_code' => $v['GJMLBM'] ?: '',
'single_dose' => $v['YCJL'] ?: '',
'frequency' => $v['YPYF'] ?: '',
'medication_days' => $v['YYTS'] ?: '',
'administration_route' => $v['GYTJ'] ?: '',
'hospital_approval_flag' => $v['HOSP_APPR_FLAG'] ?: '',
'chinese_medicine_usage' => $v['TCMDRUG_USED_WAY'] ?: '',
'external_inspection_flag' => $v['ETIP_FLAG'] ?: '',
'external_inspection_hospital_code' => $v['ETIP_HOSP_CODE'] ?: '',
'discharge_medication_flag' => $v['DSCG_TKDRUG_FLAG'] ?: '',
'maternity_fee_flag' => $v['MATN_FEE_FLAG'] ?: '',
'external_purchase_prescription_flag' => $v['RX_CIRC_FLAG'] ?: '',
]; ];
} }

@ -15,33 +15,24 @@ class PendingListsResource extends JsonResource
*/ */
public function toArray(Request $request = null): array public function toArray(Request $request = null): array
{ {
$this->resource = xmlArrayToListByKey($this->resource, 'ITEM');
$lists = []; $lists = [];
foreach ($this->resource['ITEM'] as $v) { foreach ($this->resource['response'] as $v) {
$lists[] = [ $lists[] = [
'category' => $v['JZLB'], 'category' => $v['visitType'],
'visit_date' => $v['JZRQ'], 'visit_date' => date('Y-m-d', strtotime($v['visitDate'])),
'diagnosis' => $v['CYZD'], 'diagnosis' => $v['outpatientDiagnosis'],
'dept_id' => $v['BQDM'], 'dept_id' => $v['treatmentDepartment'],
'dept_name' => $v['BQMC'], 'dept_name' => $v['departmentName'],
'reg_id' => $v['REGID'], 'reg_id' => $v['regId'],
'prescription_id' => $v['CFID'], 'prescription_id' => $v['prescriptionId'],
'total_prescription_amount' => (float) $v['YLFYZE'], 'total_prescription_amount' => (float) $v['prescriptionAmount'],
'single_prescription_amount' => (float) $v['CFFYJE'] ?? 0, 'single_prescription_amount' => (float) $v['singleAmount'],
'doctor_id' => $v['YSGH'], 'doctor_name' => $v['doctorName'],
'doctor_name' => $v['YSMC'], 'remark' => $v['remarks'],
'remark' => $v['BZ'], 'is_self_pay' => $v['isexpense'],
'is_self_pay' => $v['ZFCF'], 'prescription_number' => $v['nrescriptionNumber'],
'visit_no' => $v['JZXH'], 'exec_address' => $v['takeMedicine'],
'prescription_number' => $v['CHHM'] ?: '', 'visit_no' => $v['visitNumber'],
'prescription_type' => $v['CFTYPE'] ?: '',
'exec_address' => $v['YFMC'] ?: '',
'medical_type' => $v['MED_TYPE'] ?: '',
'disease_code' => $v['DISE_CODG'] ?: '',
'disease_name' => $v['DISE_NAME'] ?: '',
'settlement_method' => $v['PSN_SETLWAY'] ?: '',
'out_of_area_flag' => $v['OUT_FLAG'] ?: ''
]; ];
} }

@ -2,10 +2,13 @@
namespace App\Http\Resources\Registration\Schedule; namespace App\Http\Resources\Registration\Schedule;
use App\Models\Department;
use App\Models\DepartmentCategory;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource; use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Redis; use Illuminate\Support\Facades\Redis;
use mysql_xdevapi\Collection;
class DeptListsResource extends JsonResource class DeptListsResource extends JsonResource
{ {
@ -16,27 +19,54 @@ class DeptListsResource extends JsonResource
*/ */
public function toArray(Request $request = null): array public function toArray(Request $request = null): array
{ {
$department_lists = $this->getDepartmentLists(); // 科室分类
$sort = collect($department_lists)->pluck('sort', 'dept_id'); $categories = $this->getDepartmentCategoryLists();
// 科室及排序
$departments = $this->getDepartmentLists();
$sorts = collect($departments)->pluck('sort', 'dept_id')->toArray();
// 根据科室的 sort 字段对 科室列表 进行排序
usort($this->resource['response'], function ($a, $b) use ($sorts) {
$sort_a = $sorts[$a['typeId']] ?? 0;
$sort_b = $sorts[$b['typeId']] ?? 0;
return $sort_b <=> $sort_a; // 倒序排序
});
$lists = [];
foreach ($this->resource['response'] as $v) { foreach ($this->resource['response'] as $v) {
$lists[] = [ if (!isset($categories[$departments[$v['typeId']]['category_id']])) {
continue;
}
$categories[$departments[$v['typeId']]['category_id']]['item_lists'][] = [
'dept_id' => $v['typeId'], 'dept_id' => $v['typeId'],
'dept_name' => $v['typeName'], 'dept_name' => $v['typeName'],
// 'dept_intro' => $v['INTRODUCE'] // 'dept_intro' => $v['introduce'] ?? ''
]; ];
} }
// 根据科室的 sort 字段对 $lists 进行排序 return array_values($categories);
usort($lists, function ($a, $b) use ($sort) { }
$sort_a = $sort[$a['dept_id']] ?? 0;
$sort_b = $sort[$b['dept_id']] ?? 0; /**
return $sort_b <=> $sort_a; // 倒序排序 * 获取科室分类
}); * @return array
*/
public function getDepartmentCategoryLists(): array
{
if (Redis::exists('department.category')) {
$category_lists = Redis::get('department.category');
$category_lists = json_decode($category_lists, true);
} else {
$category_lists = DepartmentCategory::select('id as category_id', 'name as category_name')
->orderBy('sort', 'DESC')
->orderBy('id', 'ASC')
->get();
$category_lists = $category_lists->keyBy('category_id')->map(function ($value) { return (array)$value; })->toArray();
Redis::setex('department.category', 4 * 3600, json_encode($category_lists, JSON_UNESCAPED_UNICODE));
}
return $lists; return $category_lists;
} }
/** /**
@ -46,16 +76,15 @@ class DeptListsResource extends JsonResource
public function getDepartmentLists(): array public function getDepartmentLists(): array
{ {
if (Redis::exists('department.lists')) { if (Redis::exists('department.lists')) {
$department_lists = Redis::get('doctor.lists'); $department_lists = Redis::get('department.lists');
$department_lists = json_decode($department_lists, true); $department_lists = json_decode($department_lists, true);
} else { } else {
$db = DB::connection('mysql_admin')->table('departments'); $department_lists = Department::where('is_enable', 1)
$department_lists = $db
->where('is_enable', 1)
->orderBy('sort', 'DESC') ->orderBy('sort', 'DESC')
->orderBy('id', 'ASC') ->orderBy('id', 'ASC')
->get(); ->get();
$department_lists = $department_lists->keyBy('dept_id')->map(function ($value) { return (array)$value; })->toArray();
Redis::setex('department.lists', 4 * 3600, json_encode($department_lists, JSON_UNESCAPED_UNICODE)); Redis::setex('department.lists', 4 * 3600, json_encode($department_lists, JSON_UNESCAPED_UNICODE));
} }

@ -2,6 +2,7 @@
namespace App\Http\Resources\Registration\Schedule; namespace App\Http\Resources\Registration\Schedule;
use App\Models\Doctor;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource; use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
@ -16,9 +17,8 @@ class DoctorListsResource extends JsonResource
*/ */
public function toArray(Request $request = null): array public function toArray(Request $request = null): array
{ {
$doctor_lists = $this->getDoctorLists(); $doctors = $this->getDoctorLists();
$specialty = collect($doctor_lists)->pluck('specialty', 'doctor_id'); $sort = collect($doctors)->pluck('sort', 'doctor_id');
$sort = collect($doctor_lists)->pluck('sort', 'doctor_id');
$lists = []; $lists = [];
foreach ($this->resource['response'] as $k=>$v) { foreach ($this->resource['response'] as $k=>$v) {
@ -26,7 +26,8 @@ class DoctorListsResource extends JsonResource
'doctor_id' => $v['doctId'], 'doctor_id' => $v['doctId'],
'doctor_name' => $v['doctName'], 'doctor_name' => $v['doctName'],
'doctor_title' => $v['docTitle'], 'doctor_title' => $v['docTitle'],
'doctor_intro' => $specialty[$v['doctId']] ?? ($v['depLocation'] ?: '暂无介绍'), 'doctor_intro' => $doctors[$v['doctId']]['doctor_specialty'] ?? ($v['depLocation'] ?: '暂无介绍'),
'doctor_avatar' => $doctors[$v['doctId']]['avatar'] ?: '',
'is_doctor' => (int) $v['isksDoc'], 'is_doctor' => (int) $v['isksDoc'],
]; ];
@ -66,13 +67,12 @@ class DoctorListsResource extends JsonResource
$doctor_lists = Redis::get('doctor.lists'); $doctor_lists = Redis::get('doctor.lists');
$doctor_lists = json_decode($doctor_lists, true); $doctor_lists = json_decode($doctor_lists, true);
} else { } else {
$db = DB::connection('mysql_admin')->table('doctors'); $doctor_lists = Doctor::where('is_enable', 1)
$doctor_lists = $db
->where('is_enable', 1)
->orderBy('sort', 'DESC') ->orderBy('sort', 'DESC')
->orderBy('id', 'ASC') ->orderBy('id', 'ASC')
->get(); ->get();
$doctor_lists = $doctor_lists->keyBy('doctor_id')->map(function ($value) { return (array)$value; })->toArray();
Redis::setex('doctor.lists', 4 * 3600, json_encode($doctor_lists, JSON_UNESCAPED_UNICODE)); Redis::setex('doctor.lists', 4 * 3600, json_encode($doctor_lists, JSON_UNESCAPED_UNICODE));
} }

@ -6,11 +6,23 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Department extends Model class Department extends Model
{ {
use HasFactory; use HasFactory;
/**
* @var string
*/
protected $connection = 'mysql_admin';
/**
* @var string
*/
protected $table = 'departments';
/** /**
* The attributes that are mass assignable. * The attributes that are mass assignable.
* *
@ -18,14 +30,12 @@ class Department extends Model
*/ */
protected $fillable = [ protected $fillable = [
'dept_id', 'dept_id',
'type_id',
'dept_name', 'dept_name',
'leader_name', 'category_id',
'image', 'icon',
'location', 'introduction',
'telephone',
'sort', 'sort',
'intro', 'is_enable'
]; ];
/** /**
@ -35,7 +45,26 @@ class Department extends Model
*/ */
protected $casts = [ protected $casts = [
'id' => 'integer', 'id' => 'integer',
'type_id' => 'integer', 'category_id' => 'integer',
'sort' => 'integer', 'sort' => 'integer',
'is_enable' => 'integer',
]; ];
/**
* 科室分类
* @return BelongsTo
*/
public function departmentCategory(): BelongsTo
{
return $this->belongsTo(DepartmentCategory::class, 'category_id');
}
/**
* 获取科室医生
* @return HasMany
*/
public function doctor(): HasMany
{
return $this->hasMany(Doctor::class, 'dept_id', 'dept_id');
}
} }

@ -6,21 +6,32 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
class DepartmentType extends Model class DepartmentCategory extends Model
{ {
use HasFactory; use HasFactory;
/**
* @var string
*/
protected $connection = 'mysql_admin';
/**
* @var string
*/
protected $table = 'department_categories';
/** /**
* The attributes that are mass assignable. * The attributes that are mass assignable.
* *
* @var array<int, string> * @var array<int, string>
*/ */
protected $fillable = [ protected $fillable = [
'type_id', 'id',
'type_name', 'name',
'description',
'sort', 'sort',
'icon',
]; ];
/** /**
@ -30,7 +41,15 @@ class DepartmentType extends Model
*/ */
protected $casts = [ protected $casts = [
'id' => 'integer', 'id' => 'integer',
'type_id' => 'integer',
'sort' => 'integer', 'sort' => 'integer',
]; ];
/**
* 分类
* @return HasMany
*/
public function department(): HasMany
{
return $this->hasMany(Department::class, 'category_id');
}
} }

@ -0,0 +1,55 @@
<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class DepartmentTip extends Model
{
use HasFactory;
/**
* @var string
*/
protected $connection = 'mysql_admin';
/**
* @var string
*/
protected $table = 'department_tips';
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'dept_id',
'title',
'message',
'is_enable'
];
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'id' => 'integer',
'is_enable' => 'integer',
];
/**
* 科室分类
* @return BelongsTo
*/
public function department(): BelongsTo
{
return $this->belongsTo(Department::class, 'dept_id', 'dept_id');
}
}

@ -6,11 +6,22 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Doctor extends Model class Doctor extends Model
{ {
use HasFactory; use HasFactory;
/**
* @var string
*/
protected $connection = 'mysql_admin';
/**
* @var string
*/
protected $table = 'doctors';
/** /**
* The attributes that are mass assignable. * The attributes that are mass assignable.
* *
@ -19,13 +30,14 @@ class Doctor extends Model
protected $fillable = [ protected $fillable = [
'doctor_id', 'doctor_id',
'doctor_name', 'doctor_name',
'doctor_title',
'doctor_specialty',
'dept_id', 'dept_id',
'dept_name', 'avatar',
'title', 'introduction',
'image',
'sort', 'sort',
'adept', 'is_expert',
'intro', 'is_enable',
]; ];
/** /**
@ -36,5 +48,16 @@ class Doctor extends Model
protected $casts = [ protected $casts = [
'id' => 'integer', 'id' => 'integer',
'sort' => 'integer', 'sort' => 'integer',
'is_expert' => 'integer',
'is_enable' => 'integer',
]; ];
/**
* 科室
* @return BelongsTo
*/
public function department(): BelongsTo
{
return $this->belongsTo(Department::class, 'dept_id', 'dept_id');
}
} }

@ -0,0 +1,55 @@
<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Navigation extends Model
{
use HasFactory;
/**
* @var string
*/
protected $connection = 'mysql_admin';
/**
* @var string
*/
protected $table = 'hospital_navigations';
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'area_id',
'area_name',
'longitude',
'latitude',
'address',
'telephone',
'traffic',
'guide',
'sort',
'is_enable',
];
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'id' => 'integer',
'area_id' => 'integer',
'sort' => 'integer',
'is_enable' => 'integer',
];
}

@ -59,7 +59,7 @@ class Client
protected function requestHandle(string $method_name, string $request_name, array $params): mixed protected function requestHandle(string $method_name, string $request_name, array $params): mixed
{ {
//if ($request_name === 'PayRegTrade') { //if ($request_name === 'PayRegTrade') {
dd(json_encode($params['json'], JSON_UNESCAPED_UNICODE)); //dd(json_encode($params['json'], JSON_UNESCAPED_UNICODE));
//} //}
try { try {

@ -186,14 +186,17 @@ class ClientMockHttpTransfer extends HttpTransferAbstract
private function mockGetPendingLists(array $params) private function mockGetPendingLists(array $params)
{ {
$this->transfer_response = '<RESPONSE><RESULTCODE>0</RESULTCODE><ERRORMSG></ERRORMSG><ITEM><YFMC>0</YFMC><GMSFHM>441827197303226022</GMSFHM><JZLB>门诊</JZLB><JZRQ>20210717</JZRQ><CYZD>1.急性胃肠炎2.湿热证</CYZD><BQDM>226</BQDM><BQMC>发热门诊</BQMC><REGID>0</REGID><CFID>4-5555857</CFID><YLFYZE>81.53</YLFYZE><CFFYJE>16.2</CFFYJE><YSGH>10395</YSGH><YSMC>麦明杰</YSMC><BZ>无特殊备注</BZ><ZFCF>1</ZFCF><JZXH>2671947</JZXH><CHHM>4-5555857</CHHM><CFTYPE>2</CFTYPE><MED_TYPE>普通医疗</MED_TYPE><DISE_CODG>K52.9</DISE_CODG><DISE_NAME>急性胃肠炎</DISE_NAME><PSN_SETLWAY>自费</PSN_SETLWAY><OUT_FLAG>0</OUT_FLAG></ITEM><ITEM><YFMC>1</YFMC><GMSFHM>441827199405226019</GMSFHM><JZLB>住院</JZLB><JZRQ>20231215</JZRQ><CYZD>1.高血压2.冠心病</CYZD><BQDM>112</BQDM><BQMC>心内科</BQMC><REGID>1</REGID><CFID>3-4567890</CFID><YLFYZE>1050.75</YLFYZE><CFFYJE>450.5</CFFYJE><YSGH>20876</YSGH><YSMC>李海涛</YSMC><BZ>长期病管理</BZ><ZFCF>0</ZFCF><JZXH>3758291</JZXH><CHHM>3-4567890</CHHM><CFTYPE>1</CFTYPE><MED_TYPE>住院医疗</MED_TYPE><DISE_CODG>I10</DISE_CODG><DISE_NAME>高血压</DISE_NAME><PSN_SETLWAY>自费</PSN_SETLWAY><OUT_FLAG>1</OUT_FLAG></ITEM></RESPONSE>'; $date_1 = date('Ymd');
$date_2 = date('Y-m-d');
$this->transfer_response = '{"status":200,"success":true,"msg":"成功","msgDev":null,"response":[{"idCardNo":"230403199903245493","visitType":"门诊","visitDate":"'.$date_1.'","strVisitDate":"'.$date_2.'","outpatientDiagnosis":"健康查体,健康查体,健康查体,健康查体,健康查体,健康查体,健康查体","treatmentDepartment":"132","departmentName":"急诊内科","regId":"0","prescriptionId":"1-17452209","prescriptionAmount":"1.05","singleAmount":"1.05","doctorName":"管理员","remarks":"","isexpense":"1","strExpense":"自费","nrescriptionNumber":"1-17452209","takeMedicine":"","visitNumber":"3886415"}]}';
return $this; return $this;
} }
private function mockGetPendingDetails(array $params) private function mockGetPendingDetails(array $params)
{ {
$this->transfer_response = '<RESPONSE><RESULTCODE>0</RESULTCODE><ERRORMSG></ERRORMSG><ITEM><FYRQ>2021-07-14</FYRQ><XMXH>13072784</XMXH><XMBH>2220</XMBH><XMMC>尿妊娠试验(金标法)</XMMC><JG>5.67</JG><MCYL>1</MCYL><JE>5.67</JE><ZFBL>1</ZFBL><ZFJE>5.67</ZFJE><CFID>4-5549038</CFID><UNIT></UNIT><ZTMC>妊娠检查</ZTMC><CFTYPE>检验单</CFTYPE><BQDM>8</BQDM><BQMC>妇科门诊</BQMC><YSGH>10537</YSGH><YSMC>邝国超</YSMC><GJMLBM>12345</GJMLBM><YCJL>1次</YCJL><YPYF>口服</YPYF><YYTS>1天</YYTS><GYTJ>口服给药</GYTJ><HOSP_APPR_FLAG>0</HOSP_APPR_FLAG><TCMDRUG_USED_WAY></TCMDRUG_USED_WAY><ETIP_FLAG>0</ETIP_FLAG><ETIP_HOSP_CODE></ETIP_HOSP_CODE><DSCG_TKDRUG_FLAG>0</DSCG_TKDRUG_FLAG><MATN_FEE_FLAG>0</MATN_FEE_FLAG><RX_CIRC_FLAG>0</RX_CIRC_FLAG></ITEM><ITEM><FYRQ>2021-07-14</FYRQ><XMXH>13072785</XMXH><XMBH>2231</XMBH><XMMC>血常规检查</XMMC><JG>12.34</JG><MCYL>1</MCYL><JE>12.34</JE><ZFBL>0.2</ZFBL><ZFJE>2.47</ZFJE><CFID>4-5549040</CFID><UNIT></UNIT><ZTMC>常规检查</ZTMC><CFTYPE>检验单</CFTYPE><BQDM>8</BQDM><BQMC>妇科门诊</BQMC><YSGH>10538</YSGH><YSMC>张伟</YSMC><GJMLBM>67890</GJMLBM><YCJL>1次</YCJL><YPYF>静脉注射</YPYF><YYTS>1天</YYTS><GYTJ>静脉注射</GYTJ><HOSP_APPR_FLAG>0</HOSP_APPR_FLAG><TCMDRUG_USED_WAY></TCMDRUG_USED_WAY><ETIP_FLAG>0</ETIP_FLAG><ETIP_HOSP_CODE></ETIP_HOSP_CODE><DSCG_TKDRUG_FLAG>0</DSCG_TKDRUG_FLAG><MATN_FEE_FLAG>0</MATN_FEE_FLAG><RX_CIRC_FLAG>0</RX_CIRC_FLAG></ITEM><ITEM><FYRQ>2021-07-15</FYRQ><XMXH>13072786</XMXH><XMBH>3001</XMBH><XMMC>超声波检查</XMMC><JG>80.00</JG><MCYL>1</MCYL><JE>80.00</JE><ZFBL>0.5</ZFBL><ZFJE>40.00</ZFJE><CFID>4-5549041</CFID><UNIT></UNIT><ZTMC>影像检查</ZTMC><CFTYPE>影像单</CFTYPE><BQDM>6</BQDM><BQMC>放射科</BQMC><YSGH>10539</YSGH><YSMC>李明</YSMC><GJMLBM>78901</GJMLBM><YCJL>一次</YCJL><YPYF>其他</YPYF><YYTS>1天</YYTS><GYTJ></GYTJ><HOSP_APPR_FLAG>1</HOSP_APPR_FLAG><TCMDRUG_USED_WAY></TCMDRUG_USED_WAY><ETIP_FLAG>0</ETIP_FLAG><ETIP_HOSP_CODE></ETIP_HOSP_CODE><DSCG_TKDRUG_FLAG>0</DSCG_TKDRUG_FLAG><MATN_FEE_FLAG>0</MATN_FEE_FLAG><RX_CIRC_FLAG>0</RX_CIRC_FLAG></ITEM><ITEM><FYRQ>2021-07-16</FYRQ><XMXH>13072787</XMXH><XMBH>4002</XMBH><XMMC>CT检查</XMMC><JG>300.00</JG><MCYL>1</MCYL><JE>300.00</JE><ZFBL>0.3</ZFBL><ZFJE>90.00</ZFJE><CFID>4-5549042</CFID><UNIT></UNIT><ZTMC>影像检查</ZTMC><CFTYPE>影像单</CFTYPE><BQDM>7</BQDM><BQMC>影像科</BQMC><YSGH>10540</YSGH><YSMC>王磊</YSMC><GJMLBM>34567</GJMLBM><YCJL>1次</YCJL><YPYF>其他</YPYF><YYTS>1天</YYTS><GYTJ></GYTJ><HOSP_APPR_FLAG>1</HOSP_APPR_FLAG><TCMDRUG_USED_WAY></TCMDRUG_USED_WAY><ETIP_FLAG>0</ETIP_FLAG><ETIP_HOSP_CODE></ETIP_HOSP_CODE><DSCG_TKDRUG_FLAG>0</DSCG_TKDRUG_FLAG><MATN_FEE_FLAG>0</MATN_FEE_FLAG><RX_CIRC_FLAG>0</RX_CIRC_FLAG></ITEM><ITEM><FYRQ>2021-07-17</FYRQ><XMXH>13072788</XMXH><XMBH>5003</XMBH><XMMC>心电图检查</XMMC><JG>25.00</JG><MCYL>1</MCYL><JE>25.00</JE><ZFBL>0.1</ZFBL><ZFJE>2.50</ZFJE><CFID>4-5549043</CFID><UNIT></UNIT><ZTMC>心电检查</ZTMC><CFTYPE>检查单</CFTYPE><BQDM>9</BQDM><BQMC>心内科</BQMC><YSGH>10541</YSGH><YSMC>赵云</YSMC><GJMLBM>45678</GJMLBM><YCJL>1次</YCJL><YPYF>其他</YPYF><YYTS>1天</YYTS><GYTJ></GYTJ><HOSP_APPR_FLAG>1</HOSP_APPR_FLAG><TCMDRUG_USED_WAY></TCMDRUG_USED_WAY><ETIP_FLAG>0</ETIP_FLAG><ETIP_HOSP_CODE></ETIP_HOSP_CODE><DSCG_TKDRUG_FLAG>0</DSCG_TKDRUG_FLAG><MATN_FEE_FLAG>0</MATN_FEE_FLAG><RX_CIRC_FLAG>0</RX_CIRC_FLAG></ITEM></RESPONSE>'; $date = date('Y-m-d');
$this->transfer_response = '{"status":200,"success":true,"msg":"成功","msgDev":null,"response":[{"feeDate":"'.$date.'","itemNo":"11255860","projectNumber":"1550","entryName":"0.9%氯化钠注射液G","unitPrice":"1.05","quantity":"1","money":"1.05","remarks":"","projectSpecifications":"250ML:2.25G/瓶","prescriptionNumber":"1-17452209","company":"瓶","prescriptionType":"西药","treatmentDepartment":"132","departmentName":"急诊内科","doctorNumber":"10365","doctorName":"管理员"}]}';
return $this; return $this;
} }

@ -1,6 +1,7 @@
<?php <?php
use App\Http\Controllers\Auth\AuthController; use App\Http\Controllers\Auth\AuthController;
use App\Http\Controllers\Hospital\IntroduceController;
use App\Http\Controllers\Notify\NotifyController; use App\Http\Controllers\Notify\NotifyController;
use App\Http\Controllers\Outpatient\PaymentController; use App\Http\Controllers\Outpatient\PaymentController;
use App\Http\Controllers\Outpatient\PendingController; use App\Http\Controllers\Outpatient\PendingController;
@ -34,6 +35,7 @@ Route::middleware(['apiLog'])->group(function() {
// 挂号模块 // 挂号模块
Route::prefix('Registration')->group(function () { Route::prefix('Registration')->group(function () {
Route::get('/dept', [ScheduleController::class, 'dept']); Route::get('/dept', [ScheduleController::class, 'dept']);
Route::get('/dept/tips', [ScheduleController::class, 'deptTips']);
Route::get('/doctor', [ScheduleController::class, 'doctor']); Route::get('/doctor', [ScheduleController::class, 'doctor']);
Route::post('/{patient_id}/register', [RegisterController::class, 'register']); Route::post('/{patient_id}/register', [RegisterController::class, 'register']);
@ -54,7 +56,21 @@ Route::middleware(['apiLog'])->group(function() {
// 缴费详情项目 // 缴费详情项目
Route::prefix('Dictionary')->group(function () { Route::prefix('Dictionary')->group(function () {
Route::get('/', [ItemController::class, 'lists']); Route::get('/', [ItemController::class, 'lists']);
Route::get('/{type_id}', [ItemController::class, 'details'])->where('type_id', '[0-9]+');; Route::get('/{type_id}', [ItemController::class, 'details'])->where('type_id', '[0-9]+');
});
// 医院详情相关项目
Route::prefix('Hospital')->group(function () {
// 科室介绍
Route::get('/dept', [IntroduceController::class, 'deptLists']);
Route::get('/dept/{dept_id}', [IntroduceController::class, 'deptDetails'])->where('dept_id', '[0-9]+');
// 医生介绍
Route::get('/doctor', [IntroduceController::class, 'doctorLists']);
Route::get('/doctor/{doctor_id}', [IntroduceController::class, 'doctorDetails'])->where('doctor_id', '[0-9]+');
// 医院导航
Route::get('/navigation', [IntroduceController::class, 'navigationDetails']);
}); });
}); });
}); });

Loading…
Cancel
Save