Skip to content

CO.19: Clone Treatment Plan

Summary

Counselors clone a treatment plan template into a custom plan for a specific client, copying the plan structure, sessions, and activities.

Role

  • Primary: Counselor

Entry Point

  • Treatment plan detail clone action.
  • Client detail create-plan dialog.

Preconditions

  • Source plan is accessible.
  • Target client relationship exists.

Steps

  1. Counselor opens a template or client detail plan action.
  2. Counselor selects clone/create-for-client.
  3. Counselor confirms title and target client.
  4. Backend validates source access and client relationship.
  5. Backend deep-copies sessions and activities.
  6. Frontend navigates to the custom plan detail.

Diagram

Edge Cases

  • Existing active plan: Backend prevents more than one active custom plan per client relationship.
  • Template access: User must have access to the source template.
  • Custom source: Clone-to-client expects a valid template/custom flow as enforced by backend rules.

Current Implementation Notes

  • Frontend: frontend/src/features/library/components/shared/clone-dialog.tsx, frontend/src/app/pages/client-details.tsx
  • Backend: backend/internal/services/treatment_service.go

Screenshot Status

  • Not captured.