diff --git a/.cursor/rules/dyolink-overview.mdc b/.cursor/rules/dyolink-overview.mdc index 866f845..f30ff6b 100644 --- a/.cursor/rules/dyolink-overview.mdc +++ b/.cursor/rules/dyolink-overview.mdc @@ -35,7 +35,7 @@ Treatment-type colors and labels: `components/shared/treatmentTypeDisplay.ts` + ## Today dashboard -CLINIC + LAB KPIs/charts in `modules/today/today.service.ts`. Deep links: `components/today/today-deep-links.ts`. Task KPIs need `TAB_TASKS_READ` (no owner bypass). Skill: `.cursor/skills/today-dashboard/SKILL.md`. +CLINIC + LAB KPIs/charts in `modules/today/today.service.ts`. Lab gadgets count the same cases as Cases and Tasks (started own cases included; outsourced steps excluded). Deep links: `components/today/today-deep-links.ts`. Task KPIs need `TAB_TASKS_READ` (no owner bypass). Skill: `.cursor/skills/today-dashboard/SKILL.md`. ## Lab case share link diff --git a/.cursor/skills/today-dashboard/SKILL.md b/.cursor/skills/today-dashboard/SKILL.md index 345e86c..6816f58 100644 --- a/.cursor/skills/today-dashboard/SKILL.md +++ b/.cursor/skills/today-dashboard/SKILL.md @@ -31,13 +31,25 @@ KPIs with count `0` still register; `getVisibleTodayKpis` hides when `formatValu Use `useRouter` from `@/i18n/navigation` for chart clicks. KPI cards use `Link`/`href` on `KpiCard`. +## Lab case scope + +Lab gadgets use `visibleStartedToLabWhere` in `today.service.ts`, the same cases Cases and Tasks show: + +- A received case has `sentAt` and a `LabCaseSend` for this lab (clinic dispatch or a received lab-to-lab case). +- A started own case is `LAB_INTERNAL`, `destinationOrganizationId` is this lab, and `startedAt` is set. Date windows use `startedAt` where a sent case uses `sentAt` (received today, activity “received”, partner chart). +- Unstarted drafts stay out. +- Task counts use `CURRENT_VISIBLE_TASK_FILTER`: current round only, and a step already handed to another lab is not counted. +- Partner chart name: the clinic, else `partnerClinicOrganizationId`, else the parent case’s lab for a received lab-to-lab case. + +Clinic gadgets are unchanged. + ## Charts (LAB examples) - **Tasks by prosthesis** — `TodayBarChart` + `colorForCode` from prosthesis catalog; `canViewTasks` -- **Cases due** — forward day buckets (next 7 / 30); active sent cases with due date + in-progress task; `canViewCases`; empty card still shown -- **Lab task activity** — stacked lookback day chart (7 / 30); `canViewCases \|\| canViewTasks` +- **Cases due** — forward day buckets (next 7 / 30); a due date plus an in-progress task on a received or started own case; `canViewCases`; empty card still shown +- **Lab task activity** — stacked lookback day chart (7 / 30); `canViewCases \|\| canViewTasks`. “Received” adds a send’s tasks, and a started own case’s current tasks on `startedAt`. -Week/month day labels: `useTodayDayLabelFormatter` + `mapWeekChartBuckets`. +Day axis tick is month + day (`APP_DATE.chartAxisDay` via `mapWeekChartBuckets`). The tooltip keeps the full weekday label. ## Chart period dropdowns @@ -50,6 +62,16 @@ Seven time-window charts support a compact header `