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 CreateIntegracaoErpsaudeTipoAtendimentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
|
||||
if (app('config')->get('database.default') !== 'santarita') {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::create('integracao_erpsaude_tipo_atendimento', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 50);
|
||||
$table->char('codigo')->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
|
||||
if (app('config')->get('database.default') !== 'santarita') {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::dropIfExists('integracao_erpsaude_tipo_atendimento');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateIntegracaoErpsaudeUnidadeEncaminhadoraTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
|
||||
if (app('config')->get('database.default') !== 'santarita') {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::create('integracao_erpsaude_unidade_encaminhadora', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 50);
|
||||
$table->char('codigo')->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
|
||||
if (app('config')->get('database.default') !== 'santarita') {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::dropIfExists('integracao_erpsaude_unidade_encaminhadora');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateIntegracaoErpsaudeUnidadeAtendimentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
|
||||
if (app('config')->get('database.default') !== 'santarita') {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::create('integracao_erpsaude_unidade_atendimento', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 50);
|
||||
$table->char('codigo')->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
|
||||
if (app('config')->get('database.default') !== 'santarita') {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::dropIfExists('integracao_erpsaude_unidade_atendimento');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateIntegracaoErpsaudeTipoAltaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
|
||||
if (app('config')->get('database.default') !== 'santarita') {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::create('integracao_erpsaude_tipo_alta', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('descricao', 100);
|
||||
$table->char('codigo')->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
|
||||
if (app('config')->get('database.default') !== 'santarita') {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::dropIfExists('integracao_erpsaude_tipo_alta');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateIntegracaoErpsaudePacienteTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
|
||||
if (app('config')->get('database.default') !== 'santarita') {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::create('integracao_erpsaude_paciente', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->string('nome');
|
||||
$table->date('data_nascimento')->nullable();
|
||||
$table->string('sexo', 1)->nullable();
|
||||
$table->string('cns', 15)->nullable();
|
||||
$table->string('cep', 8)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
|
||||
if (app('config')->get('database.default') !== 'santarita') {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::dropIfExists('integracao_erpsaude_paciente');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateIntegracaoErpsaudeAtendimentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
|
||||
if (app('config')->get('database.default') !== 'santarita') {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::create('integracao_erpsaude_atendimento', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
|
||||
$table->date('data')->nullable();
|
||||
$table->time('hora')->nullable();
|
||||
$table->date('data_alta')->nullable();
|
||||
$table->time('hora_alta')->nullable();
|
||||
$table->date('data_atendimento')->nullable();
|
||||
$table->time('horario_atendimento')->nullable();
|
||||
|
||||
$table->string('cod_tipo_encaminhamento', 10)->nullable();
|
||||
$table->string('cod_grupo_atendimento', 10)->nullable();
|
||||
|
||||
$table->foreignId('paciente_id')->constrained('integracao_erpsaude_paciente');
|
||||
$table->foreignId('tipo_atendimento_id')->nullable()->constrained('integracao_erpsaude_tipo_atendimento');
|
||||
$table->foreignId('unidade_encaminhadora_id')->nullable()->constrained('integracao_erpsaude_unidade_encaminhadora');
|
||||
$table->foreignId('unidade_atendimento_id')->nullable()->constrained('integracao_erpsaude_unidade_atendimento');
|
||||
$table->foreignId('tipo_alta_id')->nullable()->constrained('integracao_erpsaude_tipo_alta');
|
||||
|
||||
$table->string('unidade_atendimento')->nullable();
|
||||
$table->string('cnes_un_atendimento', 20)->nullable();
|
||||
|
||||
$table->char('suspeita_maus_tratos', 1)->nullable();
|
||||
$table->text('hipotese_diagnostica')->nullable();
|
||||
$table->string('cid10', 10)->nullable();
|
||||
$table->text('descricao_procedimento')->nullable();
|
||||
$table->text('descricao_exame_clinico')->nullable();
|
||||
$table->text('conduta_medica')->nullable();
|
||||
|
||||
$table->string('codigo_conta_prof', 50)->nullable();
|
||||
$table->string('profissional')->nullable();
|
||||
$table->string('conselho', 50)->nullable();
|
||||
$table->char('uf_conselho', 2)->nullable();
|
||||
|
||||
$table->string('convenio')->nullable();
|
||||
$table->string('registro_ans', 50)->nullable();
|
||||
$table->string('cod_convenio', 50)->nullable();
|
||||
|
||||
$table->string('nome_setor')->nullable();
|
||||
$table->string('codigo_setor', 50)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
|
||||
if (app('config')->get('database.default') !== 'santarita') {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::dropIfExists('integracao_erpsaude_atendimento');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateIntegracaoErpsaudeReavaliacoesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
|
||||
if (app('config')->get('database.default') !== 'santarita') {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::create('integracao_erpsaude_reavaliacoes', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('atendimento_id')->constrained('integracao_erpsaude_atendimento');
|
||||
$table->date('data');
|
||||
$table->time('hora');
|
||||
$table->text('reavaliacao')->nullable();
|
||||
$table->string('profissional')->nullable();
|
||||
$table->string('numero_conselho')->nullable();
|
||||
$table->string('uf_conselho', 2)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
if (app('config')->get('database.default') !== 'santarita') {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::dropIfExists('integracao_erpsaude_reavaliacoes');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateIntegracaoErpsaudeExamesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if (app('config')->get('database.default') !== 'santarita') {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::create('integracao_erpsaude_exames', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('atendimento_id')->constrained('integracao_erpsaude_atendimento');
|
||||
$table->string('exame');
|
||||
$table->string('tipo');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
|
||||
if (app('config')->get('database.default') !== 'santarita') {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::dropIfExists('integracao_erpsaude_exames');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateIntegracaoErpsaudeMedicamentosTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
|
||||
if (app('config')->get('database.default') !== 'santarita') {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::create('integracao_erpsaude_medicamentos', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('atendimento_id')->constrained('integracao_erpsaude_atendimento');
|
||||
$table->string('medicamento');
|
||||
$table->decimal('quantidade', 8, 2);
|
||||
$table->string('unidade_medida');
|
||||
$table->string('tipo');
|
||||
$table->integer('medicamento_id');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
|
||||
if (app('config')->get('database.default') !== 'santarita') {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::dropIfExists('integracao_erpsaude_medicamentos');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddCpfToIntegracaoErpsaudePacienteTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
|
||||
if (app('config')->get('database.default') !== 'santarita') {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::table('integracao_erpsaude_paciente', function (Blueprint $table) {
|
||||
|
||||
$table->string('cpf', 11)->nullable()->after('cns');;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
|
||||
if (app('config')->get('database.default') !== 'santarita') {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::table('integracao_erpsaude_paciente', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn(['cpf']);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user