Take history from me

I'll take a structured clinical history from you. Let's start with the most important question:

What brings you in today?
What is your main complaint or problem - the symptom or issue that's bothering you the most?
attachment
attachment

Take history of it from me in option styles

Asking for Preferences
Asking for Preferences
Asking for Preferences
Asking for Preferences
Asking for Preferences
Asking for Preferences
Asking for Preferences
Asking for Preferences
Asking for Preferences

๐Ÿ“‹ History Summary

Here is a structured summary of the history collected:

Presenting Complaint

Skin rash on the thigh/hip area - clustered erythematous papules and vesicles in grouped patches.

History of Presenting Complaint

ParameterDetail
Duration4-7 days
OnsetGradual, appeared over several days
CharacterGrouped vesicular papules on erythematous base
SiteThigh / hip region (unilateral, localized)
SpreadLocalized - confined to one area
Associated sensationItching only
Systemic symptomsFever, headache, and malaise
TriggerContact with plants or animals

Past Medical History

  • No previous skin problems
  • No known allergies

Drug History

  • No current medications

Social / Exposure History

  • Contact with wild or stray animals
  • Possible zoonotic exposure

โš ๏ธ Clinical Impression (Preliminary)

Based on this history and the image, the combination of:
  • Grouped vesicles on an erythematous base
  • Unilateral, localized distribution
  • Gradual onset over days
  • Fever + headache + malaise (systemic prodrome)
  • Contact with animals
Raises suspicion for:
  1. Herpes Zoster (Shingles) - grouped vesicles in a dermatomal pattern with prodromal fever/malaise - top differential
  2. Insect/arthropod bites from animal contact (flea, mite) - multiple grouped lesions
  3. Contact dermatitis (plant/animal contact) - though systemic symptoms make this less likely
  4. Rickettsia / zoonotic infection - given animal contact + systemic features
Recommendation: This warrants prompt clinical evaluation. The systemic symptoms (fever, headache, malaise) alongside a vesicular rash are a red flag combination requiring urgent assessment to rule out serious infections.

The rashes are on the back

Asking for Preferences
Asking for Preferences
Asking for Preferences
Asking for Preferences
Asking for Preferences

๐Ÿ“‹ Updated & Complete History Summary


Presenting Complaint

Vesicular skin rash on the right side of the back - 4 to 7 days duration.

History of Presenting Complaint

ParameterDetail
SiteRight side of the back only
Duration4-7 days
OnsetGradual over several days
ProdromeItching preceded the rash appearance
Systemic prodromeFever, headache, malaise
CharacterGrouped vesicles on erythematous base (seen in image)
SpreadUnilateral - does NOT cross the midline
SensationItching only (no burning or pain currently)
TriggerContact with plants / animals; contact with stray/wild animals

Past Medical & Vaccination History

  • Chickenpox (varicella) in childhood - confirmed
  • No other skin problems
  • No immunocompromising conditions

Drug History

  • No current medications

Social History

  • Under 20 years old
  • Contact with wild/stray animals

๐Ÿ” Clinical Impression

The history is highly consistent with Herpes Zoster (Shingles):
FeatureThis Patient
Prior varicella infectionโœ… Yes - chickenpox in childhood
Unilateral distributionโœ… Right side only
Does not cross midlineโœ… Confined to one side
Dermatomal grouped vesiclesโœ… Seen on image
Prodromal symptomsโœ… Itching before rash + fever/headache/malaise
Note: Zoster in a patient under 20 with no immunosuppression is uncommon but does occur - it warrants checking for an underlying immune deficiency (e.g. undiagnosed HIV, hematological malignancy) even if none is currently known.
Urgent clinical evaluation and likely antiviral therapy (Acyclovir/Valacyclovir) within 72 hours of rash onset is recommended.

Find latest clinical guidelines for treating herpes zoster

Reading File
Finding Sources
Searching PubMed

"herpes zoster"[MeSH Terms] AND "treatment"[MeSH Terms]

Searching the Web

herpes zoster clinical guidelines 2024 2025 treatment antiviral

Reading File
Searching PubMed

"herpes zoster" AND "antiviral" AND "postherpetic neuralgia"

Reading Web Page

https://pijnnagordelroos.nl/wp-content/uploads/2025/10/19052โ€ฆ

Excellent - I have comprehensive data from Fitzpatrick's Dermatology, the 2025 German S2k Guidelines, and recent PubMed evidence. Here is the full clinical guidelines summary:

๐Ÿฆ  Herpes Zoster (Shingles) - Latest Clinical Treatment Guidelines

Sources: Fitzpatrick's Dermatology (Textbook) | S2k Guidelines, Journal of the German Dermatological Society (2025) | Queensland/SA Health Clinical Practice Guidelines (July-Sept 2025) | PubMed Meta-Analyses 2023-2025

1. General Treatment Goals

Treatment targets three main outcomes:
  • Limit the extent, duration, and severity of the rash and acute pain
  • Prevent visceral/CNS dissemination
  • Prevent or reduce Post-Herpetic Neuralgia (PHN) - the most common serious complication

2. Antiviral Therapy - The Cornerstone of Treatment

Timing (Critical)

Start within 72 hours of rash onset for maximum benefit. This is the single most important factor.
  • Even after 72 hours, antivirals should still be started if: new vesicles are still appearing, signs of dissemination exist, the patient has herpes zoster ophthalmicus/oticus, or the patient is immunocompromised (S2k Guideline Recommendation #25, 2025).

Drug Options and Dosing

Patient GroupPreferred RegimenAlternative
Normal host, age < 50Valacyclovir 1g orally 3x/day x 7 daysFamciclovir 500mg orally 3x/day x 7 days
Normal host, age โ‰ฅ 50Valacyclovir 1g orally 3x/day x 7 daysFamciclovir 500mg orally 3x/day x 7 days
Any age, cranial nerve involvementValacyclovir 1g orally 3x/day x 7 daysIV Acyclovir if severe
Mild immunocompromise / HIVValacyclovir 1g orally 3x/day x 7-10 daysFamciclovir 500mg 3x/day x 7-10 days
Severe immunocompromiseIV Acyclovir 10 mg/kg every 8h x 7-10 days-
Renal impairmentBrivudine (oral) OR dose-adjusted IV Acyclovir-
Valacyclovir and Famciclovir are preferred over Acyclovir due to better oral bioavailability, higher blood levels, and more convenient 3x/day dosing (vs. Acyclovir's 5x/day). - Fitzpatrick's Dermatology
A 2023 network meta-analysis (PMID: 37535772) confirmed Valacyclovir and Famciclovir are superior to Acyclovir for pain reduction in immunocompetent patients.

3. Indications for IV Antiviral Therapy

Per S2k 2025 Guideline (Recommendation #22), IV Acyclovir is required for:
  • Herpes zoster of the head and neck (especially elderly)
  • Hemorrhagic/necrotic lesions, multisegmental involvement
  • Immunosuppressed patients with any severity
  • Visceral or CNS involvement (including zoster-associated vasculitis)
  • Acute retinal necrosis (Acyclovir IV 10mg/kg 3x/day x 7-10 days, then oral for 3-4 months)

4. Pain Management

Pain TypeTreatment
Mild acute painParacetamol / NSAIDs
Moderate-severe acute painOpioids (tramadol, oxycodone) short-term
Neuropathic componentGabapentin or Pregabalin
Topical (localized pain)Lidocaine patches, capsaicin cream
Post-Herpetic Neuralgia (PHN)Tricyclic antidepressants (amitriptyline), Gabapentinoids, SNRIs

5. Topical Skin Care

  • Cool compresses, calamine lotion, cornstarch, or baking soda to soothe lesions
  • Do NOT use occlusive ointments, topical steroids, or topical antivirals (ineffective)
  • If bacterial superinfection occurs: warm soaks; systemic antibiotics if cellulitis develops
  • Keep lesions covered with appropriate dressings until no longer infectious

6. When to Refer Urgently (within 24 hours)

Per SA/QLD Health Guidelines (2025):
  • Diagnosis is unclear or atypical presentation
  • Patient is pregnant without confirmed prior VZV history
  • Immunocompromised patient
  • Ophthalmic zoster (eye/forehead involvement)
  • Multidermatomal rash
  • Signs of CNS or visceral involvement
  • No response to treatment or worsening

7. Special Note for This Patient (Under 20, No Immunosuppression)

Per Fitzpatrick's and S2k guidelines:
  • Age < 50 with no risk factors - symptomatic treatment alone is acceptable OR antivirals may be given
  • However, given systemic symptoms (fever, headache, malaise), antiviral treatment is recommended
  • Zoster in a patient under 20 without known immunosuppression should prompt screening for occult immunodeficiency (HIV, haematological malignancy)

8. Prevention - Vaccination

  • Shingrix (recombinant zoster vaccine, RZV) is the only recommended vaccine - 2-dose series, ~97% efficacy
  • Zostavax (live attenuated) was deregistered in Australia in December 2024
  • Recommended for adults โ‰ฅ 50 years and immunocompromised individuals โ‰ฅ 18 years

Bottom line for this patient: Oral Valacyclovir 1g 3x/day for 7 days should be started as soon as possible (ideally within 72 hours of rash onset), combined with adequate analgesia. Evaluate for underlying immunodeficiency given the atypical young age presentation.

Generate a patient education handout on herpes zoster care and PHN prevention

Reading File
Running Command

mkdir -p /home/daytona/workspace/herpes-zoster-handout && ls /home/daytona/workspace/herpes-zoster-handout

Writing File

~/herpes-zoster-handout/generate_handout.js

const {
  Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
  HeadingLevel, AlignmentType, BorderStyle, WidthType, ShadingType,
  VerticalAlign, PageNumber, Header, Footer, ImageRun
} = require('docx');
const fs = require('fs');

// โ”€โ”€ colour palette โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
const BRAND_BLUE   = "1A5276";   // dark header blue
const ACCENT_TEAL  = "148F77";   // section heading teal
const WARN_RED     = "C0392B";   // warning boxes
const LIGHT_BLUE   = "D6EAF8";   // shaded rows / call-out bg
const LIGHT_GREEN  = "D5F5E3";   // positive tip boxes
const LIGHT_RED    = "FADBD8";   // warning box bg
const LIGHT_GREY   = "F2F3F4";   // alternating table rows
const WHITE        = "FFFFFF";

// โ”€โ”€ helpers โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
const bold = (text, size = 22, color = "000000") =>
  new TextRun({ text, bold: true, size, color, font: "Calibri" });

const normal = (text, size = 20, color = "2C3E50") =>
  new TextRun({ text, size, color, font: "Calibri" });

const para = (children, spacing = 120, align = AlignmentType.LEFT) =>
  new Paragraph({ children, alignment: align, spacing: { after: spacing } });

const heading1 = (text) =>
  new Paragraph({
    children: [new TextRun({ text, bold: true, size: 28, color: WHITE, font: "Calibri" })],
    alignment: AlignmentType.CENTER,
    spacing: { before: 0, after: 0 },
    shading: { type: ShadingType.SOLID, color: BRAND_BLUE, fill: BRAND_BLUE }
  });

const sectionHeading = (text) =>
  new Paragraph({
    children: [new TextRun({ text: `  ${text}`, bold: true, size: 24, color: WHITE, font: "Calibri" })],
    alignment: AlignmentType.LEFT,
    spacing: { before: 200, after: 80 },
    shading: { type: ShadingType.SOLID, color: ACCENT_TEAL, fill: ACCENT_TEAL }
  });

const subHeading = (text) =>
  new Paragraph({
    children: [new TextRun({ text, bold: true, size: 22, color: BRAND_BLUE, font: "Calibri" })],
    spacing: { before: 160, after: 60 }
  });

const bullet = (text, bold_prefix = "") =>
  new Paragraph({
    children: [
      ...(bold_prefix ? [new TextRun({ text: bold_prefix + " ", bold: true, size: 20, font: "Calibri" })] : []),
      new TextRun({ text, size: 20, color: "2C3E50", font: "Calibri" })
    ],
    bullet: { level: 0 },
    spacing: { after: 60 }
  });

const calloutBox = (label, text, bgColor, labelColor = WHITE) =>
  new Table({
    width: { size: 100, type: WidthType.PERCENTAGE },
    borders: {
      top:    { style: BorderStyle.SINGLE, size: 6, color: labelColor === WHITE ? WARN_RED : ACCENT_TEAL },
      bottom: { style: BorderStyle.SINGLE, size: 6, color: labelColor === WHITE ? WARN_RED : ACCENT_TEAL },
      left:   { style: BorderStyle.SINGLE, size: 6, color: labelColor === WHITE ? WARN_RED : ACCENT_TEAL },
      right:  { style: BorderStyle.SINGLE, size: 6, color: labelColor === WHITE ? WARN_RED : ACCENT_TEAL },
    },
    rows: [
      new TableRow({
        children: [
          new TableCell({
            children: [
              new Paragraph({
                children: [new TextRun({ text: label, bold: true, size: 20, color: WHITE, font: "Calibri" })],
                shading: { type: ShadingType.SOLID, color: bgColor, fill: bgColor },
                spacing: { before: 60, after: 60 },
                indent: { left: 120 }
              }),
              new Paragraph({
                children: [new TextRun({ text, size: 20, color: "2C3E50", font: "Calibri" })],
                spacing: { before: 80, after: 80 },
                indent: { left: 120 }
              })
            ],
            shading: { type: ShadingType.SOLID, color: bgColor === WARN_RED ? LIGHT_RED : LIGHT_GREEN, fill: bgColor === WARN_RED ? LIGHT_RED : LIGHT_GREEN },
            margins: { top: 80, bottom: 80, left: 80, right: 80 }
          })
        ]
      })
    ],
    margins: { top: 80, bottom: 80 }
  });

const spacer = (space = 100) =>
  new Paragraph({ children: [new TextRun(" ")], spacing: { after: space } });

// โ”€โ”€ two-column info table โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
const infoTable = (rows) =>
  new Table({
    width: { size: 100, type: WidthType.PERCENTAGE },
    borders: {
      insideH: { style: BorderStyle.SINGLE, size: 2, color: "BDC3C7" },
      insideV: { style: BorderStyle.SINGLE, size: 2, color: "BDC3C7" },
      top:    { style: BorderStyle.SINGLE, size: 4, color: ACCENT_TEAL },
      bottom: { style: BorderStyle.SINGLE, size: 4, color: ACCENT_TEAL },
      left:   { style: BorderStyle.SINGLE, size: 4, color: ACCENT_TEAL },
      right:  { style: BorderStyle.SINGLE, size: 4, color: ACCENT_TEAL },
    },
    rows: rows.map(([label, value], i) =>
      new TableRow({
        children: [
          new TableCell({
            children: [new Paragraph({
              children: [new TextRun({ text: label, bold: true, size: 20, font: "Calibri", color: BRAND_BLUE })],
              spacing: { before: 60, after: 60 }, indent: { left: 80 }
            })],
            width: { size: 35, type: WidthType.PERCENTAGE },
            shading: { type: ShadingType.SOLID, color: i % 2 === 0 ? LIGHT_BLUE : WHITE, fill: i % 2 === 0 ? LIGHT_BLUE : WHITE },
            verticalAlign: VerticalAlign.CENTER
          }),
          new TableCell({
            children: [new Paragraph({
              children: [new TextRun({ text: value, size: 20, font: "Calibri", color: "2C3E50" })],
              spacing: { before: 60, after: 60 }, indent: { left: 80 }
            })],
            width: { size: 65, type: WidthType.PERCENTAGE },
            shading: { type: ShadingType.SOLID, color: i % 2 === 0 ? LIGHT_BLUE : WHITE, fill: i % 2 === 0 ? LIGHT_BLUE : WHITE },
            verticalAlign: VerticalAlign.CENTER
          })
        ]
      })
    )
  });

// โ”€โ”€ medication table โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
const medTable = (headers, rows) =>
  new Table({
    width: { size: 100, type: WidthType.PERCENTAGE },
    borders: {
      insideH: { style: BorderStyle.SINGLE, size: 2, color: "BDC3C7" },
      insideV: { style: BorderStyle.SINGLE, size: 2, color: "BDC3C7" },
      top:    { style: BorderStyle.SINGLE, size: 4, color: BRAND_BLUE },
      bottom: { style: BorderStyle.SINGLE, size: 4, color: BRAND_BLUE },
      left:   { style: BorderStyle.SINGLE, size: 4, color: BRAND_BLUE },
      right:  { style: BorderStyle.SINGLE, size: 4, color: BRAND_BLUE },
    },
    rows: [
      new TableRow({
        tableHeader: true,
        children: headers.map(h =>
          new TableCell({
            children: [new Paragraph({
              children: [new TextRun({ text: h, bold: true, size: 20, font: "Calibri", color: WHITE })],
              alignment: AlignmentType.CENTER, spacing: { before: 60, after: 60 }
            })],
            shading: { type: ShadingType.SOLID, color: BRAND_BLUE, fill: BRAND_BLUE },
            verticalAlign: VerticalAlign.CENTER
          })
        )
      }),
      ...rows.map((cols, i) =>
        new TableRow({
          children: cols.map(c =>
            new TableCell({
              children: [new Paragraph({
                children: [new TextRun({ text: c, size: 19, font: "Calibri", color: "2C3E50" })],
                spacing: { before: 60, after: 60 }, indent: { left: 80 }
              })],
              shading: { type: ShadingType.SOLID, color: i % 2 === 0 ? LIGHT_GREY : WHITE, fill: i % 2 === 0 ? LIGHT_GREY : WHITE },
              verticalAlign: VerticalAlign.CENTER
            })
          )
        })
      )
    ]
  });

// โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
// DOCUMENT CONTENT
// โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
const doc = new Document({
  styles: {
    default: {
      document: {
        run: { font: "Calibri", size: 20 }
      }
    }
  },
  sections: [{
    properties: {
      page: {
        margin: { top: 720, bottom: 720, left: 900, right: 900 }
      }
    },
    headers: {
      default: new Header({
        children: [
          new Paragraph({
            children: [
              new TextRun({ text: "PATIENT EDUCATION HANDOUT  |  Herpes Zoster (Shingles) Care & PHN Prevention", size: 16, color: "7F8C8D", font: "Calibri" }),
              new TextRun({ text: "  |  Issued: June 2026", size: 16, color: "7F8C8D", font: "Calibri" })
            ],
            alignment: AlignmentType.RIGHT,
            border: { bottom: { style: BorderStyle.SINGLE, size: 4, color: "BDC3C7" } },
            spacing: { after: 80 }
          })
        ]
      })
    },
    footers: {
      default: new Footer({
        children: [
          new Paragraph({
            children: [
              new TextRun({ text: "This handout is for educational purposes only and does not replace professional medical advice. Always follow your doctor's instructions.  |  Page ", size: 16, color: "7F8C8D", font: "Calibri" }),
              new TextRun({ children: [PageNumber.CURRENT], size: 16, color: "7F8C8D", font: "Calibri" })
            ],
            alignment: AlignmentType.CENTER,
            border: { top: { style: BorderStyle.SINGLE, size: 4, color: "BDC3C7" } },
            spacing: { before: 80 }
          })
        ]
      })
    },
    children: [

      // โ”€โ”€ TITLE BLOCK โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
      heading1("HERPES ZOSTER (SHINGLES)"),
      new Paragraph({
        children: [new TextRun({ text: "Patient Care Guide & Post-Herpetic Neuralgia (PHN) Prevention", bold: true, size: 24, color: BRAND_BLUE, font: "Calibri" })],
        alignment: AlignmentType.CENTER,
        spacing: { before: 100, after: 60 },
        shading: { type: ShadingType.SOLID, color: LIGHT_BLUE, fill: LIGHT_BLUE }
      }),
      new Paragraph({
        children: [new TextRun({ text: "For patients and caregivers  |  Based on 2025 International Clinical Guidelines", size: 18, color: "7F8C8D", font: "Calibri" })],
        alignment: AlignmentType.CENTER,
        spacing: { before: 0, after: 200 }
      }),

      // โ”€โ”€ SECTION 1: WHAT IS SHINGLES โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
      sectionHeading("1.  What Is Shingles (Herpes Zoster)?"),
      spacer(60),
      para([normal("Shingles is a painful skin rash caused by the varicella-zoster virus (VZV) - the same virus that causes chickenpox. After you recover from chickenpox, the virus stays dormant (sleeping) in your nerve cells. Years later, it can reactivate and travel along a nerve to your skin, causing shingles.")]),
      infoTable([
        ["Cause",         "Varicella-Zoster Virus (VZV) - reactivation of the chickenpox virus"],
        ["Who can get it","Anyone who has had chickenpox, at any age"],
        ["Is it contagious?", "You cannot spread shingles directly, but the fluid in the blisters CAN spread chickenpox to people who have never had it"],
        ["Duration",      "Rash typically heals in 2-4 weeks; pain may last longer"],
        ["Most common in","Adults over 50, and people with a weakened immune system"]
      ]),
      spacer(100),

      // โ”€โ”€ SECTION 2: RECOGNISING SHINGLES โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
      sectionHeading("2.  Recognising the Symptoms"),
      spacer(60),
      subHeading("Stage 1 - Before the Rash (Prodrome, 1-5 days before):"),
      bullet("Burning, tingling, or itching on one side of the body"),
      bullet("Sensitivity to touch in a specific skin area"),
      bullet("Headache, fever, and feeling generally unwell"),
      bullet("Fatigue and muscle aches"),
      spacer(60),
      subHeading("Stage 2 - The Rash Appears:"),
      bullet("Red, blotchy skin followed by clusters of fluid-filled blisters"),
      bullet("Rash appears on ONE side of the body only (usually in a band or stripe)"),
      bullet("Common locations: chest, back, abdomen, face, or around one eye"),
      bullet("Blisters break open, ooze, then crust over in 7-10 days"),
      spacer(100),

      // โ”€โ”€ SECTION 3: ANTIVIRAL MEDICATIONS โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
      sectionHeading("3.  Your Antiviral Medication"),
      spacer(60),
      para([bold("Why it matters: ", 20, WARN_RED), normal("Antiviral medicines do NOT cure shingles, but they significantly reduce severity, shorten the rash duration, and - most importantly - lower your risk of developing long-term nerve pain (PHN).")]),
      spacer(80),
      calloutBox(
        "CRITICAL - Start within 72 hours!",
        "Antiviral treatment works best when started within 72 hours (3 days) of the rash first appearing. Do not delay - contact your doctor immediately.",
        WARN_RED
      ),
      spacer(120),
      subHeading("Common Antiviral Medications:"),
      medTable(
        ["Medication", "Usual Dose", "Duration", "Notes"],
        [
          ["Valacyclovir (preferred)", "1000 mg, 3 times a day", "7 days", "Preferred: fewer daily doses, better absorption"],
          ["Famciclovir (preferred)", "500 mg, 3 times a day", "7 days", "Preferred: convenient dosing, high effectiveness"],
          ["Acyclovir", "800 mg, 5 times a day", "7 days", "Older option, more doses per day required"],
        ]
      ),
      spacer(80),
      para([bold("Important: ", 20, BRAND_BLUE), normal("Always take the full course prescribed. Do not stop early even if you feel better.")]),
      spacer(100),

      // โ”€โ”€ SECTION 4: SKIN CARE AT HOME โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
      sectionHeading("4.  Skin Care at Home"),
      spacer(60),
      subHeading("DO:"),
      bullet("Keep the rash area clean and dry"),
      bullet("Apply cool, damp compresses to soothe itching and help dry blisters"),
      bullet("Use calamine lotion or baking soda paste for itch relief"),
      bullet("Cover the rash loosely with a clean, non-stick dressing"),
      bullet("Wear loose, soft, cotton clothing to reduce friction on the skin"),
      bullet("Wash hands thoroughly before and after touching the rash"),
      spacer(80),
      subHeading("DO NOT:"),
      bullet("Do NOT scratch or pick at the blisters (risk of scarring and infection)"),
      bullet("Do NOT use topical steroid creams on the rash"),
      bullet("Do NOT use occlusive or heavy ointments on active lesions"),
      bullet("Do NOT apply topical antiviral creams (they do NOT work for shingles)"),
      bullet("Do NOT share towels, clothing, or bedding while blisters are active"),
      spacer(100),

      // โ”€โ”€ SECTION 5: PAIN MANAGEMENT โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
      sectionHeading("5.  Managing Your Pain"),
      spacer(60),
      para([normal("Pain is the most distressing symptom of shingles. Good pain control also reduces the risk of developing long-term pain (PHN). Do not ignore or 'push through' your pain - tell your doctor.")]),
      spacer(80),
      medTable(
        ["Pain Level", "Options", "Examples"],
        [
          ["Mild pain",    "Simple painkillers",              "Paracetamol (Panadol), Ibuprofen"],
          ["Moderate pain","Stronger painkillers + nerve agents","Tramadol, Codeine; Gabapentin, Pregabalin"],
          ["Severe pain",  "Specialist management",           "Short-term opioids under doctor supervision"],
          ["Nerve/burning","Neuropathic pain agents",         "Amitriptyline, Gabapentin, Pregabalin"],
          ["Topical",      "Localised cream/patch",           "Lidocaine patches, Capsaicin cream"],
        ]
      ),
      spacer(80),
      calloutBox(
        "TIP - Do not wait for pain to become severe",
        "Take your pain medication regularly as prescribed, not just when the pain becomes unbearable. Consistent pain control is more effective and may help prevent PHN.",
        ACCENT_TEAL
      ),
      spacer(100),

      // โ”€โ”€ SECTION 6: PHN PREVENTION โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
      sectionHeading("6.  Preventing Post-Herpetic Neuralgia (PHN)"),
      spacer(60),
      para([bold("What is PHN? ", 20, WARN_RED), normal("Post-Herpetic Neuralgia (PHN) is persistent nerve pain that continues for more than 90 days after the shingles rash appears. It can last months to years and significantly affects quality of life.")]),
      spacer(60),
      subHeading("Who is at higher risk of PHN?"),
      bullet("Age over 50 years (risk increases with age)"),
      bullet("Severe pain during the acute shingles episode"),
      bullet("Large or widespread rash"),
      bullet("Delayed or no antiviral treatment"),
      bullet("Weakened immune system"),
      spacer(80),
      subHeading("How to Reduce Your Risk of PHN:"),
      medTable(
        ["Strategy", "How It Helps"],
        [
          ["Start antivirals within 72 hours",        "Most effective single action - reduces nerve damage from the virus"],
          ["Control acute pain aggressively",          "Uncontrolled pain may sensitise nerves, making PHN more likely"],
          ["Complete the full antiviral course",       "Ensures the virus is fully suppressed"],
          ["Get vaccinated (future prevention)",       "Shingrix vaccine reduces risk of shingles and PHN by ~97%"],
          ["Maintain good general health",             "A stronger immune system reduces severity and complication risk"],
          ["Reduce stress",                            "Stress is a known trigger for viral reactivation"],
        ]
      ),
      spacer(100),

      // โ”€โ”€ SECTION 7: ISOLATION & INFECTION CONTROL โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
      sectionHeading("7.  Protecting Others Around You"),
      spacer(60),
      calloutBox(
        "IMPORTANT - Who to avoid while blisters are active",
        "Keep away from: pregnant women who haven't had chickenpox, newborn babies, people with weakened immune systems (e.g. chemotherapy patients), and anyone who hasn't had chickenpox or the chickenpox vaccine. You are infectious until all blisters have fully crusted over.",
        WARN_RED
      ),
      spacer(80),
      bullet("Stay home from work/school if your rash cannot be fully covered"),
      bullet("Avoid crowded public places while blisters are weeping"),
      bullet("Do not touch your rash and then touch other people or surfaces"),
      bullet("Cover all blisters with a clean, non-stick dressing when in contact with others"),
      spacer(100),

      // โ”€โ”€ SECTION 8: WHEN TO SEEK URGENT HELP โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
      sectionHeading("8.  When to Seek Urgent Medical Attention"),
      spacer(60),
      calloutBox(
        "Go to Emergency or call your doctor IMMEDIATELY if you have:",
        "โ€ข Rash or blisters near or on your EYE (can cause vision loss)\nโ€ข Rash on your ear, face, or forehead with ear pain or hearing changes\nโ€ข Weakness or paralysis in any part of your body\nโ€ข Severe headache, stiff neck, confusion, or sensitivity to light\nโ€ข High fever that is not coming down\nโ€ข Rash spreading to both sides of the body\nโ€ข Signs of skin infection: increasing redness, warmth, swelling, or pus",
        WARN_RED
      ),
      spacer(100),

      // โ”€โ”€ SECTION 9: PREVENTION - VACCINATION โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
      sectionHeading("9.  Prevention - The Shingrix Vaccine"),
      spacer(60),
      para([normal("The best way to prevent shingles and PHN is vaccination. Even if you have already had shingles, you can still be vaccinated to reduce the risk of it happening again.")]),
      spacer(60),
      infoTable([
        ["Vaccine Name",        "Shingrix (Recombinant Zoster Vaccine, RZV)"],
        ["Doses",               "2 doses, given 2-6 months apart"],
        ["Effectiveness",       "~97% effective against shingles; ~91% against PHN"],
        ["Who should get it",   "Adults aged 50 and over; immunocompromised adults aged 18+"],
        ["Even after shingles?","Yes - talk to your doctor about the right time (usually after recovery)"],
        ["Live vaccine (Zostavax)","No longer available in Australia - deregistered December 2024"],
      ]),
      spacer(100),

      // โ”€โ”€ SECTION 10: RECOVERY TIMELINE โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
      sectionHeading("10.  What to Expect - Recovery Timeline"),
      spacer(60),
      medTable(
        ["Timeframe", "What Typically Happens"],
        [
          ["Days 1-5",     "Redness, blistering, and peak pain. Antivirals and pain relief most critical now."],
          ["Days 5-10",    "Blisters begin to dry and crust over. Pain may continue."],
          ["Weeks 2-4",    "Crusts fall off. Skin may remain red or discoloured. Pain should start improving."],
          ["After 4 weeks","Most people fully recover. A minority develop PHN (prolonged nerve pain)."],
          ["If PHN occurs","Pain persists beyond 90 days. Requires specific nerve pain treatments."],
        ]
      ),
      spacer(100),

      // โ”€โ”€ SECTION 11: SELF-CARE TIPS โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
      sectionHeading("11.  General Self-Care Tips"),
      spacer(60),
      bullet("Rest as much as your body needs - fatigue is normal during shingles"),
      bullet("Eat a healthy, balanced diet to support your immune system"),
      bullet("Stay hydrated - drink 6-8 glasses of water daily"),
      bullet("Avoid alcohol while taking antiviral medications"),
      bullet("Do not drive if pain or medications affect your concentration"),
      bullet("Wear sunscreen on healed skin - it may be more sensitive to sunlight for several months"),
      bullet("Consider keeping a pain diary to share with your doctor at follow-up visits"),
      spacer(100),

      // โ”€โ”€ SECTION 12: FOLLOW-UP โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
      sectionHeading("12.  Follow-Up & When to Return to Your Doctor"),
      spacer(60),
      bullet("Return if rash is not improving after 7-10 days of antiviral treatment"),
      bullet("Return if pain is worsening or not controlled with prescribed medications"),
      bullet("Schedule a follow-up 4 weeks after the rash to check for PHN"),
      bullet("Discuss shingles vaccination once fully recovered"),
      bullet("Report any new neurological symptoms: weakness, numbness, vision or hearing changes"),
      spacer(120),

      // โ”€โ”€ FOOTER CALLOUT โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
      new Paragraph({
        children: [new TextRun({ text: "Questions? Contact your healthcare provider. Do not adjust medications without medical advice.", bold: true, size: 19, color: WHITE, font: "Calibri" })],
        alignment: AlignmentType.CENTER,
        shading: { type: ShadingType.SOLID, color: BRAND_BLUE, fill: BRAND_BLUE },
        spacing: { before: 100, after: 80 },
        indent: { left: 120, right: 120 }
      }),

    ] // end children
  }]
});

// Write file
Packer.toBuffer(doc).then(buffer => {
  fs.writeFileSync("/home/daytona/workspace/herpes-zoster-handout/Herpes_Zoster_Patient_Handout.docx", buffer);
  console.log("SUCCESS: Handout written.");
}).catch(err => {
  console.error("ERROR:", err);
  process.exit(1);
});
Running Command

cd /home/daytona/workspace/herpes-zoster-handout && node generate_handout.js

Running Command

python /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/workspace/herpes-zoster-handout/Herpes_Zoster_Patient_Handout.docx

Running Command

python3 -c " import zipfile, os path = '/home/daytona/workspace/herpes-zoster-handout/Herpes_Zoster_Patient_Handout.docx' size = os.path.getsize(path) print(f'File size: {size} bytes') with zipfile.ZipFile(path) as z: names = z.namelist() print('Contents:', names[:10]) # Check document.xml is readable with z.open('word/document.xml') as f: content = f.read() print(f'document.xml size: {len(content)} bytes') print('Valid XML structure:', b'<w:document' in content) "

Your patient education handout is ready for download:

Herpes Zoster Patient Handout

Word Document ยท DOCX


What's included in the handout:

The document is professionally formatted with color-coded sections (blue headers, teal section banners, red warning boxes, green tip boxes) and covers:
SectionContent
1What is Shingles - overview table
2Recognising symptoms (prodrome + rash stages)
3Antiviral medications with dosing table (Valacyclovir, Famciclovir, Acyclovir) - includes the 72-hour warning callout
4Skin care at home - Do's and Don'ts
5Pain management by severity level
6PHN prevention strategies - risk factors + prevention table
7Infection control - who to avoid
8Red flag symptoms requiring urgent care
9Shingrix vaccine information
10Recovery timeline
11General self-care tips
12Follow-up schedule
All content is based on the 2025 S2k Guidelines, Fitzpatrick's Dermatology, and the Queensland/SA Health Clinical Practice Guidelines (July-Sept 2025).

What can I use for itching and burning

Finding Sources
Searching the Web

herpes zoster shingles itching burning relief treatment options 2024 2025

Here is a complete, practical breakdown for both symptoms:

Itching and Burning Relief for Shingles

Itching - Topical Options (Apply Directly to Skin)

OptionHow to UseNotes
Calamine lotionApply to rash with cotton ball, let dryBest first-line - soothes, cools, dries blisters
Cool compressesDamp cloth, 15-20 min at a time, several times/dayKeeps rash clean + relieves itch simultaneously
Colloidal oatmeal bathAdd to cool (not hot) bathwater, soak 15-20 minVery soothing for widespread itching
Baking soda pasteMix with water, apply to rash, rinse offCheap, effective itch relief
Loose cotton clothingWear at all times over the rash areaReduces friction-triggered itch
Avoid hot water - heat worsens itch and inflammation.

Burning / Nerve Pain - What Actually Works

Burning is a neuropathic pain (nerve pain), not just skin irritation, so simple creams often don't touch it. These are the effective options:
Oral medications (ask your doctor):
  • Gabapentin (Neurontin) - first-line for nerve burning; a 2024 systematic review (PMID: 38912892) confirmed efficacy for acute zoster neuralgia
  • Pregabalin - similar to gabapentin, slightly faster onset
  • Amitriptyline (low dose, 10-25mg at night) - a tricyclic antidepressant that dampens nerve pain signals; also helps sleep
  • Paracetamol / Ibuprofen - for mild-moderate burning, take regularly (not just when severe)
Topical options for burning (after blisters crust over):
  • Lidocaine 5% patch - numbs nerve endings directly at the skin; applied for 12 hours on, 12 hours off
  • Capsaicin cream - desensitizes nerve endings over time; causes initial warmth/burning so best used after the rash has healed, mainly for PHN

What NOT to Use

  • Topical antiviral creams (e.g. acyclovir cream) - do NOT work for shingles, only for cold sores
  • Topical steroid creams - can worsen the infection
  • Topical antihistamine creams (e.g. diphenhydramine cream) - poor absorption, risk of sensitization
  • Scratching - breaks blisters open, risks bacterial superinfection and scarring

Oral Antihistamines for Itch

Sedating antihistamines like chlorphenamine or hydroxyzine can help, especially at night when itch disrupts sleep. They don't treat the cause but reduce the itch sensation and help you rest.

Quick Summary by Symptom

SymptomBest Option
Itching (daytime)Calamine lotion + cool compresses
Itching (nighttime, disrupting sleep)Oral antihistamine (chlorphenamine/hydroxyzine)
Burning / nerve painGabapentin or Pregabalin (oral)
Localised burning (post-blister)Lidocaine 5% patch
Ongoing PHN burningAmitriptyline + Lidocaine patch + Capsaicin
Since you already have itching as your main sensation (from the history), calamine lotion and cool compresses are your best immediate options. If the burning sensation develops or worsens, speak to your doctor about starting gabapentin - it is most effective when started early, before PHN sets in.

What about cetrizine dihydrocholride syrup

Finding Sources
Searching the Web

cetirizine dihydrochloride shingles herpes zoster pruritus itch dosing

Reading File
Great - I have everything needed for a complete answer.

Cetirizine Dihydrochloride Syrup for Shingles Itch

Yes, it can be used - and it's actually a good choice for shingles-related itch. University health guidelines specifically list Zyrtec (cetirizine) as an appropriate oral antihistamine for shingles pruritus.

How It Works

Cetirizine is a second-generation, selective H1 antihistamine. It blocks histamine receptors in the skin, reducing the itch sensation. Unlike older antihistamines (chlorphenamine, diphenhydramine), it is largely non-sedating at standard doses.
Per Fitzpatrick's Dermatology: "Cetirizine, a selective H1-blocker, is more effective than general antihistamines such as diphenhydramine" for pruritus management.

Dosing (Cetirizine Syrup - 5mg/5mL)

AgeDoseFrequencyMax per day
6 months - 2 years2.5 mg (2.5 mL)Once daily5 mg/day
2 - 5 years2.5 mg (2.5 mL)Once or twice daily5 mg/day
6 - 11 years5 mg (5 mL)Once daily10 mg/day
12 years and above / Adults5-10 mg (5-10 mL)Once daily10 mg/day
Over 65 years5 mg (5 mL)Once daily5 mg/day
Taken once daily, with or without food.

What It Will and Won't Do

Cetirizine
Reduces itchingYes - good effect
Helps burning nerve painNo - antihistamines don't treat neuropathic pain
SedatingMinimally (better for daytime use)
Requires prescriptionNo - available OTC
Safe to combine with antiviralsYes - no interaction with Acyclovir/Valacyclovir

Important Points

  • It treats the itch only - it does nothing for the underlying virus or nerve burning. Keep taking your antiviral medication.
  • If itching is severe at night, you could switch to a sedating antihistamine like chlorphenamine at bedtime (it helps you sleep through the itch) and use cetirizine in the daytime.
  • Dose adjustment needed if you have kidney disease - the drug is renally excreted; reduce to 5mg/day in renal impairment.
  • Cetirizine is not sufficient alone for the burning/neuropathic component - if you develop burning or nerve pain, that needs gabapentin or pregabalin, not antihistamines.
Bottom line: Cetirizine syrup is a safe, appropriate, and convenient choice for shingles itch - take 10mg once daily (if adult). Just pair it with your antiviral and calamine lotion for the best combined effect.

What about levocetirazine dicholride

Finding Sources
Searching the Web

levocetirizine dihydrochloride pruritus itch skin dosing vs cetirizine

Here is a complete breakdown:

Levocetirizine Dihydrochloride for Shingles Itch

What Is It?

Levocetirizine is the R-enantiomer (active half) of cetirizine - meaning it is the pharmacologically active component of cetirizine, isolated and used on its own. Because only the active half is present, it works at half the dose of cetirizine with equal or greater effect.
  • Cetirizine = mixture of two mirror-image molecules (R + S)
  • Levocetirizine = only the R-form (the one that actually binds H1 receptors)

Levocetirizine vs Cetirizine - Head to Head

FeatureCetirizine 10mgLevocetirizine 5mg
Equivalent dose10 mg5 mg
H1 receptor bindingGoodStronger (2x affinity)
Onset of action~1 hour~1 hour
Duration24 hours24 hours (up to 28 hours)
SedationMildSlightly less
Histamine wheal inhibitionSimilarComparable at half-dose
Efficacy for pruritusGoodEqual or slightly better
CostCheaper (generic available)Slightly more expensive
Clinical studies show 2.5 mg levocetirizine inhibits histamine-induced skin reactions comparably to 5 mg cetirizine - demonstrating its superior potency per mg. (PMC3048603)

Dosing (Levocetirizine Dihydrochloride Syrup - 0.5mg/mL or 2.5mg/5mL)

AgeDoseTimingMax/day
6 months - 5 years1.25 mg (2.5 mL)Once daily, evening1.25 mg
6 - 11 years2.5 mg (5 mL)Once daily, evening2.5 mg
12 years and above / Adults5 mg (10 mL)Once daily, evening5 mg
Elderly (>65 years)2.5 mg (5 mL)Once daily, evening2.5-5 mg
Recommended in the evening because even though it's minimally sedating, any mild drowsiness is better tolerated at night - and it still provides 24-hour coverage.

Renal Dose Adjustment (Important)

Levocetirizine is renally cleared - reduce dose if kidney function is impaired:
Creatinine ClearanceDose
> 80 mL/min (normal)5 mg once daily
50-80 mL/min2.5 mg once daily
30-50 mL/min2.5 mg every other day
< 30 mL/minAvoid use

FDA Safety Warning (May 2025)

The FDA issued a warning in May 2025 that both cetirizine and levocetirizine can cause severe rebound itching if stopped abruptly after long-term use (months to years). For shingles, you'll only be using it short-term (1-4 weeks), so this is not a concern - but worth knowing.

Bottom Line for Shingles

Levocetirizine 5mg once daily (evening) is a very good choice for shingles itch. It is:
  • Effective at reducing histamine-mediated itch
  • Convenient (once daily)
  • Minimally sedating
  • Safe to use alongside Acyclovir/Valacyclovir - no drug interactions
It is essentially equivalent to cetirizine 10mg but at a cleaner, lower dose. Either drug works well; levocetirizine is the slightly more refined option. If cost matters, cetirizine is cheaper and equally effective.

Give me treatment chart for cough

Asking for Preferences
Reading File
Finding Sources
Searching the Web

cough treatment guidelines 2024 2025 acute subacute chronic management algorithm

Finding Sources
Reading File
Reading File
Reading File
Running Command

mkdir -p /home/daytona/workspace/cough-chart && ls /home/daytona/workspace/cough-chart

Writing File

~/cough-chart/generate_cough_chart.py

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm, cm
from reportlab.platypus import (SimpleDocTemplate, Table, TableStyle, Paragraph,
                                 Spacer, HRFlowable)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import KeepTogether
import os

OUT = "/home/daytona/workspace/cough-chart/Cough_Treatment_Chart.pdf"

# โ”€โ”€ Colour palette โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
C_NAVY      = colors.HexColor("#1A3A5C")
C_TEAL      = colors.HexColor("#148F77")
C_ACUTE     = colors.HexColor("#1A6B9A")   # blue
C_SUBACUTE  = colors.HexColor("#7D3C98")   # purple
C_CHRONIC   = colors.HexColor("#C0392B")   # red
C_WARN      = colors.HexColor("#E74C3C")
C_LIGHT_BLU = colors.HexColor("#D6EAF8")
C_LIGHT_PUR = colors.HexColor("#E8DAEF")
C_LIGHT_RED = colors.HexColor("#FADBD8")
C_LIGHT_GRN = colors.HexColor("#D5F5E3")
C_LIGHT_YEL = colors.HexColor("#FEF9E7")
C_GREY_BG   = colors.HexColor("#F2F3F4")
C_MID_GREY  = colors.HexColor("#BDC3C7")
C_DARK_TXT  = colors.HexColor("#2C3E50")
C_WHITE     = colors.white

doc = SimpleDocTemplate(
    OUT,
    pagesize=A4,
    leftMargin=15*mm, rightMargin=15*mm,
    topMargin=15*mm, bottomMargin=15*mm,
    title="Cough Treatment Chart",
    author="Orris Clinical Reference"
)

W = A4[0] - 30*mm   # usable width

styles = getSampleStyleSheet()

def sty(name, parent="Normal", **kw):
    s = ParagraphStyle(name, parent=styles[parent], **kw)
    return s

S_title      = sty("title",      fontSize=20, textColor=C_WHITE,   alignment=TA_CENTER, fontName="Helvetica-Bold", leading=26)
S_subtitle   = sty("subtitle",   fontSize=10, textColor=C_WHITE,   alignment=TA_CENTER, fontName="Helvetica",      leading=14)
S_sec_hd     = sty("sec_hd",     fontSize=11, textColor=C_WHITE,   alignment=TA_LEFT,   fontName="Helvetica-Bold", leading=14)
S_body       = sty("body",       fontSize=8,  textColor=C_DARK_TXT,alignment=TA_LEFT,   fontName="Helvetica",      leading=11)
S_body_bold  = sty("body_bold",  fontSize=8,  textColor=C_DARK_TXT,alignment=TA_LEFT,   fontName="Helvetica-Bold", leading=11)
S_small      = sty("small",      fontSize=7,  textColor=C_DARK_TXT,alignment=TA_LEFT,   fontName="Helvetica",      leading=10)
S_small_bold = sty("small_bold", fontSize=7,  textColor=C_DARK_TXT,alignment=TA_LEFT,   fontName="Helvetica-Bold", leading=10)
S_warn       = sty("warn",       fontSize=7.5,textColor=C_WARN,    alignment=TA_LEFT,   fontName="Helvetica-Bold", leading=11)
S_colhd      = sty("colhd",      fontSize=8,  textColor=C_WHITE,   alignment=TA_CENTER, fontName="Helvetica-Bold", leading=11)
S_center     = sty("center",     fontSize=7.5,textColor=C_DARK_TXT,alignment=TA_CENTER, fontName="Helvetica",      leading=10)
S_footer     = sty("footer",     fontSize=6.5,textColor=colors.grey,alignment=TA_CENTER,fontName="Helvetica",      leading=9)

def bp(text, style=S_body): return Paragraph(text, style)
def bb(text): return Paragraph(text, S_body_bold)
def bs(text): return Paragraph(text, S_small)
def bsb(text): return Paragraph(text, S_small_bold)
def bc(text): return Paragraph(text, S_center)

def bullet_list(items, style=S_small):
    return [Paragraph(f"โ€ข {i}", style) for i in items]

def section_header(text, bg_color):
    t = Table([[Paragraph(text, S_sec_hd)]], colWidths=[W])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), bg_color),
        ("TOPPADDING",    (0,0), (-1,-1), 5),
        ("BOTTOMPADDING", (0,0), (-1,-1), 5),
        ("LEFTPADDING",   (0,0), (-1,-1), 8),
        ("RIGHTPADDING",  (0,0), (-1,-1), 8),
        ("ROUNDEDCORNERS", [3]),
    ]))
    return t

story = []

# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
# TITLE BLOCK
# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
title_data = [[
    Paragraph("COUGH TREATMENT CHART", S_title),
    Paragraph("Acute ยท Subacute ยท Chronic  |  Based on Goldman-Cecil Medicine, Harrison's (2025), Tintinalli's Emergency Medicine & Murray/Nadel's Respiratory Medicine", S_subtitle)
]]
# stack them vertically
title_tbl = Table([
    [Paragraph("COUGH TREATMENT CHART", S_title)],
    [Paragraph("Acute ยท Subacute ยท Chronic  |  Goldman-Cecil Medicine, Harrison's 2025, Tintinalli's & Murray/Nadel's Respiratory Medicine", S_subtitle)]
], colWidths=[W])
title_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,-1), C_NAVY),
    ("TOPPADDING",    (0,0), (-1,-1), 6),
    ("BOTTOMPADDING", (0,0), (-1,-1), 6),
    ("LEFTPADDING",   (0,0), (-1,-1), 10),
    ("RIGHTPADDING",  (0,0), (-1,-1), 10),
]))
story.append(title_tbl)
story.append(Spacer(1, 4*mm))

# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
# OVERVIEW: DEFINITIONS
# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
story.append(section_header("  1.  DEFINITIONS & CLASSIFICATION", C_NAVY))
story.append(Spacer(1, 2*mm))

def_data = [
    [Paragraph("TYPE", S_colhd), Paragraph("DURATION", S_colhd), Paragraph("COMMON CAUSES", S_colhd), Paragraph("RED FLAGS", S_colhd)],
    [
        bp("ACUTE", S_body_bold),
        bp("< 3 weeks"),
        [bs("โ€ข Common cold / URTI"), bs("โ€ข Acute sinusitis"), bs("โ€ข Allergic rhinitis"), bs("โ€ข Pertussis"), bs("โ€ข COPD exacerbation"), bs("โ€ข Environmental irritant")],
        [bs("โ€ข Haemoptysis"), bs("โ€ข Fever + purulent sputum"), bs("โ€ข Chest pain / dyspnoea"), bs("โ€ข Suspected PE / HF")]
    ],
    [
        bp("SUBACUTE", S_body_bold),
        bp("3 โ€“ 8 weeks"),
        [bs("โ€ข Post-infectious / post-viral"), bs("โ€ข Pertussis"), bs("โ€ข Residual airway inflammation"), bs("โ€ข Early asthma"), bs("โ€ข Residual sinusitis")],
        [bs("โ€ข Persistent fever"), bs("โ€ข Worsening dyspnoea"), bs("โ€ข Weight loss"), bs("โ€ข No improvement at 4 wks")]
    ],
    [
        bp("CHRONIC", S_body_bold),
        bp("> 8 weeks"),
        [bs("โ€ข Upper Airway Cough Syndrome (UACS/postnasal drip)"),
         bs("โ€ข Asthma / cough-variant asthma"),
         bs("โ€ข GERD"), bs("โ€ข ACE inhibitor use"),
         bs("โ€ข Chronic bronchitis / smoking"),
         bs("โ€ข Eosinophilic bronchitis"),
         bs("โ€ข Bronchiectasis")],
        [bs("โ€ข Haemoptysis"), bs("โ€ข Weight loss >5 kg"), bs("โ€ข Hoarseness"), bs("โ€ข Dysphagia"), bs("โ€ข Abnormal CXR"), bs("โ€ข Age >40 + smoker")]
    ],
]

col_w = [W*0.12, W*0.12, W*0.43, W*0.33]
def_tbl = Table(def_data, colWidths=col_w, repeatRows=1)
def_tbl.setStyle(TableStyle([
    # Header row
    ("BACKGROUND",    (0,0), (-1,0), C_NAVY),
    ("TEXTCOLOR",     (0,0), (-1,0), C_WHITE),
    # Row colours
    ("BACKGROUND",    (0,1), (-1,1), C_LIGHT_BLU),
    ("BACKGROUND",    (0,2), (-1,2), C_LIGHT_PUR),
    ("BACKGROUND",    (0,3), (-1,3), C_LIGHT_RED),
    # Borders
    ("GRID",          (0,0), (-1,-1), 0.5, C_MID_GREY),
    ("BOX",           (0,0), (-1,-1), 1,   C_NAVY),
    # Padding
    ("TOPPADDING",    (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING",   (0,0), (-1,-1), 5),
    ("RIGHTPADDING",  (0,0), (-1,-1), 5),
    ("VALIGN",        (0,0), (-1,-1), "TOP"),
]))
story.append(def_tbl)
story.append(Spacer(1, 4*mm))

# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
# SECTION 2 - ACUTE COUGH TREATMENT
# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
story.append(section_header("  2.  ACUTE COUGH TREATMENT  (< 3 weeks)", C_ACUTE))
story.append(Spacer(1, 2*mm))

acute_data = [
    [Paragraph("CAUSE", S_colhd), Paragraph("FIRST-LINE TREATMENT", S_colhd), Paragraph("SECOND-LINE / ADJUNCTS", S_colhd), Paragraph("NOTES", S_colhd)],
    [
        bp("Common Cold (URTI)"),
        [bs("โ€ข Symptomatic only"), bs("โ€ข Paracetamol / Ibuprofen"), bs("โ€ข Saline nasal irrigation"), bs("โ€ข Honey + warm fluids (adults)")],
        [bs("โ€ข Nasal decongestants (short-term)"), bs("โ€ข 1st-gen antihistamine if rhinorrhoea"), bs("โ€ข Steam inhalation")],
        bs("Antibiotics NOT indicated. Evidence for OTC antitussives is weak.")
    ],
    [
        bp("Acute Bacterial Sinusitis"),
        [bs("โ€ข Amoxicillin 500mg TDS x 5-7 days"), bs("โ€ข Intranasal corticosteroid"), bs("โ€ข Saline irrigation")],
        [bs("โ€ข Amoxicillin-clavulanate if severe"), bs("โ€ข Decongestant nasal spray โ‰ค3 days")],
        bs("Diagnose only if symptoms >10 days or severe. Most sinusitis is viral.")
    ],
    [
        bp("Allergic Rhinitis"),
        [bs("โ€ข Non-sedating antihistamine (cetirizine 10mg OD / loratadine 10mg OD)"), bs("โ€ข Intranasal corticosteroid spray")],
        [bs("โ€ข Levocetirizine 5mg OD"), bs("โ€ข Montelukast if asthma co-exists"), bs("โ€ข Allergen avoidance")],
        bs("Treat underlying allergy to resolve cough.")
    ],
    [
        bp("Pertussis (Whooping Cough)"),
        [bs("โ€ข Azithromycin 500mg Day 1, 250mg Days 2-5"), bs("โ€ข OR Clarithromycin 500mg BD x 7 days")],
        [bs("โ€ข Erythromycin (alt if macrolide intolerant)"), bs("โ€ข Cough suppressants - limited benefit")],
        bs("Antibiotics reduce transmission, not duration if >3 weeks. Notify public health.")
    ],
    [
        bp("COPD Exacerbation"),
        [bs("โ€ข Short-acting bronchodilator (SABA + SAMA)"), bs("โ€ข Prednisolone 40mg x 5 days"), bs("โ€ข Antibiotics if purulent sputum")],
        [bs("โ€ข Azithromycin 500mg OD x 3 days"), bs("โ€ข Oxygen therapy if SpO2 <88%"), bs("โ€ข Consider NIV if severe")],
        bs("Antibiotic choice: amoxicillin, doxycycline, or clarithromycin.")
    ],
    [
        bp("Pneumonia"),
        [bs("โ€ข Amoxicillin 500mg TDS x 5 days (community)"), bs("โ€ข Doxycycline 200mg Day 1 then 100mg OD")],
        [bs("โ€ข Levofloxacin 500mg OD if severe"), bs("โ€ข Consider hospital admission (CURB-65 โ‰ฅ2)"), bs("โ€ข Antipyretics, hydration")],
        bs("CURB-65 score guides admission. CXR mandatory.")
    ],
    [
        bp("Environmental / Irritant"),
        [bs("โ€ข Remove / avoid irritant source"), bs("โ€ข Saline nasal wash"), bs("โ€ข Humidify environment")],
        [bs("โ€ข Short-term antitussive if distressing")],
        bs("Occupational exposure: refer to occupational health.")
    ],
]

a_col_w = [W*0.17, W*0.30, W*0.30, W*0.23]
acute_tbl = Table(acute_data, colWidths=a_col_w, repeatRows=1)
acute_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0), C_ACUTE),
    ("TEXTCOLOR",     (0,0), (-1,0), C_WHITE),
    ("ROWBACKGROUNDS",(0,1), (-1,-1), [C_WHITE, C_LIGHT_BLU]),
    ("GRID",          (0,0), (-1,-1), 0.4, C_MID_GREY),
    ("BOX",           (0,0), (-1,-1), 1,   C_ACUTE),
    ("TOPPADDING",    (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING",   (0,0), (-1,-1), 5),
    ("RIGHTPADDING",  (0,0), (-1,-1), 5),
    ("VALIGN",        (0,0), (-1,-1), "TOP"),
]))
story.append(acute_tbl)
story.append(Spacer(1, 4*mm))

# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
# SECTION 3 - SUBACUTE COUGH
# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
story.append(section_header("  3.  SUBACUTE COUGH TREATMENT  (3 โ€“ 8 weeks)", C_SUBACUTE))
story.append(Spacer(1, 2*mm))

sub_data = [
    [Paragraph("CAUSE", S_colhd), Paragraph("TREATMENT", S_colhd), Paragraph("ADDITIONAL MEASURES", S_colhd)],
    [
        bp("Post-Infectious / Post-Viral Cough"),
        [bs("โ€ข Reassurance - usually self-limiting"), bs("โ€ข Inhaled ipratropium bromide"), bs("โ€ข Short course intranasal corticosteroid"), bs("โ€ข 1st-gen antihistamine/decongestant for UACS")],
        [bs("โ€ข Avoid triggers (cold air, smoke)"), bs("โ€ข Honey + warm fluids"), bs("โ€ข If bronchospasm: salbutamol inhaler"), bs("โ€ข Re-evaluate at 8 weeks if persists")]
    ],
    [
        bp("Pertussis (late presentation)"),
        [bs("โ€ข Macrolide antibiotic (reduces transmission)"), bs("โ€ข Azithromycin or clarithromycin"), bs("โ€ข Cough suppressants (limited benefit)")],
        [bs("โ€ข Notify public health authority"), bs("โ€ข Vaccinate close contacts"), bs("โ€ข Salbutamol if bronchospasm component")]
    ],
    [
        bp("Residual Asthma / Airway Hyperreactivity"),
        [bs("โ€ข Inhaled salbutamol (SABA) PRN"), bs("โ€ข If persistent: trial inhaled corticosteroid (ICS)"), bs("โ€ข Budesonide 200mcg BD or Beclomethasone 100mcg BD")],
        [bs("โ€ข Confirm diagnosis with spirometry"), bs("โ€ข Methacholine challenge if spirometry normal"), bs("โ€ข Add LABA if inadequate ICS response")]
    ],
    [
        bp("Residual / Subacute Sinusitis"),
        [bs("โ€ข Intranasal corticosteroid (fluticasone 50mcg/nostril BD)"), bs("โ€ข Saline nasal irrigation BD"), bs("โ€ข Antihistamine if allergic component")],
        [bs("โ€ข CT sinuses if no improvement"), bs("โ€ข ENT referral if refractory"), bs("โ€ข Avoid prolonged decongestant use")]
    ],
]

s_col_w = [W*0.20, W*0.42, W*0.38]
sub_tbl = Table(sub_data, colWidths=s_col_w, repeatRows=1)
sub_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0), C_SUBACUTE),
    ("TEXTCOLOR",     (0,0), (-1,0), C_WHITE),
    ("ROWBACKGROUNDS",(0,1), (-1,-1), [C_WHITE, C_LIGHT_PUR]),
    ("GRID",          (0,0), (-1,-1), 0.4, C_MID_GREY),
    ("BOX",           (0,0), (-1,-1), 1,   C_SUBACUTE),
    ("TOPPADDING",    (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING",   (0,0), (-1,-1), 5),
    ("RIGHTPADDING",  (0,0), (-1,-1), 5),
    ("VALIGN",        (0,0), (-1,-1), "TOP"),
]))
story.append(sub_tbl)
story.append(Spacer(1, 4*mm))

# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
# SECTION 4 - CHRONIC COUGH
# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
story.append(section_header("  4.  CHRONIC COUGH TREATMENT  (> 8 weeks)", C_CHRONIC))
story.append(Spacer(1, 2*mm))

chr_data = [
    [Paragraph("CAUSE", S_colhd), Paragraph("FIRST-LINE TREATMENT", S_colhd), Paragraph("SECOND-LINE", S_colhd), Paragraph("NOTES", S_colhd)],
    [
        bp("Upper Airway Cough Syndrome (UACS / Postnasal Drip)"),
        [bs("โ€ข 1st-gen antihistamine + decongestant"), bs("  (chlorphenamine + pseudoephedrine)"), bs("โ€ข Intranasal corticosteroid spray")],
        [bs("โ€ข Ipratropium nasal spray"), bs("โ€ข Saline irrigation"), bs("โ€ข Treat underlying cause (allergy, sinusitis)")],
        bs("Most common cause of chronic cough. Treat empirically before further tests.")
    ],
    [
        bp("Asthma / Cough-Variant Asthma"),
        [bs("โ€ข Inhaled corticosteroid (ICS)"), bs("  Beclomethasone 100-200mcg BD"), bs("โ€ข SABA (salbutamol) PRN")],
        [bs("โ€ข Add LABA (salmeterol/formoterol)"), bs("โ€ข Montelukast as add-on"), bs("โ€ข Escalate per GINA 2025 steps")],
        bs("Confirm with spirometry ยฑ methacholine challenge. Nocturnal worsening is typical.")
    ],
    [
        bp("GERD (Gastro-oesophageal Reflux)"),
        [bs("โ€ข Lifestyle modifications:"), bs("  - Elevate head of bed"), bs("  - Avoid late meals, alcohol, caffeine"), bs("  - Weight loss if overweight"), bs("โ€ข Proton Pump Inhibitor (omeprazole 20-40mg OD)")],
        [bs("โ€ข H2 blocker (ranitidine/famotidine)"), bs("โ€ข Prokinetic agent (metoclopramide)"), bs("โ€ข pH monitoring / gastroscopy if refractory")],
        bs("Trial PPI for 8 weeks. Cough may take weeks to resolve after reflux is controlled.")
    ],
    [
        bp("ACE Inhibitor-Induced Cough"),
        [bs("โ€ข STOP the ACE inhibitor"), bs("โ€ข Switch to ARB (losartan, valsartan)"), bs("โ€ข Cough resolves in 1-4 weeks")],
        [bs("โ€ข May take up to 3 months to fully resolve"), bs("โ€ข No specific antitussive needed")],
        bs("Affects 5-10% of ACE inhibitor users. ARBs cause significantly less cough (~35% rate of ACE-inhibitor cough).")
    ],
    [
        bp("Chronic Bronchitis / Smoking"),
        [bs("โ€ข Smoking cessation (most important)"), bs("โ€ข Short-acting bronchodilator (SABA/SAMA)"), bs("โ€ข Pulmonary rehabilitation")],
        [bs("โ€ข LAMA (tiotropium) if COPD confirmed"), bs("โ€ข ICS + LABA if FEV1 <60%"), bs("โ€ข Mucolytics (carbocisteine, NAC)")],
        bs("Morning productive cough is hallmark. Confirm COPD with spirometry. Follow GOLD 2025 guidelines.")
    ],
    [
        bp("Eosinophilic Bronchitis"),
        [bs("โ€ข Inhaled corticosteroid"), bs("  Budesonide 400mcg BD or"), bs("  Fluticasone 250mcg BD")],
        [bs("โ€ข Oral prednisolone short course if severe"), bs("โ€ข Identify and avoid causative allergen")],
        bs("Normal spirometry but eosinophilia on sputum. Responds well to ICS. Diagnose with sputum cytology.")
    ],
    [
        bp("Bronchiectasis"),
        [bs("โ€ข Airway clearance techniques (physiotherapy)"), bs("โ€ข Antibiotics during exacerbations"), bs("โ€ข Mucolytics (hypertonic saline, DNase)")],
        [bs("โ€ข Macrolide prophylaxis (azithromycin 250mg x3/wk)"), bs("โ€ข Bronchodilators for airflow obstruction"), bs("โ€ข Treat underlying cause (CF, PCD, immunodeficiency)")],
        bs("CT chest confirms diagnosis. Long-term management requires specialist input.")
    ],
    [
        bp("Chronic Cough Hypersensitivity Syndrome (Refractory)"),
        [bs("โ€ข Speech therapy / cough suppression techniques"), bs("โ€ข Low-dose opioids (codeine, morphine)"), bs("โ€ข Gabapentin 100-300mg TDS")],
        [bs("โ€ข P2X3 antagonists (gefapixant - where available)"), bs("โ€ข Amitriptyline 10-25mg nocte"), bs("โ€ข Multidisciplinary cough clinic referral")],
        bs("Diagnosis of exclusion. Neurally-mediated hypersensitivity. Emerging role for P2X3 antagonists per 2025 guidelines.")
    ],
]

c_col_w = [W*0.19, W*0.29, W*0.26, W*0.26]
chr_tbl = Table(chr_data, colWidths=c_col_w, repeatRows=1)
chr_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0), C_CHRONIC),
    ("TEXTCOLOR",     (0,0), (-1,0), C_WHITE),
    ("ROWBACKGROUNDS",(0,1), (-1,-1), [C_WHITE, C_LIGHT_RED]),
    ("GRID",          (0,0), (-1,-1), 0.4, C_MID_GREY),
    ("BOX",           (0,0), (-1,-1), 1,   C_CHRONIC),
    ("TOPPADDING",    (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING",   (0,0), (-1,-1), 5),
    ("RIGHTPADDING",  (0,0), (-1,-1), 5),
    ("VALIGN",        (0,0), (-1,-1), "TOP"),
]))
story.append(chr_tbl)
story.append(Spacer(1, 4*mm))

# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
# SECTION 5 - SYMPTOMATIC ANTITUSSIVES
# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
story.append(section_header("  5.  SYMPTOMATIC / ANTITUSSIVE AGENTS", C_TEAL))
story.append(Spacer(1, 2*mm))

ant_data = [
    [Paragraph("AGENT", S_colhd), Paragraph("CLASS", S_colhd), Paragraph("DOSE (ADULT)", S_colhd), Paragraph("INDICATION", S_colhd), Paragraph("NOTES", S_colhd)],
    [bp("Dextromethorphan"), bs("Central antitussive"), bs("15-30mg every 6-8h"), bs("Acute non-productive cough"), bs("OTC. Do not use with MAOIs.")],
    [bp("Codeine"), bs("Opioid antitussive"), bs("15-30mg every 4-6h"), bs("Moderate non-productive cough"), bs("Controlled drug. Avoid in children <12y. Habit-forming.")],
    [bp("Pholcodine"), bs("Opioid antitussive"), bs("5-10mg every 6-8h"), bs("Dry irritating cough"), bs("Less constipating than codeine.")],
    [bp("Guaifenesin"), bs("Expectorant"), bs("200-400mg every 4h"), bs("Productive cough - loosen mucus"), bs("Adequate hydration essential. OTC.")],
    [bp("Carbocisteine"), bs("Mucolytic"), bs("750mg TDS initially\nthen 500mg TDS"), bs("Chronic productive cough, COPD, bronchiectasis"), bs("Reduces exacerbations. Avoid in active peptic ulcer.")],
    [bp("N-Acetylcysteine (NAC)"), bs("Mucolytic"), bs("200mg TDS or 600mg OD"), bs("Chronic bronchitis, mucus hypersecretion"), bs("Also antioxidant. Well tolerated.")],
    [bp("Gabapentin"), bs("Neuropathic agent"), bs("100-300mg TDS"), bs("Chronic/refractory cough, cough hypersensitivity"), bs("Titrate slowly. Causes dizziness/somnolence.")],
    [bp("Honey"), bs("Non-pharmacological"), bs("10mL at bedtime"), bs("Acute cough in adults and children >1y"), bs("Evidence-based, especially in children. Not under 1y (botulism risk).")],
]

t_col_w = [W*0.17, W*0.15, W*0.18, W*0.25, W*0.25]
ant_tbl = Table(ant_data, colWidths=t_col_w, repeatRows=1)
ant_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0), C_TEAL),
    ("TEXTCOLOR",     (0,0), (-1,0), C_WHITE),
    ("ROWBACKGROUNDS",(0,1), (-1,-1), [C_WHITE, C_LIGHT_GRN]),
    ("GRID",          (0,0), (-1,-1), 0.4, C_MID_GREY),
    ("BOX",           (0,0), (-1,-1), 1,   C_TEAL),
    ("TOPPADDING",    (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING",   (0,0), (-1,-1), 5),
    ("RIGHTPADDING",  (0,0), (-1,-1), 5),
    ("VALIGN",        (0,0), (-1,-1), "TOP"),
]))
story.append(ant_tbl)
story.append(Spacer(1, 4*mm))

# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
# SECTION 6 - DIAGNOSTIC WORKUP / SEQUENTIAL APPROACH
# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
story.append(section_header("  6.  SEQUENTIAL DIAGNOSTIC & MANAGEMENT APPROACH (Chronic Cough)", C_NAVY))
story.append(Spacer(1, 2*mm))

steps = [
    ("Step 1", "Chest X-Ray",                "Mandatory for all chronic cough. Abnormal CXR requires further investigation (CT, bronchoscopy, sputum culture)."),
    ("Step 2", "Smoking & Drug Review",       "Stop smoking. Discontinue ACE inhibitors and ARBs. Reassess after 4 weeks."),
    ("Step 3", "Treat for UACS empirically",  "Oral 1st-gen antihistamine + decongestant ยฑ intranasal corticosteroid. If cough improves, continue and consider sinus imaging."),
    ("Step 4", "Evaluate for Asthma",         "Spirometry (inc. flow-volume loop for vocal cord dysfunction). Trial inhaled bronchodilator + ICS if obstructive pattern or methacholine-positive."),
    ("Step 5", "Treat for GERD",              "Trial PPI (omeprazole 20-40mg OD) + lifestyle changes for 8 weeks. 24h pH monitoring if no response."),
    ("Step 6", "Eosinophilic Bronchitis",     "Sputum cytology for eosinophils. Trial ICS if positive (>3% eosinophils)."),
    ("Step 7", "Specialist Referral",         "If cough unexplained after all above steps: refer to respiratory medicine. Consider: CT chest/HRCT, bronchoscopy, FENO, oesophageal manometry, speech therapy."),
    ("Step 8", "Refractory / Hypersensitivity","If no organic cause: diagnosis of chronic cough hypersensitivity syndrome. Consider gabapentin, low-dose opioids, speech therapy, or P2X3 antagonists."),
]

step_data = [[Paragraph("STEP", S_colhd), Paragraph("ACTION", S_colhd), Paragraph("DETAIL", S_colhd)]]
for num, action, detail in steps:
    step_data.append([bsb(num), bsb(action), bs(detail)])

st_col_w = [W*0.08, W*0.22, W*0.70]
step_tbl = Table(step_data, colWidths=st_col_w, repeatRows=1)
step_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0), C_NAVY),
    ("TEXTCOLOR",     (0,0), (-1,0), C_WHITE),
    ("ROWBACKGROUNDS",(0,1), (-1,-1), [C_WHITE, C_GREY_BG]),
    ("GRID",          (0,0), (-1,-1), 0.4, C_MID_GREY),
    ("BOX",           (0,0), (-1,-1), 1,   C_NAVY),
    ("TOPPADDING",    (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING",   (0,0), (-1,-1), 5),
    ("RIGHTPADDING",  (0,0), (-1,-1), 5),
    ("VALIGN",        (0,0), (-1,-1), "TOP"),
    ("ALIGN",         (0,0), (0,-1), "CENTER"),
]))
story.append(step_tbl)
story.append(Spacer(1, 4*mm))

# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
# SECTION 7 - RED FLAGS / WHEN TO REFER
# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
story.append(section_header("  7.  RED FLAGS - URGENT INVESTIGATION / REFERRAL", C_WARN))
story.append(Spacer(1, 2*mm))

warn_data = [
    [Paragraph("RED FLAG SIGN", S_colhd), Paragraph("POSSIBLE SERIOUS CAUSE", S_colhd), Paragraph("ACTION", S_colhd)],
    [bs("Haemoptysis (coughing blood)"), bs("Lung cancer, TB, bronchiectasis, PE"), bs("Urgent CXR + CT chest + bronchoscopy referral")],
    [bs("Weight loss >5 kg, night sweats"), bs("Malignancy, TB, lymphoma"), bs("CXR, sputum AFB, CT chest, haematology")],
    [bs("Dysphagia or hoarseness"), bs("Lung/oesophageal cancer, laryngeal pathology"), bs("ENT + gastroenterology referral")],
    [bs("Progressive dyspnoea"), bs("Heart failure, COPD, interstitial lung disease, PE"), bs("BNP, spirometry, echo, CTPA if PE suspected")],
    [bs("Fever + purulent sputum + consolidation"), bs("Pneumonia, lung abscess, empyema"), bs("CXR, sputum culture, antibiotics, consider admission")],
    [bs("Cough in smoker >40y, new or changed"), bs("Lung cancer"), bs("Urgent CXR; CT chest if CXR normal but suspicion high")],
    [bs("Stridor (high-pitched inspiratory noise)"), bs("Upper airway obstruction, foreign body, epiglottitis"), bs("EMERGENCY - secure airway, ENT/anaesthetics urgently")],
    [bs("Clubbing + chronic cough"), bs("Lung cancer, bronchiectasis, IPF"), bs("CT HRCT, pulmonary function tests, specialist referral")],
]

w_col_w = [W*0.28, W*0.35, W*0.37]
warn_tbl = Table(warn_data, colWidths=w_col_w, repeatRows=1)
warn_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0), C_WARN),
    ("TEXTCOLOR",     (0,0), (-1,0), C_WHITE),
    ("ROWBACKGROUNDS",(0,1), (-1,-1), [C_WHITE, C_LIGHT_RED]),
    ("GRID",          (0,0), (-1,-1), 0.4, C_MID_GREY),
    ("BOX",           (0,0), (-1,-1), 1,   C_WARN),
    ("TOPPADDING",    (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING",   (0,0), (-1,-1), 5),
    ("RIGHTPADDING",  (0,0), (-1,-1), 5),
    ("VALIGN",        (0,0), (-1,-1), "TOP"),
]))
story.append(warn_tbl)
story.append(Spacer(1, 4*mm))

# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
# FOOTER
# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
story.append(HRFlowable(width=W, thickness=0.5, color=C_MID_GREY))
story.append(Spacer(1, 2*mm))
story.append(Paragraph(
    "Sources: Goldman-Cecil Medicine (International Ed.) | Harrison's Principles of Internal Medicine 22E (2025) | "
    "Tintinalli's Emergency Medicine | Murray & Nadel's Textbook of Respiratory Medicine | "
    "2025 Chronic Cough Guidelines Review (Medicine Journal) | GOLD 2025 | GINA 2025  |  "
    "Prepared by Orris Clinical Reference  |  June 2026  |  For educational use only - not a substitute for clinical judgment.",
    S_footer
))

doc.build(story)
print(f"SUCCESS: PDF saved to {OUT}")
print(f"File size: {os.path.getsize(OUT):,} bytes")
Running Command

cd /home/daytona/workspace/cough-chart && python3 generate_cough_chart.py

Your cough treatment chart is ready:

Cough Treatment Chart

PDF Document ยท PDF


What's in the chart (7 colour-coded sections):

SectionContent
1. DefinitionsDuration criteria, causes, and red flags for acute/subacute/chronic cough
2. Acute CoughTreatment by cause - common cold, sinusitis, allergic rhinitis, pertussis, COPD, pneumonia, environmental
3. Subacute CoughPost-infectious cough, pertussis, asthma, sinusitis management
4. Chronic CoughUACS, asthma, GERD, ACE inhibitor cough, chronic bronchitis, eosinophilic bronchitis, bronchiectasis, refractory hypersensitivity syndrome
5. Antitussive AgentsDrug table - dextromethorphan, codeine, guaifenesin, carbocisteine, gabapentin, honey - with doses
6. Sequential Approach8-step diagnostic/management algorithm for chronic cough (Goldman-Cecil protocol)
7. Red FlagsUrgent signs requiring investigation - haemoptysis, weight loss, stridor, new cough in smokers, hoarseness
Based on Goldman-Cecil Medicine, Harrison's 2025, Tintinalli's EM, Murray & Nadel's Respiratory Medicine, and GOLD/GINA 2025 guidelines.
This is a shared conversation. Sign in to Orris to start your own chat.