This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterArquivosExameLaboratorialAssinaturasTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
|
||||
$cliente = app('config')->get('database.default');
|
||||
|
||||
$destino = storage_path("app/exame-laboratorial/assinaturas/" . $cliente);
|
||||
|
||||
if (!File::exists($destino)) {
|
||||
File::makeDirectory($destino, 0775, true);
|
||||
}
|
||||
|
||||
DB::table('cadastro_usuario_assinatura')
|
||||
->select(['arquivo'])
|
||||
->whereNotNull('arquivo')
|
||||
->orderBy('id')
|
||||
->get()
|
||||
->each(function ($registro) use ($destino) {
|
||||
$origem = storage_path('app/exame-laboratorial/assinaturas/' . $registro->arquivo);
|
||||
|
||||
if (File::exists($origem)) {
|
||||
File::move($origem, $destino . DIRECTORY_SEPARATOR . $registro->arquivo);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialAgendamentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_agendamento', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('paciente_id')->constrained('cadastro_paciente');
|
||||
$table->foreignId('medico_id')->constrained('cadastro_usuario');
|
||||
$table->foreignId('unidade_id')->constrained('cadastro_unidade');
|
||||
$table->foreignId('infraestrutura_id')->nullable()->constrained('cadastro_infraestrutura');
|
||||
$table->foreignId('coleta_unidade_id')->nullable()->constrained('cadastro_unidade');
|
||||
$table->foreignId('coleta_infraestrutura_id')->nullable()->constrained('cadastro_infraestrutura');
|
||||
$table->foreignId('laboratorio_unidade_id')->nullable()->constrained('cadastro_unidade');
|
||||
$table->foreignId('laboratorio_infraestrutura_id')->nullable()->constrained('cadastro_infraestrutura');
|
||||
$table->foreignId('jornada_id')->constrained('exame_laboratorial_jornada');
|
||||
$table->foreignId('supervisor_id')->nullable()->constrained('cadastro_usuario');
|
||||
$table->string('uso_medicamento', 500)->nullable();
|
||||
$table->string('suspeita_clinica', 500)->nullable();
|
||||
$table->string('observacao', 500)->nullable();
|
||||
$table->boolean('urgente')->default(false);
|
||||
$table->date('ultima_menstruacao')->nullable();
|
||||
$table->string('responsavel', 100)->nullable();
|
||||
$table->boolean('gestante')->default(false);
|
||||
$table->date('data');
|
||||
$table->time('horario');
|
||||
$table->integer('agendamento_numero');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_agendamento');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialAgendamentoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('agendamento_id')->constrained('exame_laboratorial_agendamento');
|
||||
$table->foreignId('paciente_id')->constrained('cadastro_paciente');
|
||||
$table->foreignId('exame_id')->constrained('parametrizacao_exame');
|
||||
$table->decimal('valor', 8, 2)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_agendamento_exame');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialAgendamentoHistoricoMedicamentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_agendamento_historico_medicamento', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('agendamento_id')->constrained('exame_laboratorial_agendamento');
|
||||
$table->date('data');
|
||||
$table->foreignId('paciente_id')->constrained('cadastro_paciente');
|
||||
$table->string('uso_medicamento', 500)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_agendamento_historico_medicamento');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialAgendamentoExameStatusTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_agendamento_exame_status', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 20);
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_agendamento_exame_status');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddStatusIdToExameLaboratorialAgendamentoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('status_id')->nullable()->after('paciente_id')->constrained('exame_laboratorial_agendamento_exame_status');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['status_id']);
|
||||
$table->dropColumn(['status_id']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddFieldsToExameLaboratorialAgendamentoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('usuario_id')->nullable()->after('valor')->constrained('cadastro_usuario');
|
||||
$table->foreignId('ocupacao_id')->nullable()->after('usuario_id')->constrained('sigtap.ocupacao');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['usuario_id']);
|
||||
$table->dropColumn(['usuario_id']);
|
||||
|
||||
$table->dropForeign(['ocupacao_id']);
|
||||
$table->dropColumn(['ocupacao_id']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddImpressaoMapaProducaoToExameLaboratorialAgendamentoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->boolean('impressao_mapa_producao')->default(false)->after('ocupacao_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn(['impressao_mapa_producao']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddDataColetaToExameLaboratorialAgendamentoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->timestamp('data_coleta')->nullable()->after('status_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn(['data_coleta']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterDescricaoToExameLaboratorialAgendamentoExameStatusTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame_status', function (Blueprint $table) {
|
||||
|
||||
$table->string('descricao', 30)->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame_status', function (Blueprint $table) {
|
||||
|
||||
$table->string('descricao', 20)->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddMotivoIdToExameLaboratorialAgendamentoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('motivo_id')->nullable()->after('status_id')->constrained('exame_laboratorial_parametrizacao_motivo');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['motivo_id']);
|
||||
$table->dropColumn(['motivo_id']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialAgendamentoExameResultadoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_agendamento_exame_resultado', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('agendamento_exame_id')->constrained('exame_laboratorial_agendamento_exame');
|
||||
$table->foreignId('composicao_id')->constrained('parametrizacao_exame_composicao');
|
||||
$table->string('valor', 500)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_agendamento_exame_resultado');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddDataLaudoToExameLaboratorialAgendamentoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->timestamp('data_laudo')->nullable()->after('data_coleta');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn(['data_laudo']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddObservacaoToExameLaboratorialAgendamentoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->string('observacao', 500)->nullable()->after('impressao_mapa_producao');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
$table->dropColumn(['observacao']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddFieldsAssinaturaToExameLaboratorialAgendamentoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->timestamp('data_assinatura')->nullable()->after('data_laudo');
|
||||
$table->foreignId('assinatura_profissional_id')->nullable()->after('data_assinatura')->constrained('cadastro_usuario');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn(['data_assinatura']);
|
||||
|
||||
$table->dropForeign(['assinatura_profissional_id']);
|
||||
$table->dropColumn(['assinatura_profissional_id']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialAgendamentoLaudoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_agendamento_laudo', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('agendamento_id')->constrained('exame_laboratorial_agendamento');
|
||||
$table->string('arquivo', 100);
|
||||
$table->tinyInteger('ordem')->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_agendamento_laudo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddImpressaoEntregueToExameLaboratorialAgendamentoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->boolean('entregue')->default(false)->after('assinatura_profissional_id');
|
||||
$table->foreignId('entregue_usuario_id')->nullable()->after('entregue')->constrained('cadastro_usuario');
|
||||
$table->timestamp('data_entregue')->nullable()->after('entregue_usuario_id');
|
||||
|
||||
$table->boolean('impressao')->default(false)->after('data_entregue');
|
||||
$table->foreignId('impressao_usuario_id')->nullable()->after('impressao')->constrained('cadastro_usuario');
|
||||
$table->timestamp('data_impressao')->nullable()->after('impressao_usuario_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn(['entregue']);
|
||||
$table->dropColumn(['data_entregue']);
|
||||
$table->dropColumn(['impressao']);
|
||||
$table->dropColumn(['data_impressao']);
|
||||
|
||||
$table->dropForeign(['entregue_usuario_id']);
|
||||
$table->dropColumn(['entregue_usuario_id']);
|
||||
|
||||
$table->dropForeign(['impressao_usuario_id']);
|
||||
$table->dropColumn(['impressao_usuario_id']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddRetroativoToExameLaboratorialAgendamentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento', function (Blueprint $table) {
|
||||
|
||||
$table->boolean('retroativo')->nullable()->default(false);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn(['retroativo']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddFieldsBpaLaboratorialToExameLaboratorialAgendamentoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('bpa_procedimento_id')->after('observacao')->nullable()->constrained('bpa_procedimento');
|
||||
$table->foreignId('procedimento_id')->nullable()->after('bpa_procedimento_id')->constrained('sigtap.procedimento');
|
||||
$table->foreignId('lotacao_id')->nullable()->after('procedimento_id')->constrained('cadastro_lotacao');
|
||||
$table->unsignedSmallInteger('quantidade')->after('lotacao_id');
|
||||
$table->foreignId('cid_principal_id')->after('quantidade')->nullable()->constrained('sigtap.cid');
|
||||
$table->foreignId('cid_secundario_id')->after('cid_principal_id')->nullable()->constrained('sigtap.cid');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['bpa_procedimento_id']);
|
||||
$table->dropColumn(['bpa_procedimento_id']);
|
||||
$table->dropForeign(['procedimento_id']);
|
||||
$table->dropColumn('procedimento_id');
|
||||
$table->dropForeign(['lotacao_id']);
|
||||
$table->dropColumn('lotacao_id');
|
||||
$table->dropColumn('quantidade');
|
||||
$table->dropForeign(['cid_principal_id']);
|
||||
$table->dropColumn(['cid_principal_id']);
|
||||
$table->dropForeign(['cid_secundario_id']);
|
||||
$table->dropColumn(['cid_secundario_id']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddSupervisorIdToExameLaboratorialAgendamentoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('supervisor_id')->nullable()->after('data_impressao')->constrained('cadastro_usuario');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['supervisor_id']);
|
||||
$table->dropColumn(['supervisor_id']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialAgendamentoExameBloqueadoMotivoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_agendamento_exame_bloqueado_motivo', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->text('descricao', 100);
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_agendamento_exame_bloqueado_motivo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialAgendamentoExameBloqueadoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_agendamento_exame_bloqueado', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('paciente_id')->constrained('cadastro_paciente');
|
||||
$table->foreignId('exame_id')->constrained('parametrizacao_exame');
|
||||
$table->foreignId('supervisor_id')->nullable()->constrained('cadastro_usuario');
|
||||
$table->foreignId('motivo_id')->nullable()->constrained('exame_laboratorial_agendamento_exame_bloqueado_motivo');
|
||||
$table->decimal('valor', 8, 2)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_agendamento_exame_bloqueado');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddPreAtendimentoIdToExameLaboratorialAgendamentoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('pre_atendimento_id')
|
||||
->nullable()
|
||||
->after('agendamento_id')
|
||||
->constrained('ambulatorio_atendimento_pre_atendimento');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->dropConstrainedForeignId('pre_atendimento_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialAgendamentoExameHistoricoAcao extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_agendamento_exame_historico_acao', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('descricao');
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_agendamento_exame_historico_acao');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use App\Enums\ExameLaboratorial\Acao;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialAgendamentoExameHistorico extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_agendamento_exame_historico', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('exame_id')->constrained('parametrizacao_exame');
|
||||
$table->foreignId('agendamento_id')->constrained('exame_laboratorial_agendamento');
|
||||
$table->foreignId('acao_id')->constrained('exame_laboratorial_agendamento_exame_historico_acao')->default(Acao::INSERCAO);
|
||||
$table->date('data');
|
||||
$table->time('horario');
|
||||
$table->foreignId('status_id')->constrained('exame_laboratorial_agendamento_exame_status');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_agendamento_exame_historico');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddRegulacaoSolicitacaoIdToExameLaboratorialAgendamentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('regulacao_solicitacao_id')
|
||||
->nullable()
|
||||
->after('agendamento_numero')
|
||||
->constrained('regulacao_solicitacao');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento', function (Blueprint $table) {
|
||||
|
||||
$table->dropConstrainedForeignId('regulacao_solicitacao_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class UpdateAgendamentoExameHistoricoForeignKey extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame_historico', function (Blueprint $table) {
|
||||
$table->dropForeign(['agendamento_id']);
|
||||
$table->foreign('agendamento_id')
|
||||
->references('id')->on('exame_laboratorial_agendamento')
|
||||
->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame_historico', function (Blueprint $table) {
|
||||
$table->dropForeign(['agendamento_id']);
|
||||
$table->foreign('agendamento_id')
|
||||
->references('id')->on('exame_laboratorial_agendamento');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddFieldsLaboratorioToExameLaboratorialAgendamentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('usuario_id')->nullable()->after('regulacao_solicitacao_id')->constrained('cadastro_usuario');
|
||||
$table->foreignId('ocupacao_id')->nullable()->after('usuario_id')->constrained('sigtap.ocupacao');
|
||||
$table->foreignId('lotacao_id')->nullable()->after('ocupacao_id')->constrained('cadastro_lotacao');
|
||||
|
||||
$table->foreignId('laboratorio_usuario_id')->nullable()->after('lotacao_id')->constrained('cadastro_usuario');
|
||||
$table->foreignId('laboratorio_ocupacao_id')->nullable()->after('laboratorio_usuario_id')->constrained('sigtap.ocupacao');
|
||||
$table->foreignId('laboratorio_lotacao_id')->nullable()->after('laboratorio_ocupacao_id')->constrained('cadastro_lotacao');
|
||||
|
||||
$table->foreignId('bpa_procedimento_id')->nullable()->after('laboratorio_ocupacao_id')->constrained('bpa_procedimento');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['usuario_id']);
|
||||
$table->dropColumn(['usuario_id']);
|
||||
|
||||
$table->dropForeign(['ocupacao_id']);
|
||||
$table->dropColumn(['ocupacao_id']);
|
||||
|
||||
$table->dropForeign(['lotacao_id']);
|
||||
$table->dropColumn(['lotacao_id']);
|
||||
|
||||
$table->dropForeign(['laboratorio_usuario_id']);
|
||||
$table->dropColumn(['laboratorio_usuario_id']);
|
||||
|
||||
$table->dropForeign(['laboratorio_ocupacao_id']);
|
||||
$table->dropColumn(['laboratorio_ocupacao_id']);
|
||||
|
||||
$table->dropForeign(['laboratorio_lotacao_id']);
|
||||
$table->dropColumn(['laboratorio_lotacao_id']);
|
||||
|
||||
$table->dropForeign(['bpa_procedimento_id']);
|
||||
$table->dropColumn(['bpa_procedimento_id']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use App\Enums\WebService\Laboratorio\Cliente\PedidoStatus;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddWebServiceLaboratorioClientePedidoStatusIdToExameLaboratorialAgendamentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('web_service_laboratorio_cliente_pedido_status_id')
|
||||
->nullable()
|
||||
->after('laboratorio_lotacao_id')
|
||||
->constrained('web_service_laboratorio_cliente_pedido_status');
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento', function (Blueprint $table) {
|
||||
|
||||
$table->dropConstrainedForeignId('web_service_laboratorio_cliente_pedido_status_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddWebServiceLaboratorioClientePedidoResultadoUrlToExameLaboratorialAgendamentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento', function (Blueprint $table) {
|
||||
|
||||
$table->string('web_service_laboratorio_cliente_pedido_resultado_url', 300)
|
||||
->nullable()
|
||||
->after('web_service_laboratorio_cliente_pedido_status_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn('web_service_laboratorio_cliente_pedido_resultado_url');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddExternalFieldsToExameLaboratorialAgendamentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::addExternalFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento', function (Blueprint $table) {
|
||||
|
||||
$table->dropConstrainedForeignId('externo_created_usuario_id');
|
||||
$table->dropConstrainedForeignId('externo_updated_usuario_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddExternalFieldsToExameLaboratorialAgendamentoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::addExternalFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->dropConstrainedForeignId('externo_created_usuario_id');
|
||||
$table->dropConstrainedForeignId('externo_updated_usuario_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddExternalFieldsToExameLaboratorialAgendamentoExameHistoricoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame_historico', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::addExternalFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame_historico', function (Blueprint $table) {
|
||||
|
||||
$table->dropConstrainedForeignId('externo_created_usuario_id');
|
||||
$table->dropConstrainedForeignId('externo_updated_usuario_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class DropWebServiceLaboratorioClientePedidoResultadoUrlOnExameLaboratorialAgendamento extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn('web_service_laboratorio_cliente_pedido_resultado_url');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento', function (Blueprint $table) {
|
||||
|
||||
$table->string('web_service_laboratorio_cliente_pedido_resultado_url', 300)
|
||||
->nullable()
|
||||
->after('web_service_laboratorio_cliente_pedido_status_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddUrlToExameLaboratorialAgendamentoLaudoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_laudo', function (Blueprint $table) {
|
||||
|
||||
$table->string('url', 300)->nullable()->after('arquivo');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_laudo', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn('url');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddExternalFieldsToExameLaboratorialAgendamentoLaudoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_laudo', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::addExternalFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_laudo', function (Blueprint $table) {
|
||||
|
||||
$table->dropConstrainedForeignId('externo_created_usuario_id');
|
||||
$table->dropConstrainedForeignId('externo_updated_usuario_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterFieldSuspeitaClinicaOnExameLaboratorialAgendamentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento', function (Blueprint $table) {
|
||||
|
||||
$table->text('suspeita_clinica')->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento', function (Blueprint $table) {
|
||||
|
||||
$table->string('suspeita_clinica', 500)->nullable()->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddSoapSolicitacaoExameItemIdToExameLaboratorialAgendamentoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('soap_solicitacao_exame_item_id')
|
||||
->nullable()
|
||||
->after('pre_atendimento_id')
|
||||
->constrained('ambulatorio_atendimento_soap_solicitacao_exame_item');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->dropConstrainedForeignId('soap_solicitacao_exame_item_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddApacProcedimentoSecundarioIdToExameLaboratorialAgendamentoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('apac_procedimento_secundario_id')
|
||||
->nullable()
|
||||
->after('bpa_procedimento_id')
|
||||
->constrained('apac_solicitacao_autorizacao_procedimento_secundario');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->dropConstrainedForeignId('apac_procedimento_secundario_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddAcompanhamentoOciIdToExameLaboratorialAgendamentoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('acompanhamento_oci_id')
|
||||
->nullable()
|
||||
->after('cid_secundario_id')
|
||||
->constrained('ambulatorio_acompanhamento_oci');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame', function (Blueprint $table) {
|
||||
|
||||
$table->dropConstrainedForeignId('acompanhamento_oci_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddIsEnviadoWebserviceToExameLaboratorialAgendamentoLaudo extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_laudo', function (Blueprint $table) {
|
||||
|
||||
$table->boolean('is_enviado_webservice')->default(false)->after('ordem');
|
||||
});
|
||||
|
||||
DB::table('exame_laboratorial_agendamento_laudo')->whereNotNull('url')->update(['is_enviado_webservice' => true]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_laudo', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn('is_enviado_webservice');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
use App\Enums\ExameLaboratorial\StatusAgendamento;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class DeleteAgendamentoExameOrigemAmbulatorioDuplicado extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
DB::transaction(function () {
|
||||
|
||||
$agendamentoExames = DB::table('exame_laboratorial_agendamento_exame as agendamento_exame')
|
||||
->select(
|
||||
'agendamento_exame.agendamento_id',
|
||||
'agendamento_exame.exame_id'
|
||||
)
|
||||
->whereNotNull('agendamento_exame.soap_solicitacao_exame_item_id')
|
||||
->groupBy(
|
||||
'agendamento_exame.agendamento_id',
|
||||
'agendamento_exame.exame_id'
|
||||
)
|
||||
->havingRaw('COUNT(*) > 1')
|
||||
->get();
|
||||
|
||||
$agendamentoExames->each(function ($agendamentoExame) {
|
||||
|
||||
$hasNaoAgendado = DB::table('exame_laboratorial_agendamento_exame as agendamento_exame')
|
||||
->where('agendamento_exame.agendamento_id', $agendamentoExame->agendamento_id)
|
||||
->where('agendamento_exame.exame_id', $agendamentoExame->exame_id)
|
||||
->where('agendamento_exame.status_id', '<>', StatusAgendamento::AGENDADO)
|
||||
->exists();
|
||||
|
||||
DB::table('exame_laboratorial_agendamento_exame as agendamento_exame')
|
||||
->select('agendamento_exame.id')
|
||||
->where('agendamento_exame.agendamento_id', $agendamentoExame->agendamento_id)
|
||||
->where('agendamento_exame.exame_id', $agendamentoExame->exame_id)
|
||||
->where('agendamento_exame.status_id', StatusAgendamento::AGENDADO)
|
||||
->orderBy('agendamento_exame.id')
|
||||
->get()
|
||||
->each(function ($agendamentoExame, $i) use ($hasNaoAgendado) {
|
||||
|
||||
if ($i === 0 && !$hasNaoAgendado) {
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
DB::table('exame_laboratorial_agendamento_exame')->where('id', $agendamentoExame->id)->delete();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use App\Models\ExameLaboratorial\AgendamentoExame\Agendamento;
|
||||
|
||||
class AddUniqueToAgendamentoNumeroOnExameLaboratorialAgendamento extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$duplicados = DB::table('exame_laboratorial_agendamento')
|
||||
->select(
|
||||
'agendamento_numero',
|
||||
DB::raw('COUNT(agendamento_numero) as total')
|
||||
)
|
||||
->groupBy('agendamento_numero')
|
||||
->having('total', '>', 1)
|
||||
->get();
|
||||
|
||||
foreach($duplicados as $duplicado)
|
||||
{
|
||||
$registros = DB::table('exame_laboratorial_agendamento')
|
||||
->where('agendamento_numero', $duplicado->agendamento_numero)
|
||||
->orderBy('created_at')
|
||||
->get();
|
||||
|
||||
foreach($registros as $index => $registro)
|
||||
{
|
||||
if($index === 0 ){
|
||||
continue;
|
||||
}
|
||||
|
||||
$ultimo_numero_agendamento = Agendamento::orderByDesc('agendamento_numero')->first();
|
||||
$novoNumero = $ultimo_numero_agendamento ? $ultimo_numero_agendamento->agendamento_numero + 1 : 1;
|
||||
|
||||
DB::table('exame_laboratorial_agendamento')
|
||||
->where('id', $registro->id)
|
||||
->update([
|
||||
'agendamento_numero' => $novoNumero
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Schema::table('exame_laboratorial_agendamento', function (Blueprint $table) {
|
||||
$table->unique('agendamento_numero');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddAppCidadaoToExameLaboratorialAgendamentoTable extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento', function (Blueprint $table) {
|
||||
|
||||
$table
|
||||
->boolean('app_conectasus_cidadao')
|
||||
->nullable()
|
||||
->default(null)
|
||||
->after('agendamento_numero');
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento', function (Blueprint $table) {
|
||||
$table->dropColumn('app_conectasus_cidadao');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddJustificativaToExameLaboratorialAgendamentoExameHistoricoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame_historico', function (Blueprint $table) {
|
||||
|
||||
$table->text('justificativa')->nullable()->after('status_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_agendamento_exame_historico', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn('justificativa');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialFormulaExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_formula_exame', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('nome', 100);
|
||||
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_formula_exame');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialFormulaExameOperacaoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_formula_exame_operacao', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 30);
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_formula_exame_operacao');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialFormulaExameFatorTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_formula_exame_fator', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('formula_exame_id')->constrained('exame_laboratorial_formula_exame')->onDelete('cascade');
|
||||
$table->string('fator', 50);
|
||||
$table->foreignId('operacao_id')->constrained('exame_laboratorial_formula_exame_operacao');
|
||||
$table->smallInteger('tipo');
|
||||
$table->decimal('valor', 16, 6)->nullable();
|
||||
$table->boolean('exponenciacao')->default(false);
|
||||
$table->smallInteger('exponenciacao_tipo')->nullable();
|
||||
$table->decimal('exponenciacao_valor', 16, 6)->nullable();
|
||||
$table->smallInteger('ordem');
|
||||
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_formula_exame_fator');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialJornadaTipoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_jornada_tipo', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('nome', 10);
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_jornada_tipo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialJornadaSemanaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_jornada_semana', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('nome', 10);
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_jornada_semana');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialJornadaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_jornada', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('unidade_id')->constrained('cadastro_unidade');
|
||||
$table->foreignId('infraestrutura_id')->constrained('cadastro_infraestrutura');
|
||||
$table->foreignId('semana_id')->constrained('exame_laboratorial_jornada_semana');
|
||||
$table->foreignId('tipo_id')->constrained('exame_laboratorial_jornada_tipo');
|
||||
$table->bigInteger('vagas');
|
||||
$table->date('data');
|
||||
$table->time('hora_inicial');
|
||||
$table->time('hora_fim');
|
||||
$table->bigInteger('tempo_atendimento');
|
||||
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_jornada');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterExameLaboratorialJornadaAddVagasApp extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_jornada', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('vagas_app')->nullable()->after('vagas');
|
||||
$table->foreignId('laboratorio_prestador_infraestrutura_id')
|
||||
->nullable()
|
||||
->after('vagas_app')
|
||||
->constrained('cadastro_infraestrutura');
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_jornada', function (Blueprint $table) {
|
||||
$table->dropForeign(['laboratorio_prestador_infraestrutura_id']);
|
||||
$table->dropColumn(['vagas_app', 'laboratorio_prestador_infraestrutura_id']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialParametrizacaoCotaTipoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_parametrizacao_cota_tipo', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 50)->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_parametrizacao_cota_tipo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialParametrizacaoUnidadeTipoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_parametrizacao_unidade_tipo', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 50)->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_parametrizacao_unidade_tipo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialParametrizacaoUnidadeTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_parametrizacao_unidade', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('unidade_id')->constrained('cadastro_unidade');
|
||||
$table->boolean('unidade_coleta');
|
||||
$table->boolean('laboratorio');
|
||||
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_parametrizacao_unidade');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialParametrizacaoUnidadeSolicitanteTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_parametrizacao_unidade_solicitante', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('unidade_id')->constrained('cadastro_unidade');
|
||||
$table->foreignId('unidade_solicitante_id')->constrained('cadastro_unidade');
|
||||
$table->foreignId('unidade_tipo_id')->constrained('exame_laboratorial_parametrizacao_unidade_tipo');
|
||||
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_parametrizacao_unidade_solicitante');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialParametrizacaoCotaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_parametrizacao_cota', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('unidade_id')->constrained('cadastro_unidade');
|
||||
$table->foreignId('unidade_tipo_id')->constrained('exame_laboratorial_parametrizacao_unidade_tipo');
|
||||
$table->foreignId('cota_tipo_id')->constrained('exame_laboratorial_parametrizacao_cota_tipo');
|
||||
$table->date('inicio');
|
||||
$table->date('fim');
|
||||
$table->smallInteger('cota_quantidade')->nullable();
|
||||
$table->decimal('cota_valor', 8, 2)->nullable();
|
||||
$table->tinyInteger('unidade_solicitante_id')->nullable()->constrained('cadastro_unidade');
|
||||
$table->text('observacao', 250)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_parametrizacao_cota');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialParametrizacaoCotaAnualTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_parametrizacao_cota_anual', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('exame_id')->constrained('parametrizacao_exame');
|
||||
$table->smallInteger('ano')->nullable();
|
||||
$table->smallInteger('cota')->nullable();
|
||||
$table->text('observacao', 250)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_parametrizacao_cota_anual');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialParametrizacaoCotaExamePeriodoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_parametrizacao_cota_exame_periodo', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('exame_id')->constrained('parametrizacao_exame');
|
||||
$table->foreignId('infraestrutura_id')->constrained('cadastro_infraestrutura');
|
||||
$table->foreignId('unidade_id')->constrained('cadastro_unidade');
|
||||
$table->foreignId('cota_tipo_id')->constrained('exame_laboratorial_parametrizacao_cota_tipo');
|
||||
$table->text('observacao', 250)->nullable();
|
||||
$table->date('inicio');
|
||||
$table->date('fim');
|
||||
$table->integer('cota_quantidade')->nullable();
|
||||
$table->decimal('cota_valor', 8, 2)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_parametrizacao_cota_exame_periodo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddFieldsIntoExameLaboratorialParametrizacaoCotaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota', function (Blueprint $table) {
|
||||
$table->foreignId('infraestrutura_id')->constrained('cadastro_infraestrutura')->after('unidade_id');
|
||||
$table->foreignId('unidade_solicitante_infraestrutura_id')->nullable()->constrained('cadastro_infraestrutura')->after('unidade_solicitante_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota', function (Blueprint $table) {
|
||||
$table->dropForeign(['infraestrutura_id']);
|
||||
$table->dropForeign(['unidade_solicitante_infraestrutura_id']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddInfraestruturaIdToExameLaboratorialParametrizacaoUnidadeTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_unidade', function (Blueprint $table) {
|
||||
$table->foreignId('infraestrutura_id')->constrained('cadastro_infraestrutura')->after('unidade_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_unidade', function (Blueprint $table) {
|
||||
$table->dropForeign(['infraestrutura_id']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddFieldsToExameLaboratorialParametrizacaoUnidadeSolicitanteTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_unidade_solicitante', function (Blueprint $table) {
|
||||
$table->foreignId('infraestrutura_id')->constrained('cadastro_infraestrutura')->after('unidade_id');
|
||||
$table->foreignId('unidade_solicitante_infraestrutura_id')->nullable()->constrained('cadastro_infraestrutura')->after('unidade_solicitante_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_unidade_solicitante', function (Blueprint $table) {
|
||||
$table->dropForeign(['infraestrutura_id']);
|
||||
$table->dropForeign(['unidade_solicitante_infraestrutura_id']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterFieldsToExameLaboratorialParametrizacaoCotaAnualTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_anual', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn([
|
||||
'ano',
|
||||
]);
|
||||
|
||||
$table->foreignId('infraestrutura_id')->after('observacao')->constrained('cadastro_infraestrutura');
|
||||
$table->foreignId('unidade_id')->after('infraestrutura_id')->constrained('cadastro_unidade');
|
||||
$table->foreignId('cota_tipo_id')->after('unidade_id')->constrained('exame_laboratorial_parametrizacao_cota_tipo');
|
||||
$table->date('inicio')->after('cota_tipo_id');
|
||||
$table->date('fim')->after('inicio');
|
||||
$table->mediumInteger('cota_quantidade')->after('fim')->nullable();
|
||||
$table->decimal('cota_valor', 8, 2)->after('cota_quantidade')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_anual', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn([
|
||||
'infraestrutura_id',
|
||||
'unidade_id',
|
||||
'cota_tipo_id',
|
||||
'inicio',
|
||||
'fim',
|
||||
'cota_quantidade',
|
||||
'cota_valor',
|
||||
]);
|
||||
|
||||
$table->smallInteger('ano')->nullable();
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialParametrizacaoMesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_parametrizacao_mes', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->string('descricao');
|
||||
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_parametrizacao_mes');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialParametrizacaoCotaExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_parametrizacao_cota_exame', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('cota_id')->constrained('exame_laboratorial_parametrizacao_cota')->onDelete('cascade');
|
||||
$table->smallInteger('cota_quantidade')->nullable();
|
||||
$table->decimal('cota_valor', 8, 2)->nullable();
|
||||
$table->foreignId('exame_id')->constrained('parametrizacao_exame');
|
||||
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_parametrizacao_cota_exame');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialParametrizacaoCotaUnidadeSolicitanteTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_parametrizacao_cota_unidade_solicitante', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('cota_id')->constrained('exame_laboratorial_parametrizacao_cota')->onDelete('cascade');
|
||||
$table->foreignId('unidade_solicitante_id')->constrained('cadastro_unidade');
|
||||
$table->foreignId('infraestrutura_solicitante_id')->constrained('cadastro_infraestrutura');
|
||||
$table->smallInteger('cota_quantidade')->nullable();
|
||||
$table->decimal('cota_valor', 8, 2)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_parametrizacao_cota_unidade_solicitante');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddCotaAnualIdToExameLaboratorialParametrizacaoCotaExame extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_exame', function (Blueprint $table) {
|
||||
$table->foreignId('cota_anual_id')
|
||||
->after('exame_id')->nullable()
|
||||
->constrained('exame_laboratorial_parametrizacao_cota_exame_periodo');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_exame', function (Blueprint $table) {
|
||||
$table->dropForeign(['cota_anual_id']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddCotaIdUnidadeSolicitanteToExameLaboratorialParametrizacaoCotaUnidadeSolicitante extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_unidade_solicitante', function (Blueprint $table) {
|
||||
$table->foreignId('cota_id_unidade_solicitante')->after('cota_valor')->constrained('exame_laboratorial_parametrizacao_cota');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_unidade_solicitante', function (Blueprint $table) {
|
||||
$table->dropForeign(['cota_id_unidade_solicitante']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialParametrizacaoCotaExameUnidadeTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_parametrizacao_cota_exame_unidade', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->foreignId('cota_exame_id')
|
||||
->constrained('exame_laboratorial_parametrizacao_cota_exame')
|
||||
->onDelete('cascade');
|
||||
|
||||
$table->foreignId('cota_id')->constrained('exame_laboratorial_parametrizacao_cota');
|
||||
$table->foreignId('unidade_solicitante_id')->constrained('cadastro_unidade');
|
||||
$table->foreignId('infraestrutura_solicitante_id')->constrained('cadastro_infraestrutura');
|
||||
$table->smallInteger('cota_quantidade')->nullable();
|
||||
$table->decimal('cota_valor', 8, 2)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_parametrizacao_cota_exame_unidade');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterCotaToExameLaboratorialParametrizacaoCotaAnualTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_anual', function (Blueprint $table) {
|
||||
|
||||
$table->integer('cota')->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_anual', function (Blueprint $table) {
|
||||
|
||||
$table->smallInteger('cota')->nullable()->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialParametrizacaoMensagemProtocoloTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_parametrizacao_mensagem_protocolo', function (Blueprint $table) {
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
$table->string('mensagem', 500);
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_parametrizacao_mensagem_protocolo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class DropCotaToExameLaboratorialParametrizacaoCotaAnualTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_anual', function (Blueprint $table) {
|
||||
$table->dropColumn([
|
||||
'cota',
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_anual', function (Blueprint $table) {
|
||||
$table->integer('cota')->nullable();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterCotaAnualIdToCotaExamePeriodoIdExameLaboratorialParametrizacaoCotaExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_exame', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::dropColumnWithForeign($table, 'cota_anual_id');
|
||||
|
||||
$table->foreignId('cota_exame_periodo_id')
|
||||
->after('exame_id')
|
||||
->nullable()
|
||||
->constrained('exame_laboratorial_parametrizacao_cota_exame_periodo');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_exame', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['cota_exame_periodo_id']);
|
||||
|
||||
$table->foreignId('cota_anual_id')
|
||||
->after('exame_id')
|
||||
->nullable()
|
||||
->constrained('exame_laboratorial_parametrizacao_cota_exame_periodo');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class DropExameLaboratorialParametrizacaoCotaAnualTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::drop('exame_laboratorial_parametrizacao_cota_anual');
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::create('exame_laboratorial_parametrizacao_cota_anual', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('exame_id')->constrained('parametrizacao_exame');
|
||||
$table->smallInteger('ano')->nullable();
|
||||
$table->smallInteger('cota')->nullable();
|
||||
$table->text('observacao', 250)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialParametrizacaoMotivoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_parametrizacao_motivo', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('descricao', 100);
|
||||
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_parametrizacao_motivo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialParametrizacaoOcupacaoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_parametrizacao_ocupacao', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->foreignId('ocupacao_id')->constrained('sigtap.ocupacao');
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_parametrizacao_ocupacao');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class DropFieldsToExameLaboratorialParametrizacaoMesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_mes', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn('deleted_at');
|
||||
MigrationUtil::dropColumnWithForeign($table, 'deleted_lotacao_id');
|
||||
MigrationUtil::dropColumnWithForeign($table, 'deleted_centro_custo_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_mes', function (Blueprint $table) {
|
||||
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialParametrizacaoSupervisorTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_parametrizacao_supervisor', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('usuario_id')->constrained('cadastro_usuario');
|
||||
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_parametrizacao_supervisor');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialParametrizacaoCotaTransferenciaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_parametrizacao_cota_transferencia', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('cota_id')->nullable()->constrained('exame_laboratorial_parametrizacao_cota');
|
||||
$table->foreignId('laboratorio_unidade_id')->nullable()->constrained('cadastro_unidade');
|
||||
$table->foreignId('laboratorio_infraestrutura_id')->nullable()->constrained('cadastro_infraestrutura');
|
||||
$table->foreignId('origem_unidade_id')->constrained('cadastro_unidade');
|
||||
$table->foreignId('origem_infraestrutura_id')->constrained('cadastro_infraestrutura');
|
||||
$table->date('origem_inicio');
|
||||
$table->date('origem_fim');
|
||||
$table->integer('origem_cota_quantidade')->nullable();
|
||||
$table->decimal('origem_cota_valor', 8, 2)->nullable();
|
||||
$table->foreignId('destino_unidade_id')->constrained('cadastro_unidade');
|
||||
$table->foreignId('destino_infraestrutura_id')->constrained('cadastro_infraestrutura');
|
||||
$table->date('destino_inicio');
|
||||
$table->date('destino_fim');
|
||||
$table->integer('destino_cota_quantidade')->nullable();
|
||||
$table->decimal('destino_cota_valor', 8, 2)->nullable();
|
||||
$table->foreignId('unidade_tipo_id')->constrained('exame_laboratorial_parametrizacao_unidade_tipo');
|
||||
$table->foreignId('cota_tipo_id')->constrained('exame_laboratorial_parametrizacao_cota_tipo');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_parametrizacao_cota_transferencia');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialParametrizacaoCotaTransferenciaExamesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_parametrizacao_cota_transferencia_exames', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('cota_transferencia_id')->constrained('exame_laboratorial_parametrizacao_cota_transferencia');
|
||||
$table->integer('cota_quantidade')->nullable();
|
||||
$table->decimal('cota_valor', 8, 2)->nullable();
|
||||
$table->foreignId('cota_exame_id')->constrained('exame_laboratorial_parametrizacao_cota_exame');
|
||||
$table->integer('cota_quantidade_transferido')->nullable();
|
||||
$table->decimal('cota_valor_transferido', 8, 2)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_parametrizacao_cota_transferencia_exames');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class DropExameLaboratorialParametrizacaoOcupacaoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::drop('exame_laboratorial_parametrizacao_ocupacao');
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::create('exame_laboratorial_parametrizacao_ocupacao', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->foreignId('ocupacao_id')->constrained('sigtap.ocupacao');
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class DropCotaExameIdToExameLaboratorialParametrizacaoCotaTransferenciaExamesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_transferencia_exames', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::dropColumnWithForeign($table, 'cota_exame_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_transferencia_exames', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('cota_exame_id')->constrained('exame_laboratorial_parametrizacao_cota_exame');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterCotaExameIdToExameLaboratorialParametrizacaoCotaTransferenciaExamesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_transferencia_exames', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('cota_exame_id')
|
||||
->after('id')
|
||||
->nullable()
|
||||
->constrained('exame_laboratorial_parametrizacao_cota_exame_periodo');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_transferencia_exames', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::dropColumnWithForeign($table, 'cota_exame_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterCotaQuantidadeToExameLaboratorialParametrizacaoCotaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota', function (Blueprint $table) {
|
||||
|
||||
$table->integer('cota_quantidade')->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota', function (Blueprint $table) {
|
||||
|
||||
$table->smallInteger('cota_quantidade')->nullable()->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterCotaQuantidadeToExameLaboratorialParametrizacaoCotaUnidadeSolicitanteTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_unidade_solicitante', function (Blueprint $table) {
|
||||
|
||||
$table->integer('cota_quantidade')->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_unidade_solicitante', function (Blueprint $table) {
|
||||
|
||||
$table->smallInteger('cota_quantidade')->nullable()->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterCotaQuantidadeToExameLaboratorialParametrizacaoCotaExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_exame', function (Blueprint $table) {
|
||||
|
||||
$table->integer('cota_quantidade')->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_exame', function (Blueprint $table) {
|
||||
|
||||
$table->smallInteger('cota_quantidade')->nullable()->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterCotaQuantidadeToExameLaboratorialParametrizacaoCotaExameUnidadeTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_exame_unidade', function (Blueprint $table) {
|
||||
|
||||
$table->integer('cota_quantidade')->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_exame_unidade', function (Blueprint $table) {
|
||||
|
||||
$table->smallInteger('cota_quantidade')->nullable()->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialParametrizacaoUnidadeFaturamentoAutomaticoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_parametrizacao_unidade_faturamento_automatico', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('unidade_id')->constrained('cadastro_unidade');
|
||||
$table->foreignId('infraestrutura_id')->constrained('cadastro_infraestrutura');
|
||||
$table->foreignId('usuario_id')->nullable()->constrained('cadastro_usuario');
|
||||
$table->foreignId('ocupacao_id')->nullable()->constrained('sigtap.ocupacao');
|
||||
$table->foreignId('unidade_id_principal')->nullable()->constrained('cadastro_unidade');
|
||||
$table->foreignId('infraestrutura_id_principal')->nullable()->constrained('cadastro_infraestrutura');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_parametrizacao_unidade_faturamento_automatico');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddRelacionamentoIdToExameLaboratorialParametrizacaoUnidadeFaturamentoAutomaticoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_unidade_faturamento_automatico', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('relacionado_id')
|
||||
->after('infraestrutura_id_principal')
|
||||
->nullable()
|
||||
->constrained('exame_laboratorial_parametrizacao_unidade_faturamento_automatico');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_unidade_faturamento_automatico', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::dropColumnWithForeign($table, 'relacionado_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialParametrizacaoProfissionalAssinaturaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_parametrizacao_profissional_assinatura', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('unidade_id')->constrained('cadastro_unidade');
|
||||
$table->foreignId('infraestrutura_id')->constrained('cadastro_infraestrutura');
|
||||
$table->foreignId('usuario_id')->nullable()->constrained('cadastro_usuario');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_parametrizacao_profissional_assinatura');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialParametrizacaoImpressaoAgendamentoTipoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_parametrizacao_impressao_agendamento_tipo', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('descricao');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_parametrizacao_impressao_agendamento_tipo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialParametrizacaoImpressaoAgendamentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_parametrizacao_impressao_agendamento', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('tipo_id')->constrained('exame_laboratorial_parametrizacao_impressao_agendamento_tipo');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_parametrizacao_impressao_agendamento');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterDecimalToExameLaboratorialParametrizacaoCotaTransferenciaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_transferencia', function (Blueprint $table) {
|
||||
|
||||
$table->decimal('origem_cota_valor', 12, 2)->nullable()->change();
|
||||
$table->decimal('destino_cota_valor', 12, 2)->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_transferencia', function (Blueprint $table) {
|
||||
|
||||
$table->decimal('origem_cota_valor', 8, 2)->nullable()->change();
|
||||
$table->decimal('destino_cota_valor', 8, 2)->nullable()->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterDecimalToExameLaboratorialParametrizacaoCotaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota', function (Blueprint $table) {
|
||||
|
||||
$table->decimal('cota_valor', 12, 2)->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota', function (Blueprint $table) {
|
||||
|
||||
$table->decimal('cota_valor', 8, 2)->nullable()->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterDecimalToExameLaboratorialParametrizacaoCotaExamePeriodoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_exame_periodo', function (Blueprint $table) {
|
||||
|
||||
$table->decimal('cota_valor', 12, 2)->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_exame_periodo', function (Blueprint $table) {
|
||||
|
||||
$table->decimal('cota_valor', 8, 2)->nullable()->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterDecimalToExameLaboratorialParametrizacaoCotaExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_exame', function (Blueprint $table) {
|
||||
|
||||
$table->decimal('cota_valor', 12, 2)->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_exame', function (Blueprint $table) {
|
||||
|
||||
$table->decimal('cota_valor', 8, 2)->nullable()->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterDecimalToExameLaboratorialParametrizacaoCotaUnidadeSolicitanteTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_unidade_solicitante', function (Blueprint $table) {
|
||||
|
||||
$table->decimal('cota_valor', 12, 2)->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_unidade_solicitante', function (Blueprint $table) {
|
||||
|
||||
$table->decimal('cota_valor', 8, 2)->nullable()->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterDecimalToExameLaboratorialParametrizacaoCotaExameUnidadeTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_exame_unidade', function (Blueprint $table) {
|
||||
|
||||
$table->decimal('cota_valor', 12, 2)->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_exame_unidade', function (Blueprint $table) {
|
||||
|
||||
$table->decimal('cota_valor', 8, 2)->nullable()->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterDecimalToExameLaboratorialParametrizacaoCotaTransferenciaExamesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_transferencia_exames', function (Blueprint $table) {
|
||||
|
||||
$table->decimal('cota_valor', 12, 2)->nullable()->change();
|
||||
$table->decimal('cota_valor_transferido', 12, 2)->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('exame_laboratorial_parametrizacao_cota_transferencia_exames', function (Blueprint $table) {
|
||||
|
||||
$table->decimal('cota_valor', 8, 2)->nullable()->change();
|
||||
$table->decimal('cota_valor_transferido', 8, 2)->nullable()->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExameLaboratorialParametrizacaoUnidadeSolicitanteExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('exame_laboratorial_parametrizacao_unidade_solicitante_exame', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('unidade_id')->constrained('cadastro_unidade');
|
||||
$table->foreignId('infraestrutura_id')->constrained('cadastro_infraestrutura');
|
||||
$table->boolean('urgencia');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('exame_laboratorial_parametrizacao_unidade_solicitante_exame');
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user