Update Formularium

This commit is contained in:
2022-08-15 12:42:49 +07:00
parent 8319331d26
commit a3b53ea334
65 changed files with 3218 additions and 52 deletions

View File

@@ -59,9 +59,9 @@ return new class extends Migration
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
$table->foreignId('created_by')->nullable();
$table->foreignId('updated_by')->nullable();
$table->foreignId('deleted_by')->nullable();
});
}

View File

@@ -25,9 +25,9 @@ return new class extends Migration
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
$table->foreignId('created_by')->nullable();
$table->foreignId('updated_by')->nullable();
$table->foreignId('deleted_by')->nullable();
});
}

View File

@@ -25,9 +25,9 @@ return new class extends Migration
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
$table->foreignId('created_by')->nullable();
$table->foreignId('updated_by')->nullable();
$table->foreignId('deleted_by')->nullable();
});
}

View File

@@ -28,9 +28,9 @@ return new class extends Migration
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
$table->foreignId('created_by')->nullable();
$table->foreignId('updated_by')->nullable();
$table->foreignId('deleted_by')->nullable();
});
}

View File

@@ -32,9 +32,9 @@ return new class extends Migration
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
$table->foreignId('created_by')->nullable();
$table->foreignId('updated_by')->nullable();
$table->foreignId('deleted_by')->nullable();
});
}

View File

@@ -24,9 +24,9 @@ return new class extends Migration
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
$table->foreignId('created_by')->nullable();
$table->foreignId('updated_by')->nullable();
$table->foreignId('deleted_by')->nullable();
$table->index(['policy_id', 'member_id']);
});

View File

@@ -24,9 +24,9 @@ return new class extends Migration
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
$table->foreignId('created_by')->nullable();
$table->foreignId('updated_by')->nullable();
$table->foreignId('deleted_by')->nullable();
$table->index(['member_id', 'plan_id']);
});

View File

@@ -25,9 +25,9 @@ return new class extends Migration
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
$table->foreignId('created_by')->nullable();
$table->foreignId('updated_by')->nullable();
$table->foreignId('deleted_by')->nullable();
});
}

View File

@@ -23,9 +23,9 @@ return new class extends Migration
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
$table->foreignId('created_by')->nullable();
$table->foreignId('updated_by')->nullable();
$table->foreignId('deleted_by')->nullable();
});
}

View File

@@ -22,9 +22,9 @@ return new class extends Migration
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
$table->foreignId('created_by')->nullable();
$table->foreignId('updated_by')->nullable();
$table->foreignId('deleted_by')->nullable();
});
}

View File

@@ -22,9 +22,9 @@ return new class extends Migration
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
$table->foreignId('created_by')->nullable();
$table->foreignId('updated_by')->nullable();
$table->foreignId('deleted_by')->nullable();
$table->index(['corporate_id', 'service_code']);
});

View File

@@ -22,9 +22,9 @@ return new class extends Migration
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
$table->foreignId('created_by')->nullable();
$table->foreignId('updated_by')->nullable();
$table->foreignId('deleted_by')->nullable();
});
}

View File

@@ -0,0 +1,52 @@
<?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('drugs', function (Blueprint $table) {
$table->id();
$table->string('code')->index();
$table->string('name')->index();
$table->string('generic_name')->nullable()->index();
$table->foreignId('unit_id')->nullable();
$table->foreignId('selling_unit_id')->index()->nullable();
$table->text('description')->nullable();
$table->foreignId('brand_id')->nullable();
$table->string('mims_class')->nullable();
$table->text('indications')->nullable();
$table->string('atc_code')->nullable()->index();
$table->string('segmentation')->nullable();
$table->string('type')->nullable();
$table->string('dosage')->nullable();
$table->text('remark')->nullable();
$table->string('status')->nullable();
$table->timestamps();
$table->softDeletes();
$table->foreignId('created_by')->nullable();
$table->foreignId('updated_by')->nullable();
$table->foreignId('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('drugs');
}
};

View File

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

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('categories', function (Blueprint $table) {
$table->id();
$table->foreignId('parent_id')->index()->nullable();
$table->string('code')->index()->nullable();
$table->string('name');
$table->string('type')->nullable();
$table->timestamps();
$table->softDeletes();
$table->foreignId('created_by')->nullable();
$table->foreignId('updated_by')->nullable();
$table->foreignId('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('categories');
}
};

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('drug_categories', function (Blueprint $table) {
$table->id();
$table->foreignId('drug_id');
$table->foreignId('category_id');
$table->timestamps();
$table->softDeletes();
$table->foreignId('created_by')->nullable();
$table->foreignId('updated_by')->nullable();
$table->foreignId('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('drug_categories');
}
};

View File

@@ -0,0 +1,42 @@
<?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('organizations', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('type')->nullable();
$table->string('status')->nullable()->default('active');
$table->text('description')->nullable();
$table->foreignId('part_of')->nullable();
$table->timestamps();
$table->softDeletes();
$table->foreignId('created_by')->nullable();
$table->foreignId('updated_by')->nullable();
$table->foreignId('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('organizations');
}
};

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('drug_compositions', function (Blueprint $table) {
$table->id();
$table->foreignId('drug_id');
$table->foreignId('ingredient_id');
$table->boolean('active')->default(true);
$table->string('strength')->nullable();
$table->timestamps();
$table->softDeletes();
$table->foreignId('created_by')->nullable();
$table->foreignId('updated_by')->nullable();
$table->foreignId('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('drug_compositions');
}
};

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('drug_atcs', function (Blueprint $table) {
$table->id();
$table->string('code')->index();
$table->string('name')->nullable();
$table->timestamps();
$table->softDeletes();
$table->foreignId('created_by')->nullable();
$table->foreignId('updated_by')->nullable();
$table->foreignId('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('drug_atcs');
}
};

View File

@@ -0,0 +1,45 @@
<?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('identifiers', function (Blueprint $table) {
$table->id();
$table->morphs('identifiable');
$table->string('use')->nullable();
$table->string('type')->nullable();
$table->string('system')->nullable();
$table->string('value')->nullable();
$table->date('period_start')->nullable();
$table->date('period_end')->nullable();
$table->string('assigner')->nullable();
$table->timestamps();
$table->softDeletes();
$table->foreignId('created_by')->nullable();
$table->foreignId('updated_by')->nullable();
$table->foreignId('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('identifiers');
}
};

View File

@@ -0,0 +1,40 @@
<?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('ingredients', function (Blueprint $table) {
$table->id();
// $table->foreignId('drug_id');
$table->text('substance');
$table->string('snomed_code')->index()->nullable();
$table->timestamps();
$table->softDeletes();
$table->foreignId('created_by')->nullable();
$table->foreignId('updated_by')->nullable();
$table->foreignId('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('ingredients');
}
};

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('drug_manufacturers', function (Blueprint $table) {
$table->id();
$table->foreignId('drug_id');
$table->foreignId('organization_id');
$table->timestamps();
$table->softDeletes();
$table->foreignId('created_by')->nullable();
$table->foreignId('updated_by')->nullable();
$table->foreignId('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('drug_manufacturers');
}
};

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('units', function (Blueprint $table) {
$table->id();
$table->string('name')->index();
$table->string('metrics')->index()->nullable();
$table->timestamps();
$table->softDeletes();
$table->foreignId('created_by')->nullable();
$table->foreignId('updated_by')->nullable();
$table->foreignId('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('units');
}
};

View File

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

View File

@@ -0,0 +1,38 @@
<?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('formularium_items', function (Blueprint $table) {
$table->id();
$table->foreignId('formularium_id');
$table->foreignId('item_id');
$table->timestamps();
$table->softDeletes();
$table->foreignId('created_by')->nullable();
$table->foreignId('updated_by')->nullable();
$table->foreignId('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('formularium_items');
}
};

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('corporate_formulariums', function (Blueprint $table) {
$table->id();
$table->foreignId('corporate_id');
$table->foreignId('formularium_id');
$table->timestamps();
$table->softDeletes();
$table->foreignId('created_by')->nullable();
$table->foreignId('updated_by')->nullable();
$table->foreignId('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('corporate_formulariums');
}
};