[WIP] Encounter

This commit is contained in:
R
2023-03-16 14:27:53 +07:00
parent f65b28107c
commit 229908e492
15 changed files with 433 additions and 10 deletions

View File

@@ -0,0 +1,43 @@
<?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('encounters', function (Blueprint $table) {
$table->id();
$table->foreignId('part_of')->comment('encounter_id');
$table->string('status');
$table->string('class')->nullable();
$table->string('type')->nullable();
$table->foreignId('patient_id')->nullable();
$table->dateTime('start')->nullable();
$table->dateTime('end')->nullable();
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable()->index();
$table->unsignedBigInteger('updated_by')->nullable()->index();
$table->unsignedBigInteger('deleted_by')->nullable()->index();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('encounters');
}
};

View File

@@ -0,0 +1,39 @@
<?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('encounter_participants', function (Blueprint $table) {
$table->id();
$table->foreignId('encounter_id');
$table->string('type');
$table->nullableMorphs('participantable', 'participantable');
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable()->index();
$table->unsignedBigInteger('updated_by')->nullable()->index();
$table->unsignedBigInteger('deleted_by')->nullable()->index();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('encounter_participants');
}
};

View File

@@ -0,0 +1,41 @@
<?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('encounter_diagnoses', function (Blueprint $table) {
$table->id();
$table->foreignId('encounter_id');
$table->foreignId('diagnosis_id');
$table->string('use')->nullable();
$table->text('source')->nullable();
$table->text('description')->nullable();
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable()->index();
$table->unsignedBigInteger('updated_by')->nullable()->index();
$table->unsignedBigInteger('deleted_by')->nullable()->index();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('encounter_diagnoses');
}
};