香洲二院小程序
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.
mini_xzey/app/Http/Controllers/Registration/MedicalController.php

78 lines
2.3 KiB

<?php
declare(strict_types = 1);
namespace App\Http\Controllers\Registration;
use App\Dictionary\Medical\PatientProperty;
use App\Dictionary\Medical\SettleType;
use App\Exceptions\GeneralException;
use App\Http\Logics\Registration\MedicalLogic;
use App\Http\Requests\Registration\RegisterPreSettleRequest;
use App\Http\Resources\Registration\Medical\RegisterPreSettleResource;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
class MedicalController
{
protected MedicalLogic $medical_logic;
/**
* MedicalController Construct.
*/
public function __construct()
{
$this->medical_logic = new MedicalLogic();
}
/**
* 挂号预结算
* @param RegisterPreSettleRequest $request
* @param string $patient_id
* @return JsonResponse
* @throws GeneralException
*/
public function registerPreSettle(RegisterPreSettleRequest $request, string $patient_id): JsonResponse
{
$patient_property = PatientProperty::from((int) $request->patient_property);
$settle_type = SettleType::from((int) $request->settle_type);
$response = $this->medical_logic->registerPreSettle(
$patient_id,
$request->date,
$request->dept_id,
$request->doctor_id,
$request->reg_id,
$patient_property,
$settle_type
);
return jsonResponse(Response::HTTP_OK, 'success', RegisterPreSettleResource::make($response)->toArray());
}
/**
* 医保支付
* @param Request $request
* @param string $patient_id
* @return JsonResponse
* @throws GeneralException
*/
public function register(Request $request, string $patient_id): JsonResponse
{
$patient_property = PatientProperty::from((int) $request->patient_property);
$settle_type = SettleType::from((int) $request->settle_type);
$response = $this->medical_logic->medicalRegister(
$patient_id,
$request->date,
$request->dept_id,
$request->doctor_id,
$request->reg_id,
$patient_property,
$settle_type
);
return jsonResponse(Response::HTTP_OK, 'success', $response);
}
}