This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateProntoAtendimentoPedidoExameTable extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::create('pronto_atendimento_pedido_exame', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->string('justificativa', 100);
|
||||
$table->boolean('urgente')->default(false);
|
||||
$table->foreignId('atendimento_medico_id')->nullable()->constrained('pronto_atendimento_atendimento_medico');
|
||||
$table->foreignId('atendimento_id')->constrained('pronto_atendimento_atendimento');
|
||||
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('pronto_atendimento_pedido_exame');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use App\Enums\Parametrizacao\Exame\Status;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateProntoAtendimentoPedidoExameItemTable extends Migration
|
||||
{
|
||||
|
||||
public function up()
|
||||
{
|
||||
Schema::create('pronto_atendimento_pedido_exame_item', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->string('medico_solicitante')->nullable();
|
||||
$table->string('unidade_solicitante')->nullable();
|
||||
$table->date('data_solicitacao')->nullable();
|
||||
$table->foreignId('pedido_exame_id')->constrained('pronto_atendimento_pedido_exame');
|
||||
$table->foreignId('exame_id')->constrained('cadastro_exame');
|
||||
$table->foreignId('status_id')->default(Status::SOLICITADO)->constrained('cadastro_exame_status');
|
||||
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
|
||||
$table->unique(['pedido_exame_id', 'exame_id', 'deleted_at']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('pronto_atendimento_pedido_exame_item');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateProntoAtendimentoPedidoExameLaudoTable extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::create('pronto_atendimento_pedido_exame_laudo', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('pedido_exame_id')->constrained('pronto_atendimento_pedido_exame');
|
||||
$table->string('hash');
|
||||
$table->string('nome');
|
||||
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('pronto_atendimento_pedido_exame_laudo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateProntoAtendimentoPedidoExameItemObservacao extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::create('pronto_atendimento_pedido_exame_item_observacao', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('item_id')->constrained('pronto_atendimento_pedido_exame_item');
|
||||
$table->string('observacao', 1000)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('pronto_atendimento_pedido_exame_item_observacao');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterStatusIdForeignKeyOnProntoAtendimentoPedidoExameItem extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('pronto_atendimento_pedido_exame_item', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['status_id']);
|
||||
|
||||
$table->foreign('status_id')->references('id')->on('parametrizacao_exame_status');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('pronto_atendimento_pedido_exame_item', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['status_id']);
|
||||
|
||||
$table->foreign('status_id')->references('id')->on('cadastro_exame_status');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterExameIdForeignKeyOnProntoAtendimentoPedidoExameItem extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('pronto_atendimento_pedido_exame_item', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['exame_id']);
|
||||
|
||||
$table->foreign('exame_id')->references('id')->on('parametrizacao_exame');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('pronto_atendimento_pedido_exame_item', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['exame_id']);
|
||||
|
||||
$table->foreign('exame_id')->references('id')->on('cadastro_exame');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterJustificativaProntoAtendimentoPedidoExame extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('pronto_atendimento_pedido_exame', function (Blueprint $table) {
|
||||
|
||||
$table->string('justificativa', 100)->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('pronto_atendimento_pedido_exame', function (Blueprint $table) {
|
||||
|
||||
$table->string('justificativa', 100)->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddValorExameToProntoAtendimentoPedidoExameItemTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('pronto_atendimento_pedido_exame_item', function (Blueprint $table) {
|
||||
|
||||
$table->decimal('valor_exame', 8, 2)->nullable()->after('exame_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('pronto_atendimento_pedido_exame_item', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn(['valor_exame']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddDescartadoAgendadoToProntoAtendimentoPedidoExameItemTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('pronto_atendimento_pedido_exame_item', function (Blueprint $table) {
|
||||
|
||||
$table->boolean('descartado_exame_laboratorial')->default(false)->nullable()->after('status_id');
|
||||
$table->boolean('agendado_exame_laboratorial')->default(false)->nullable()->after('descartado_exame_laboratorial');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('pronto_atendimento_pedido_exame_item', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn(['descartado_exame_laboratorial']);
|
||||
$table->dropColumn(['agendado_exame_laboratorial']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class DropDescartadoAgendadoToProntoAtendimentoPedidoExameItemTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('pronto_atendimento_pedido_exame_item', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn(['descartado_exame_laboratorial']);
|
||||
$table->dropColumn(['agendado_exame_laboratorial']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('pronto_atendimento_pedido_exame_item', function (Blueprint $table) {
|
||||
|
||||
$table->boolean('descartado_exame_laboratorial')->default(false)->nullable()->after('status_id');
|
||||
$table->boolean('agendado_exame_laboratorial')->default(false)->nullable()->after('descartado_exame_laboratorial');
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user