This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateParametrizacaoProcedimentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('parametrizacao_procedimento', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->string('procedimento_codigo', 10);
|
||||
$table->string('apelido', 100);
|
||||
$table->boolean('pronto_atendimento_servico_enfermagem')->default(false);
|
||||
$table->boolean('pronto_atendimento_procedimento_padrao')->default(false);
|
||||
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
|
||||
$table->unique(['procedimento_codigo', 'deleted_at']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('parametrizacao_procedimento');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateParametrizacaoKitExameTipoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('parametrizacao_kit_exame_tipo', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('nome', 100);
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('parametrizacao_kit_exames');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateParametrizacaoKitExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('parametrizacao_kit_exame', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('tipo_id')->nullable()->constrained('cadastro_exame_tipo');
|
||||
$table->string('nome', 150);
|
||||
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
|
||||
$table->unique(['nome', 'deleted_at']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('parametrizacao_kit_exame');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateParametrizacaoKitExameItemTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('parametrizacao_kit_exame_item', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('kit_exame_id')->nullable()->onDelete('cascade')->constrained('parametrizacao_kit_exame');
|
||||
$table->foreignId('exame_id')->nullable()->constrained('cadastro_exame');
|
||||
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
|
||||
$table->unique(['exame_id', 'deleted_at']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('parametrizacao_kit_exame_item');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateParametrizacaoExameTipoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('parametrizacao_exame_tipo', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('nome', 100);
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('parametrizacao_exame_tipo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateParametrizacaoExameStatusTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('parametrizacao_exame_status', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('nome', 255);
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('parametrizacao_exame_status');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateParametrizacaoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('parametrizacao_exame', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->string('codigo', 10);
|
||||
$table->foreignId('tipo_id')->constrained('parametrizacao_exame_tipo');
|
||||
$table->string('nome', 100);
|
||||
$table->boolean('ativo')->default(true);
|
||||
$table->string('observacao', 1000)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
|
||||
$table->unique(['nome', 'deleted_at']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('parametrizacao_exame');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterTipoIdForeignKeyOnParametrizacaoKitExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('parametrizacao_kit_exame', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['tipo_id']);
|
||||
|
||||
$table->foreign('tipo_id')->references('id')->on('parametrizacao_exame_tipo');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('parametrizacao_kit_exame', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['tipo_id']);
|
||||
|
||||
$table->foreign('tipo_id')->references('id')->on('cadastro_exame_tipo');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterExameIdForeignKeyOnParametrizacaoKitExameItem extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('parametrizacao_kit_exame_item', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['exame_id']);
|
||||
|
||||
$table->foreign('exame_id')->references('id')->on('parametrizacao_exame');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('parametrizacao_kit_exame_item', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['exame_id']);
|
||||
|
||||
$table->foreign('exame_id')->references('id')->on('cadastro_exame');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterFieldsOnParametrizacaoProcedimentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('parametrizacao_procedimento', function (Blueprint $table) {
|
||||
|
||||
$table->unique(['apelido', 'deleted_at']);
|
||||
|
||||
$table->dropColumn([
|
||||
'pronto_atendimento_servico_enfermagem',
|
||||
'pronto_atendimento_procedimento_padrao',
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('parametrizacao_procedimento', function (Blueprint $table) {
|
||||
|
||||
$table->dropUnique(['apelido', 'deleted_at']);
|
||||
|
||||
$table->boolean('pronto_atendimento_servico_enfermagem')->default(false);
|
||||
$table->boolean('pronto_atendimento_procedimento_padrao')->default(false);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddFieldsToParametrizacaoExame extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('parametrizacao_exame', function (Blueprint $table) {
|
||||
$table->string('sigla_exame', 5)->after('observacao')->nullable();
|
||||
$table->smallInteger('prazo_entrega')->after('sigla_exame')->nullable();
|
||||
$table->smallInteger('validade')->after('prazo_entrega')->nullable();
|
||||
$table->decimal('valor', 8, 2)->after('validade')->nullable();
|
||||
$table->smallInteger('quantidade_maxima')->after('valor')->nullable();
|
||||
$table->boolean('outro_municipio')->after('quantidade_maxima')->nullable();
|
||||
$table->boolean('provisorio')->after('outro_municipio')->nullable();
|
||||
$table->boolean('sigilo')->after('provisorio')->nullable();
|
||||
$table->boolean('senha_supervisor')->after('sigilo')->nullable();
|
||||
$table->tinyInteger('ultimo_resultado')->after('senha_supervisor')->nullable();
|
||||
$table->text('resultado', 500)->after('ultimo_resultado')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('parametrizacao_exame', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn('sigla_exame');
|
||||
$table->dropColumn('prazo_entrega');
|
||||
$table->dropColumn('validade');
|
||||
$table->dropColumn('valor');
|
||||
$table->dropColumn('quantidade_maxima');
|
||||
$table->dropColumn('outro_municipio');
|
||||
$table->dropColumn('provisorio');
|
||||
$table->dropColumn('sigilo');
|
||||
$table->dropColumn('senha_supervisor');
|
||||
$table->dropColumn('ultimo_resultado');
|
||||
$table->dropColumn('resultado');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddGrupoIdToParametrizacaoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('parametrizacao_exame', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('grupo_tipo_id')->after('tipo_id')->nullable()->constrained('cadastro_grupo');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('parametrizacao_exame', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::dropColumnWithForeign($table, 'grupo_tipo_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterFieldNomeSizeFromParametrizacaoExame extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('parametrizacao_exame', function (Blueprint $table) {
|
||||
|
||||
$table->string('nome', 180)->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('parametrizacao_exame', function (Blueprint $table) {
|
||||
|
||||
$table->string('nome', 100)->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterResultadoSizeFromParametrizacaoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('parametrizacao_exame', function (Blueprint $table) {
|
||||
|
||||
$table->string('resultado', 1500)->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('parametrizacao_exame', function (Blueprint $table) {
|
||||
|
||||
$table->string('resultado', 1500)->nullable()->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddFieldsToParametrizacaoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('parametrizacao_exame', function (Blueprint $table) {
|
||||
|
||||
$table->boolean('mapa_agrupado')->after('resultado')->nullable();
|
||||
$table->integer('posicao_mapa')->after('mapa_agrupado')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('parametrizacao_exame', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn('mapa_agrupado');
|
||||
$table->dropColumn('posicao_mapa');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateParametrizacaoExameComposicaoUnidadeTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('parametrizacao_exame_composicao_unidade', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 50);
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('parametrizacao_exame_composicao_unidade');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateParametrizacaoExameComposicaoTipoIdadeTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('parametrizacao_exame_composicao_tipo_idade', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 50);
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('parametrizacao_exame_composicao_tipo_idade');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateParametrizacaoExameComposicaoTipoResultadoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('parametrizacao_exame_composicao_tipo_resultado', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 50);
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('parametrizacao_exame_composicao_tipo_resultado');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateParametrizacaoExameComposicaoCasaDecimalTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('parametrizacao_exame_composicao_casa_decimal', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->tinyInteger('descricao');
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('parametrizacao_exame_composicao_casa_decimal');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateParametrizacaoExameComposicaoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('parametrizacao_exame_composicao', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('exame_id')->constrained('parametrizacao_exame');
|
||||
$table->string('descricao', 150);
|
||||
$table->decimal('limite_inferior', 8, 2)->nullable();
|
||||
$table->decimal('limite_superior', 8, 2)->nullable();
|
||||
$table->foreignId('unidade_id')->nullable()->constrained('parametrizacao_exame_composicao_unidade');
|
||||
$table->string('referencia', 100)->nullable();
|
||||
$table->foreignId('tipo_idade_id')->nullable()->constrained('parametrizacao_exame_composicao_tipo_idade');
|
||||
$table->smallInteger('idade_inicial')->nullable();
|
||||
$table->smallInteger('idade_final')->nullable();
|
||||
$table->foreignId('sexo_id')->nullable()->constrained('cadastro_sexo');
|
||||
$table->foreignId('tipo_resultado_id')->nullable()->constrained('parametrizacao_exame_composicao_tipo_resultado');
|
||||
$table->foreignId('casa_decimal_id')->nullable()->constrained('parametrizacao_exame_composicao_casa_decimal');
|
||||
$table->boolean('visivel');
|
||||
$table->foreignId('formula_id')->nullable()->constrained('exame_laboratorial_formula_exame');
|
||||
$table->boolean('valor_absoluto')->nullable();
|
||||
$table->string('referencia_especial', 500)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('parametrizacao_exame_composicao');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateParametrizacaoExameComposicaoSituacaoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('parametrizacao_exame_composicao_situacao', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 50);
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('parametrizacao_exame_composicao_situacao');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateParametrizacaoExameComposicaoListaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('parametrizacao_exame_composicao_lista', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('composicao_id')->constrained('parametrizacao_exame_composicao')->onDelete('cascade');
|
||||
$table->string('descricao', 150);
|
||||
$table->tinyInteger('ordem')->nullable();
|
||||
$table->foreignId('situacao_id')->constrained('parametrizacao_exame_composicao_situacao');
|
||||
$table->boolean('padrao')->default(false);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('parametrizacao_exame_composicao_lista');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateParametrizacaoExameTextoProntoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('parametrizacao_exame_texto_pronto', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('exame_id')->constrained('parametrizacao_exame');
|
||||
$table->string('codigo', 50);
|
||||
$table->string('descricao', 150);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('parametrizacao_exame_texto_pronto');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateParametrizacaoExameComposicaoVariavelTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('parametrizacao_exame_composicao_variavel', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('composicao_id')->constrained('parametrizacao_exame_composicao')->onDelete('cascade');
|
||||
$table->foreignId('fator_id')->constrained('exame_laboratorial_formula_exame_fator');
|
||||
$table->tinyInteger('ordem')->nullable();
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('parametrizacao_exame_composicao_variavel');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterDescricaoToParametrizacaoExameComposicaoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('parametrizacao_exame_composicao', function (Blueprint $table) {
|
||||
|
||||
$table->string('descricao', 150)->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('parametrizacao_exame_composicao', function (Blueprint $table) {
|
||||
|
||||
$table->string('descricao', 150)->nullable(false)->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddValorSigtapToParametrizacaoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('parametrizacao_exame', function (Blueprint $table) {
|
||||
|
||||
$table->boolean('valor_sigtap')->after('posicao_mapa')->default(false);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('parametrizacao_exame', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn('valor_sigtap');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddFieldExigeProcedimentoESexoToParametrizacaoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('parametrizacao_exame', function (Blueprint $table) {
|
||||
|
||||
$table->boolean('exige_procedimento')->after('valor_sigtap')->default(true);
|
||||
$table->foreignId('sexo_id')->nullable()->constrained('cadastro_sexo')->after('exige_procedimento');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('parametrizacao_exame', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn('exige_procedimento');
|
||||
$table->dropForeign(['sexo_id']);
|
||||
$table->dropColumn(['sexo_id']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterTipoIdadeIdForeignKeyOnParametrizacaoExameComposicaoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('parametrizacao_exame_composicao', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['tipo_idade_id']);
|
||||
|
||||
$table->foreign('tipo_idade_id')->references('id')->on('geral_medida_tempo');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('parametrizacao_exame_composicao', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['tipo_idade_id']);
|
||||
|
||||
$table->foreign('tipo_idade_id')->references('id')->on('parametrizacao_exame_composicao_tipo_idade');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class DropParametrizacaoExameComposicaoTipoIdadeTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::drop('parametrizacao_exame_composicao_tipo_idade');
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
|
||||
Schema::create('parametrizacao_exame_composicao_tipo_idade', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 50);
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddResultadoToParametrizacaoExameComposicaoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('parametrizacao_exame_composicao', function (Blueprint $table) {
|
||||
|
||||
$table->boolean('resultado')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('parametrizacao_exame_composicao', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn('resultado');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddQuantidadeReagenteToParametrizacaoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('parametrizacao_exame', function (Blueprint $table) {
|
||||
|
||||
$table->smallInteger('quantidade_reagente')->after('mapa_agrupado')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('parametrizacao_exame', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn('quantidade_reagente');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterFieldReferenciaEspecialToParametrizacaoExameComposicaoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('parametrizacao_exame_composicao', function (Blueprint $table) {
|
||||
|
||||
$table->string('referencia_especial', 1000)->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('parametrizacao_exame_composicao', function (Blueprint $table) {
|
||||
|
||||
$table->string('referencia_especial', 500)->nullable();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddRegulacaoTipoIdToParametrizacaoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('parametrizacao_exame', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('regulacao_tipo_id')->nullable()->constrained('regulacao_tipo');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('parametrizacao_exame', function (Blueprint $table) {
|
||||
|
||||
$table->dropConstrainedForeignId('regulacao_tipo_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddPpiFieldsToParametrizacaoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('parametrizacao_exame', function (Blueprint $table) {
|
||||
|
||||
$table->boolean('is_ppi')->nullable();
|
||||
$table->decimal('valor_ppi', 8, 2)->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('parametrizacao_exame', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn([
|
||||
'is_ppi',
|
||||
'valor_ppi',
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateParametrizacaoProcedimentoCirurgicoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('parametrizacao_procedimento_cirurgico', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->string('nome', 100);
|
||||
$table->string('procedimento_codigo', 10);
|
||||
$table->string('observacao', 1000)->nullable();
|
||||
$table->boolean('status')->default(true);
|
||||
$table->foreignId('grupo_exame_id')->nullable()->constrained('cadastro_grupo');
|
||||
$table->boolean('is_regulado')->default(0);
|
||||
$table->foreignId('regulacao_tipo_id')->nullable()->constrained('regulacao_tipo');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
|
||||
$table->unique(['nome']);
|
||||
$table->unique(['procedimento_codigo']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('parametrizacao_procedimento_cirurgico');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterResultadoSizeFrom1500To5000FromParametrizacaoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('parametrizacao_exame', function (Blueprint $table) {
|
||||
|
||||
$table->string('resultado', 5000)->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('parametrizacao_exame', function (Blueprint $table) {
|
||||
|
||||
$table->string('resultado', 1500)->nullable()->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddPermiteRepeticaoToParametrizacaoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('parametrizacao_exame', function (Blueprint $table) {
|
||||
|
||||
$table->boolean('permite_repeticao')->after('exige_procedimento')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('parametrizacao_exame', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn('permite_repeticao');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddPpiFieldsToProcedimentoCirurgicoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('parametrizacao_procedimento_cirurgico', function (Blueprint $table) {
|
||||
$table->boolean('is_ppi')->nullable();
|
||||
$table->decimal('valor_ppi', 8, 2)->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('parametrizacao_procedimento_cirurgico', function (Blueprint $table) {
|
||||
$table->dropColumn([
|
||||
'is_ppi',
|
||||
'valor_ppi',
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterObservacaoSizeToParametrizacaoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('parametrizacao_exame', function (Blueprint $table) {
|
||||
|
||||
|
||||
$table->string('observacao', 5000)->nullable()->change();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('parametrizacao_exame', function (Blueprint $table) {
|
||||
|
||||
$table->string('observacao', 1000)->nullable()->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class AlterValueFromValorOnParametrizacaoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
DB::statement("
|
||||
UPDATE parametrizacao_exame
|
||||
SET valor = (
|
||||
SELECT procedimento.valor_servico_ambilatorial
|
||||
FROM sigtap.procedimento
|
||||
WHERE procedimento.codigo = parametrizacao_exame.codigo
|
||||
ORDER BY procedimento.competencia_id DESC
|
||||
LIMIT 1
|
||||
)
|
||||
WHERE parametrizacao_exame.valor_sigtap = 1
|
||||
");
|
||||
|
||||
DB::statement("
|
||||
UPDATE exame_laboratorial_agendamento_exame
|
||||
INNER JOIN parametrizacao_exame ON parametrizacao_exame.id = exame_laboratorial_agendamento_exame.exame_id
|
||||
SET exame_laboratorial_agendamento_exame.valor = (
|
||||
SELECT procedimento.valor_servico_ambilatorial
|
||||
FROM sigtap.procedimento
|
||||
WHERE procedimento.codigo = parametrizacao_exame.codigo
|
||||
ORDER BY procedimento.competencia_id DESC
|
||||
LIMIT 1
|
||||
)
|
||||
WHERE parametrizacao_exame.valor_sigtap = 1
|
||||
AND exame_laboratorial_agendamento_exame.valor <> parametrizacao_exame.valor
|
||||
");
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddTempoMedioPrevistoAtendimentoDiasToParametrizacaoExameTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('parametrizacao_exame', function (Blueprint $table) {
|
||||
$table->integer('tempo_medio_previsto_atendimento_dias')
|
||||
->nullable()
|
||||
->after('exigir_peso_altura_circunferencia');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('parametrizacao_exame', function (Blueprint $table) {
|
||||
$table->dropColumn('tempo_medio_previsto_atendimento_dias');
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user