Client.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class Client extends Model
  5. {
  6. protected $table = "client";
  7. public function displayName() {
  8. return $this->name_last . ', '. $this->name_first;
  9. }
  10. public function notes()
  11. {
  12. return $this->hasMany(Note::class, 'client_id', 'id');
  13. }
  14. public function duplicateOfClient(){
  15. return $this->hasOne(Client::class, 'id', 'duplicate_of_client_id');
  16. }
  17. public function mcpPro(){
  18. return $this->hasOne(Pro::class, 'id', 'mcp_pro_id');
  19. }
  20. public function cmPro(){
  21. return $this->hasOne(Pro::class, 'id', 'cm_pro_id');
  22. }
  23. public function rmePro(){
  24. return $this->hasOne(Pro::class, 'id', 'rme_pro_id');
  25. }
  26. public function rmmPro(){
  27. return $this->hasOne(Pro::class, 'id', 'rmm_pro_id');
  28. }
  29. public function name_display(){
  30. return $this->name_first . ' '.$this->name_last;
  31. }
  32. public function careMonth(){
  33. return $this->hasOne(CareMonth::class, 'client_id', 'id');
  34. }
  35. public function medicareStatus(){
  36. // $this->mcn_reject_reason_code = 'not part b';
  37. return true ? true : (
  38. // return $this->is_mcn_valid_number ? true : (
  39. $this->mcn_reject_reason_code ? false : null
  40. );
  41. }
  42. }