This commit is contained in:
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',
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user