This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaReceitaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_receita', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('usuario_id')->constrained('cadastro_usuario');
|
||||
$table->foreignId('paciente_id')->constrained('cadastro_paciente');
|
||||
$table->date('data_receita');
|
||||
$table->foreignId('cid_id')->nullable()->constrained('sigtap.cid');
|
||||
$table->boolean('is_receita_sus')->default(true);
|
||||
$table->boolean('is_remedio_em_casa')->default(false);
|
||||
$table->string('observacao', 300)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_receita');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaReceitaItemTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_receita_item', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('receita_id')->constrained('farmacia_receita');
|
||||
$table->foreignId('material_id')->constrained('cadastro_material');
|
||||
$table->integer('quantidade');
|
||||
$table->tinyInteger('intervalo_tempo');
|
||||
$table->foreignId('intervalo_medida_tempo_id')->constrained('cadastro_unidade_medida');
|
||||
$table->tinyInteger('durante_tempo')->nullable();
|
||||
$table->integer('prescrito')->nullable();
|
||||
$table->date('proxima_retirada');
|
||||
$table->string('observacao', 300)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_receita_item');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaReceitaItemEntrega extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_receita_item_entrega', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('receita_item_id')->constrained('farmacia_receita_item');
|
||||
$table->integer('quantidade');
|
||||
$table->boolean('pendente')->default(false);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_receita_item_entrega');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateCadastroMedicamentoNaoPadronizadoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('cadastro_medicamento_nao_padronizado', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->string('descricao', 100);
|
||||
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('cadastro_medicamento_nao_padronizado');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateMedicamentoNaoPadronizadoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('medicamento_nao_padronizado', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('paciente_id')->constrained('cadastro_paciente');
|
||||
$table->foreignId('usuario_id')->constrained('cadastro_usuario');
|
||||
$table->date('data_receita');
|
||||
$table->foreignId('medicamento_nao_padronizado_id')->constrained('cadastro_medicamento_nao_padronizado');
|
||||
$table->integer('quantidade');
|
||||
|
||||
MigrationUtil::addCommonFieldsWithSoftDeletes($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('medicamento_nao_padronizado');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterTablenameFromMedicamentoNaoPadronizadoToFarmaciaMedicamentoNaoPadronizado extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::rename('medicamento_nao_padronizado', 'farmacia_medicamento_nao_padronizado');
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::rename('farmacia_medicamento_nao_padronizado', 'medicamento_nao_padronizado');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddDispensadoEmIntoFarmaciaReceitaItemEntrega extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('farmacia_receita_item_entrega', function (Blueprint $table) {
|
||||
|
||||
$table->timestamp('dispensado_em')
|
||||
->after('pendente')
|
||||
->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('farmacia_receita_item_entrega', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn('dispensado_em');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddSaidaItemIdToFarmaciaReceitaItemEntrega extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('farmacia_receita_item_entrega', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('saida_item_id')
|
||||
->nullable()
|
||||
->after('dispensado_em')
|
||||
->constrained('almoxarifado_saida_item');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('farmacia_receita_item_entrega', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::dropColumnWithForeign($table, 'saida_item_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddEstornadoToFarmaciaReceitaItemEntregaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('farmacia_receita_item_entrega', function (Blueprint $table) {
|
||||
|
||||
$table->boolean('estornado')->default(false)->nullable()->after('saida_item_id');
|
||||
});
|
||||
|
||||
DB::statement("UPDATE farmacia_receita_item_entrega SET estornado = 0;");
|
||||
|
||||
Schema::table('farmacia_receita_item_entrega', function (Blueprint $table) {
|
||||
|
||||
$table->boolean('estornado')->nullable(false)->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('farmacia_receita_item_entrega', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn('estornado');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class SetProximaRetiradaToNullableAtFarmaciaReceitaItemTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('farmacia_receita_item', function (Blueprint $table) {
|
||||
|
||||
$table->date('proxima_retirada')->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('farmacia_receita_item', function (Blueprint $table) {
|
||||
|
||||
$table->date('proxima_retirada')->nullable(false)->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaParametrizacaoBnafarTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_parametrizacao_bnafar', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->boolean('informa_movimentacoes')->default(false);
|
||||
$table->string('usuario', 180)->nullable();
|
||||
$table->string('senha', 100)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_parametrizacao_bnafar');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaLivroStatusTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_livro_status', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('nome', 10);
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_livro_status');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaLivroTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_livro', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->unsignedInteger('numero');
|
||||
$table->date('aberto_em');
|
||||
$table->foreignId('status_id')->constrained('farmacia_livro_status');
|
||||
$table->foreignId('livro_registro_id')->constrained('cadastro_livro_registro');
|
||||
$table->foreignId('livro_registro_tipo_id')->constrained('cadastro_livro_registro_tipo');
|
||||
$table->string('registro', 100);
|
||||
$table->foreignId('usuario_farmaceutico_id')->constrained('cadastro_usuario');
|
||||
$table->string('inscricao_estadual', 14)->nullable();
|
||||
$table->string('autoridade_sanitaria', 100);
|
||||
$table->timestamp('fechado_em')->nullable();
|
||||
$table->foreignId('lotacao_fechamento_id')->nullable()->constrained('cadastro_lotacao');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
|
||||
$table->unique(['numero', 'livro_registro_id', 'livro_registro_tipo_id']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_livro');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaLivroPaginaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_livro_pagina', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('livro_id')->constrained('farmacia_livro');
|
||||
$table->unsignedSmallInteger('numero');
|
||||
$table->foreignId('material_id')->nullable()->constrained('cadastro_material');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
|
||||
$table->unique(['livro_id', 'numero']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_livro_pagina');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaBnafarProcessamentoStatusTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_bnafar_processamento_status', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->string('descricao', 200)->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_bnafar_processamento_status');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaBnafarServicoTipoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_bnafar_servico_tipo', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->string('descricao', 200)->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_bnafar_servico_tipo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaBnafarOperacaoTipoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_bnafar_operacao_tipo', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->string('descricao', 200)->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_bnafar_operacao_tipo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaBnafarProtocoloTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_bnafar_protocolo', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->foreignId('processamento_status_id')->nullable()->constrained('farmacia_bnafar_processamento_status');
|
||||
$table->foreignId('servico_tipo_id')->constrained('farmacia_bnafar_servico_tipo');
|
||||
$table->foreignId('operacao_tipo_id')->constrained('farmacia_bnafar_operacao_tipo');
|
||||
$table->integer('protocolo')->nullable();
|
||||
$table->timestamp('data_protocolo')->nullable();
|
||||
$table->json('erro')->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_bnafar_protocolo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaBnafarEntradaTipoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_bnafar_entrada_tipo', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->string('codigo', 10)->unique();
|
||||
$table->string('descricao', 100);
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_bnafar_entrada_tipo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaBnafarEntradaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_bnafar_entrada', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->foreignId('protocolo_id')->constrained('farmacia_bnafar_protocolo');
|
||||
$table->foreignId('entrada_tipo_id')->constrained('farmacia_bnafar_entrada_tipo');
|
||||
$table->foreignId('almoxarifado_entrada_id')->constrained('almoxarifado_entrada');
|
||||
$table->foreignId('centro_custo_id')->constrained('cadastro_centro_custo');
|
||||
$table->foreignId('fornecedor_id')->constrained('cadastro_fornecedor');
|
||||
$table->date('data_entrada');
|
||||
$table->string('numero_documento', 10);
|
||||
$table->integer('codigo_registro')->nullable();
|
||||
$table->boolean('processado_sucesso')->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_bnafar_entrada');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaBnafarEntradaItemTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_bnafar_entrada_item', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->foreignId('entrada_id')->constrained('farmacia_bnafar_entrada');
|
||||
$table->foreignId('almoxarifado_entrada_item_id')->constrained('almoxarifado_entrada_item');
|
||||
$table->foreignId('material_id')->constrained('cadastro_material');
|
||||
$table->foreignId('fabricante_id')->constrained('cadastro_fabricante');
|
||||
$table->string('lote', 15);
|
||||
$table->date('data_validade');
|
||||
$table->integer('quantidade');
|
||||
$table->decimal('valor_unitario', 16, 8);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_bnafar_entrada_item');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaLivroPaginaLinhaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_livro_pagina_linha', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('pagina_id')->constrained('farmacia_livro_pagina');
|
||||
$table->foreignId('entrada_item_id')->nullable()->constrained('almoxarifado_entrada_item');
|
||||
$table->foreignId('saida_item_id')->nullable()->constrained('almoxarifado_saida_item');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_livro_pagina_linha');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaBnafarSaidaTipoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_bnafar_saida_tipo', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->string('codigo', 10)->unique();
|
||||
$table->string('descricao', 100);
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_bnafar_saida_tipo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaBnafarSaidaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_bnafar_saida', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->foreignId('protocolo_id')->constrained('farmacia_bnafar_protocolo');
|
||||
$table->foreignId('saida_tipo_id')->constrained('farmacia_bnafar_saida_tipo');
|
||||
$table->foreignId('almoxarifado_saida_id')->constrained('almoxarifado_saida');
|
||||
$table->foreignId('centro_custo_id')->constrained('cadastro_centro_custo');
|
||||
$table->foreignId('centro_custo_destino_id')->constrained('cadastro_centro_custo');
|
||||
$table->date('data_saida');
|
||||
$table->integer('codigo_registro')->nullable();
|
||||
$table->boolean('processado_sucesso')->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_bnafar_saida');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaBnafarSaidaItemTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_bnafar_saida_item', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->foreignId('saida_id')->constrained('farmacia_bnafar_saida');
|
||||
$table->foreignId('almoxarifado_saida_item_id')->nullable()->constrained('almoxarifado_saida_item');
|
||||
$table->foreignId('material_id')->constrained('cadastro_material');
|
||||
$table->foreignId('fabricante_id')->constrained('cadastro_fabricante');
|
||||
$table->string('lote', 15);
|
||||
$table->date('data_validade');
|
||||
$table->integer('quantidade');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_bnafar_saida_item');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaBnafarDispensacaoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_bnafar_dispensacao', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->foreignId('protocolo_id')->constrained('farmacia_bnafar_protocolo');
|
||||
$table->foreignId('farmacia_receita_id')->constrained('farmacia_receita');
|
||||
$table->foreignId('centro_custo_id')->constrained('cadastro_centro_custo');
|
||||
$table->foreignId('paciente_id')->constrained('cadastro_paciente');
|
||||
$table->date('data_dispensacao');
|
||||
$table->integer('codigo_registro')->nullable();
|
||||
$table->boolean('processado_sucesso')->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_bnafar_dispensacao');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaBnafarDispensacaoItemTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_bnafar_dispensacao_item', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->foreignId('dispensacao_id')->constrained('farmacia_bnafar_dispensacao');
|
||||
$table->foreignId('farmacia_receita_item_id')->constrained('farmacia_receita_item');
|
||||
$table->foreignId('material_id')->constrained('cadastro_material');
|
||||
$table->foreignId('fabricante_id')->constrained('cadastro_fabricante');
|
||||
$table->foreignId('cid_id')->nullable()->constrained('sigtap.cid');
|
||||
$table->foreignId('usuario_prescritor_id')->constrained('cadastro_usuario');
|
||||
$table->foreignId('usuario_dispensador_id')->constrained('cadastro_usuario');
|
||||
$table->string('lote', 15);
|
||||
$table->date('data_validade');
|
||||
$table->integer('quantidade');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_bnafar_dispensacao_item');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaBnafarPosicaoEstoqueTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_bnafar_posicao_estoque', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->foreignId('protocolo_id')->constrained('farmacia_bnafar_protocolo');
|
||||
$table->foreignId('centro_custo_id')->constrained('cadastro_centro_custo');
|
||||
$table->date('data_posicao_estoque');
|
||||
$table->integer('codigo_registro')->nullable();
|
||||
$table->boolean('processado_sucesso')->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_bnafar_posicao_estoque');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaBnafarPosicaoEstoqueItemTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_bnafar_posicao_estoque_item', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->foreignId('posicao_estoque_id')->constrained('farmacia_bnafar_posicao_estoque');
|
||||
$table->foreignId('material_id')->constrained('cadastro_material');
|
||||
$table->foreignId('fabricante_id')->constrained('cadastro_fabricante');
|
||||
$table->string('lote', 15);
|
||||
$table->date('data_validade');
|
||||
$table->integer('quantidade');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_bnafar_posicao_estoque_item');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddNumeroNotificacaoToFarmaciaReceitaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('farmacia_receita', function (Blueprint $table) {
|
||||
|
||||
$table->string('numero_notificacao', 8)->nullable()->after('data_receita');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('farmacia_receita', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn('numero_notificacao');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaAltoCustoProcessoTipoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_alto_custo_processo_tipo', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('nome', 50)->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_alto_custo_processo_tipo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaAltoCustoProcessoNumeroRecebimentoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_alto_custo_processo_numero_recebimento', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('centro_custo_id')->constrained('cadastro_centro_custo');
|
||||
$table->unsignedInteger('numero');
|
||||
|
||||
$table->unique(['centro_custo_id', 'numero']);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_alto_custo_processo_numero_recebimento');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaAltoCustoProcessoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_alto_custo_processo', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('paciente_id')->constrained('cadastro_paciente');
|
||||
$table->decimal('peso', 8, 2)->nullable();
|
||||
$table->foreignId('peso_unidade_medida_id')->nullable()->constrained('cadastro_unidade_medida');
|
||||
$table->decimal('altura', 5, 2)->nullable();
|
||||
$table->foreignId('altura_unidade_medida_id')->nullable()->constrained('cadastro_unidade_medida');
|
||||
$table->foreignId('tipo_id')->constrained('farmacia_alto_custo_processo_tipo');
|
||||
$table->date('solicitado_em');
|
||||
$table->foreignId('unidade_solicitante_id')->constrained('cadastro_unidade');
|
||||
$table->foreignId('usuario_solicitante_id')->constrained('cadastro_usuario');
|
||||
$table->foreignId('cid_id')->nullable()->constrained('sigtap.cid');
|
||||
$table->text('observacoes')->nullable();
|
||||
$table->text('observacoes_drs')->nullable();
|
||||
$table->date('processo_devolvido_em')->nullable();
|
||||
$table->text('motivo_processo_devolvido')->nullable();
|
||||
$table->date('medicamento_devolvido_em')->nullable();
|
||||
$table->text('motivo_medicamento_devolvido')->nullable();
|
||||
$table->unsignedInteger('numero_recebimento')->default(0);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_alto_custo_processo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaAltoCustoProcessoItemMesStatusTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_alto_custo_processo_item_mes_status', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('nome', 100)->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_alto_custo_processo_item_mes_status');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaAltoCustoProcessoItemTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_alto_custo_processo_item', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('processo_id')->constrained('farmacia_alto_custo_processo')->onDelete('cascade');
|
||||
$table->foreignId('material_id')->constrained('cadastro_material');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_alto_custo_processo_item');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaAltoCustoProcessoItemMesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_alto_custo_processo_item_mes', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('item_id')->constrained('farmacia_alto_custo_processo_item')->onDelete('cascade');
|
||||
$table->unsignedTinyInteger('mes');
|
||||
$table->unsignedInteger('quantidade_solicitada');
|
||||
$table->date('enviado_drs_em')->nullable();
|
||||
$table->date('retirado_drs_em')->nullable();
|
||||
$table->unsignedInteger('quantidade_retirada')->nullable();
|
||||
$table->date('retirado_paciente_em')->nullable();
|
||||
$table->foreignId('usuario_atendente_id')->nullable()->constrained('cadastro_usuario');
|
||||
$table->foreignId('status_id')->constrained('farmacia_alto_custo_processo_item_mes_status');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_alto_custo_processo_item_mes');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaSupervisorTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_supervisor', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('infraestrutura_id')->constrained('cadastro_infraestrutura');
|
||||
$table->foreignId('usuario_id')->constrained('cadastro_usuario');
|
||||
|
||||
$table->unique(['infraestrutura_id', 'usuario_id']);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_supervisor');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddSupervisorIdToFarmaciaReceitaItemTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('farmacia_receita_item', function (Blueprint $table) {
|
||||
$table->foreignId('supervisor_id')->nullable()->after('observacao')->constrained('cadastro_usuario');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('farmacia_receita_item', function (Blueprint $table) {
|
||||
$table->dropForeign(['supervisor_id']);
|
||||
$table->dropColumn(['supervisor_id']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaParametrizacaoMedicamentoSupervisorTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_parametrizacao_medicamento_supervisor', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->boolean('dispensar')->default(false);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_parametrizacao_medicamento_supervisor');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaParametrizacaoPosologiaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_parametrizacao_posologia', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->boolean('is_obrigatorio')->default(true);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_parametrizacao_posologia');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
use Doctrine\DBAL\Types\IntegerType;
|
||||
use Doctrine\DBAL\Types\Type;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterFieldsToFarmaciaReceitaItemTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('farmacia_receita_item', function (Blueprint $table) {
|
||||
|
||||
if (!Type::hasType('tinyinteger')) {
|
||||
|
||||
Type::addType('tinyinteger', IntegerType::class);
|
||||
}
|
||||
|
||||
$table->integer('quantidade')->nullable()->change();
|
||||
$table->tinyInteger('intervalo_tempo')->nullable()->change();
|
||||
$table->foreignId('intervalo_medida_tempo_id')->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('farmacia_receita_item', function (Blueprint $table) {
|
||||
|
||||
if (!Type::hasType('tinyinteger')) {
|
||||
|
||||
Type::addType('tinyinteger', IntegerType::class);
|
||||
}
|
||||
|
||||
$table->integer('quantidade')->nullable(false)->change();
|
||||
$table->tinyInteger('intervalo_tempo')->nullable(false)->change();
|
||||
$table->foreignId('intervalo_medida_tempo_id')->nullable(false)->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaHistoricoDispensacaoV1Table extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_historico_dispensacao_v1', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->date('data_solicitacao');
|
||||
$table->string('nome_medico', 100);
|
||||
$table->string('nome_unidade', 100);
|
||||
$table->foreignId('cidadao_id')->constrained('cadastro_cidadao');
|
||||
$table->date('data_hora_dispensacao');
|
||||
$table->string('nome_medicamento', 250);
|
||||
$table->string('lote', 30);
|
||||
$table->integer('quantidade_receita');
|
||||
$table->integer('quantidade');
|
||||
$table->date('data_proxima_retirada');
|
||||
$table->string('observacao', 140);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterQuantidadeOnFarmaciaReceitaItemTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('farmacia_receita_item', function(Blueprint $table) {
|
||||
$table->decimal('quantidade')->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('farmacia_receita_item', function(Blueprint $table) {
|
||||
$table->integer('quantidade')->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Doctrine\DBAL\Types\IntegerType;
|
||||
use Doctrine\DBAL\Types\Type;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterDuranteTempoColumnInFarmaciaReceitaItemTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('farmacia_receita_item', function (Blueprint $table) {
|
||||
$table->smallInteger('durante_tempo')->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
if (!Type::hasType('tinyinteger')) {
|
||||
|
||||
Type::addType('tinyinteger', IntegerType::class);
|
||||
}
|
||||
|
||||
Schema::table('farmacia_receita_item', function (Blueprint $table) {
|
||||
$table->tinyInteger('durante_tempo')->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaParametrizacaoLimitePrescricaoMedicamento extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_parametrizacao_limite_prescricao_medicamento', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->integer('limite_dias')->default(180);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_parametrizacao_limite_prescricao_medicamento');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaParametrizacaoDispensacaoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_parametrizacao_dispensacao', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->unsignedInteger('prazo_receita_dias')->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_parametrizacao_dispensacao');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddUtilizaSolicitacaoMedicamentosAmbulatorioToFarmaciaParametrizacaoDispensacaoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('farmacia_parametrizacao_dispensacao', function (Blueprint $table) {
|
||||
|
||||
$table->boolean('utiliza_solicitacao_medicamentos_ambulatorio')->nullable()->after('prazo_receita_dias');
|
||||
});
|
||||
|
||||
DB::statement("UPDATE farmacia_parametrizacao_dispensacao SET utiliza_solicitacao_medicamentos_ambulatorio = 0;");
|
||||
|
||||
Schema::table('farmacia_parametrizacao_dispensacao', function (Blueprint $table) {
|
||||
|
||||
$table->boolean('utiliza_solicitacao_medicamentos_ambulatorio')->nullable(false)->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('farmacia_parametrizacao_dispensacao', function (Blueprint $table) {
|
||||
|
||||
$table->dropColumn(['utiliza_solicitacao_medicamentos_ambulatorio']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddAmbulatorioPrescricaoMedicamentoIdToFarmaciaReceitaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('farmacia_receita', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('ambulatorio_prescricao_medicamento_id')
|
||||
->nullable()
|
||||
->after('id')
|
||||
->constrained('ambulatorio_atendimento_soap_prescricao_medicamento');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('farmacia_receita', function (Blueprint $table) {
|
||||
|
||||
$table->dropConstrainedForeignId('ambulatorio_prescricao_medicamento_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterLivroRegistroTipoIdToNullableOnFarmaciaLivroTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('farmacia_livro', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('livro_registro_tipo_id')->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('farmacia_livro', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('livro_registro_tipo_id')->nullable(false)->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaAltoCustoProcessoSubtipoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_alto_custo_processo_subtipo', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('nome', 50);
|
||||
$table->foreignId('tipo_id')->constrained('farmacia_alto_custo_processo_tipo');
|
||||
|
||||
$table->unique(['nome', 'tipo_id']);
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_alto_custo_processo_subtipo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddSubtipoIdToFarmaciaAltoCustoProcessoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('farmacia_alto_custo_processo', function (Blueprint $table) {
|
||||
|
||||
$table->foreignId('subtipo_id')
|
||||
->nullable()
|
||||
->after('tipo_id')
|
||||
->constrained('farmacia_alto_custo_processo_subtipo');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('farmacia_alto_custo_processo', function (Blueprint $table) {
|
||||
|
||||
$table->dropConstrainedForeignId('subtipo_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterTypeOfQuantidadeSolicitadaOnFarmaciaAltoCustoProcessoItemMesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('farmacia_alto_custo_processo_item_mes', function (Blueprint $table) {
|
||||
|
||||
$table->decimal('quantidade_solicitada', 6, 3)->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('farmacia_alto_custo_processo_item_mes', function (Blueprint $table) {
|
||||
|
||||
$table->unsignedInteger('quantidade_solicitada')->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterTypeOfQuantidadeRetiradaOnFarmaciaAltoCustoProcessoItemMesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('farmacia_alto_custo_processo_item_mes', function (Blueprint $table) {
|
||||
|
||||
$table->decimal('quantidade_retirada', 6, 3)->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('farmacia_alto_custo_processo_item_mes', function (Blueprint $table) {
|
||||
|
||||
$table->unsignedInteger('quantidade_retirada')->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class RenameFarmaciaBnafarProcessamentoStatusTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::rename('farmacia_bnafar_processamento_status', 'integracao_bnafar_processamento_status');
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class RenameFarmaciaBnafarServicoTipoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::rename('farmacia_bnafar_servico_tipo', 'integracao_bnafar_servico_tipo');
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class RenameFarmaciaBnafarOperacaoTipoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::rename('farmacia_bnafar_operacao_tipo', 'integracao_bnafar_operacao_tipo');
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class RenameFarmaciaBnafarEntradaTipoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::rename('farmacia_bnafar_entrada_tipo', 'integracao_bnafar_entrada_tipo');
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class RenameFarmaciaBnafarSaidaTipoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::rename('farmacia_bnafar_saida_tipo', 'integracao_bnafar_saida_tipo');
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class RenameFarmaciaBnafarProtocoloTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('farmacia_bnafar_protocolo', function (Blueprint $table) {
|
||||
$table->dropForeign(['processamento_status_id']);
|
||||
$table->dropForeign(['servico_tipo_id']);
|
||||
$table->dropForeign(['operacao_tipo_id']);
|
||||
$table->dropConstrainedForeignId('created_lotacao_id');
|
||||
$table->dropConstrainedForeignId('created_centro_custo_id');
|
||||
$table->dropConstrainedForeignId('updated_lotacao_id');
|
||||
$table->dropConstrainedForeignId('updated_centro_custo_id');
|
||||
});
|
||||
|
||||
Schema::rename('farmacia_bnafar_protocolo', 'integracao_bnafar_protocolo');
|
||||
|
||||
Schema::table('integracao_bnafar_protocolo', function (Blueprint $table) {
|
||||
$table->foreign('processamento_status_id')->references('id')->on('integracao_bnafar_processamento_status');
|
||||
$table->foreign('servico_tipo_id')->references('id')->on('integracao_bnafar_servico_tipo');
|
||||
$table->foreign('operacao_tipo_id')->references('id')->on('integracao_bnafar_operacao_tipo');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class RenameFarmaciaBnafarEntradaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('farmacia_bnafar_entrada', function (Blueprint $table) {
|
||||
$table->dropForeign(['protocolo_id']);
|
||||
$table->dropForeign(['entrada_tipo_id']);
|
||||
$table->dropForeign(['almoxarifado_entrada_id']);
|
||||
$table->dropForeign(['centro_custo_id']);
|
||||
$table->dropForeign(['fornecedor_id']);
|
||||
$table->dropConstrainedForeignId('created_lotacao_id');
|
||||
$table->dropConstrainedForeignId('created_centro_custo_id');
|
||||
$table->dropConstrainedForeignId('updated_lotacao_id');
|
||||
$table->dropConstrainedForeignId('updated_centro_custo_id');
|
||||
});
|
||||
|
||||
Schema::rename('farmacia_bnafar_entrada', 'integracao_bnafar_entrada');
|
||||
|
||||
Schema::table('integracao_bnafar_entrada', function (Blueprint $table) {
|
||||
$table->foreign('protocolo_id')->references('id')->on('integracao_bnafar_protocolo');
|
||||
$table->foreign('entrada_tipo_id')->references('id')->on('integracao_bnafar_entrada_tipo');
|
||||
$table->foreign('almoxarifado_entrada_id')->references('id')->on('almoxarifado_entrada');
|
||||
$table->foreign('centro_custo_id')->references('id')->on('cadastro_centro_custo');
|
||||
$table->foreign('fornecedor_id')->references('id')->on('cadastro_fornecedor');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class RenameFarmaciaBnafarEntradaItemTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('farmacia_bnafar_entrada_item', function (Blueprint $table) {
|
||||
$table->dropForeign(['entrada_id']);
|
||||
$table->dropForeign(['almoxarifado_entrada_item_id']);
|
||||
$table->dropForeign(['material_id']);
|
||||
$table->dropForeign(['fabricante_id']);
|
||||
$table->dropConstrainedForeignId('created_lotacao_id');
|
||||
$table->dropConstrainedForeignId('created_centro_custo_id');
|
||||
$table->dropConstrainedForeignId('updated_lotacao_id');
|
||||
$table->dropConstrainedForeignId('updated_centro_custo_id');
|
||||
});
|
||||
|
||||
Schema::rename('farmacia_bnafar_entrada_item', 'integracao_bnafar_entrada_item');
|
||||
|
||||
Schema::table('integracao_bnafar_entrada_item', function (Blueprint $table) {
|
||||
$table->foreign('entrada_id')->references('id')->on('integracao_bnafar_entrada');
|
||||
$table->foreign('almoxarifado_entrada_item_id')->references('id')->on('almoxarifado_entrada_item');
|
||||
$table->foreign('material_id')->references('id')->on('cadastro_material');
|
||||
$table->foreign('fabricante_id')->references('id')->on('cadastro_fabricante');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class RenameFarmaciaBnafarSaidaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('farmacia_bnafar_saida', function (Blueprint $table) {
|
||||
$table->dropForeign(['protocolo_id']);
|
||||
$table->dropForeign(['saida_tipo_id']);
|
||||
$table->dropForeign(['almoxarifado_saida_id']);
|
||||
$table->dropForeign(['centro_custo_id']);
|
||||
$table->dropForeign(['centro_custo_destino_id']);
|
||||
$table->dropConstrainedForeignId('created_lotacao_id');
|
||||
$table->dropConstrainedForeignId('created_centro_custo_id');
|
||||
$table->dropConstrainedForeignId('updated_lotacao_id');
|
||||
$table->dropConstrainedForeignId('updated_centro_custo_id');
|
||||
});
|
||||
|
||||
Schema::rename('farmacia_bnafar_saida', 'integracao_bnafar_saida');
|
||||
|
||||
Schema::table('integracao_bnafar_saida', function (Blueprint $table) {
|
||||
$table->foreign('protocolo_id')->references('id')->on('integracao_bnafar_protocolo');
|
||||
$table->foreign('saida_tipo_id')->references('id')->on('integracao_bnafar_saida_tipo');
|
||||
$table->foreign('almoxarifado_saida_id')->references('id')->on('almoxarifado_saida');
|
||||
$table->foreign('centro_custo_id')->references('id')->on('cadastro_centro_custo');
|
||||
$table->foreign('centro_custo_destino_id')->references('id')->on('cadastro_centro_custo');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class RenameFarmaciaBnafarSaidaItemTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('farmacia_bnafar_saida_item', function (Blueprint $table) {
|
||||
$table->dropForeign(['saida_id']);
|
||||
$table->dropForeign(['almoxarifado_saida_item_id']);
|
||||
$table->dropForeign(['material_id']);
|
||||
$table->dropForeign(['fabricante_id']);
|
||||
$table->dropConstrainedForeignId('created_lotacao_id');
|
||||
$table->dropConstrainedForeignId('created_centro_custo_id');
|
||||
$table->dropConstrainedForeignId('updated_lotacao_id');
|
||||
$table->dropConstrainedForeignId('updated_centro_custo_id');
|
||||
});
|
||||
|
||||
Schema::rename('farmacia_bnafar_saida_item', 'integracao_bnafar_saida_item');
|
||||
|
||||
Schema::table('integracao_bnafar_saida_item', function (Blueprint $table) {
|
||||
$table->foreign('saida_id')->references('id')->on('integracao_bnafar_saida');
|
||||
$table->foreign('almoxarifado_saida_item_id')->references('id')->on('almoxarifado_saida_item');
|
||||
$table->foreign('material_id')->references('id')->on('cadastro_material');
|
||||
$table->foreign('fabricante_id')->references('id')->on('cadastro_fabricante');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class RenameFarmaciaBnafarDispensacaoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('farmacia_bnafar_dispensacao', function (Blueprint $table) {
|
||||
$table->dropForeign(['protocolo_id']);
|
||||
$table->dropForeign(['farmacia_receita_id']);
|
||||
$table->dropForeign(['centro_custo_id']);
|
||||
$table->dropForeign(['paciente_id']);
|
||||
$table->dropConstrainedForeignId('created_lotacao_id');
|
||||
$table->dropConstrainedForeignId('created_centro_custo_id');
|
||||
$table->dropConstrainedForeignId('updated_lotacao_id');
|
||||
$table->dropConstrainedForeignId('updated_centro_custo_id');
|
||||
});
|
||||
|
||||
Schema::rename('farmacia_bnafar_dispensacao', 'integracao_bnafar_dispensacao');
|
||||
|
||||
Schema::table('integracao_bnafar_dispensacao', function (Blueprint $table) {
|
||||
$table->foreign('protocolo_id')->references('id')->on('integracao_bnafar_protocolo');
|
||||
$table->foreign('farmacia_receita_id')->references('id')->on('farmacia_receita');
|
||||
$table->foreign('centro_custo_id')->references('id')->on('cadastro_centro_custo');
|
||||
$table->foreign('paciente_id')->references('id')->on('cadastro_paciente');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class RenameFarmaciaBnafarDispensacaoItemTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('farmacia_bnafar_dispensacao_item', function (Blueprint $table) {
|
||||
$table->dropForeign(['dispensacao_id']);
|
||||
$table->dropForeign(['farmacia_receita_item_id']);
|
||||
$table->dropForeign(['material_id']);
|
||||
$table->dropForeign(['fabricante_id']);
|
||||
$table->dropForeign(['cid_id']);
|
||||
$table->dropForeign(['usuario_prescritor_id']);
|
||||
$table->dropForeign(['usuario_dispensador_id']);
|
||||
$table->dropConstrainedForeignId('created_lotacao_id');
|
||||
$table->dropConstrainedForeignId('created_centro_custo_id');
|
||||
$table->dropConstrainedForeignId('updated_lotacao_id');
|
||||
$table->dropConstrainedForeignId('updated_centro_custo_id');
|
||||
});
|
||||
|
||||
Schema::rename('farmacia_bnafar_dispensacao_item', 'integracao_bnafar_dispensacao_item');
|
||||
|
||||
Schema::table('integracao_bnafar_dispensacao_item', function (Blueprint $table) {
|
||||
$table->foreign('dispensacao_id')->references('id')->on('integracao_bnafar_dispensacao');
|
||||
$table->foreign('farmacia_receita_item_id')->references('id')->on('farmacia_receita_item');
|
||||
$table->foreign('material_id')->references('id')->on('cadastro_material');
|
||||
$table->foreign('fabricante_id')->references('id')->on('cadastro_fabricante');
|
||||
$table->foreign('cid_id')->references('id')->on('sigtap.cid');
|
||||
$table->foreign('usuario_prescritor_id')->references('id')->on('cadastro_usuario');
|
||||
$table->foreign('usuario_dispensador_id')->references('id')->on('cadastro_usuario');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class RenameFarmaciaBnafarPosicaoEstoqueTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('farmacia_bnafar_posicao_estoque', function (Blueprint $table) {
|
||||
$table->dropForeign(['protocolo_id']);
|
||||
$table->dropForeign(['centro_custo_id']);
|
||||
$table->dropConstrainedForeignId('created_lotacao_id');
|
||||
$table->dropConstrainedForeignId('created_centro_custo_id');
|
||||
$table->dropConstrainedForeignId('updated_lotacao_id');
|
||||
$table->dropConstrainedForeignId('updated_centro_custo_id');
|
||||
});
|
||||
|
||||
Schema::rename('farmacia_bnafar_posicao_estoque', 'integracao_bnafar_posicao_estoque');
|
||||
|
||||
Schema::table('integracao_bnafar_posicao_estoque', function (Blueprint $table) {
|
||||
$table->foreign('protocolo_id')->references('id')->on('integracao_bnafar_protocolo');
|
||||
$table->foreign('centro_custo_id')->references('id')->on('cadastro_centro_custo');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class RenameFarmaciaBnafarPosicaoEstoqueItemTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('farmacia_bnafar_posicao_estoque_item', function (Blueprint $table) {
|
||||
$table->dropForeign(['posicao_estoque_id']);
|
||||
$table->dropForeign(['material_id']);
|
||||
$table->dropForeign(['fabricante_id']);
|
||||
$table->dropConstrainedForeignId('created_lotacao_id');
|
||||
$table->dropConstrainedForeignId('created_centro_custo_id');
|
||||
$table->dropConstrainedForeignId('updated_lotacao_id');
|
||||
$table->dropConstrainedForeignId('updated_centro_custo_id');
|
||||
});
|
||||
|
||||
Schema::rename('farmacia_bnafar_posicao_estoque_item', 'integracao_bnafar_posicao_estoque_item');
|
||||
|
||||
Schema::table('integracao_bnafar_posicao_estoque_item', function (Blueprint $table) {
|
||||
$table->foreign('posicao_estoque_id')->references('id')->on('integracao_bnafar_posicao_estoque');
|
||||
$table->foreign('material_id')->references('id')->on('cadastro_material');
|
||||
$table->foreign('fabricante_id')->references('id')->on('cadastro_fabricante');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Integracao\Bnafar\Parametrizacao;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class DropFarmaciaParametrizacaoBnafarTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$farmaciaParametrizacaoBnafar = DB::table('farmacia_parametrizacao_bnafar')
|
||||
->select([
|
||||
'usuario',
|
||||
'senha',
|
||||
'informa_movimentacoes',
|
||||
])
|
||||
->first();
|
||||
|
||||
if (!is_null($farmaciaParametrizacaoBnafar)) {
|
||||
Parametrizacao::create([
|
||||
'usuario' => $farmaciaParametrizacaoBnafar->usuario,
|
||||
'senha' => $farmaciaParametrizacaoBnafar->senha,
|
||||
'ativo' => $farmaciaParametrizacaoBnafar->informa_movimentacoes,
|
||||
]);
|
||||
}
|
||||
|
||||
Schema::dropIfExists('farmacia_parametrizacao_bnafar');
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaParametrizacaoAppCidadaoTable extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_parametrizacao_app_cidadao', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->boolean('permite_envio_receitas_medicas')->default(false);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_parametrizacao_app_cidadao');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaReceitaTratamentoInicioTable extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_receita_tratamento_inicio', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('receita_item_id')->constrained('farmacia_receita_item');
|
||||
$table->foreignId('paciente_id')->constrained('cadastro_paciente');
|
||||
$table->datetime('inicio_em');
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_receita_tratamento_inicio');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaReceitaMonitoramentoPosologiaTable extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_receita_monitoramento_posologia', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('receita_item_id')->constrained('farmacia_receita_item');
|
||||
$table->foreignId('paciente_id')->constrained('cadastro_paciente');
|
||||
$table->datetime('confirmado_em');
|
||||
$table->integer('dose_numero');
|
||||
$table->string('observacao')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_receita_monitoramento_posologia');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFarmaciaAppCidadaoLogTable extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::create('farmacia_app_cidadao_log', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('paciente_id')->constrained('cadastro_paciente');
|
||||
$table->foreignId('receita_id')->nullable()->constrained('farmacia_receita');
|
||||
$table->foreignId('receita_item_id')->nullable()->constrained('farmacia_receita_item');
|
||||
$table->string('tipo_acao');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('farmacia_app_cidadao_log');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddInterrompidoEmToFarmaciaReceitaTratamentoInicioTable extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::table('farmacia_receita_tratamento_inicio', function (Blueprint $table) {
|
||||
$table->datetime('interrompido_em')->nullable()->after('inicio_em');
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::table('farmacia_receita_tratamento_inicio', function (Blueprint $table) {
|
||||
$table->dropColumn('interrompido_em');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddAderiuTratamentoToFarmaciaReceitaTratamentoInicioTable extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::table('farmacia_receita_tratamento_inicio', function (Blueprint $table) {
|
||||
$table->boolean('aderiu_tratamento')->nullable()->after('interrompido_em');
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::table('farmacia_receita_tratamento_inicio', function (Blueprint $table) {
|
||||
$table->dropColumn('aderiu_tratamento');
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user