<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
    public function up(): void
    {
        Schema::create('radiology', function (Blueprint $table) {
             $table->id();
             $table->unsignedBigInteger('hcp_id'); 
            $table->json('reason')->nullable(); // JSON for storing multiple reasons
            $table->string('reason_other')->nullable();

            $table->json('imaging')->nullable(); // JSON for imaging options
            $table->string('xRay_area')->nullable();
            $table->string('ultrasound_area')->nullable();
            $table->string('ctScan_area')->nullable();
            $table->string('mri_area')->nullable();
            $table->string('nuclearMedicine_area')->nullable();
            $table->string('interventionalRadiology_procedure')->nullable();
            $table->string('otherImaging_specify')->nullable();

            $table->json('diagnostics')->nullable(); // JSON for diagnostics options
            $table->string('stressTestSpecify')->nullable();
            $table->string('endoscopySpecify')->nullable();
            $table->string('biopsySpecify')->nullable();
            $table->string('bloodTestsSpecify')->nullable();
            $table->string('urineTestsSpecify')->nullable();
            $table->string('otherDiagnosticsSpecify')->nullable();
            $table->foreign('hcp_id')->references('hcp_id')->on('hcp')->onUpdate('no action')->onDelete('no action');

            $table->timestamps();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('radiology');
    }
};
