---
title: "Patients who entered a target state in a period"
method: GET
path: "/api/analytics/detail/transitions"
tags: ["analytics"]
---

# Patients who entered a target state in a period

`GET /api/analytics/detail/transitions`

Returns full analytics detail for each patient who entered target_status between from_date and to_date and is still in that status at to_date. Coordinator sees only their supervisors' data.

## Query parameters

- `target_status` string, required — Target status key (e.g. attivo_general, abbandono_psi).
- `from_date` string, date, required — Period start date (YYYY-MM-DD).
- `to_date` string, date, required — Period end date (YYYY-MM-DD).
- `operator_id` string, uuid, nullable — Filter by psychologist or nutritionist UUID.
- `role` 'psychologist' | 'nutritionist', nullable
- `supervisor_id` string, uuid, nullable
- `search` string, nullable — Case-insensitive patient search.
- `sort_by` 'full_name' | 'email' | 'patient_registration_at' | 'supervisor_psychologist_name' | 'psychologist_name' | 'first_psi' | 'last_psi' | 'next_psi' | 'delta_psi' | 'done_psi' | 'expected_psi' | 'freq_psi_days' | 'percentage_psi' | 'supervisor_nutritionist_name' | 'nutritionist_name' | 'first_nutri' | 'last_nutri' | 'next_nutri' | 'delta_nutri' | 'done_nutri' | 'expected_nutri' | 'freq_nutri_days' | 'percentage_nutri' | 'assigned_experts' | 'total_spent', nullable
- `sort_dir` 'asc' | 'desc', nullable
- `per_page` integer
- `page` integer

## Response `200`

Successful Response

- AnalyticsTransitionsPeriodResponse — Paginated patients who transitioned to a target status in the period.
  - `items` AnalyticsPatientDetailRow[] — Filtered patient page
    - `patient_id` string, uuid, required — Patient UUID
    - `user_id` string, uuid, nullable
    - `full_name` string, nullable
    - `email` string, nullable
    - `phone` string, nullable
    - `patient_registration_at` string, date-time, nullable
    - `total_appointments` integer, nullable
    - `appointments_completed` integer, nullable
    - `appointments_future` integer, nullable
    - `total_spent` number, nullable
    - `patient_status` string[], nullable
    - `days_since_last_appointment` integer, nullable
    - `days_since_first_appointment` integer, nullable
    - `months_in_path` integer, nullable
    - `expected_sessions_tot` integer, nullable
    - `adherence_ratio_strict` string, nullable
    - `adherence_ratio_adjusted` string, nullable
    - `psychologist_name` string, nullable
    - `nutritionist_name` string, nullable
    - `psychologist_id` string, uuid, nullable
    - `nutritionist_id` string, uuid, nullable
    - `patient_status_custom` object, nullable
    - `last_psi` string, date-time, nullable
    - `first_psi` string, date-time, nullable
    - `done_psi` integer, nullable
    - `next_psi` string, date-time, nullable
    - `last_nutri` string, date-time, nullable
    - `first_nutri` string, date-time, nullable
    - `done_nutri` integer, nullable
    - `next_nutri` string, date-time, nullable
    - `expected_psi` integer, nullable
    - `expected_nutri` integer, nullable
    - `psi_frequency` string, nullable
    - `nutri_frequency` string, nullable
    - `frequency_compliance` string, nullable
    - `assigned_experts` string, nullable
    - `total_completed` integer, nullable
    - `start_type` string, nullable
    - `first_appointment` string, date-time, nullable
    - `freq_psi_days` string, nullable
    - `freq_nutri_days` string, nullable
    - `delta_psi` integer, nullable
    - `delta_nutri` integer, nullable
    - `percentage_psi` integer, nullable
    - `percentage_nutri` integer, nullable
    - `effective_frequency_psi` string, nullable
    - `effective_frequency_nutri` string, nullable
    - `first_call` string, date-time, nullable
    - `supervisor_psychologist_id` string, uuid, nullable
    - `supervisor_psychologist_name` string, nullable
    - `supervisor_nutritionist_id` string, uuid, nullable
    - `supervisor_nutritionist_name` string, nullable
    - `coordinator_psychologist_id` string, uuid, nullable
    - `coordinator_nutritionist_id` string, uuid, nullable
  - `total` integer, required — Unique patients matching filters before pagination
  - `per_page` integer, required
  - `page` integer, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/corabea/apis/corabea-api.md) · [All operations](https://skmtc.dev/corabea/apis/corabea-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/corabea/corabea-api/revisions/13c1bce1bdc4/schema)
