belongsTo(Study::class); } /** * @return array */ protected function casts(): array { return [ 'properties' => 'array', 'series' => 'array', 'assignment_log' => 'array', ]; } public static function historyOnly(int $studyId): self { return self::where('study_id', $studyId)->firstOrFail(['id', 'study_id', 'clinical_history', 'surgical_history', 'lab_results', 'clinical_diagnosis']); } public static function seriesOnly(int $studyId): self { return self::where('study_id', $studyId)->firstOrFail(['id', 'study_id', 'series']); } }