[WIP] Claim Encounters

This commit is contained in:
R
2023-03-24 14:41:02 +07:00
parent 229908e492
commit 7b9a341ccd
23 changed files with 1099 additions and 37 deletions

View File

@@ -15,13 +15,16 @@ return new class extends Migration
{
Schema::create('encounters', function (Blueprint $table) {
$table->id();
$table->foreignId('part_of')->comment('encounter_id');
$table->foreignId('part_of')->nullable()->comment('encounter_id')->index();
$table->string('status');
$table->string('class')->nullable();
$table->string('type')->nullable();
$table->foreignId('patient_id')->nullable();
$table->foreignId('patient_id')->nullable()->index();
$table->foreignId('healthcare_id')->nullable()->index();
$table->dateTime('start')->nullable();
$table->dateTime('end')->nullable();
$table->integer('number_of_bed')->nullable();
$table->integer('duration_day')->nullable();
$table->timestamps();
$table->softDeletes();

View File

@@ -17,6 +17,7 @@ return new class extends Migration
$table->id();
$table->foreignId('encounter_id');
$table->foreignId('diagnosis_id');
$table->string('type')->nullable();
$table->string('use')->nullable();
$table->text('source')->nullable();
$table->text('description')->nullable();

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('claim_encounter', function (Blueprint $table) {
$table->id();
$table->foreignId('claim_id');
$table->foreignId('encounter_id');
$table->index(['claim_id', 'encounter_id'], 'claim_encounter_index');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('claim_encounter');
}
};

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('claims', function (Blueprint $table) {
$table->foreignId('final_encounter_id')->nullable()->after('benefit_id')->index();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('claims', function (Blueprint $table) {
$table->dropColumn('final_encounter_id');
});
}
};