Use a specialty dropdown when adding practitioners.
Deploy Ladill Care / deploy (push) Successful in 26s
Deploy Ladill Care / deploy (push) Successful in 26s
Replace free-text specialty on practitioner and team-invite forms with a shared selectable list so clinicians pick a known specialty. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -64,6 +64,25 @@ class Practitioner extends Model
|
||||
return $this->hasMany(Appointment::class, 'practitioner_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Specialty dropdown options. Preserves a legacy/custom value when editing.
|
||||
*
|
||||
* @return list<string>
|
||||
*/
|
||||
public static function specialtyOptions(?string $current = null): array
|
||||
{
|
||||
$options = array_values(array_filter(
|
||||
config('care.practitioner_specialties', []),
|
||||
fn ($label) => is_string($label) && $label !== '',
|
||||
));
|
||||
|
||||
if ($current !== null && $current !== '' && ! in_array($current, $options, true)) {
|
||||
$options[] = $current;
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Select option label — includes branch context when available.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user