Specialties Feature
Medical specialty categories (Cardiology, Physical Therapy, Dermatology) to organize your team.
What this enables
Team organization: Categorize your specialists by medical discipline—helps you manage who can do what.
Patient filtering: Patients can browse by specialty ("I want a Cardiologist") to find the right specialist.
Multi-specialty clinics: Run a clinic with Cardiology, PT, and Dermatology all in the same platform, each with their own team.
How it works
- Admin creates specialties: "Cardiology", "Physical Therapy", "Dermatology"
- Admin assigns specialists: Dr. Smith → Cardiology, Dr. Jones → Physical Therapy
- Patients filter by specialty: "Show me available Cardiologists"
- System filters: Shows only specialists tagged with Cardiology
Technical Reference
Overview
Specialties are medical specialty categories (e.g., Cardiology, Dermatology, Orthopedics) used to organize specialists and appointment templates within an organization.
Key Concepts
- Organization-scoped: Each organization maintains its own specialty catalog
- Specialist association: Specialists can belong to multiple specialties (M:M relationship via
specialist_specialtiesjunction table) - Appointment template filtering: Templates can be linked to a specific specialty
- Simple CRUD: Basic create/read/update/delete operations with admin-only mutations
Database Schema
See schema.sql for the complete table definition, including:
specialtiestable with organization_id for multi-tenancy- Unique constraint on
(slug, organization_id) - Indexes for RLS performance
- Row-Level Security policies (admin-only mutations, org-scoped reads)
Key fields:
id(bigserial) - Internal primary keyorganization_id(bigint) - Organization foreign keytitle(text) - Display name (e.g., "Cardiology")slug(text) - URL-safe identifier (e.g., "cardiology")created_at,updated_at- Standard timestamps
API Reference
See api.md for complete endpoint documentation.
Endpoints:
GET /v1/specialties- List all specialties in current organizationPOST /v1/specialties- Create specialty (admin only)GET /v1/specialties/{id}- Get specialty with related specialistsPUT /v1/specialties/{id}- Update specialty (admin only)DELETE /v1/specialties/{id}- Delete specialty (admin only)
Related Features
- Specialists (
/docs/features/specialists/) - Specialists link to specialties viaspecialist_specialties - Appointment Templates (
/docs/features/appointment-templates/) - Templates can reference a single specialty viaspecialty_idFK
Implementation Files
Backend implementation (Go):
/services/api/internal/handlers/specialty_handlers.go- HTTP request handlers/services/api/internal/services/specialty_service.go- Business logic/services/api/internal/repositories/specialty_repository.go- Database access layer/services/api/internal/routes/specialty_routes.go- Route registration
Database migrations:
- Migration 000001: Core schema (
CREATE TABLE specialties) - Migration 000002: Indexes (
idx_specialties_org,idx_specialties_slug_org) - Migration 000003: RLS policies (
specialties_select,specialties_modify)