<?php

declare(strict_types=1);

use Illuminate\Support\Facades\Route;
use Kylin\Medical\Http\Controllers\MedicalController;

/**
 * 医疗管理 API 路由
 *
 * 所有路由需通过 auth:sanctum 鉴权，确保操作可追溯（依据《网络安全法》第二十一条）。
 */
Route::prefix('kylin/medical')->middleware(['auth:sanctum'])->group(function () {
    // 预约挂号
    Route::post('/appointments', [MedicalController::class, 'createAppointment']);
    Route::delete('/appointments/{id}', [MedicalController::class, 'cancelAppointment']);

    // 处方管理
    Route::post('/prescriptions', [MedicalController::class, 'createPrescription']);
    Route::post('/prescriptions/{id}/review', [MedicalController::class, 'reviewPrescription']);

    // 电子病历
    Route::post('/records/{id}/sign', [MedicalController::class, 'signMedicalRecord']);
    Route::get('/patients/{patientId}/records', [MedicalController::class, 'patientRecords']);
});
