You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.0 KiB
PHP
42 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\API\Admin;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Services\ComprehensiveValidationService;
|
|
use Illuminate\Http\Request;
|
|
|
|
/**
|
|
* 综合校验测试控制器
|
|
*/
|
|
class ComprehensiveTestController extends Controller
|
|
{
|
|
/**
|
|
* 测试综合校验
|
|
*/
|
|
public function test(Request $request)
|
|
{
|
|
$data = $request->validate([
|
|
'item_codes' => 'required|array',
|
|
'item_codes.*' => 'required|string',
|
|
'patient_id' => 'required|integer|min:1',
|
|
'plan_id' => 'required|integer|min:1',
|
|
]);
|
|
|
|
$itemCodes = $data['item_codes'];
|
|
$patientId = $data['patient_id'];
|
|
$planId = $data['plan_id'];
|
|
|
|
// 创建综合校验服务
|
|
$service = app(ComprehensiveValidationService::class);
|
|
|
|
// 执行校验
|
|
$result = $service->validate($patientId, $itemCodes, $planId);
|
|
|
|
return response()->json([
|
|
'success' => true,
|
|
'data' => $result
|
|
]);
|
|
}
|
|
}
|