This commit is contained in:
35
api/app/Models/Integracao/Bnafar/Medicamento.php
Normal file
35
api/app/Models/Integracao/Bnafar/Medicamento.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Bnafar;
|
||||
|
||||
use App\Models\Cadastro\Material\Material;
|
||||
use App\Models\Cadastro\Material\MaterialIntegracaoBnafarMedicamento;
|
||||
use App\Models\Model;
|
||||
|
||||
class Medicamento extends Model
|
||||
{
|
||||
protected $table = 'integracao_bnafar_medicamento';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'codigo',
|
||||
'descricao',
|
||||
'codigo_catmat',
|
||||
'cnpj_nome_fabricante',
|
||||
'codigo_registro_sanitario',
|
||||
'codigo_barras_primario',
|
||||
'codigo_barras_secundario',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
public function materiais()
|
||||
{
|
||||
return $this->belongsToMany(Material::class, 'cadastro_material_integracao_bnafar_medicamento', 'medicamento_id', 'material_id')
|
||||
->using(MaterialIntegracaoBnafarMedicamento::class)
|
||||
->withTimestamps();
|
||||
}
|
||||
}
|
||||
20
api/app/Models/Integracao/Bnafar/OperacaoTipo.php
Normal file
20
api/app/Models/Integracao/Bnafar/OperacaoTipo.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Bnafar;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class OperacaoTipo extends Model
|
||||
{
|
||||
protected $table = 'integracao_bnafar_operacao_tipo';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'descricao',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
29
api/app/Models/Integracao/Bnafar/Parametrizacao.php
Normal file
29
api/app/Models/Integracao/Bnafar/Parametrizacao.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Bnafar;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class Parametrizacao extends Model
|
||||
{
|
||||
protected $table = 'integracao_bnafar_parametrizacao';
|
||||
|
||||
protected $casts = [
|
||||
'ativo' => 'boolean',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'usuario',
|
||||
'senha',
|
||||
'ativo',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
}
|
||||
28
api/app/Models/Integracao/Bnafar/PosicaoEstoque.php
Normal file
28
api/app/Models/Integracao/Bnafar/PosicaoEstoque.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Bnafar;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class PosicaoEstoque extends Model
|
||||
{
|
||||
protected $table = 'integracao_bnafar_posicao_estoque';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'protocolo_id',
|
||||
'centro_custo_id',
|
||||
'data_posicao_estoque',
|
||||
'codigo_registro',
|
||||
'processado_sucesso',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
}
|
||||
32
api/app/Models/Integracao/Bnafar/PosicaoEstoqueItem.php
Normal file
32
api/app/Models/Integracao/Bnafar/PosicaoEstoqueItem.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Bnafar;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class PosicaoEstoqueItem extends Model
|
||||
{
|
||||
protected $table = 'integracao_bnafar_posicao_estoque_item';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'posicao_estoque_id',
|
||||
'material_id',
|
||||
'fabricante_id',
|
||||
'integracao_bnafar_medicamento_id',
|
||||
'lote',
|
||||
'data_validade',
|
||||
'quantidade',
|
||||
'valor_unitario',
|
||||
'mensagem',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
}
|
||||
20
api/app/Models/Integracao/Bnafar/ProcessamentoStatus.php
Normal file
20
api/app/Models/Integracao/Bnafar/ProcessamentoStatus.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Bnafar;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class ProcessamentoStatus extends Model
|
||||
{
|
||||
protected $table = 'integracao_bnafar_processamento_status';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'descricao',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
29
api/app/Models/Integracao/Bnafar/Protocolo.php
Normal file
29
api/app/Models/Integracao/Bnafar/Protocolo.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Bnafar;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class Protocolo extends Model
|
||||
{
|
||||
protected $table = 'integracao_bnafar_protocolo';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'processamento_status_id',
|
||||
'servico_tipo_id',
|
||||
'operacao_tipo_id',
|
||||
'protocolo',
|
||||
'data_protocolo',
|
||||
'erro',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
}
|
||||
21
api/app/Models/Integracao/Bnafar/ProtocoloResposta.php
Normal file
21
api/app/Models/Integracao/Bnafar/ProtocoloResposta.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Bnafar;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ProtocoloResposta extends Model
|
||||
{
|
||||
protected $table = 'integracao_bnafar_protocolo_resposta';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'protocolo_id',
|
||||
'resposta',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
21
api/app/Models/Integracao/Bnafar/Resposta.php
Normal file
21
api/app/Models/Integracao/Bnafar/Resposta.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Bnafar;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Resposta extends Model
|
||||
{
|
||||
protected $table = 'integracao_bnafar_resposta';
|
||||
|
||||
protected $fillable = [
|
||||
'codigo',
|
||||
'mensagem',
|
||||
'descricao',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
31
api/app/Models/Integracao/Bnafar/Saida.php
Normal file
31
api/app/Models/Integracao/Bnafar/Saida.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Bnafar;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class Saida extends Model
|
||||
{
|
||||
protected $table = 'integracao_bnafar_saida';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'protocolo_id',
|
||||
'saida_tipo_id',
|
||||
'almoxarifado_saida_id',
|
||||
'centro_custo_id',
|
||||
'centro_custo_destino_id',
|
||||
'data_saida',
|
||||
'codigo_registro',
|
||||
'processado_sucesso',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
}
|
||||
33
api/app/Models/Integracao/Bnafar/SaidaItem.php
Normal file
33
api/app/Models/Integracao/Bnafar/SaidaItem.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Bnafar;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class SaidaItem extends Model
|
||||
{
|
||||
protected $table = 'integracao_bnafar_saida_item';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'saida_id',
|
||||
'almoxarifado_saida_item_id',
|
||||
'material_id',
|
||||
'fabricante_id',
|
||||
'integracao_bnafar_medicamento_id',
|
||||
'lote',
|
||||
'data_validade',
|
||||
'quantidade',
|
||||
'valor_unitario',
|
||||
'mensagem',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
}
|
||||
21
api/app/Models/Integracao/Bnafar/SaidaTipo.php
Normal file
21
api/app/Models/Integracao/Bnafar/SaidaTipo.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Bnafar;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class SaidaTipo extends Model
|
||||
{
|
||||
protected $table = 'integracao_bnafar_saida_tipo';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'codigo',
|
||||
'descricao',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
20
api/app/Models/Integracao/Bnafar/ServicoTipo.php
Normal file
20
api/app/Models/Integracao/Bnafar/ServicoTipo.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Bnafar;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class ServicoTipo extends Model
|
||||
{
|
||||
protected $table = 'integracao_bnafar_servico_tipo';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'descricao',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
30
api/app/Models/Integracao/Cns/Parametrizacao.php
Normal file
30
api/app/Models/Integracao/Cns/Parametrizacao.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Cns;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class Parametrizacao extends Model
|
||||
{
|
||||
protected $table = 'integracao_cns_parametrizacao';
|
||||
|
||||
protected $fillable = [
|
||||
'senha',
|
||||
'identificador_solicitante',
|
||||
'cns_solicitante',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
|
||||
public function getIsAllowedToDeleteAttribute()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
95
api/app/Models/Integracao/Erpsaude/Atendimento.php
Normal file
95
api/app/Models/Integracao/Erpsaude/Atendimento.php
Normal file
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Erpsaude;
|
||||
|
||||
use App\Models\Integracao\Erpsaude\Medicamento;
|
||||
use App\Models\Integracao\Erpsaude\Paciente;
|
||||
use App\Models\Integracao\Erpsaude\Reavaliacao;
|
||||
use App\Models\Integracao\Erpsaude\TipoAlta;
|
||||
use App\Models\Integracao\Erpsaude\TipoAtendimento;
|
||||
use App\Models\Integracao\Erpsaude\UnidadeAtendimento;
|
||||
use App\Models\Integracao\Erpsaude\UnidadeEncaminhadora;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Atendimento extends Model
|
||||
{
|
||||
protected $table = 'integracao_erpsaude_atendimento';
|
||||
|
||||
protected $fillable = [
|
||||
'data',
|
||||
'hora',
|
||||
'data_alta',
|
||||
'hora_alta',
|
||||
'data_atendimento',
|
||||
'horario_atendimento',
|
||||
'cod_tipo_encaminhamento',
|
||||
'cod_grupo_atendimento',
|
||||
'paciente_id',
|
||||
'tipo_atendimento_id',
|
||||
'unidade_encaminhadora_id',
|
||||
'unidade_atendimento_id',
|
||||
'tipo_alta_id',
|
||||
'unidade_atendimento',
|
||||
'cnes_un_atendimento',
|
||||
'suspeita_maus_tratos',
|
||||
'hipotese_diagnostica',
|
||||
'cid10',
|
||||
'descricao_procedimento',
|
||||
'descricao_exame_clinico',
|
||||
'conduta_medica',
|
||||
'codigo_conta_prof',
|
||||
'profissional',
|
||||
'conselho',
|
||||
'uf_conselho',
|
||||
'convenio',
|
||||
'registro_ans',
|
||||
'cod_convenio',
|
||||
'nome_setor',
|
||||
'codigo_setor',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
public function paciente()
|
||||
{
|
||||
return $this->belongsTo(Paciente::class);
|
||||
}
|
||||
|
||||
public function tipoAtendimento()
|
||||
{
|
||||
return $this->belongsTo(TipoAtendimento::class);
|
||||
}
|
||||
|
||||
public function unidadeEncaminhadora()
|
||||
{
|
||||
return $this->belongsTo(UnidadeEncaminhadora::class);
|
||||
}
|
||||
|
||||
public function unidadeAtendimento()
|
||||
{
|
||||
return $this->belongsTo(UnidadeAtendimento::class);
|
||||
}
|
||||
|
||||
public function tipoAlta()
|
||||
{
|
||||
return $this->belongsTo(TipoAlta::class);
|
||||
}
|
||||
|
||||
public function reavaliacoes()
|
||||
{
|
||||
return $this->hasMany(Reavaliacao::class, 'atendimento_id');
|
||||
}
|
||||
|
||||
public function medicamentos()
|
||||
{
|
||||
return $this->hasMany(Medicamento::class, 'atendimento_id');
|
||||
}
|
||||
|
||||
public function exames()
|
||||
{
|
||||
return $this->hasMany(Exame::class, 'atendimento_id');
|
||||
}
|
||||
}
|
||||
27
api/app/Models/Integracao/Erpsaude/Exame.php
Normal file
27
api/app/Models/Integracao/Erpsaude/Exame.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Erpsaude;
|
||||
|
||||
use App\Models\Integracao\Erpsaude\Atendimento;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Exame extends Model
|
||||
{
|
||||
protected $table = 'integracao_erpsaude_exames';
|
||||
|
||||
protected $fillable = [
|
||||
'atendimento_id',
|
||||
'exame',
|
||||
'tipo',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
public function atendimentos()
|
||||
{
|
||||
return $this->hasMany(Atendimento::class);
|
||||
}
|
||||
}
|
||||
30
api/app/Models/Integracao/Erpsaude/Medicamento.php
Normal file
30
api/app/Models/Integracao/Erpsaude/Medicamento.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Erpsaude;
|
||||
|
||||
use App\Models\Integracao\Erpsaude\Atendimento;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Medicamento extends Model
|
||||
{
|
||||
protected $table = 'integracao_erpsaude_medicamentos';
|
||||
|
||||
protected $fillable = [
|
||||
'atendimento_id',
|
||||
'medicamento',
|
||||
'quantidade',
|
||||
'unidade_medida',
|
||||
'medicamento_id',
|
||||
'tipo',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
public function atendimentos()
|
||||
{
|
||||
return $this->hasMany(Atendimento::class);
|
||||
}
|
||||
}
|
||||
39
api/app/Models/Integracao/Erpsaude/Paciente.php
Normal file
39
api/app/Models/Integracao/Erpsaude/Paciente.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Erpsaude;
|
||||
|
||||
use App\Models\Integracao\Erpsaude\Atendimento;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Paciente extends Model
|
||||
{
|
||||
protected $table = 'integracao_erpsaude_paciente';
|
||||
|
||||
protected $fillable = [
|
||||
'nome',
|
||||
'data_nascimento',
|
||||
'sexo',
|
||||
'mae',
|
||||
'cns',
|
||||
'cpf',
|
||||
'telefone',
|
||||
'email',
|
||||
'endereco',
|
||||
'numero',
|
||||
'complemento',
|
||||
'bairro',
|
||||
'cidade',
|
||||
'estado',
|
||||
'cep',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
public function atendimentos()
|
||||
{
|
||||
return $this->hasMany(Atendimento::class);
|
||||
}
|
||||
}
|
||||
31
api/app/Models/Integracao/Erpsaude/Reavaliacao.php
Normal file
31
api/app/Models/Integracao/Erpsaude/Reavaliacao.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Erpsaude;
|
||||
|
||||
use App\Models\Integracao\Erpsaude\Atendimento;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Reavaliacao extends Model
|
||||
{
|
||||
protected $table = 'integracao_erpsaude_reavaliacoes';
|
||||
|
||||
protected $fillable = [
|
||||
'atendimento_id',
|
||||
'data',
|
||||
'hora',
|
||||
'reavaliacao',
|
||||
'profissional',
|
||||
'numero_conselho',
|
||||
'uf_conselho',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
public function atendimentos()
|
||||
{
|
||||
return $this->hasMany(Atendimento::class);
|
||||
}
|
||||
}
|
||||
20
api/app/Models/Integracao/Erpsaude/TipoAlta.php
Normal file
20
api/app/Models/Integracao/Erpsaude/TipoAlta.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Erpsaude;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class TipoAlta extends Model
|
||||
{
|
||||
protected $table = 'integracao_erpsaude_tipo_alta';
|
||||
|
||||
protected $fillable = [
|
||||
'descricao',
|
||||
'codigo',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
20
api/app/Models/Integracao/Erpsaude/TipoAtendimento.php
Normal file
20
api/app/Models/Integracao/Erpsaude/TipoAtendimento.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Erpsaude;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class TipoAtendimento extends Model
|
||||
{
|
||||
protected $table = 'integracao_erpsaude_tipo_atendimento';
|
||||
|
||||
protected $fillable = [
|
||||
'descricao',
|
||||
'codigo',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
20
api/app/Models/Integracao/Erpsaude/UnidadeAtendimento.php
Normal file
20
api/app/Models/Integracao/Erpsaude/UnidadeAtendimento.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Erpsaude;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class UnidadeAtendimento extends Model
|
||||
{
|
||||
protected $table = 'integracao_erpsaude_unidade_atendimento';
|
||||
|
||||
protected $fillable = [
|
||||
'descricao',
|
||||
'codigo',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
20
api/app/Models/Integracao/Erpsaude/UnidadeEncaminhadora.php
Normal file
20
api/app/Models/Integracao/Erpsaude/UnidadeEncaminhadora.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Erpsaude;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class UnidadeEncaminhadora extends Model
|
||||
{
|
||||
protected $table = 'integracao_erpsaude_unidade_encaminhadora';
|
||||
|
||||
protected $fillable = [
|
||||
'descricao',
|
||||
'codigo',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
215
api/app/Models/Integracao/Esus/Inconsistencia.php
Normal file
215
api/app/Models/Integracao/Esus/Inconsistencia.php
Normal file
@@ -0,0 +1,215 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Esus;
|
||||
|
||||
use App\Models\AtencaoBasica\AtendimentoDomiciliar\AtendimentoDomiciliar;
|
||||
use App\Models\AtencaoBasica\AtendimentoDomiciliar\AtendimentoDomiciliarAtendimento;
|
||||
use App\Models\AtencaoBasica\AtendimentoIndividual\AtendimentoIndividual;
|
||||
use App\Models\AtencaoBasica\AtendimentoOdontologico\AtendimentoOdontologico;
|
||||
use App\Models\AtencaoBasica\AtividadeColetiva\AtividadeColetiva;
|
||||
use App\Models\AtencaoBasica\AtividadeColetiva\Participante;
|
||||
use App\Models\AtencaoBasica\Avaliacao\Avaliacao;
|
||||
use App\Models\AtencaoBasica\CadastroDomiciliar\CadastroDomiciliar;
|
||||
use App\Models\AtencaoBasica\CadastroIndividual\CadastroIndividual;
|
||||
use App\Models\AtencaoBasica\FichaComplementar\FichaComplementar;
|
||||
use App\Models\AtencaoBasica\FichaVacinacao\FichaVacinacao;
|
||||
use App\Models\AtencaoBasica\FichaVacinacao\VacinacaoPaciente;
|
||||
use App\Models\AtencaoBasica\MarcadorConsumoAlimentar\MarcadorConsumoAlimentar;
|
||||
use App\Models\AtencaoBasica\Parametrizacao\Equipe;
|
||||
use App\Models\AtencaoBasica\Procedimento\Procedimento;
|
||||
use App\Models\AtencaoBasica\Procedimento\ProcedimentoAtendimento;
|
||||
use App\Models\AtencaoBasica\VisitaDomiciliar\VisitaDomiciliar;
|
||||
use App\Models\Cadastro\SujeitoAtencao\Paciente;
|
||||
use App\Models\Cadastro\SujeitoAtencao\Usuario;
|
||||
use App\Models\Model;
|
||||
use App\Models\Sigtap\Ocupacao;
|
||||
|
||||
class Inconsistencia extends Model
|
||||
{
|
||||
protected $table = 'integracao_esus_inconsistencia';
|
||||
|
||||
protected $casts = [
|
||||
'data_atendimento' => 'datetime:d/m/Y'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'origem_id',
|
||||
'data_atendimento',
|
||||
'usuario_id',
|
||||
'ocupacao_id',
|
||||
'equipe_id',
|
||||
'atendimento_domiciliar_id',
|
||||
'atividade_coletiva_id',
|
||||
'avaliacao_id',
|
||||
'procedimento_id',
|
||||
'ficha_vacinacao_id',
|
||||
'ficha_complementar_id',
|
||||
'cadastro_domiciliar_id',
|
||||
'cadastro_individual_id',
|
||||
'consumo_alimentar_id',
|
||||
'inconsistencia',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
|
||||
public function origem()
|
||||
{
|
||||
return $this->belongsTo(Origem::class);
|
||||
}
|
||||
|
||||
public function usuario()
|
||||
{
|
||||
return $this->belongsTo(Usuario::class);
|
||||
}
|
||||
|
||||
public function ocupacao()
|
||||
{
|
||||
return $this->belongsTo(Ocupacao::class);
|
||||
}
|
||||
|
||||
public function equipe()
|
||||
{
|
||||
return $this->belongsTo(Equipe::class);
|
||||
}
|
||||
|
||||
public function atendimentoDomiciliar()
|
||||
{
|
||||
return $this->belongsTo(AtendimentoDomiciliar::class);
|
||||
}
|
||||
|
||||
public function atividadeColetiva()
|
||||
{
|
||||
return $this->belongsTo(AtividadeColetiva::class);
|
||||
}
|
||||
|
||||
public function avaliacao()
|
||||
{
|
||||
return $this->belongsTo(Avaliacao::class);
|
||||
}
|
||||
|
||||
public function procedimento()
|
||||
{
|
||||
return $this->belongsTo(Procedimento::class);
|
||||
}
|
||||
|
||||
public function fichaVacinacao()
|
||||
{
|
||||
return $this->belongsTo(FichaVacinacao::class);
|
||||
}
|
||||
|
||||
public function fichaComplementar()
|
||||
{
|
||||
return $this->belongsTo(FichaComplementar::class);
|
||||
}
|
||||
|
||||
public function cadastroDomiciliar()
|
||||
{
|
||||
return $this->belongsTo(CadastroDomiciliar::class);
|
||||
}
|
||||
|
||||
public function cadastroIndividual()
|
||||
{
|
||||
return $this->belongsTo(CadastroIndividual::class);
|
||||
}
|
||||
|
||||
public function consumoAlimentar()
|
||||
{
|
||||
return $this->belongsTo(MarcadorConsumoAlimentar::class);
|
||||
}
|
||||
|
||||
public function atendimentosIndividuais()
|
||||
{
|
||||
return $this->belongsToMany(AtendimentoIndividual::class, 'integracao_esus_inconsistencia_atendimento_individual')
|
||||
->using(InconsistenciaAtendimentoIndividual::class)
|
||||
->withPivot(['posicao'])
|
||||
->withTimestamps();
|
||||
}
|
||||
|
||||
public function atendimentosOdontologicos()
|
||||
{
|
||||
return $this->belongsToMany(AtendimentoOdontologico::class, 'integracao_esus_inconsistencia_atendimento_odontologico')
|
||||
->using(InconsistenciaAtendimentoOdontologico::class)
|
||||
->withPivot(['posicao'])
|
||||
->withTimestamps();
|
||||
}
|
||||
|
||||
public function visitasDomiciliares()
|
||||
{
|
||||
return $this->belongsToMany(VisitaDomiciliar::class, 'integracao_esus_inconsistencia_visita_domiciliar')
|
||||
->using(InconsistenciaVisitaDomiciliar::class)
|
||||
->withPivot(['posicao'])
|
||||
->withTimestamps();
|
||||
}
|
||||
|
||||
public function atendimentoDomiciliarAtendimentos()
|
||||
{
|
||||
return $this->belongsToMany(
|
||||
AtendimentoDomiciliarAtendimento::class,
|
||||
'integracao_esus_inconsistencia_atendimento_domiciliar_atend',
|
||||
'inconsistencia_id',
|
||||
'atendimento_domiciliar_atendimento_id'
|
||||
)
|
||||
->using(InconsistenciaAtendimentoDomiciliarAtendimento::class)
|
||||
->withPivot(['posicao'])
|
||||
->withTimestamps();
|
||||
}
|
||||
|
||||
public function procedimentoAtendimentos()
|
||||
{
|
||||
return $this->belongsToMany(
|
||||
ProcedimentoAtendimento::class,
|
||||
'integracao_esus_inconsistencia_procedimento_atendimento',
|
||||
'inconsistencia_id',
|
||||
'procedimento_atendimento_id'
|
||||
)
|
||||
->using(InconsistenciaProcedimentoAtendimento::class)
|
||||
->withPivot(['posicao'])
|
||||
->withTimestamps();
|
||||
}
|
||||
|
||||
public function atividadeColetivaParticipantes()
|
||||
{
|
||||
return $this->belongsToMany(
|
||||
Participante::class,
|
||||
'integracao_esus_inconsistencia_atividade_coletiva_participante',
|
||||
'inconsistencia_id',
|
||||
'atividade_coletiva_participante_id'
|
||||
)
|
||||
->using(InconsistenciaAtividadeColetivaParticipante::class)
|
||||
->withPivot(['posicao'])
|
||||
->withTimestamps();
|
||||
}
|
||||
|
||||
public function fichaVacinacaoPacientes()
|
||||
{
|
||||
return $this->belongsToMany(
|
||||
VacinacaoPaciente::class,
|
||||
'integracao_esus_inconsistencia_ficha_vacinacao_paciente',
|
||||
'inconsistencia_id',
|
||||
'ficha_vacinacao_paciente_id'
|
||||
)
|
||||
->using(InconsistenciaFichaVacinacaoPaciente::class)
|
||||
->withPivot(['posicao'])
|
||||
->withTimestamps();
|
||||
}
|
||||
|
||||
public function cadastroDomiciliarPacientes()
|
||||
{
|
||||
return $this->belongsToMany(
|
||||
Paciente::class,
|
||||
'integracao_esus_inconsistencia_cadastro_domiciliar_paciente',
|
||||
'inconsistencia_id',
|
||||
'paciente_id'
|
||||
)
|
||||
->using(InconsistenciaCadastroDomiciliarPaciente::class)
|
||||
->withPivot(['posicao'])
|
||||
->withTimestamps();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Esus;
|
||||
|
||||
use App\Models\Pivot;
|
||||
|
||||
class InconsistenciaAtendimentoDomiciliarAtendimento extends Pivot
|
||||
{
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Esus;
|
||||
|
||||
use App\Models\Pivot;
|
||||
|
||||
class InconsistenciaAtendimentoIndividual extends Pivot
|
||||
{
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Esus;
|
||||
|
||||
use App\Models\Pivot;
|
||||
|
||||
class InconsistenciaAtendimentoOdontologico extends Pivot
|
||||
{
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Esus;
|
||||
|
||||
use App\Models\Pivot;
|
||||
|
||||
class InconsistenciaAtividadeColetivaParticipante extends Pivot
|
||||
{
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Esus;
|
||||
|
||||
use App\Models\Pivot;
|
||||
|
||||
class InconsistenciaCadastroDomiciliarPaciente extends Pivot
|
||||
{
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Esus;
|
||||
|
||||
use App\Models\Pivot;
|
||||
|
||||
class InconsistenciaFichaVacinacaoPaciente extends Pivot
|
||||
{
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Esus;
|
||||
|
||||
use App\Models\Pivot;
|
||||
|
||||
class InconsistenciaProcedimentoAtendimento extends Pivot
|
||||
{
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Esus;
|
||||
|
||||
use App\Models\Pivot;
|
||||
|
||||
class InconsistenciaVisitaDomiciliar extends Pivot
|
||||
{
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
}
|
||||
20
api/app/Models/Integracao/Esus/Origem.php
Normal file
20
api/app/Models/Integracao/Esus/Origem.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Esus;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class Origem extends Model
|
||||
{
|
||||
protected $table = 'integracao_esus_origem';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'nome',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
30
api/app/Models/Integracao/Esus/Parametrizacao.php
Normal file
30
api/app/Models/Integracao/Esus/Parametrizacao.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Esus;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class Parametrizacao extends Model
|
||||
{
|
||||
protected $table = 'integracao_esus_parametrizacao';
|
||||
|
||||
protected $casts = [
|
||||
'ativo' => 'boolean',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'ativo',
|
||||
'url_instalacao',
|
||||
'usuario',
|
||||
'senha',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
}
|
||||
40
api/app/Models/Integracao/Ria/DocumentoImunologicoRotina.php
Normal file
40
api/app/Models/Integracao/Ria/DocumentoImunologicoRotina.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Ria;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class DocumentoImunologicoRotina extends Model
|
||||
{
|
||||
protected $table = 'integracao_ria_documento_imunologico_rotina';
|
||||
|
||||
protected $casts = [
|
||||
'excluir' => 'boolean',
|
||||
'alterar' => 'boolean',
|
||||
'atualizado' => 'boolean',
|
||||
'usuario_atualizou' => 'boolean',
|
||||
'tentou_substituir' => 'boolean',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'registro_aplicacao_id',
|
||||
'registro_atualizacao_id',
|
||||
'identificador_rnds',
|
||||
'identificador_solicitante',
|
||||
'cns_solicitante',
|
||||
'identificador_documento',
|
||||
'identificador_composicao',
|
||||
'identificador_imunizacao',
|
||||
'data_hora_envio',
|
||||
'excluir',
|
||||
'alterar',
|
||||
'atualizado',
|
||||
'usuario_atualizou',
|
||||
'tentou_substituir',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Ria;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class DocumentoImunologicoRotinaResposta extends Model
|
||||
{
|
||||
protected $table = 'integracao_ria_documento_imunologico_rotina_resposta';
|
||||
|
||||
protected $fillable = [
|
||||
'documento_imunologico_rotina_id',
|
||||
'tipo',
|
||||
'resposta',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
25
api/app/Models/Integracao/Ria/Parametrizacao.php
Normal file
25
api/app/Models/Integracao/Ria/Parametrizacao.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Ria;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class Parametrizacao extends Model
|
||||
{
|
||||
protected $table = 'integracao_ria_parametrizacao';
|
||||
|
||||
protected $fillable = [
|
||||
'senha',
|
||||
'identificador_solicitante',
|
||||
'cns_solicitante',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
}
|
||||
21
api/app/Models/Integracao/Ria/Reposta.php
Normal file
21
api/app/Models/Integracao/Ria/Reposta.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Ria;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Reposta extends Model
|
||||
{
|
||||
protected $table = 'integracao_ria_resposta';
|
||||
|
||||
protected $fillable = [
|
||||
'codigo',
|
||||
'mensagem',
|
||||
'desricao',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
25
api/app/Models/Integracao/Rira/Documento.php
Normal file
25
api/app/Models/Integracao/Rira/Documento.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Rira;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class Documento extends Model
|
||||
{
|
||||
protected $table = 'integracao_rira_documento';
|
||||
|
||||
protected $fillable = [
|
||||
'regulacao_solicitacao_item_id',
|
||||
'identificador',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
public function envios()
|
||||
{
|
||||
return $this->hasMany(DocumentoEnvio::class);
|
||||
}
|
||||
}
|
||||
37
api/app/Models/Integracao/Rira/DocumentoEnvio.php
Normal file
37
api/app/Models/Integracao/Rira/DocumentoEnvio.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Rira;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class DocumentoEnvio extends Model
|
||||
{
|
||||
protected $table = 'integracao_rira_documento_envio';
|
||||
|
||||
protected $casts = [
|
||||
'enviado_com_sucesso' => 'boolean',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'documento_id',
|
||||
'url_rnds',
|
||||
'identificador_rnds',
|
||||
'regulacao_status_enviado_id',
|
||||
'identificador_solicitante',
|
||||
'cns_solicitante',
|
||||
'data_hora_envio',
|
||||
'enviado_com_sucesso',
|
||||
'request',
|
||||
'response',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
public function documento()
|
||||
{
|
||||
return $this->belongsTo(Documento::class);
|
||||
}
|
||||
}
|
||||
25
api/app/Models/Integracao/Rira/Parametrizacao.php
Normal file
25
api/app/Models/Integracao/Rira/Parametrizacao.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Integracao\Rira;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class Parametrizacao extends Model
|
||||
{
|
||||
protected $table = 'integracao_rira_parametrizacao';
|
||||
|
||||
protected $fillable = [
|
||||
'senha',
|
||||
'identificador_solicitante',
|
||||
'cns_solicitante',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user