79 lines
1.7 KiB
PHP
79 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace App\Models\Ambulatorio;
|
|
|
|
use App\Models\Cadastro\SujeitoAtencao\PacienteGestacao;
|
|
use App\Models\Geral\Ciap;
|
|
use App\Models\Model;
|
|
use App\Models\Sigtap\Cid;
|
|
|
|
class AtendimentoSoapProblemaCondicao extends Model
|
|
{
|
|
protected $table = 'ambulatorio_atendimento_soap_problema_condicao';
|
|
|
|
protected $casts = [
|
|
'inicio' => 'datetime:d/m/Y',
|
|
'fim' => 'datetime:d/m/Y',
|
|
'automatico' => 'boolean',
|
|
'resolvido_automaticamente' => 'boolean',
|
|
];
|
|
|
|
protected $fillable = [
|
|
'soap_id',
|
|
'ciap_id',
|
|
'cid_id',
|
|
'situacao_id',
|
|
'inicio',
|
|
'fim',
|
|
'observacao',
|
|
'paciente_gestacao_id',
|
|
'problema_condicao_anterior_id',
|
|
'automatico',
|
|
'resolvido_automaticamente',
|
|
];
|
|
|
|
protected $hidden = [
|
|
'created_at',
|
|
'created_lotacao_id',
|
|
'created_centro_custo_id',
|
|
'updated_at',
|
|
'updated_lotacao_id',
|
|
'updated_centro_custo_id',
|
|
];
|
|
|
|
public function soap()
|
|
{
|
|
return $this->belongsTo(AtendimentoSoap::class);
|
|
}
|
|
|
|
public function ciap()
|
|
{
|
|
return $this->belongsTo(Ciap::class);
|
|
}
|
|
|
|
public function cid()
|
|
{
|
|
return $this->belongsTo(Cid::class);
|
|
}
|
|
|
|
public function situacao()
|
|
{
|
|
return $this->belongsTo(ProblemaCondicaoSituacao::class);
|
|
}
|
|
|
|
public function pacienteGestacao()
|
|
{
|
|
return $this->belongsTo(PacienteGestacao::class);
|
|
}
|
|
|
|
public function problemaCondicaoAnterior()
|
|
{
|
|
return $this->belongsTo(AtendimentoSoapProblemaCondicao::class);
|
|
}
|
|
|
|
public function problemaCondicaoPosterior()
|
|
{
|
|
return $this->hasOne(AtendimentoSoapProblemaCondicao::class, 'problema_condicao_anterior_id');
|
|
}
|
|
}
|