Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
225 changes: 223 additions & 2 deletions docs/site-map.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ This file is generated by `npm run sitemap:update`. Run `npm run sitemap:check`
- `/specifiers/builder` - Structured diagnostic wording builder. Source: `src/app/specifiers/builder/page.tsx`.
- `/specifiers/compare` - Side-by-side psychiatric specifier comparison. Source: `src/app/specifiers/compare/page.tsx`.
- `/specifiers/map` - Psychiatric specifier family map. Source: `src/app/specifiers/map/page.tsx`.
- `/therapy-compass` - Route discovered from app directory Source: `src/app/therapy-compass/page.tsx`.
- `/therapy-compass` - Therapy Compass home (source-grounded therapy decision support). Source: `src/app/therapy-compass/page.tsx`.
- `/therapy-compass/[slug]/brief` - Therapy brief-intervention view. Source: `src/app/therapy-compass/[slug]/brief/page.tsx`.
- `/therapy-compass/[slug]/sheet` - Therapy patient-sheet builder. Source: `src/app/therapy-compass/[slug]/sheet/page.tsx`.
- `/therapy-compass/compare` - Side-by-side therapy comparison. Source: `src/app/therapy-compass/compare/page.tsx`.
- `/therapy-compass/pathways` - Problem-based clinical therapy pathways. Source: `src/app/therapy-compass/pathways/page.tsx`.
- `/therapy-compass/recommend` - Recommend a therapy from a clinical question and constraints. Source: `src/app/therapy-compass/recommend/page.tsx`.
- `/therapy-compass/review` - Therapy records awaiting qualified-clinician source review. Source: `src/app/therapy-compass/review/page.tsx`.
- `/therapy-compass/search` - Therapy library search surface. Source: `src/app/therapy-compass/search/page.tsx`.
- `/tools` - Route discovered from app directory Source: `src/app/tools/page.tsx`.

## Mode/query routes
Expand Down Expand Up @@ -750,6 +757,221 @@ This file is generated by `npm run sitemap:update`. Run `npm run sitemap:check`
- `splitting`
- `worry`

### Therapy slugs

- `/therapy-compass/[slug]` - Dynamic route family.
- `acceptance-and-commitment-therapy-act`
- `adherence-focused-brief-work-adherence-therapy`
- `adolescent-cbt`
- `adolescent-focused-psychotherapy-for-anorexia-nervosa`
- `advocacy-informed-therapeutic-work`
- `app-supported-therapy`
- `applied-relaxation-relaxation-based-therapy`
- `arts-therapies-for-psychosis`
- `behaviour-therapy`
- `behavioural-activation`
- `behavioural-activation-ba`
- `behavioural-couples-therapy-bct`
- `behavioural-couples-therapy-for-substance-use-disorders-bct-sud`
- `behavioural-parent-training`
- `brief-low-intensity-cbt`
- `brief-supportive-psychotherapy`
- `bright-light-therapy`
- `carer-focused-education-and-support-carer-psychoeducation-in-psychosis`
- `carer-groups`
- `carer-interventions`
- `carer-supported-meal-based-interventions`
- `cbt-informed-psychological-intervention-for-self-harm`
- `child-cbt`
- `circadian-rhythm-based-interventions`
- `client-directed-feedback-informed-brief-work`
- `cognitive-analytic-therapy-cat`
- `cognitive-behavioural-therapy-cbt`
- `cognitive-behavioural-therapy-for-bipolar-depression-bipolar-relapse-prevention`
- `cognitive-behavioural-therapy-for-insomnia`
- `cognitive-behavioural-therapy-for-insomnia-cbt-i`
- `cognitive-behavioural-therapy-for-psychosis-cbtp`
- `cognitive-processing-therapy-cpt`
- `cognitive-remediation-therapy-crt`
- `cognitive-stimulation-therapy`
- `cognitive-therapy`
- `cognitive-therapy-for-ptsd-ct-ptsd`
- `community-based-psychosocial-intervention`
- `community-reinforcement-and-family-training-craft`
- `community-reinforcement-approach`
- `compassion-focused-therapy`
- `constructivist-therapies`
- `contingency-management-cm`
- `coping-skills-interventions`
- `couples-therapy`
- `craving-management-interventions`
- `crisis-intervention-crisis-oriented-brief-therapy`
- `cue-exposure-therapy-cet-for-substance-use-disorders`
- `dbt-informed-adjunctive-emotion-regulation-work-for-eating-disorders`
- `dbt-skills-groups`
- `developmental-social-skills-interventions`
- `developmentally-adapted-dbt`
- `developmentally-adapted-erp`
- `dialectical-behaviour-therapy-dbt`
- `dignity-therapy`
- `dyadic-therapy`
- `dynamic-interpersonal-therapy`
- `eating-disorder-focused-cognitive-behavioural-therapy-cbt-ed-cbt-e`
- `eating-disorder-focused-focal-psychodynamic-therapy-fpt-for-adult-anorexia-nervosa`
- `ect`
- `emdr`
- `emotion-focused-therapy`
- `empowerment-focused-practice`
- `existential-psychotherapy`
- `experiential-therapies`
- `exposure-and-response-prevention-erp`
- `exposure-and-response-prevention-for-tics-erp-for-tics`
- `exposure-based-cbt-exposure-therapy`
- `exposure-therapy`
- `eye-movement-desensitisation-and-reprocessing-emdr`
- `family-based-treatment-for-adolescent-anorexia-nervosa-ft-an`
- `family-based-treatment-for-bulimia-nervosa-ft-bn`
- `family-focused-psychoeducation-for-bipolar-disorder`
- `family-focused-therapy-for-bipolar-disorder-fft-bd`
- `family-intervention-for-psychosis`
- `family-problem-solving-interventions`
- `family-psychoeducation-for-psychosis`
- `family-therapy`
- `functional-family-therapy-fft`
- `gestalt-therapy`
- `good-psychiatric-management`
- `graded-exposure`
- `group-exposure-programmes`
- `group-psychoeducation`
- `group-psychoeducation-for-bipolar-disorder`
- `group-relapse-prevention-programmes`
- `group-social-skills-training`
- `guided-self-help`
- `guided-self-help-for-binge-eating-disorder`
- `guided-self-help-for-bulimia-nervosa`
- `habit-reversal-training-cbit`
- `habit-reversal-training-for-trichotillomania-and-excoriation-disorder`
- `harm-reduction-counselling`
- `health-anxiety-focused-cbt`
- `humanistic-psychotherapy`
- `illness-management-and-recovery-style-interventions-imr-style-interventions`
- `imagery-rehearsal-therapy-irt-for-nightmare-disorder`
- `imagery-rescripting`
- `inference-based-cbt-for-ocd`
- `integrated-cbt-for-ptsd-and-substance-use-disorders`
- `integrated-dual-diagnosis-psychotherapy`
- `intensive-psychodynamic-psychotherapy`
- `internet-delivered-cbt`
- `interoceptive-exposure`
- `interpersonal-and-social-rhythm-therapy-ipsrt`
- `interpersonal-psychotherapy-ipt`
- `interpersonal-therapy`
- `life-review-therapy-reminiscence-therapy`
- `low-intensity-relapse-prevention-programmes`
- `matrix-model`
- `maudsley-anorexia-nervosa-treatment-for-adults-mantra`
- `meaning-centred-psychotherapy`
- `mentalisation-based-therapy-mbt`
- `metacognitive-therapy-mct`
- `mindfulness-based-cognitive-therapy`
- `mindfulness-based-cognitive-therapy-mbct`
- `mindfulness-based-relapse-prevention-mbrp`
- `mindfulness-based-stress-reduction`
- `mindfulness-based-therapies-not-primarily-cbt-anchored`
- `mindfulness-based-therapy-for-insomnia-mbti`
- `mother-infant-therapy-mother-infant-psychotherapy`
- `motivational-enhancement-therapy-met`
- `motivational-interviewing`
- `motivational-interviewing-mi-for-substance-use-disorders`
- `multi-family-interventions`
- `multidimensional-family-therapy`
- `multisystemic-therapy-mst`
- `narrative-exposure-therapy-net`
- `narrative-informed-community-work`
- `narrative-therapy`
- `neurodevelopmentally-adapted-psychosocial-interventions`
- `panic-focused-cbt`
- `parent-and-child-training`
- `parent-child-interaction-therapy-pcit`
- `parent-child-relational-therapy`
- `parent-management-training-pmt`
- `parent-training`
- `peer-led-groups`
- `peer-recovery-interventions`
- `peer-support`
- `person-centred-rogerian-therapy`
- `phase-oriented-trauma-therapy`
- `play-therapy-play-based-therapies`
- `problem-management-plus-pm`
- `problem-solving-therapy`
- `problem-solving-therapy-pst`
- `process-groups`
- `prolonged-exposure-pe`
- `prolonged-exposure-therapy`
- `psychoanalysis`
- `psychodynamic-psychotherapy`
- `psychoeducation`
- `psychoeducation-for-psychosis`
- `psychoeducational-recovery-groups`
- `psychosis-specific-self-management-programmes`
- `psychosocial-case-planning`
- `recovery-groups`
- `recovery-oriented-case-management`
- `recovery-oriented-psychosocial-interventions`
- `recovery-planning-for-addiction`
- `relapse-prevention-psychotherapy`
- `relapse-prevention-therapy-for-substance-use-disorders`
- `relational-cultural-therapy`
- `relational-psychodynamic-therapies`
- `relationship-focused-therapy`
- `resource-linkage-coordination-as-therapeutic-intervention`
- `rtms`
- `schema-therapy`
- `school-refusal-cbt`
- `seeking-safety`
- `self-management-interventions`
- `short-term-psychodynamic-psychotherapy-for-depression-stpp`
- `short-term-psychodynamic-psychotherapy-stpp`
- `skills-training-groups`
- `sleep-compression-therapy-for-insomnia`
- `social-anxiety-focused-cbt`
- `social-cognition-training`
- `social-communication-parent-mediated-autism-interventions`
- `social-role-restoration-work`
- `social-skills-training-sst`
- `solution-focused-brief-therapy`
- `specialist-supportive-clinical-management-sscm`
- `stabilisation-focused-trauma-preparation`
- `stair-skills-training-in-affective-and-interpersonal-regulation`
- `strengths-based-case-management`
- `strengths-based-practice`
- `structured-clinical-management`
- `support-groups`
- `supported-digital-cbt`
- `supported-digital-trauma-focused-cbt`
- `supported-digital-trauma-focused-cbt-self-help-and-digital-therapies`
- `supported-education`
- `supported-employment-individual-placement-and-support-ips`
- `supportive-expressive-psychodynamic-counselling-approaches-for-depression`
- `supportive-psychotherapy`
- `systemic-family-therapy`
- `task-centred-practice`
- `telehealth-delivered-psychotherapy`
- `telephone-delivered-cbt`
- `transference-focused-psychotherapy-tfp`
- `trauma-focused-cognitive-behavioural-therapy-tf-cbt`
- `trauma-informed-skills-work`
- `twelve-step-facilitation-tsf`
- `values-based-therapies`
- `vocational-rehabilitation`
- `waitlist-bridging-brief-interventions`
- `wake-therapy-sleep-deprivation-chronotherapy`
- `workbook-based-therapy`
- `worry-focused-cbt`
- `written-exposure-therapy`
- `youth-ipt-ipt-a`
- `youth-trauma-focused-cbt`

### Medication slugs

- `/medications/[slug]` - Dynamic route family.
Expand Down Expand Up @@ -789,7 +1011,6 @@ This file is generated by `npm run sitemap:update`. Run `npm run sitemap:check`
- `/mockups/settings-search-clinical` - Route discovered from app directory Source: `src/app/mockups/settings-search-clinical/page.tsx`.
- `/mockups/settings-search-general` - Route discovered from app directory Source: `src/app/mockups/settings-search-general/page.tsx`.
- `/mockups/settings-search-privacy` - Route discovered from app directory Source: `src/app/mockups/settings-search-privacy/page.tsx`.
- `/mockups/therapy-compass` - Route discovered from app directory Source: `src/app/mockups/therapy-compass/page.tsx`.
- `/mockups/tools-action-workbench` - Route discovered from app directory Source: `src/app/mockups/tools-action-workbench/page.tsx`.
- `/mockups/tools-clinical-lanes` - Route discovered from app directory Source: `src/app/mockups/tools-clinical-lanes/page.tsx`.
- `/mockups/tools-command-center` - Route discovered from app directory Source: `src/app/mockups/tools-command-center/page.tsx`.
Expand Down
39 changes: 39 additions & 0 deletions scripts/build-therapies-index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Generates src/data/therapies-index.json — a trimmed, server-importable projection
// of public/therapy-compass-data/therapies.json (~2.5 MB). The full dataset is fetched
// client-side by the interactive Therapy Compass screens; the server only needs a small
// rankable/metadata projection for routing (generateStaticParams / notFound / metadata)
// and the universal-search "therapies" domain. Re-run after editing the source dataset,
// then run Prettier (which owns the committed file's exact formatting):
//
// node scripts/build-therapies-index.mjs && npm run format
//
import { readFileSync, writeFileSync } from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";

const root = join(dirname(fileURLToPath(import.meta.url)), "..");
const source = join(root, "public", "therapy-compass-data", "therapies.json");
const target = join(root, "src", "data", "therapies-index.json");

const therapies = JSON.parse(readFileSync(source, "utf8"));

const projected = therapies
.map((t) => ({
slug: t.slug,
name: t.name,
category: t.category ?? null,
modality: t.modality ?? null,
clinicalSummary: t.clinicalSummary ?? null,
bestUsedFor: t.bestUsedFor ?? null,
targetSymptoms: t.targetSymptoms ?? null,
indications: t.indications ?? null,
reviewStatus: t.reviewStatus ?? "needs_review",
patientSheetAvailable: Boolean(t.patientSheetAvailable),
briefInterventionAvailable: Boolean(t.briefInterventionAvailable),
tags: Array.isArray(t.tags) ? t.tags : [],
aliases: Array.isArray(t.aliases) ? t.aliases : [],
}))
.sort((a, b) => a.name.localeCompare(b.name));

writeFileSync(target, `${JSON.stringify(projected, null, 2)}\n`);
console.log(`Wrote ${projected.length} therapy records to ${target}`);
13 changes: 13 additions & 0 deletions scripts/generate-site-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { formulationMechanisms } from "@/lib/formulation";
import { formRecords } from "@/lib/forms";
import { serviceRecords } from "@/lib/services";
import { specifierRecords } from "@/lib/specifiers";
import { therapySlugs } from "@/lib/therapies";

const appDir = path.join(process.cwd(), "src", "app");
const siteMapPath = path.join(process.cwd(), "docs", "site-map.md");
Expand Down Expand Up @@ -79,6 +80,15 @@ const routeDescriptions: Record<string, string> = {
"/specifiers/builder": "Structured diagnostic wording builder.",
"/specifiers/compare": "Side-by-side psychiatric specifier comparison.",
"/specifiers/map": "Psychiatric specifier family map.",
"/therapy-compass": "Therapy Compass home (source-grounded therapy decision support).",
"/therapy-compass/search": "Therapy library search surface.",
"/therapy-compass/recommend": "Recommend a therapy from a clinical question and constraints.",
"/therapy-compass/compare": "Side-by-side therapy comparison.",
"/therapy-compass/pathways": "Problem-based clinical therapy pathways.",
"/therapy-compass/review": "Therapy records awaiting qualified-clinician source review.",
"/therapy-compass/[slug]": "Therapy record detail.",
"/therapy-compass/[slug]/brief": "Therapy brief-intervention view.",
"/therapy-compass/[slug]/sheet": "Therapy patient-sheet builder.",
};

const publicRouteHandlerDescriptions: Record<string, string> = {
Expand Down Expand Up @@ -387,6 +397,7 @@ function renderSiteMapRaw(data = collectSiteMapData()) {
"/dsm/diagnoses/[slug]",
"/dsm/diagnoses/[slug]/differentials",
"/formulation/[slug]",
"/therapy-compass/[slug]",
"/medications/[slug]",
].includes(route.route),
);
Expand Down Expand Up @@ -457,6 +468,8 @@ function renderSiteMapRaw(data = collectSiteMapData()) {
formulationMechanisms.map((mechanism) => mechanism.id),
),
"",
...renderSlugInventory("Therapy slugs", "/therapy-compass/[slug]", therapySlugs()),
"",
Comment thread
coderabbitai[bot] marked this conversation as resolved.
...renderSlugInventory("Medication slugs", "/medications/[slug]", medicationSlugs),
]),
...section("Document viewer route", [
Expand Down
5 changes: 0 additions & 5 deletions src/app/mockups/mockups-layout-client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ export function MockupsLayoutClient({ children }: { children: ReactNode }) {
const isSourceOverlayRedesignMockup = pathname === "/mockups/document-search/source-overlays";
const isStandaloneDocumentFlow = pathname === "/mockups/document-search";
const isUniversalSearchRedesignMockup = pathname === "/mockups/universal-search-redesign";
// Therapy Compass keeps the universal header + rail but provides its own
// primary search surface, so the shared bottom composer is hidden (as with
// the tools/favourites mockups).
const isTherapyCompassMockup = pathname.startsWith("/mockups/therapy-compass");
// The calculators search page owns its own search input (top on desktop, docked
// at the bottom on phones), so the shared universal composer is suppressed here
// to avoid a second, floating search bar.
Expand All @@ -38,7 +34,6 @@ export function MockupsLayoutClient({ children }: { children: ReactNode }) {
!isFavouritesPageMockup &&
!isStandaloneDocumentFlow &&
!isUniversalSearchRedesignMockup &&
!isTherapyCompassMockup &&
!isCalculatorsSearchPageMockup
}
chromeVisible={!isSourceOverlayRedesignMockup}
Expand Down
13 changes: 0 additions & 13 deletions src/app/mockups/therapy-compass/page.tsx

This file was deleted.

30 changes: 30 additions & 0 deletions src/app/therapy-compass/[slug]/brief/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import type { Metadata } from "next";
import { notFound } from "next/navigation";

import { BriefScreen } from "@/components/therapy-compass/screens/brief-screen";
import { findTherapyRecord, therapyBriefSlugs } from "@/lib/therapies";

export function generateStaticParams() {
// Only records that actually ship a brief-intervention version get a route.
return therapyBriefSlugs().map((slug) => ({ slug }));
}

export async function generateMetadata({ params }: { params: Promise<{ slug: string }> }): Promise<Metadata> {
const { slug } = await params;
const record = findTherapyRecord(slug);
return {
title:
record && record.briefInterventionAvailable
? `${record.name} · Brief intervention - Therapy Compass`
: "Therapy not found - Therapy Compass",
};
}

export default async function TherapyCompassBriefRoute({ params }: { params: Promise<{ slug: string }> }) {
const { slug } = await params;
const record = findTherapyRecord(slug);
// 404 unknown records and records without a brief-intervention version, rather
// than rendering an unsupported workflow.
if (!record || !record.briefInterventionAvailable) notFound();
return <BriefScreen />;
Comment thread
BigSimmo marked this conversation as resolved.
}
Loading