This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaVacinacaoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_ficha_vacinacao', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid('uuid_ficha')->nullable();
|
||||
$table->foreignId('usuario_id')->constrained('cadastro_usuario');
|
||||
$table->foreignId('ocupacao_id')->constrained('sigtap.ocupacao');
|
||||
$table->foreignId('equipe_id')->constrained('atencao_basica_parametrizacao_equipe');
|
||||
$table->foreignId('sala_vacinacao_id')->constrained('imunizacao_sala_vacinacao');
|
||||
$table->date('data_atendimento');
|
||||
$table->foreignId('usuario_exportacao_id')->nullable()->constrained('cadastro_usuario');
|
||||
$table->dateTime('data_hora_exportacao')->nullable();
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('atencao_basica_ficha_vacinacao', function (Blueprint $table) {
|
||||
$table->dropForeign(['usuario_id']);
|
||||
$table->dropForeign(['ocupacao_id']);
|
||||
$table->dropForeign(['equipe_id']);
|
||||
$table->dropForeign(['sala_vacinacao_id']);
|
||||
$table->dropForeign(['usuario_exportacao_id']);
|
||||
});
|
||||
Schema::dropIfExists('atencao_basica_ficha_vacinacao');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaVacinacaoPacienteTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_vacinacao_paciente', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('vacinacao_id')->constrained('atencao_basica_ficha_vacinacao');
|
||||
$table->foreignId('paciente_id')->constrained('cadastro_paciente');
|
||||
$table->foreignId('turno_id')->constrained('geral_turno');
|
||||
$table->foreignId('local_atendimento_id')->constrained('atencao_basica_local_atendimento');
|
||||
$table->boolean('viajante');
|
||||
$table->boolean('gestante');
|
||||
$table->boolean('puerpera');
|
||||
$table->boolean('hanseniase');
|
||||
$table->time('hora_inicial_atendimento')->nullable();
|
||||
$table->time('hora_final_atendimento')->nullable();
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('atencao_basica_vacinacao_paciente', function (Blueprint $table) {
|
||||
$table->dropForeign(['vacinacao_id']);
|
||||
$table->dropForeign(['paciente_id']);
|
||||
$table->dropForeign(['turno_id']);
|
||||
$table->dropForeign(['local_atendimento_id']);
|
||||
});
|
||||
Schema::dropIfExists('atencao_basica_vacinacao_paciente');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaVacinacaoPacienteItemTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_vacinacao_paciente_item', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('vacinacao_paciente_id')->constrained('atencao_basica_vacinacao_paciente');
|
||||
$table->foreignId('vacina_id')->constrained('cadastro_vacina');
|
||||
$table->foreignId('estrategia_id')->constrained('imunizacao_estrategia');
|
||||
$table->foreignId('dose_id')->constrained('imunizacao_dose');
|
||||
$table->foreignId('grupo_id')->nullable()->constrained('imunizacao_grupo_atendimento');
|
||||
$table->foreignId('entrada_id')->constrained('imunizacao_entrada_vacina');
|
||||
$table->foreignId('produtor_id')->constrained('imunizacao_vacina_produtor_apresentacao');
|
||||
$table->boolean('registro_anterior')->nullable();
|
||||
$table->boolean('aplicado_exterior')->nullable();
|
||||
$table->date('data')->nullable();
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('atencao_basica_vacinacao_paciente_item', function (Blueprint $table) {
|
||||
$table->dropForeign(['vacinacao_paciente_id']);
|
||||
$table->dropForeign(['vacina_id']);
|
||||
$table->dropForeign(['estrategia_id']);
|
||||
$table->dropForeign(['dose_id']);
|
||||
$table->dropForeign(['grupo_id']);
|
||||
$table->dropForeign(['entrada_id']);
|
||||
$table->dropForeign(['produtor_id']);
|
||||
});
|
||||
Schema::dropIfExists('atencao_basica_vacinacao_paciente_item');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaVacinacaoRegraTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_vacinacao_regra', function (Blueprint $table) {
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
$table->foreignId('vacina_id')->constrained('cadastro_vacina');
|
||||
$table->foreignId('estrategia_id')->constrained('imunizacao_estrategia');
|
||||
$table->foreignId('dose_id')->constrained('imunizacao_dose');
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_vacinacao_regra');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaFichaVacinacaoInconsistenciaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_ficha_vacinacao_inconsistencia', function (Blueprint $table) {
|
||||
$table->foreignId('ficha_vacinacao_id')->constrained('atencao_basica_ficha_vacinacao');
|
||||
$table->foreignId('inconsistencia_id')->constrained('atencao_basica_inconsistencia');
|
||||
|
||||
$table->primary(['ficha_vacinacao_id', 'inconsistencia_id']);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_ficha_vacinacao_inconsistencia');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaVacinacaoPacienteItemInconsistenciaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_vacinacao_paciente_item_inconsistencia', function (Blueprint $table) {
|
||||
$table->foreignId('vacinacao_paciente_item_id')->constrained('atencao_basica_vacinacao_paciente_item');
|
||||
$table->foreignId('inconsistencia_id')->constrained('atencao_basica_inconsistencia');
|
||||
|
||||
$table->primary(['vacinacao_paciente_item_id', 'inconsistencia_id']);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_vacinacao_paciente_item_inconsistencia');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddExportacaoIdToAtencaoBasicaFichaVacinacaoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('atencao_basica_ficha_vacinacao', function (Blueprint $table) {
|
||||
$table->foreignId('exportacao_id')->nullable()->after('data_atendimento')->constrained('atencao_basica_exportacao');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('atencao_basica_ficha_vacinacao', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['exportacao_id']);
|
||||
$table->dropColumn(['exportacao_id']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddAtivoToImunizacaoGrupoAtendimentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('imunizacao_grupo_atendimento', function (Blueprint $table) {
|
||||
$table->integer('codigo_esus')-> nullable();
|
||||
$table->boolean('ativo')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('imunizacao_grupo_atendimento', function (Blueprint $table) {
|
||||
$table->dropColumn('codigo_esus');
|
||||
$table->dropColumn('ativo');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaVacinacaoPacienteInconsistenciaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_vacinacao_paciente_inconsistencia', function (Blueprint $table) {
|
||||
$table->foreignId('vacinacao_paciente_id')->constrained('atencao_basica_vacinacao_paciente');
|
||||
$table->foreignId('inconsistencia_id')->constrained('atencao_basica_inconsistencia');
|
||||
|
||||
$table->primary(['vacinacao_paciente_id', 'inconsistencia_id']);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_vacinacao_paciente_inconsistencia');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterUuidFichaToAtencaoBasicaFichaVacinacaoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('atencao_basica_ficha_vacinacao', function (Blueprint $table) {
|
||||
|
||||
$table->string('uuid_ficha', 44)->nullable()->unique()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('atencao_basica_ficha_vacinacao', function (Blueprint $table) {
|
||||
$table->uuid('uuid_ficha')->nullable();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterEntradaIdAndProdutorIdToAtencaoBasicaVacinacaoPacienteItemTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('atencao_basica_vacinacao_paciente_item', function (Blueprint $table) {
|
||||
|
||||
$table->unsignedBigInteger('entrada_id')->nullable()->change();
|
||||
$table->unsignedBigInteger('produtor_id')->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('atencao_basica_vacinacao_paciente_item', function (Blueprint $table) {
|
||||
|
||||
$table->unsignedBigInteger('entrada_id')->nullable(false);
|
||||
$table->unsignedBigInteger('produtor_id')->nullable(false);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterEstrategiaIdOnAtencaoBasicaVacinacaoPacienteItemTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('atencao_basica_vacinacao_paciente_item', function (Blueprint $table) {
|
||||
$table->foreignId('estrategia_id')->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('atencao_basica_vacinacao_paciente_item', function (Blueprint $table) {
|
||||
$table->foreignId('estrategia_id')->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddFieldsToAtencaoBasicaVacinacaoRegraTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('atencao_basica_vacinacao_regra', function (Blueprint $table) {
|
||||
$table->boolean('exibe_aplicacao')->default(true)->after('dose');
|
||||
$table->boolean('exibe_atualizacao')->default(true)->after('exibe_aplicacao');
|
||||
$table->boolean('exibe_aprazamento')->default(true)->after('exibe_atualizacao');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('atencao_basica_vacinacao_regra', function (Blueprint $table) {
|
||||
$table->dropColumn('exibe_aplicacao');
|
||||
$table->dropColumn('exibe_atualizacao');
|
||||
$table->dropColumn('exibe_aprazamento');
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user