This commit is contained in:
131
api/app/Models/ExameImagem/Agendamento/Agendamento.php
Normal file
131
api/app/Models/ExameImagem/Agendamento/Agendamento.php
Normal file
@@ -0,0 +1,131 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameImagem\Agendamento;
|
||||
|
||||
|
||||
use App\Models\Cadastro\Estabelecimento\Infraestrutura;
|
||||
use App\Models\Cadastro\Estabelecimento\Unidade;
|
||||
use App\Models\Cadastro\Grupo\Grupo;
|
||||
use App\Models\Cadastro\SujeitoAtencao\Paciente;
|
||||
use App\Models\Cadastro\SujeitoAtencao\Usuario;
|
||||
use App\Models\ExameImagem\Agendamento\AgendamentoExame;
|
||||
use App\Models\ExameImagem\Jornada\Jornada;
|
||||
use App\Models\Model;
|
||||
use App\Models\Parametrizacao\Exame\Exame;
|
||||
use App\Models\Regulacao\Solicitacao as RegulacaoSolicitacao;
|
||||
use App\Models\Sms\SmsEnvio;
|
||||
|
||||
class Agendamento extends Model
|
||||
{
|
||||
protected $table = 'exame_imagem_agendamento';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'paciente_id',
|
||||
'unidade_id',
|
||||
'infraestrutura_id',
|
||||
'unidade_solicitante_id',
|
||||
'infraestrutura_solicitante_id',
|
||||
'exame_id',
|
||||
'medico_id',
|
||||
'hora_exame',
|
||||
'jornada_id',
|
||||
'profissional_id',
|
||||
'gestante',
|
||||
'urgente',
|
||||
'observacao',
|
||||
'agendamento_numero',
|
||||
'supervisor_id',
|
||||
'nome_responsavel',
|
||||
'retroativo',
|
||||
'agendador_id',
|
||||
'regulacao_solicitacao_id',
|
||||
'sms_envio_id',
|
||||
'app_conectasus_cidadao',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'data' => 'datetime:d/m/Y',
|
||||
'data_menstruacao' => 'datetime:d/m/Y',
|
||||
'gestante' => 'boolean',
|
||||
'urgente' => 'boolean',
|
||||
'retroativo' => 'boolean',
|
||||
'app_conectasus_cidadao' => 'boolean',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
'deleted_at',
|
||||
'deleted_lotacao_id',
|
||||
'deleted_centro_custo_id',
|
||||
];
|
||||
|
||||
public function unidade()
|
||||
{
|
||||
return $this->belongsTo(Unidade::class);
|
||||
}
|
||||
|
||||
public function unidadeSolicitante()
|
||||
{
|
||||
return $this->belongsTo(Unidade::class);
|
||||
}
|
||||
|
||||
public function exame()
|
||||
{
|
||||
return $this->belongsTo(Exame::class);
|
||||
}
|
||||
|
||||
public function infraestruturaSolicitante()
|
||||
{
|
||||
return $this->belongsTo(Infraestrutura::class);
|
||||
}
|
||||
|
||||
public function infraestrutura()
|
||||
{
|
||||
return $this->belongsTo(Infraestrutura::class);
|
||||
}
|
||||
|
||||
public function usuario()
|
||||
{
|
||||
return $this->belongsTo(Usuario::class);
|
||||
}
|
||||
|
||||
public function medico()
|
||||
{
|
||||
return $this->belongsTo(Usuario::class);
|
||||
}
|
||||
|
||||
public function agendamentoExame()
|
||||
{
|
||||
return $this->hasMany(AgendamentoExame::class);
|
||||
}
|
||||
|
||||
public function jornada()
|
||||
{
|
||||
return $this->belongsTo(Jornada::class);
|
||||
}
|
||||
|
||||
public function paciente()
|
||||
{
|
||||
return $this->belongsTo(Paciente::class);
|
||||
}
|
||||
|
||||
public function grupo()
|
||||
{
|
||||
return $this->belongsTo(Grupo::class, 'exame_id');
|
||||
}
|
||||
|
||||
public function regulacaoSolicitacao()
|
||||
{
|
||||
return $this->belongsTo(RegulacaoSolicitacao::class);
|
||||
}
|
||||
|
||||
public function smsEnvio()
|
||||
{
|
||||
return $this->belongsTo(SmsEnvio::class);
|
||||
}
|
||||
}
|
||||
68
api/app/Models/ExameImagem/Agendamento/AgendamentoExame.php
Normal file
68
api/app/Models/ExameImagem/Agendamento/AgendamentoExame.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameImagem\Agendamento;
|
||||
|
||||
use App\Models\Cadastro\SujeitoAtencao\Paciente;
|
||||
use App\Models\Cadastro\SujeitoAtencao\Usuario;
|
||||
use App\Models\ExameImagem\Agendamento\Agendamento;
|
||||
use App\Models\ExameImagem\Fechamento\Faturamento;
|
||||
use App\Models\Parametrizacao\Exame\Exame;
|
||||
use App\Models\Model;
|
||||
|
||||
class AgendamentoExame extends Model
|
||||
{
|
||||
protected $table = 'exame_imagem_agendamento_exame';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'agendamento_id',
|
||||
'soap_solicitacao_exame_item_id',
|
||||
'exame_id',
|
||||
'paciente_id',
|
||||
'status_id',
|
||||
'status_troca',
|
||||
'resultado',
|
||||
'arquivo',
|
||||
'laudo_nome',
|
||||
'usuario_id',
|
||||
'acompanhamento_oci_id'
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'laudo_data' => 'datetime:d/m/Y',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
|
||||
public function exame()
|
||||
{
|
||||
return $this->belongsTo(Exame::class);
|
||||
}
|
||||
|
||||
public function agendamento()
|
||||
{
|
||||
return $this->belongsTo(Agendamento::class);
|
||||
}
|
||||
|
||||
public function faturamentos()
|
||||
{
|
||||
return $this->hasMany(Faturamento::class);
|
||||
}
|
||||
|
||||
public function paciente()
|
||||
{
|
||||
return $this->belongsTo(Paciente::class);
|
||||
}
|
||||
|
||||
public function usuario()
|
||||
{
|
||||
return $this->belongsTo(Usuario::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameImagem\Agendamento;
|
||||
|
||||
use App\Models\Cadastro\SujeitoAtencao\Paciente;
|
||||
use App\Models\Cadastro\SujeitoAtencao\Usuario;
|
||||
use App\Models\ExameImagem\Agendamento\Agendamento;
|
||||
use App\Models\ExameImagem\Agendamento\AgendamentoExame;
|
||||
use App\Models\ExameImagem\Fechamento\Faturamento;
|
||||
use App\Models\Parametrizacao\Exame\Exame;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AgendamentoHistorico extends Model
|
||||
{
|
||||
protected $table = 'exame_imagem_historico_alteracao';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'agendamento_id',
|
||||
'paciente_id',
|
||||
'agendamento_exame_id',
|
||||
'resultado',
|
||||
'arquivo',
|
||||
'laudo_nome',
|
||||
'usuario_id',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'data' => 'datetime:d/m/Y',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
|
||||
|
||||
public function agendamento()
|
||||
{
|
||||
return $this->belongsTo(Agendamento::class);
|
||||
}
|
||||
|
||||
public function paciente()
|
||||
{
|
||||
return $this->belongsTo(Paciente::class);
|
||||
}
|
||||
|
||||
public function agendamentoExame()
|
||||
{
|
||||
return $this->belongsTo(AgendamentoExame::class);
|
||||
}
|
||||
|
||||
public function usuario()
|
||||
{
|
||||
return $this->belongsTo(Usuario::class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameImagem\Agendamento;
|
||||
|
||||
use App\Models\Cadastro\SujeitoAtencao\Usuario;
|
||||
use App\Models\Model;
|
||||
use App\Models\Parametrizacao\Exame\Exame;
|
||||
|
||||
class AgendamentoHistoricoExclusao extends Model
|
||||
{
|
||||
protected $table = 'exame_imagem_agendamento_historico_exclusao';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'agendamento_id',
|
||||
'agendamento_agendador_id',
|
||||
'data_hora_criacao',
|
||||
'paciente_id',
|
||||
'agendamento_numero',
|
||||
'exame_id',
|
||||
'data_hora_exclusao',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'data_hora_criacao' => 'datetime:d/m/Y H:i:s',
|
||||
'data_hora_exclusao' => 'datetime:d/m/Y H:i:s',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
|
||||
public function usuario()
|
||||
{
|
||||
return $this->belongsTo(Usuario::class);
|
||||
}
|
||||
|
||||
public function exame()
|
||||
{
|
||||
return $this->belongsTo(Exame::class);
|
||||
}
|
||||
}
|
||||
59
api/app/Models/ExameImagem/CotaPrestador.php
Normal file
59
api/app/Models/ExameImagem/CotaPrestador.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameImagem;
|
||||
|
||||
use App\Models\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use App\Models\Cadastro\Estabelecimento\Unidade;
|
||||
use App\Models\Cadastro\Estabelecimento\Infraestrutura;
|
||||
use App\Models\ExameImagem\Parametrizacao\TipoCotaPrestador;
|
||||
|
||||
class CotaPrestador extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'exame_imagem_parametrizacao_cota_prestador';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'unidade_id',
|
||||
'infraestrutura_id',
|
||||
'cota_tipo_id',
|
||||
'inicio',
|
||||
'fim',
|
||||
'cota_valor',
|
||||
'cota_unidade',
|
||||
'observacao',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
'deleted_at',
|
||||
'deleted_lotacao_id',
|
||||
'deleted_centro_custo_id',
|
||||
];
|
||||
|
||||
public function unidade()
|
||||
{
|
||||
return $this->belongsTo(Unidade::class);
|
||||
}
|
||||
|
||||
public function infraestrutura()
|
||||
{
|
||||
return $this->belongsTo(Infraestrutura::class);
|
||||
}
|
||||
|
||||
public function tipo()
|
||||
{
|
||||
return $this->belongsTo(TipoCotaPrestador::class);
|
||||
}
|
||||
|
||||
public function getIsAllowedToDeleteAttribute()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
90
api/app/Models/ExameImagem/Fechamento/Faturamento.php
Normal file
90
api/app/Models/ExameImagem/Fechamento/Faturamento.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameImagem\Fechamento;
|
||||
|
||||
use App\Models\Cadastro\Estabelecimento\Unidade;
|
||||
use App\Models\Cadastro\SujeitoAtencao\Lotacao;
|
||||
use App\Models\Cadastro\SujeitoAtencao\Paciente;
|
||||
use App\Models\ExameImagem\Agendamento\Agendamento;
|
||||
use App\Models\ExameImagem\Agendamento\AgendamentoExame;
|
||||
use App\Models\Model;
|
||||
use App\Models\Parametrizacao\Exame\Exame;
|
||||
use App\Models\Sigtap\Ocupacao;
|
||||
|
||||
class Faturamento extends Model
|
||||
{
|
||||
|
||||
protected $table = 'exame_imagem_fechamento_faturamento';
|
||||
|
||||
protected $fillable = [
|
||||
'agendamento_id',
|
||||
'exame_id',
|
||||
'paciente_id',
|
||||
'grupo_id',
|
||||
'unidade_id',
|
||||
'agendamento_exame_id',
|
||||
'bpa_procedimento_id',
|
||||
'apac_procedimento_secundario_id',
|
||||
'procedimento_id',
|
||||
'lotacao_id',
|
||||
'quantidade',
|
||||
'ocupacao_id',
|
||||
'usuario_id',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'data' => 'datetime:d/m/Y',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
'deleted_at',
|
||||
'deleted_lotacao_id',
|
||||
'deleted_centro_custo_id',
|
||||
];
|
||||
|
||||
|
||||
public function ocupacao()
|
||||
{
|
||||
return $this->belongsTo(Ocupacao::class);
|
||||
}
|
||||
|
||||
public function lotacao()
|
||||
{
|
||||
return $this->belongsTo(Lotacao::class);
|
||||
}
|
||||
|
||||
public function exame()
|
||||
{
|
||||
return $this->belongsTo(Exame::class);
|
||||
}
|
||||
|
||||
public function agendamento()
|
||||
{
|
||||
return $this->belongsTo(Agendamento::class);
|
||||
}
|
||||
|
||||
public function unidade()
|
||||
{
|
||||
return $this->belongsTo(Unidade::class);
|
||||
}
|
||||
|
||||
public function agendamentoExame()
|
||||
{
|
||||
return $this->belongsTo(AgendamentoExame::class);
|
||||
}
|
||||
|
||||
public function paciente()
|
||||
{
|
||||
return $this->belongsTo(Paciente::class);
|
||||
}
|
||||
|
||||
public function procedimento()
|
||||
{
|
||||
return $this->belongsTo(SigtapProcedimento::class);
|
||||
}
|
||||
}
|
||||
23
api/app/Models/ExameImagem/Fechamento/StatusFechamento.php
Normal file
23
api/app/Models/ExameImagem/Fechamento/StatusFechamento.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameImagem\Fechamento;
|
||||
|
||||
use App\Models\ExameImagem\Fechamento\Fechamento;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class StatusFechamento extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'exame_imagem_fechamento_status';
|
||||
|
||||
protected $fillable = [
|
||||
'nome'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
109
api/app/Models/ExameImagem/Jornada/Jornada.php
Normal file
109
api/app/Models/ExameImagem/Jornada/Jornada.php
Normal file
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameImagem\Jornada;
|
||||
|
||||
|
||||
use App\Models\Cadastro\Estabelecimento\Infraestrutura;
|
||||
use App\Models\Cadastro\Estabelecimento\Unidade;
|
||||
use App\Models\Cadastro\Grupo\Grupo;
|
||||
use App\Models\Cadastro\SujeitoAtencao\Paciente;
|
||||
use App\Models\Cadastro\SujeitoAtencao\Usuario;
|
||||
use App\Models\ExameImagem\Parametrizacao;
|
||||
use App\Models\ExameImagem\Parametrizacao\ControleJornada\TipoControleJornada;
|
||||
use App\Models\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class Jornada extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'exame_imagem_jornada';
|
||||
|
||||
protected $fillable = [
|
||||
'unidade_id',
|
||||
'infraestrutura_id',
|
||||
'controle_jornada_id',
|
||||
'semana_id',
|
||||
'exame_id',
|
||||
'usuario_id',
|
||||
'status_id',
|
||||
'tipo_id',
|
||||
'prestador_id',
|
||||
'vagas',
|
||||
'vagas_app',
|
||||
'data',
|
||||
'hora_inicial',
|
||||
'hora_fim',
|
||||
'tempo_atendimento',
|
||||
'supervisor_id',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'data' => 'datetime:d/m/Y',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
'deleted_at',
|
||||
'deleted_lotacao_id',
|
||||
'deleted_centro_custo_id',
|
||||
];
|
||||
|
||||
protected $appends = [
|
||||
'dia_semana',
|
||||
];
|
||||
|
||||
public function unidade()
|
||||
{
|
||||
return $this->belongsTo(Unidade::class);
|
||||
}
|
||||
|
||||
public function grupo()
|
||||
{
|
||||
return $this->belongsTo(Grupo::class, 'exame_id');
|
||||
}
|
||||
|
||||
public function infraestrutura()
|
||||
{
|
||||
return $this->belongsTo(Infraestrutura::class);
|
||||
}
|
||||
|
||||
public function usuario()
|
||||
{
|
||||
return $this->belongsTo(Usuario::class);
|
||||
}
|
||||
|
||||
public function paciente()
|
||||
{
|
||||
return $this->belongsTo(Paciente::class);
|
||||
}
|
||||
|
||||
public function status()
|
||||
{
|
||||
return $this->belongsTo(StatusJornada::class);
|
||||
}
|
||||
|
||||
public function tipo()
|
||||
{
|
||||
return $this->belongsTo(TipoJornada::class);
|
||||
}
|
||||
|
||||
public function controle()
|
||||
{
|
||||
return $this->belongsTo(TipoControleJornada::class);
|
||||
}
|
||||
|
||||
public function prestador()
|
||||
{
|
||||
return $this->belongsTo(Parametrizacao::class);
|
||||
}
|
||||
|
||||
public function getDiaSemanaAttribute()
|
||||
{
|
||||
return $this->data->dayOfWeek + 1;
|
||||
}
|
||||
}
|
||||
27
api/app/Models/ExameImagem/Jornada/SemanaJornada.php
Normal file
27
api/app/Models/ExameImagem/Jornada/SemanaJornada.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameImagem\Jornada;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class SemanaJornada extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'exame_imagem_jornada_semana';
|
||||
|
||||
protected $fillable = [
|
||||
'nome'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
public function jornadaExameImagem()
|
||||
{
|
||||
return $this->hasMany(Jornada::class);
|
||||
}
|
||||
}
|
||||
28
api/app/Models/ExameImagem/Jornada/StatusJornada.php
Normal file
28
api/app/Models/ExameImagem/Jornada/StatusJornada.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameImagem\Jornada;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use App\Models\ExameImagem\Jornada\Jornada;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class StatusJornada extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'exame_imagem_jornada_status';
|
||||
|
||||
protected $fillable = [
|
||||
'nome'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
public function jornadaExameImagem()
|
||||
{
|
||||
return $this->hasMany(Jornada::class);
|
||||
}
|
||||
}
|
||||
28
api/app/Models/ExameImagem/Jornada/TipoJornada.php
Normal file
28
api/app/Models/ExameImagem/Jornada/TipoJornada.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameImagem\Jornada;
|
||||
|
||||
use App\Enums\ExameImagem\Jornada\Tipo;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class TipoJornada extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'exame_imagem_jornada_tipo';
|
||||
|
||||
protected $fillable = [
|
||||
'nome'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
public function jornadaExameImagem()
|
||||
{
|
||||
return $this->hasMany(Jornada::class);
|
||||
}
|
||||
}
|
||||
68
api/app/Models/ExameImagem/Parametrizacao.php
Normal file
68
api/app/Models/ExameImagem/Parametrizacao.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameImagem;
|
||||
|
||||
use App\Models\Cadastro\Estabelecimento\Infraestrutura;
|
||||
use App\Models\Cadastro\Estabelecimento\Unidade;
|
||||
use App\Models\ExameImagem\Parametrizacao\Ocupacao;
|
||||
use App\Models\ExameImagem\Parametrizacao\ParametrizacaoUnidadeSms;
|
||||
use App\Models\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Parametrizacao extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'exame_imagem_parametrizacao_unidade';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'unidade_id',
|
||||
'executante',
|
||||
'prestador',
|
||||
'infraestrutura_id',
|
||||
'envia_sms',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'executante' => 'boolean',
|
||||
'prestador' => 'boolean',
|
||||
'envia_sms' => 'boolean',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
'deleted_at',
|
||||
'deleted_lotacao_id',
|
||||
'deleted_centro_custo_id',
|
||||
];
|
||||
|
||||
public function unidade()
|
||||
{
|
||||
return $this->belongsTo(Unidade::class);
|
||||
}
|
||||
|
||||
public function infraestrutura()
|
||||
{
|
||||
return $this->belongsTo(Infraestrutura::class);
|
||||
}
|
||||
|
||||
public function ocupacao()
|
||||
{
|
||||
return $this->belongsTo(Ocupacao::class);
|
||||
}
|
||||
|
||||
public function sms()
|
||||
{
|
||||
return $this->hasOne(ParametrizacaoUnidadeSms::class, 'parametrizacao_unidade_id');
|
||||
}
|
||||
|
||||
public function getIsAllowedToDeleteAttribute()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameImagem\Parametrizacao;
|
||||
|
||||
use App\Models\Cadastro\Estabelecimento\Infraestrutura;
|
||||
use App\Models\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class AppConectasusCidadaoPrestador extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'exame_imagem_parametrizacao_app_conectasus_cidadao_prestador';
|
||||
|
||||
protected $fillable = [
|
||||
'infraestrutura_id',
|
||||
'percentual_financeiro',
|
||||
'percentual_quantitativo',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
'deleted_at',
|
||||
'deleted_lotacao_id',
|
||||
'deleted_centro_custo_id',
|
||||
];
|
||||
|
||||
public function infraestrutura()
|
||||
{
|
||||
return $this->belongsTo(Infraestrutura::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameImagem\Parametrizacao;
|
||||
|
||||
use App\Enums\ExameImagem\Parametrizacao\ControleJornada\Tipo;
|
||||
use App\Models\ExameImagem\Parametrizacao;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ControleJornada extends Model
|
||||
{
|
||||
protected $table = 'exame_imagem_parametrizacao_controle_jornada';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'tipo_controle',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
|
||||
public function parametrizacaoExameImagem()
|
||||
{
|
||||
return $this->hasOne(Parametrizacao::class);
|
||||
}
|
||||
public function tipo()
|
||||
{
|
||||
return $this->belongsTo(Tipo::class);
|
||||
}
|
||||
|
||||
public function getIsAllowedToDeleteAttribute()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameImagem\Parametrizacao\ControleJornada;
|
||||
|
||||
use App\Enums\ExameImagem\Parametrizacao\ControleJornada\Tipo;
|
||||
use App\Models\ExameImagem\Jornada\Jornada;
|
||||
use App\Models\Model;
|
||||
|
||||
class TipoControleJornada extends Model
|
||||
{
|
||||
|
||||
protected $table = 'exame_imagem_parametrizacao_controle_jornada_tipo';
|
||||
|
||||
protected $fillable = [
|
||||
'descricao'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
public function getIdentificadorAttribute()
|
||||
{
|
||||
if ($this->id === Tipo::ATENDIMENTO) {
|
||||
|
||||
return Tipo::ATENDIMENTO;
|
||||
}
|
||||
if ($this->id === Tipo::EXAME) {
|
||||
|
||||
return Tipo::EXAME;
|
||||
}
|
||||
}
|
||||
|
||||
public function jornadaExameImagem()
|
||||
{
|
||||
return $this->hasMany(Jornada::class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameImagem\Parametrizacao;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class ExameAmbulatorioAtendimento extends Model
|
||||
{
|
||||
|
||||
protected $table = 'exame_imagem_parametrizacao_exame_ambulatorio_atendimento';
|
||||
|
||||
protected $casts = [
|
||||
'exibir' => 'boolean',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'exibir',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameImagem\Parametrizacao;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class IntegracaoAplicativo extends Model
|
||||
{
|
||||
protected $table = 'exame_imagem_parametrizacao_integracao_aplicativo';
|
||||
|
||||
protected $casts = [
|
||||
'habilita_agendamento_conectasus_cidadao' => 'boolean',
|
||||
'habilita_consulta_imagem_conectasus_cidadao' => 'boolean',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'habilita_agendamento_conectasus_cidadao',
|
||||
'habilita_consulta_imagem_conectasus_cidadao',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameImagem\Parametrizacao;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
class MensagemProtocolo extends Model
|
||||
{
|
||||
protected $table = 'exame_imagem_parametrizacao_mensagem_protocolo';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'mensagem',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameImagem\Parametrizacao;
|
||||
|
||||
use App\Enums\ExameImagem\Mes;
|
||||
use App\Models\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class MesCotaPrestador extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'exame_imagem_parametrizacao_cota_prestador_mes';
|
||||
|
||||
protected $fillable = [
|
||||
'descricao'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
34
api/app/Models/ExameImagem/Parametrizacao/Ocupacao.php
Normal file
34
api/app/Models/ExameImagem/Parametrizacao/Ocupacao.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameImagem\Parametrizacao;
|
||||
|
||||
use App\Models\Sigtap\Ocupacao as SigtapOcupacao;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Ocupacao extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'exame_imagem_parametrizacao_ocupacao';
|
||||
|
||||
protected $fillable = [
|
||||
'ocupacao_id',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
'deleted_at',
|
||||
'deleted_lotacao_id',
|
||||
'deleted_centro_custo_id',
|
||||
];
|
||||
|
||||
public function ocupacao()
|
||||
{
|
||||
return $this->belongsTo(SigtapOcupacao::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameImagem\Parametrizacao;
|
||||
|
||||
use App\Models\ExameImagem\Parametrizacao;
|
||||
use App\Models\ExameImagem\Parametrizacao\ParametrizacaoUnidadeSmsExame;
|
||||
use App\Models\Model;
|
||||
use App\Models\Parametrizacao\Exame\Exame;
|
||||
|
||||
class ParametrizacaoUnidadeSms extends Model
|
||||
{
|
||||
protected $table = 'exame_imagem_parametrizacao_unidade_sms';
|
||||
|
||||
protected $casts = [
|
||||
'envio_de' => 'datetime:d/m/Y',
|
||||
'envio_ate' => 'datetime:d/m/Y',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'parametrizacao_unidade_id',
|
||||
'dia_antecedencia',
|
||||
'envio_de',
|
||||
'envio_ate',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'id',
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
|
||||
public function parametrizacaoUnidade()
|
||||
{
|
||||
return $this->belongsTo(Parametrizacao::class, 'parametrizacao_unidade_id');
|
||||
}
|
||||
|
||||
public function exames()
|
||||
{
|
||||
return $this->belongsToMany(
|
||||
Exame::class,
|
||||
'exame_imagem_parametrizacao_unidade_sms_exame',
|
||||
'parametrizacao_unidade_sms_id',
|
||||
'exame_id'
|
||||
)
|
||||
->using(ParametrizacaoUnidadeSmsExame::class)
|
||||
->as('parametrizacaoUnidadeSmsExame')
|
||||
->withTimestamps();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameImagem\Parametrizacao;
|
||||
|
||||
use App\Models\Pivot;
|
||||
|
||||
class ParametrizacaoUnidadeSmsExame extends Pivot
|
||||
{
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
}
|
||||
39
api/app/Models/ExameImagem/Parametrizacao/Supervisor.php
Normal file
39
api/app/Models/ExameImagem/Parametrizacao/Supervisor.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameImagem\Parametrizacao;
|
||||
|
||||
use App\Models\Cadastro\SujeitoAtencao\Usuario;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Supervisor extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'exame_imagem_parametrizacao_supervisor';
|
||||
|
||||
protected $fillable = [
|
||||
'usuario_id',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
'deleted_at',
|
||||
'deleted_lotacao_id',
|
||||
'deleted_centro_custo_id',
|
||||
];
|
||||
|
||||
public function usuario()
|
||||
{
|
||||
return $this->belongsTo(Usuario::class);
|
||||
}
|
||||
|
||||
public function getIsAllowedToDeleteAttribute()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameImagem\Parametrizacao;
|
||||
|
||||
use App\Enums\ExameImagem\Tipo;
|
||||
use App\Models\ExameImagem\CotaPrestador;
|
||||
use App\Models\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class TipoCotaPrestador extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'exame_imagem_parametrizacao_cota_prestador_tipo';
|
||||
|
||||
protected $fillable = [
|
||||
'descricao'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
public function getIdentificadorAttribute()
|
||||
{
|
||||
if ($this->id === Tipo::VALOR) {
|
||||
|
||||
return '1';
|
||||
}
|
||||
if ($this->id === Tipo::QUANTIDADE) {
|
||||
|
||||
return '2';
|
||||
}
|
||||
}
|
||||
|
||||
public function cotaPrestadorExameImagem()
|
||||
{
|
||||
return $this->hasMany(CotaPrestador::class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user