<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('patientraw', function (Blueprint $table) {
            $table->id();
            $table->string('sender_name');
            $table->string('version_number');
            $table->timestamp('message_datetime');
            $table->string('patient_id');
            $table->string('patient_last_name');
            $table->string('patient_first_name')->nullable();
            $table->string('patient_middle_name')->nullable();
            $table->string('patient_suffix')->nullable();
            $table->string('patient_title')->nullable();
            $table->date('date_of_birth');
            $table->char('patient_sex');
            $table->string('address_street');
            $table->string('address_city')->nullable();
            $table->string('address_state')->nullable();
            $table->string('address_zip')->nullable();
            $table->string('address_country')->nullable();
            $table->string('phone_number')->nullable();
            $table->string('admitting_physician');
            $table->string('diagnosis')->nullable();
            $table->string('therapy')->nullable();
            $table->timestamp('admit_datetime');
            $table->string('room_number');
            $table->string('hospital_service');
            $table->string('hospital_client');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('patientraw');
    }
};
