<?php

namespace App\Models;


use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use App\Models\DataPasien;
use App\Models\Pemeriksaan;

class RekamMedis extends Model
{
  use SoftDeletes;

  protected $table = 'rekam_medis';
  protected $guarded = [
    'rm_id'
  ];

  protected $primaryKey = 'rm_id';

  const CREATED_AT = 'rm_created_at';
  const UPDATED_AT = 'rm_updated_at';
  const DELETED_AT = 'rm_deleted_at';

  public function dataPasien()
  {
    return $this->belongsTo(DataPasien::class, 'dp_id')->withTrashed();
  }

  public function pemeriksaan()
  {
    return $this->belongsTo(pemeriksaan::class, 'p_id')->withTrashed();
  }
}
