plan_type === 'MEDICARE') { $status = $this->is_partbprimary; } else { if(!$this->is_manually_determined) { // AUTO determination of non-medicare not yet supported $status = 'NO'; } else { switch($this->manual_determination_category) { case 'COVERED': $status = 'YES'; break; case 'NOT_COVERED': case 'INVALID': $status = 'NO'; break; default: $status = $this->manual_determination_category; break; } } } return $status; } public function toString() { $parts = []; $parts[] = $this->plan_type; if($this->plan_type === 'MEDICARE') { if($this->is_partbprimary === 'YES') { $parts[] = 'Part B'; } } else { if(@$this->plan_name) $parts[] = ' / ' . $this->plan_name; if(@$this->plan_identifier) $parts[] = ' / ' . $this->plan_identifier; } return implode(" ", $parts); } }