This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroProcedimentoPequenaCirurgiaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_procedimento_pequena_cirurgia', function (Blueprint $table) {
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 75);
|
||||
$table->char('codigo_esus')->nullable();
|
||||
$table->string('codigo_procedimento', 20)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_procedimento_pequena_cirurgia');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroTesteRapidoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_teste_rapido', function (Blueprint $table) {
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 50);
|
||||
$table->char('codigo_esus')->nullable();
|
||||
$table->string('codigo_procedimento', 20)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_teste_rapido');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaCadastroViaAdministracaoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_cadastro_via_administracao', function (Blueprint $table) {
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 50);
|
||||
$table->char('codigo_esus')->nullable();
|
||||
$table->string('codigo_procedimento', 20)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_cadastro_via_administracao');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaProcedimentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_procedimento', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('usuario_id')->nullable()->constrained('cadastro_usuario');
|
||||
$table->foreignId('equipe_id')->nullable()->constrained('atencao_basica_parametrizacao_equipe');
|
||||
$table->foreignId('ocupacao_id')->nullable()->constrained('sigtap.ocupacao');
|
||||
$table->date('data_usuario_responsavel')->nullable();
|
||||
$table->integer('afericao_pa')->nullable();
|
||||
$table->integer('afericao_temperatura')->nullable();
|
||||
$table->integer('curativo_simples')->nullable();
|
||||
$table->integer('coleta_material_exame_laboratorial')->nullable();
|
||||
$table->integer('glicemia_capilar')->nullable();
|
||||
$table->integer('medicao_altura')->nullable();
|
||||
$table->integer('medicao_peso')->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_procedimento');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaProcedimentoAtendimentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_procedimento_atendimento', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('paciente_id')->nullable()->constrained('cadastro_paciente');
|
||||
$table->foreignId('procedimento_id')->nullable()->constrained('atencao_basica_procedimento');
|
||||
$table->foreignId('turno_id')->nullable()->constrained('geral_turno');
|
||||
$table->foreignId('local_atendimento_id')->nullable()->constrained('atencao_basica_local_atendimento');
|
||||
$table->foreignId('microarea_id')->nullable()->constrained('atencao_basica_parametrizacao_microarea');
|
||||
$table->boolean('escuta_inicial')->nullable();
|
||||
$table->decimal('peso', 8, 2)->nullable();
|
||||
$table->decimal('altura', 5, 2)->nullable();
|
||||
$table->decimal('temperatura', 3, 1)->nullable();
|
||||
$table->string('afericao_pa')->nullable();
|
||||
$table->integer('glicemia_capilar')->nullable();
|
||||
$table->boolean('exame_laboratorial')->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_procedimento_atendimento');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaProcedimentoAtendimentoProcedimentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_procedimento_atendimento_procedimento', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('procedimento_atendimento_id')->nullable()->constrained('atencao_basica_procedimento_atendimento');
|
||||
$table->foreignId('procedimento_id')->nullable()->constrained('sigtap.procedimento');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_procedimento_atendimento_procedimento');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaProcedimentoViaAdministracaoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_procedimento_via_administracao', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('procedimento_atendimento_id')->nullable()->constrained('atencao_basica_procedimento_atendimento');
|
||||
$table->foreignId('via_administracao_id')->nullable()->constrained('atencao_basica_cadastro_via_administracao');
|
||||
|
||||
$table->primary(['procedimento_atendimento_id', 'via_administracao_id']);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_procedimento_via_administracao');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaProcedimentoAtendimentoPequenaCirurgiaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_procedimento_atendimento_pequena_cirurgia', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('procedimento_atendimento_id')->nullable()->constrained('atencao_basica_procedimento_atendimento');
|
||||
$table->foreignId('pequena_cirurgia_id')->nullable()->constrained('atencao_basica_cadastro_procedimento_pequena_cirurgia');
|
||||
|
||||
$table->primary(['procedimento_atendimento_id', 'pequena_cirurgia_id']);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_procedimento_atendimento_pequena_cirurgia');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaProcedimentoAtendimentoTesteRapidoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_procedimento_atendimento_teste_rapido', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('procedimento_atendimento_id')->nullable()->constrained('atencao_basica_procedimento_atendimento');
|
||||
$table->foreignId('teste_rapido_id')->nullable()->constrained('atencao_basica_cadastro_teste_rapido');
|
||||
|
||||
$table->primary(['procedimento_atendimento_id', 'teste_rapido_id']);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_procedimento_atendimento_teste_rapido');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddAtendimentoIndividualIdToAtencaoBasicaProcedimentoAtendimentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('atencao_basica_procedimento_atendimento', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('atendimento_individual_id')
|
||||
->nullable()
|
||||
->after('id')
|
||||
->constrained('atencao_basica_atendimento_individual');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('atencao_basica_procedimento_atendimento', function (Blueprint $table) {
|
||||
|
||||
$table->dropConstrainedForeignId('atendimento_individual_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddFieldsExportacaoToAtencaoBasicaProcedimentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('atencao_basica_procedimento', function (Blueprint $table) {
|
||||
|
||||
$table
|
||||
->foreignId('exportacao_id')
|
||||
->nullable()
|
||||
->after('id')
|
||||
->constrained('atencao_basica_exportacao');
|
||||
|
||||
$table
|
||||
->string('uuid_ficha', 44)
|
||||
->nullable()
|
||||
->after('exportacao_id')
|
||||
->unique();
|
||||
|
||||
$table
|
||||
->foreignId('usuario_exportacao_id')
|
||||
->nullable()
|
||||
->after('uuid_ficha')
|
||||
->constrained('cadastro_usuario');
|
||||
|
||||
$table
|
||||
->dateTime('data_hora_exportacao')
|
||||
->nullable()
|
||||
->after('usuario_exportacao_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('atencao_basica_procedimento', function (Blueprint $table) {
|
||||
|
||||
$table->dropForeign(['exportacao_id']);
|
||||
$table->dropColumn(['exportacao_id']);
|
||||
|
||||
$table->dropForeign(['usuario_exportacao_id']);
|
||||
$table->dropColumn(['usuario_exportacao_id']);
|
||||
|
||||
$table->dropColumn('uuid_ficha');
|
||||
$table->dropColumn('data_hora_exportacao');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddPreAtendimentoIdToAtencaoBasicaProcedimentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('atencao_basica_procedimento', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('pre_atendimento_id')
|
||||
->nullable()
|
||||
->after('id')
|
||||
->constrained('ambulatorio_atendimento_pre_atendimento');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('atencao_basica_procedimento', function (Blueprint $table) {
|
||||
|
||||
$table->dropConstrainedForeignId('pre_atendimento_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddPreAtendimentoIdToAtencaoBasicaProcedimentoAtendimentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('atencao_basica_procedimento_atendimento', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('pre_atendimento_id')
|
||||
->nullable()
|
||||
->after('id')
|
||||
->constrained('ambulatorio_atendimento_pre_atendimento');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('atencao_basica_procedimento_atendimento', function (Blueprint $table) {
|
||||
|
||||
$table->dropConstrainedForeignId('pre_atendimento_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddPreAtendimentoIdToAtencaoBasicaProcedimentoAtendimentoProcedimentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('atencao_basica_procedimento_atendimento_procedimento', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('pre_atendimento_id')
|
||||
->nullable()
|
||||
->after('id')
|
||||
->constrained('ambulatorio_atendimento_pre_atendimento');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('atencao_basica_procedimento_atendimento_procedimento', function (Blueprint $table) {
|
||||
|
||||
$table->dropConstrainedForeignId('pre_atendimento_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddFieldsMedicoesToAtencaoBasicaProcedimentoAtendimentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('atencao_basica_procedimento_atendimento', function (Blueprint $table) {
|
||||
|
||||
$table->decimal('perimetro_cefalico', 5, 2)->nullable()->after('temperatura');
|
||||
$table->unsignedSmallInteger('frequencia_respiratoria')->nullable()->after('perimetro_cefalico');
|
||||
$table->unsignedSmallInteger('frequencia_cardiaca')->nullable()->after('frequencia_respiratoria');
|
||||
$table->unsignedSmallInteger('saturacao_o2')->nullable()->after('frequencia_cardiaca');
|
||||
$table->decimal('circunferencia_abdominal', 4, 1)->nullable()->after('saturacao_o2');
|
||||
$table->decimal('perimetro_panturrilha', 3, 1)->nullable()->after('circunferencia_abdominal');
|
||||
$table->foreignId('momento_coleta_id')->nullable()->after('perimetro_panturrilha')->constrained('ambulatorio_glicemia_capilar_momento_coleta');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('atencao_basica_procedimento_atendimento', function (Blueprint $table) {
|
||||
|
||||
|
||||
$table->dropForeign(['momento_coleta_id']);
|
||||
$table->dropColumn(['momento_coleta_id']);
|
||||
|
||||
$table->dropColumn('frequencia_respiratoria');
|
||||
$table->dropColumn('frequencia_cardiaca');
|
||||
$table->dropColumn('saturacao_o2');
|
||||
$table->dropColumn('circunferencia_abdominal');
|
||||
$table->dropColumn('perimetro_panturrilha');
|
||||
$table->dropColumn('perimetro_cefalico');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddPosConsultaIdToAtencaoBasicaProcedimentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('atencao_basica_procedimento', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('pos_consulta_id')
|
||||
->nullable()
|
||||
->after('pre_atendimento_id')
|
||||
->constrained('ambulatorio_atendimento_pos_consulta');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('atencao_basica_procedimento', function (Blueprint $table) {
|
||||
|
||||
$table->dropConstrainedForeignId('pos_consulta_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddPosConsultaIdToAtencaoBasicaProcedimentoAtendimentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('atencao_basica_procedimento_atendimento', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('pos_consulta_id')
|
||||
->nullable()
|
||||
->after('pre_atendimento_id')
|
||||
->constrained('ambulatorio_atendimento_pos_consulta');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('atencao_basica_procedimento_atendimento', function (Blueprint $table) {
|
||||
|
||||
$table->dropConstrainedForeignId('pos_consulta_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddPosConsultaIdToAtencaoBasicaProcedimentoAtendimentoProcedimentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('atencao_basica_procedimento_atendimento_procedimento', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('pos_consulta_id')
|
||||
->nullable()
|
||||
->after('pre_atendimento_id')
|
||||
->constrained('ambulatorio_atendimento_pos_consulta');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('atencao_basica_procedimento_atendimento_procedimento', function (Blueprint $table) {
|
||||
|
||||
$table->dropConstrainedForeignId('pos_consulta_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddFieldsGeolocalizacaoToAtencaoBasicaProcedimentoAtendimentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('atencao_basica_procedimento_atendimento', function (Blueprint $table) {
|
||||
$table->string('latitude', 10)->nullable();
|
||||
$table->string('longitude', 10)->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('atencao_basica_procedimento_atendimento', function (Blueprint $table) {
|
||||
$table->dropColumn('latitude');
|
||||
$table->dropColumn('longitude');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddSoapIdToAtencaoBasicaProcedimentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('atencao_basica_procedimento', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('soap_id')->nullable()->after('pre_atendimento_id')->constrained('ambulatorio_atendimento_soap');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('atencao_basica_procedimento', function (Blueprint $table) {
|
||||
|
||||
$table->dropConstrainedForeignId('soap_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddSoapIdToAtencaoBasicaProcedimentoAtendimentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('atencao_basica_procedimento_atendimento', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('soap_id')->nullable()->after('pre_atendimento_id')->constrained('ambulatorio_atendimento_soap');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('atencao_basica_procedimento_atendimento', function (Blueprint $table) {
|
||||
|
||||
$table->dropConstrainedForeignId('soap_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddSoapIdToAtencaoBasicaProcedimentoAtendimentoProcedimentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('atencao_basica_procedimento_atendimento_procedimento', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('soap_id')->nullable()->after('pre_atendimento_id')->constrained('ambulatorio_atendimento_soap');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('atencao_basica_procedimento_atendimento_procedimento', function (Blueprint $table) {
|
||||
|
||||
$table->dropConstrainedForeignId('soap_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAtencaoBasicaProcedimentoAtendimentoIvcfTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('atencao_basica_procedimento_atendimento_ivcf', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->foreignId('procedimento_atendimento_id')->constrained('atencao_basica_procedimento_atendimento')->onDelete('cascade');
|
||||
$table->string('estado_saude_geral', 100);
|
||||
$table->boolean('limitacao_compras');
|
||||
$table->boolean('limitacao_gestao_financeira');
|
||||
$table->boolean('limitacao_tarefas_domesticas');
|
||||
$table->boolean('banho_independencia');
|
||||
$table->boolean('relato_esquecimento_por_terceiros');
|
||||
$table->boolean('esquecimento_piorando');
|
||||
$table->boolean('esquecimento_impacta_atividades');
|
||||
$table->boolean('humor_tristeza_desanimo');
|
||||
$table->boolean('perda_interesse_atividades');
|
||||
$table->boolean('limitacao_elevar_bracos');
|
||||
$table->boolean('limitacao_motricidade_fina');
|
||||
$table->boolean('perda_peso_nao_intencional');
|
||||
$table->boolean('imc_abaixo_22');
|
||||
$table->boolean('panturrilha_abaixo_31');
|
||||
$table->boolean('marcha_lenta_4m_maior_5s');
|
||||
$table->boolean('dificuldade_caminhar_impacto_atividades');
|
||||
$table->boolean('quedas_recorrentes');
|
||||
$table->boolean('incontinencia');
|
||||
$table->boolean('problema_visao_impacto_atividades');
|
||||
$table->boolean('problema_audicao_impacto_atividades');
|
||||
$table->boolean('doencas_cronicas_multiplas');
|
||||
$table->boolean('polifarmacia_5_ou_mais_medicamentos');
|
||||
$table->boolean('internacao_ultimos_6_meses');
|
||||
|
||||
\MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('atencao_basica_procedimento_atendimento_ivcf');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user