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
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": 2,
"id": "0a3b873b-ce2c-486b-ab9c-b364129022e9",
"createdOn": "2026-10-15",
"action": "add",
"payload": {
"pri": "P3",
"type": "task",
"summary": "Remove PR 3538 leftovers once the 30-day dead-code window passes (after 13 Nov 2026)",
"detail": "The /api/proxy route only replies authenticated and nothing calls it. scripts/recalculate-answer-support-labels.ts and its test are run by nothing. The 11 developer tool pages under src/app/mockups/development are now unreachable duplicates of /admin/developer-hub. The safe-number editor, attendance roster, QR check-in helper and clinical note editor are unwired; wire or remove each, and the note editor needs a privacy review before use. The clinical-math calculators need ideal body weight guidance, a corrected lithium dialysis label, a consistent 1.2 mmol/L boundary and tablet-strength rounding before any use.",
"source": "PR 3538 review, 15 Oct 2026",
"issueUlid": "01M4ZM796108216B8VGP235CHK"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": 2,
"id": "0f007792-605d-4f25-af8d-89f7c2ed95be",
"createdOn": "2026-10-15",
"action": "add",
"payload": {
"pri": "P2",
"type": "issue",
"summary": "PR 3538 raised every bundle size budget without a recorded approval",
"detail": "bundle-budget.json total production budget rose about 8 percent and compressed about 17 percent, and all 13 route budgets rose 2 to 10 percent, while the comment still cites only the 13 Oct approval for two routes. Measure the real sizes and either find the growth or record the owner approval for the new baseline.",
"source": "PR 3538 review, 15 Oct 2026",
"issueUlid": "01M4ZM797AVHR3TJ7Y3CWK3H4T"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": 2,
"id": "145b648c-1cc9-4283-a136-2d0e02ac53cf",
"createdOn": "2026-10-15",
"action": "cancel",
"payload": {
"requestId": "9f54ed09-1500-4eba-90b1-0a25a148d3cf",
"reason": "PR 3538 review (15 Oct 2026): scripts/recalculate-answer-support-labels.ts is run by nothing and uses its own 0.82/0.64 thresholds that production does not use; its test checks that copy, not the live label logic. The separate storage-version done request stands."
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": 2,
"id": "15c1027e-6835-49eb-bd98-54f697b3388c",
"createdOn": "2026-10-15",
"action": "add",
"payload": {
"pri": "P2",
"type": "task",
"summary": "Check the live Tall Man drug lettering list against the ACSQHC National Tall Man list",
"detail": "src/lib/medications/tall-man.ts is live on medication search and record pages but was never checked against the official list. Doubtful: citaloPRAM/escitaloPRAM and fluPENtixol/zucloPENthixol capitalise the shared stem so they do not separate the pair, CLONazepam differs from ISMP clonazePAM, and VALproate, midazolAM, temazePAM, oxazePAM need checking. Matching is exact-name only. Needs owner verification.",
"source": "PR 3538 review, 15 Oct 2026",
"issueUlid": "01M4ZM794RF3B2XCAJ2YDRJ8FG"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": 2,
"id": "5357c11a-9e2e-4f23-9474-87e40db67b3d",
"createdOn": "2026-10-15",
"action": "cancel",
"payload": {
"requestId": "e978e1fd-70a4-43f3-a547-6f7e67ff3bf8",
"reason": "PR 3538 review (15 Oct 2026): the component exists with tests, but no page in the app renders it, so the item is not done for a clinician."
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": 2,
"id": "8eed5dff-8f00-4b4d-9e42-22d3588d9164",
"createdOn": "2026-10-15",
"action": "add",
"payload": {
"pri": "P1",
"type": "issue",
"summary": "Unwired WA MHA Form 6A/6B print component carries unverified statutory text",
"detail": "src/components/forms/wa-mha-form-print.tsx (PR #3538) says Form 6B needs Chief Psychiatrist consent, while src/lib/form-register.ts calls the 6B attachment a report to the Chief Psychiatrist. Section lists, the 7-day pre-expiry examination and copy recipients are unverified, and it prints WA Government branding. Fabricated default patient, clinician and consent values were removed on 15 Oct. Nothing renders it. Delete it once the 30-day dead-code window passes (after 13 Nov 2026) unless legal and clinical sign-off is obtained first.",
"source": "PR 3538 review, 15 Oct 2026",
"issueUlid": "01M4ZM793BWFYDV65NNBHBP53K"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": 2,
"id": "9f5e9e17-6b34-4f91-adc2-ba1275821021",
"createdOn": "2026-10-15",
"action": "cancel",
"payload": {
"requestId": "563d11b8-515b-402e-a3ae-ef8ba5991105",
"reason": "PR 3538 review (15 Oct 2026): the component exists with tests, but no page in the app renders it, so the item is not done for a clinician."
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": 2,
"id": "ecbe4970-41ef-45e7-b731-6f31a5df480c",
"createdOn": "2026-10-15",
"action": "cancel",
"payload": {
"requestId": "b820ca6c-4882-4a09-85c7-a87505cb0f20",
"reason": "PR 3538 review (15 Oct 2026): the component exists with tests, but no page in the app renders it, so the item is not done for a clinician."
}
}

This file was deleted.

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions src/app/api/differentials/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,10 @@ export async function GET(request: Request) {
degraded: canonical.degraded,
governance: Object.fromEntries(canonical.records.map((entry) => [entry.workflow.id, entry.governance])),
},
// `fixture` lengthens public cacheability for canonical public responses, but is withheld
// when `canonical.degraded` is true to avoid pinning a temporary seed fallback.
{ request, fixture: !canonical.degraded },
// Not widened to `canonical.degraded`: `fixture` lengthens public cacheability, which is
// right for an uninitialised corpus and wrong for a degraded read that may heal in the
// thirty-second cooldown. Same reasoning as the registry list route.
{ request, fixture: observed.source === "seed_uninitialized" },
);
}
const differentialSeeds = differentialRecords.map((record) => ({
Expand Down Expand Up @@ -238,7 +239,7 @@ export async function GET(request: Request) {
degraded: canonical.degraded,
governance: Object.fromEntries(canonical.records.map((entry) => [entry.record.slug, entry.governance])),
},
{ request, fixture: !canonical.degraded },
{ request, fixture: observed.source === "seed_uninitialized" },
);
} catch (error) {
// A cancelled request is not a fault: answer 499, exactly as the catch in /api/search does.
Expand Down
6 changes: 3 additions & 3 deletions src/app/api/medications/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ export async function GET(request: Request) {
// turns it into the "Retained copy" notice.
...(canonical.degraded ? { retainedSnapshot: true as const } : {}),
},
// `fixture` lengthens public caching for canonical public responses, but is withheld when
// `canonical.degraded` is true to avoid pinning a temporary seed fallback.
{ request, fixture: !canonical.degraded },
// Not widened to cover `canonical.degraded`: `fixture` lengthens public caching, which would
// pin a stale seed list in front of a database that may recover in thirty seconds.
{ request, fixture: observed.source === "seed_uninitialized" },
);
} catch (error) {
// A cancelled request is not a fault: answer 499, exactly as the catch in /api/search does.
Expand Down
49 changes: 35 additions & 14 deletions src/components/forms/wa-mha-form-print.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ const FORM_METADATA = {
act: "Mental Health Act 2014 (WA)",
sections: "Sections 61, 89, 90, 131",
purpose: "Compulsory inpatient treatment in a general hospital setting due to physical health needs",
threshold: "Criteria met; Chief Psychiatrist consent obtained; physical health transfer risk is significant",
threshold:
"Criteria met; Chief Psychiatrist consent required (status shown below); physical health transfer risk is significant",
destination: "General Hospital",
statutoryNotes: [
"Authorises compulsory inpatient treatment in a general hospital setting.",
Expand All @@ -52,36 +53,56 @@ const FORM_METADATA = {
},
} as const;

// A blank field prints as a visible gap, never as invented patient, clinician or clinical content.
const NOT_ENTERED = "Not entered";

/**
* Printable leaf component for WA Mental Health Act 2014 Form 6A and 6B (#C4CFFP).
*
* Designed to ensure form headers, titles, and statutory metadata print visibly
* without rendering blank under browser print media rules.
*
* NOT FOR USE YET. Nothing renders this component. Its statutory text (section lists, the
* 6B Chief Psychiatrist wording, examination timing and copy recipients) has not been checked
* against the Act, and the app's own forms register describes the 6B attachment as a report to
* the Chief Psychiatrist rather than a consent. It needs legal and clinical sign-off before it
Comment thread
qodo-code-review[bot] marked this conversation as resolved.
Resolved
* is wired into any page.
*/
export function WaMhaFormPrint({
formCode,
patientName = "Smith, John",
patientDob = "1985-04-12",
patientId = "UMRN-984210",
facilityName = "Perth Mental Health Service",
treatingPsychiatrist = "Dr. C. Reynolds (Consultant Psychiatrist)",
orderDateTime = new Date().toISOString().slice(0, 16).replace("T", " "),
patientName = NOT_ENTERED,
patientDob = NOT_ENTERED,
Comment thread
qodo-code-review[bot] marked this conversation as resolved.
Resolved
Comment thread
codeant-ai[bot] marked this conversation as resolved.
Resolved
patientId = NOT_ENTERED,
facilityName = NOT_ENTERED,
treatingPsychiatrist = NOT_ENTERED,
orderDateTime = NOT_ENTERED,
expiryDateTime,
isChild = false,
leastRestrictiveReasoning = "Voluntary options exhausted; severe risk of serious deterioration without inpatient compulsory treatment.",
physicalHealthJustification = "Requires active intravenous therapy and cardiac monitoring requiring general medical ward detention.",
chiefPsychiatristConsent = true,
isChild,
leastRestrictiveReasoning = NOT_ENTERED,
physicalHealthJustification = NOT_ENTERED,
chiefPsychiatristConsent = false,
Comment thread
BigSimmo marked this conversation as resolved.
Resolved
className = "",
}: WaMhaFormPrintProps) {
const meta = FORM_METADATA[formCode];
const maxDays = isChild ? 14 : 21;
// Age class is unknown until the caller states it, so no age-specific period prints by default.
const ageClass = isChild === undefined ? NOT_ENTERED : isChild ? "Child" : "Adult";
const maxPeriod = isChild === undefined ? "Not determined" : `${isChild ? 14 : 21} days`;

return (
<div
className={`wa-mha-form-print p-6 max-w-4xl mx-auto bg-[color:var(--surface)] text-[color:var(--text-heading)] font-sans ${className}`}
data-wa-mha-form-print="true"
data-testid="wa-mha-form-print-root"
>
<p
className="mb-4 border-2 border-[color:var(--text-heading)] p-2 text-sm font-bold"
data-print-header="true"
data-testid="form-not-for-use-warning"
role="note"
>
DRAFT, NOT FOR CLINICAL OR LEGAL USE. The statutory wording on this form has not been verified against the
Mental Health Act 2014 (WA).
</p>
{/* Printable Form Header - ensured visible via @media print in print.css */}
<header
className="wa-mha-print-header form-print-header border-b-2 border-[color:var(--text-heading)] pb-4 mb-4"
Expand Down Expand Up @@ -124,7 +145,7 @@ export function WaMhaFormPrint({
<strong>Facility Setting:</strong> {meta.destination}
</span>
<span>
<strong>Maximum Initial Period:</strong> {maxDays} days ({isChild ? "Child" : "Adult"})
<strong>Maximum Initial Period:</strong> {maxPeriod} ({ageClass})
</span>
Comment thread
gitar-bot[bot] marked this conversation as resolved.
Resolved
</div>
<p className="italic">{meta.purpose}</p>
Expand All @@ -143,7 +164,7 @@ export function WaMhaFormPrint({
<span className="font-semibold">Full Name:</span> {patientName}
</td>
<td className="w-1/3 p-1.5 border border-[color:var(--text-heading)]">
<span className="font-semibold">DOB:</span> {patientDob} ({isChild ? "Child" : "Adult"})
<span className="font-semibold">DOB:</span> {patientDob} ({ageClass})
</td>
<td className="w-1/3 p-1.5 border border-[color:var(--text-heading)]">
<span className="font-semibold">Identifier:</span> {patientId}
Expand Down
2 changes: 1 addition & 1 deletion src/data/therapies-source.json
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@
"clinicalSummary": "Advocacy-informed therapeutic work. A recovery-oriented and socially informed clinical approach in which therapeutic work explicitly includes identifying, addressing, or helping the patient navigate structural barriers and rights-related issues that are worsening distress or blocking recovery. In RANZCP’s recovery statement, advocacy is named as one of the central elements of recovery, alongside hope, self-determination, self-management, empowerment, and rehabilitation. (RANZCP)",
"bestUsedFor": "Best in community psychiatry, rehabilitation, severe mental illness, complex psychosocial presentations, and recovery-oriented care where progress depends on both treatment and access to practical supports. Australian Government psychosocial support programmes explicitly aim to help people with severe mental health challenges live independently and safely in the community and reduce reliance on more acute services. (Dept of Health, Disability & Ageing)",
"indications": "Best in community psychiatry, rehabilitation, severe mental illness, complex psychosocial presentations, and recovery-oriented care where progress depends on both treatment and access to practical supports. Australian Government psychosocial support programmes explicitly aim to help people with severe mental health challenges live independently and safely in the community and reduce reliance on more acute services. (Dept of Health, Disability & Ageing) Distress maintained by housing instability, service exclusion, stigma, fragmented care, lack of practical support, financial or vocational barriers, and reduced ability to advocate for one’s own needs. It also targets disengagement that occurs when treatment ignores what is materially blocking recovery. This is partly drawn from recovery-oriented practice and partly an inference about how advocacy functions clinically. (RANZCP) Reduce the impact of structural barriers on mental health, improve engagement and recovery, increase agency, and help the person access the supports needed to live more independently and participate more fully in community life. (RANZCP)",
"contraindicationsOrCautions": "Check current risk, acuity, decisional capacity for the issue at hand, immediate safeguarding needs, and whether the main problem is truly an access/rights/barrier problem versus a syndrome requiring urgent diagnosis-specific treatment. Also check whether the clinician or team actually has a realistic pathway to advocate effectively rather than only naming the barrier. (RANZCP) It is not a substitute for acute treatment, medication optimisation, or diagnosis-specific psychotherapy. It is also weak if the clinician focuses on advocacy language without practical follow-through, or if the main clinical driver is acute illness severity rather than external barriers. (RANZCP)",
"contraindicationsOrCautions": "Check current risk, acuity, decisional capacity for the issue at hand, immediate safeguarding needs, and whether the main problem is truly an access/rights/barrier problem versus a syndrome requiring urgent diagnosis-specific treatment. Also check whether the clinician or team actually has a realistic pathway to advocate effectively rather than only naming the barrier. This final point is a clinical inference. (RANZCP) It is not a substitute for acute treatment, medication optimisation, or diagnosis-specific psychotherapy. It is also weak if the clinician focuses on advocacy language without practical follow-through, or if the main clinical driver is acute illness severity rather than external barriers. (RANZCP)",
"deliverySteps": "Clarify the patient’s goals, identify the structural or service barriers blocking those goals, map who or what needs to change, then integrate advocacy into the therapeutic plan. That may include care coordination, support with referrals, housing or vocational linkage, navigating supports, documenting functional impact clearly, and helping the patient communicate preferences and rights. Recovery-oriented practice supports engagement in treatment decisions and social determinants work, while the Commonwealth Psychosocial Support Program explicitly includes connecting people with needed services and strengthening social, educational, and vocational skills. (RANZCP)",
"patientExplanation": "Improve outcomes by combining therapeutic engagement with practical attention to social determinants, access barriers, discrimination, service obstacles, and rights-related problems, rather than treating symptoms as if they exist in isolation from the person’s real-world context. RANZCP states that recovery-oriented practice includes supporting people to work across social determinants of health such as housing, social contacts, exercise, and work. (RANZCP) It is used to target: Distress maintained by housing instability, service exclusion, stigma, fragmented care, lack of practical support, financial or vocational barriers, and reduced ability to advocate for one’s own needs. It also targets disengagement that occurs when treatment ignores what is materially blocking recovery. This is partly drawn from recovery-oriented practice and partly an inference about how advocacy functions clinically. (RANZCP) In practice, the clinician may use these steps: Clarify the patient’s goals, identify the structural or service barriers blocking those goals, map who or what needs to change, then integrate advocacy into the therapeutic plan. That may include care coordination, support with referrals, housing or vocational linkage, navigating supports, documenting functional impact clearly, and helping the patient communicate preferences and rights. Recovery-oriented practice supports engagement in treatment decisions and social determinants work, while the Commonwealth Psychosocial Support Program explicitly includes connecting people with needed services and strengthening social, educational, and vocational skills. (RANZCP) Advocacy-informed work is most useful when it turns “social determinants matter” into specific therapeutic action on the barriers that are actually keeping the patient unwell or stuck. (RANZCP)",
"sourceNotes": "RANZCP *Recovery and the psychiatrist* position statement. (RANZCP) Australian Government psychosocial support pages, including the Commonwealth Psychosocial Support Program. (Dept of Health, Disability & Ageing) NICE rehabilitation guidance for complex psychosis, used for the broader rehabilitation and support context. (NICE)",
Expand Down
4 changes: 2 additions & 2 deletions src/data/therapy-catalogue-assets.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Generated by scripts/build-therapies-index.mjs. Do not edit.
export const THERAPY_CATALOGUE_ASSETS = {
full: "therapies.71bd8dd41803f8d4.json",
full: "therapies.8147276e2221ad3d.json",
Comment thread
qodo-code-review[bot] marked this conversation as resolved.
Resolved
index: "therapies-index.27a5bdeb80d3aa6d.json",
} as const;

Expand All @@ -10,7 +10,7 @@ export const THERAPY_CATALOGUE_ASSETS = {
// pruned. `useTherapyData` also falls back to the unversioned alias for
// bundles that include that fallback (pre-fallback clients are best-effort).
export const THERAPY_CATALOGUE_ASSETS_PREVIOUS = {
full: "therapies.72ac900e1632e4e2.json",
full: "therapies.71bd8dd41803f8d4.json",
index: "therapies-index.0258501ace4a62fd.json",
} as const;

Expand Down
2 changes: 1 addition & 1 deletion src/lib/site-content/site-content-change-owners.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"public/therapy-compass-data/therapies-index.0258501ace4a62fd.json",
"public/therapy-compass-data/therapies-index.27a5bdeb80d3aa6d.json",
"public/therapy-compass-data/therapies.71bd8dd41803f8d4.json",
"public/therapy-compass-data/therapies.72ac900e1632e4e2.json",
"public/therapy-compass-data/therapies.8147276e2221ad3d.json",
"src/components/therapy-compass/data/generated-assets.ts",
"src/data/therapy-catalogue-assets.ts",
"src/lib/therapies.ts",
Expand Down
Loading
Loading