diff --git a/src/components/clinical-dashboard/ClinicalSidebar.tsx b/src/components/clinical-dashboard/ClinicalSidebar.tsx index 4de23418d2..de20b2b621 100644 --- a/src/components/clinical-dashboard/ClinicalSidebar.tsx +++ b/src/components/clinical-dashboard/ClinicalSidebar.tsx @@ -52,9 +52,9 @@ const sidebarToolItems = [ { id: "documents", label: "Documents", icon: FileText, href: "/?mode=documents" }, { id: "services", label: "Services", icon: ClipboardList, href: "/services" }, { id: "forms", label: "Forms", icon: FileText, href: "/forms" }, - { id: "favourites", label: "Faves", icon: Heart, href: "/favourites" }, - { id: "differentials", label: "Diffs", icon: BrainCircuit, href: "/differentials" }, - { id: "prescribing", label: "Meds", icon: Pill, href: "/?mode=prescribing" }, + { id: "favourites", label: "Favourites", icon: Heart, href: "/favourites" }, + { id: "differentials", label: "Differentials", icon: BrainCircuit, href: "/differentials" }, + { id: "prescribing", label: "Medications", icon: Pill, href: "/?mode=prescribing" }, { id: "tools", label: "Tools", icon: Wrench, href: "/?mode=tools" }, ] as const; diff --git a/src/components/clinical-dashboard/favourites-hub.tsx b/src/components/clinical-dashboard/favourites-hub.tsx index aacfdd19b0..eddd2c9d17 100644 --- a/src/components/clinical-dashboard/favourites-hub.tsx +++ b/src/components/clinical-dashboard/favourites-hub.tsx @@ -135,7 +135,7 @@ export function FavouritesHub({ {[ { label: "Items", value: itemCount, icon: Heart }, { label: "Sets", value: setCount, icon: Folder }, - { label: "Active", value: activeFilterCount, icon: Filter }, + { label: "Filters", value: activeFilterCount, icon: Filter }, ].map((stat) => { const Icon = stat.icon; return ( @@ -490,7 +490,8 @@ function FavouriteSetRow({ selected ? "text-[color:var(--clinical-accent)]" : "text-[color:var(--text-muted)]", )} > - {favouriteSet.count} items{compact ? "" : ` · ${favouriteSet.meta}`} + {favouriteSet.count} {favouriteSet.count === 1 ? "item" : "items"} + {compact ? "" : ` · ${favouriteSet.meta}`} diff --git a/src/components/clinical-dashboard/favourites-prototype-data.ts b/src/components/clinical-dashboard/favourites-prototype-data.ts index 9ddf9d4b8c..b2269fc3e1 100644 --- a/src/components/clinical-dashboard/favourites-prototype-data.ts +++ b/src/components/clinical-dashboard/favourites-prototype-data.ts @@ -94,25 +94,27 @@ export const favouriteItems: FavouriteItem[] = [ }, ]; +const countItemsInSet = (title: string) => favouriteItems.filter((item) => item.set === title).length; + export const favouriteSets: FavouriteSet[] = [ { id: "ward-round", title: "Ward round", - count: 12, + count: countItemsInSet("Ward round"), meta: "Medication pages, renal checks, forms", keywords: "ward round acamprosate lithium renal mht forms", }, { id: "prescribing-safety", title: "Prescribing safety", - count: 9, + count: countItemsInSet("Prescribing safety"), meta: "Dose limits, pregnancy, renal cautions", keywords: "prescribing safety dose pregnancy renal qt interactions", }, { id: "clozapine-clinic", title: "Clozapine clinic", - count: 7, + count: countItemsInSet("Clozapine clinic"), meta: "Monitoring, ANC table, counselling", keywords: "clozapine clinic monitoring anc table counselling", }, diff --git a/src/components/clinical-dashboard/master-search-header.tsx b/src/components/clinical-dashboard/master-search-header.tsx index e287531d2a..0b5d3b9198 100644 --- a/src/components/clinical-dashboard/master-search-header.tsx +++ b/src/components/clinical-dashboard/master-search-header.tsx @@ -355,7 +355,6 @@ export function MasterSearchHeader({ searchMode === "prescribing" ? medicationModeActionItems : modeActionItemsFor(actionMenuSetId); const actionMenuTitle = selectedAppMode.label; const actionMenuButtonLabel = `Open ${selectedAppMode.label.toLowerCase()} options`; - const isStandaloneModeHomeHeader = Boolean(desktopHomeComposerSlotId); const useMobileBackControl = mobileLeadingAction === "back"; function currentUsesScopeSheet() { @@ -887,7 +886,8 @@ export function MasterSearchHeader({ const usesAnswerFooterStyle = isAnswerFooterComposer && !isDesktopHomeComposer; const usesMobileBottomStyle = isMobileBottomComposer && !isDesktopHomeComposer; const usesUniversalFooterStyle = usesAnswerFooterStyle || (usesMobileBottomStyle && usesPhoneSearchLayout); - const usesSendAffordance = usesAnswerFooterStyle || (isStandaloneModeHomeHeader && searchMode === "differentials"); + // Only the Answer chat composer uses the send affordance; every search-mode home uses the magnifier. + const usesSendAffordance = usesAnswerFooterStyle; const composerPlaceholder = usesMobileBottomStyle && searchMode === "differentials" ? "Search a presentation" : queryPlaceholder; diff --git a/src/components/differentials/differential-detail-page.tsx b/src/components/differentials/differential-detail-page.tsx index 5bf25bf9a0..9ffc2b9fa3 100644 --- a/src/components/differentials/differential-detail-page.tsx +++ b/src/components/differentials/differential-detail-page.tsx @@ -87,6 +87,13 @@ function statusLabel(status: DifferentialRecord["status"]) { return "Routine"; } +/** Maps a related node's likelihood to its own severity tag, mirroring the record-status tones. */ +function likelihoodTag(likelihood: DifferentialRecord["related"][number]["likelihood"]) { + if (likelihood === "must-not-miss") return { label: "Emergent", className: statusTone.emergent }; + if (likelihood === "possible") return { label: "Urgent", className: statusTone.urgent }; + return { label: "Review", className: statusTone.routine }; +} + function SectionRow({ section }: { section: DifferentialSection }) { const Icon = sectionIcons[section.tone]; const meta = rowMeta[section.tone]; @@ -202,29 +209,28 @@ function RelatedDiagnoses({ record }: { record: DifferentialRecord }) { Related diagnoses - View all related ({record.related.length + 8}) + View all related ({record.related.length}) @@ -250,7 +256,16 @@ function CurrentPresentation({ record }: { record: DifferentialRecord }) { } function CompareBasket({ record }: { record: DifferentialRecord }) { - const items = [record.title, ...record.related.slice(0, 2).map((node) => node.label)]; + const items = [ + { + id: "self", + label: record.title, + tag: { label: statusLabel(record.status), className: statusTone[record.status] }, + }, + ...record.related + .slice(0, 2) + .map((node) => ({ id: node.id, label: node.label, tag: likelihoodTag(node.likelihood) })), + ]; return (
@@ -265,15 +280,20 @@ function CompareBasket({ record }: { record: DifferentialRecord }) {
    {items.map((item) => (
  • - {item} + {item.label} - - {statusLabel(record.status)} + + {item.tag.label}
  • ))} @@ -382,16 +402,6 @@ function HeaderChrome() { > -
    - - - -
    -

    Mode

    -

    Differentials

    -
    - -
    @@ -486,6 +496,7 @@ export function DifferentialDetailPage({ record }: { record: DifferentialRecord
    +
    {record.sections.map((section) => ( diff --git a/src/components/differentials/differential-stream-page.tsx b/src/components/differentials/differential-stream-page.tsx index 3e8e027d3c..71b2e24b93 100644 --- a/src/components/differentials/differential-stream-page.tsx +++ b/src/components/differentials/differential-stream-page.tsx @@ -1,5 +1,5 @@ import Link from "next/link"; -import { ArrowLeft, ArrowRight, CircleHelp, FileText } from "lucide-react"; +import { ArrowLeft, ArrowRight, FileText } from "lucide-react"; import { appModeHomeHref } from "@/lib/app-modes"; import { @@ -67,9 +67,9 @@ export function DifferentialStreamPage({ stream, query = "" }: DifferentialStrea >

    {card.title}

    {card.description}

    -
      +
        {card.examples.map((example) => ( -
      • +
      • {example}
      • @@ -82,14 +82,10 @@ export function DifferentialStreamPage({ stream, query = "" }: DifferentialStrea
        -

        Stream helper

        +

        Keep exploring

        - This stream contains differential diagnosis content only. Use it to move from presentation clues to - diagnosis detail pages without mixing in service or referral records. -

        -

        - - Use for workflow verification only + Return to the differentials home to start from a different presentation, or open search to look up another + differential.

        diff --git a/src/components/forms/form-detail-page.tsx b/src/components/forms/form-detail-page.tsx index c8c40991f5..f03e495de1 100644 --- a/src/components/forms/form-detail-page.tsx +++ b/src/components/forms/form-detail-page.tsx @@ -150,6 +150,15 @@ function summaryCardsFor(form: FormRecord): ServiceSummaryCard[] { ]; } +function joinNotes(notes: string[] | null | undefined) { + if (!notes?.length) return undefined; + return notes + .map((note) => note.trim()) + .filter(Boolean) + .map((note) => (/[.!?]$/.test(note) ? note : `${note}.`)) + .join(" "); +} + function detailRowsFor(form: FormRecord) { const referralRows = form.referralInfo?.length ? form.referralInfo @@ -162,7 +171,7 @@ function detailRowsFor(form: FormRecord) { return [ ...referralRows, - { label: "Verification", value: form.verification?.notes?.join(" ") }, + { label: "Verification", value: joinNotes(form.verification?.notes) }, { label: "Related pathway", value: form.route }, ].filter((row) => hasText(row.value)); } diff --git a/src/components/services/services-home-page.tsx b/src/components/services/services-home-page.tsx index 7965126840..df91c35ba9 100644 --- a/src/components/services/services-home-page.tsx +++ b/src/components/services/services-home-page.tsx @@ -13,7 +13,7 @@ import { defaultServiceSlug, serviceRecords } from "@/lib/services"; const taskCards: ModeHomeAction[] = [ { - title: "Find a service", + title: "Search services", description: "Search by need, catchment, provider, or keyword.", icon: FileSearch, href: appModeHomeHref("services", { focus: true }), @@ -43,7 +43,7 @@ const commonPathways: ModeHomePill[] = [ href: appModeHomeHref("services", { query: "crisis support services", focus: true, run: true }), }, { - label: "ATSI-specific", + label: "Aboriginal and Torres Strait Islander", tone: "info", href: appModeHomeHref("services", { query: "Aboriginal Torres Strait Islander services", diff --git a/src/lib/services.ts b/src/lib/services.ts index 502b88c1df..43ac294c81 100644 --- a/src/lib/services.ts +++ b/src/lib/services.ts @@ -82,7 +82,7 @@ export const serviceRecords: ServiceRecord[] = [ subtitle: "Urgent contact, crisis response, or acute support pathway.", statusChips: [ { label: "Crisis / urgent", tone: "danger" }, - { label: "ATSI-specific", tone: "info" }, + { label: "Aboriginal and Torres Strait Islander", tone: "info" }, { label: "Local confirmation", tone: "warning" }, ], primaryContact: { @@ -106,7 +106,7 @@ export const serviceRecords: ServiceRecord[] = [ }, ], route: "Self phone referral", - eligibility: "ATSI callers", + eligibility: "Aboriginal and Torres Strait Islander callers", cost: "Free", referral: "Self referral by phone. Escalate emergency medical danger through emergency services.", location: "Statewide / national", @@ -120,7 +120,7 @@ export const serviceRecords: ServiceRecord[] = [ { id: "eligibility", label: "Eligibility", - title: "ATSI callers", + title: "Aboriginal and Torres Strait Islander callers", detail: "See details", }, { @@ -140,7 +140,7 @@ export const serviceRecords: ServiceRecord[] = [ { label: "Primary route", value: "Contact: 13 92 76\nSelf phone referral" }, { label: "Phone", value: "13 92 76" }, { label: "Email", value: "None listed" }, - { label: "Provider", value: "ATSI crisis support service referenced by WACHS" }, + { label: "Provider", value: "Aboriginal and Torres Strait Islander crisis support service referenced by WACHS" }, { label: "Region", value: "Statewide / national" }, { label: "Patient group", value: "Aboriginal and Torres Strait Islander people" }, { label: "Hours", value: "Not publicly stated" }, @@ -148,7 +148,7 @@ export const serviceRecords: ServiceRecord[] = [ ], bestUse: "Culturally safe crisis phone support; escalate emergency danger elsewhere.", criteria: [ - { label: "ATSI support need", tone: "meet" }, + { label: "Aboriginal and Torres Strait Islander support need", tone: "meet" }, { label: "Crisis support pathway appropriate", tone: "meet" }, { label: "Phone referral available", tone: "meet" }, { label: "Emergency medical danger present", tone: "reject" }, @@ -411,7 +411,7 @@ export const serviceRecords: ServiceRecord[] = [ title: "State-wide Specialist Aboriginal Mental Health Service", subtitle: "Great Southern WACHS service combining cultural and clinical mental health expertise.", statusChips: [ - { label: "ATSI-specific", tone: "info" }, + { label: "Aboriginal and Torres Strait Islander", tone: "info" }, { label: "Regional WA", tone: "success" }, { label: "Local confirmation", tone: "warning" }, ],