public function getType() { if ($this->disorder) { return 'disorder'; } elseif ($this->finding) { return 'finding'; } elseif ($this->disorder_id || $this->finding_id) { // Finding or disorder is inactive return; } else { return 'none'; } }