This commit is contained in:
68
api/app/Models/Farmacia/Receita.php
Normal file
68
api/app/Models/Farmacia/Receita.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Farmacia;
|
||||
|
||||
use App\Models\Ambulatorio\AtendimentoSoapPrescricaoMedicamento;
|
||||
use App\Models\Cadastro\SujeitoAtencao\Paciente;
|
||||
use App\Models\Sigtap\Cid;
|
||||
use App\Models\Model;
|
||||
use App\Models\Farmacia\ReceitaItem;
|
||||
use App\Models\Cadastro\SujeitoAtencao\Usuario;
|
||||
|
||||
class Receita extends Model
|
||||
{
|
||||
protected $table = 'farmacia_receita';
|
||||
|
||||
protected $casts = [
|
||||
'data_receita' => 'datetime:Y-m-d',
|
||||
'validade_receita' => 'datetime:Y-m-d',
|
||||
'is_receita_sus' => 'boolean',
|
||||
'is_remedio_em_casa' => 'boolean',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'ambulatorio_prescricao_medicamento_id',
|
||||
'paciente_id',
|
||||
'usuario_id',
|
||||
'data_receita',
|
||||
'numero_notificacao',
|
||||
'cid_id',
|
||||
'is_receita_sus',
|
||||
'is_remedio_em_casa',
|
||||
'observacao',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
|
||||
public function ambulatorioPrescricaoMedicamento()
|
||||
{
|
||||
return $this->belongsTo(AtendimentoSoapPrescricaoMedicamento::class);
|
||||
}
|
||||
|
||||
public function usuario()
|
||||
{
|
||||
return $this->belongsTo(Usuario::class);
|
||||
}
|
||||
|
||||
public function paciente()
|
||||
{
|
||||
return $this->belongsTo(Paciente::class);
|
||||
}
|
||||
|
||||
public function cid()
|
||||
{
|
||||
return $this->belongsTo(Cid::class);
|
||||
}
|
||||
|
||||
public function itens()
|
||||
{
|
||||
return $this->hasMany(ReceitaItem::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user