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.
41 lines
1.2 KiB
41 lines
1.2 KiB
<?php
|
|
declare(strict_types = 1);
|
|
|
|
namespace App\Http\Controllers\Registration;
|
|
|
|
use App\Exceptions\GeneralException;
|
|
use App\Http\Logics\Registration\RegisterLogic;
|
|
use App\Http\Requests\Registration\RegisterRequest;
|
|
use App\Http\Resources\Registration\Record\RecordListsResource;
|
|
use Illuminate\Http\JsonResponse;
|
|
use Illuminate\Http\Request;
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
|
|
class RegisterController
|
|
{
|
|
protected RegisterLogic $register_logic;
|
|
|
|
/**
|
|
* Patient Construct.
|
|
*/
|
|
public function __construct()
|
|
{
|
|
$this->register_logic = new RegisterLogic();
|
|
}
|
|
|
|
/**
|
|
* 获取挂号记录列表
|
|
* @param RegisterRequest $request
|
|
* @param string $patient_id 此处为 patient_number
|
|
* @return JsonResponse
|
|
* @throws GeneralException
|
|
*/
|
|
public function register(RegisterRequest $request, string $patient_id): JsonResponse
|
|
{
|
|
$validated = $request->safe()->only(['date', 'dept_id', 'doctor_id', 'reg_id']);
|
|
|
|
$response = $this->register_logic->register($patient_id, $validated['date'], $validated['dept_id'], $validated['doctor_id'], $validated['reg_id']);
|
|
|
|
return jsonResponse(Response::HTTP_OK, 'success', $response);
|
|
}
|
|
}
|
|
|