This pdf is my subject previous year questions give me the repeted questions in every year in 15 mark and also give me the each every questions how many time asked and give me all 15 mark please

Reading File
Running Command

python3 << 'EOF' import pdfplumber with pdfplumber.open("/home/daytona/workspace/attachments/e23a85d9-31bc-4e79-b9c0-b1ca546c86f5/HF.pdf") as pdf: print(f"Total pages: {len(pdf.pages)}") for i, page in enumerate(pdf.pages): text = page.extract_text() print(f"\n===== PAGE {i+1} =====") print(text) EOF

Running Command

python3 << 'EOF' # All 15-mark (Elaborate on) questions from each year questions = { "Dec 2020": [ "Define Cryotherapy. Discuss the methods of application and its therapeutic effects.", "Describe in detail about Principles & therapeutic effects of Pulsed Shortwave Diathermy." ], "Sep 2021": [ "Explain principles and production of Ultrasound therapy. Describe thermal and non thermal effects of Therapeutic Ultrasound.", "Write in detail about the production of MWD, physiological & therapeutic effects, dosage and dangers." ], "Jan 2022": [ "Define Ultrasound. Explain the Production, Physiological effects and Therapeutic effects of Ultrasound, add note on Clinical application of Therapeutic Ultrasound.", "Define Infra Red Radiation. Write about the luminous and non luminous generators of IRR, and its physiological & therapeutic effects. Mention about precautions of IRR." ], "Jun 2022": [ "Define Microwave Diathermy. Describe the production, technique of application and dangers of Microwave Diathermy.", "Classify UVR. Explain the various types of generators and its production." ], "Oct 2022": [ "Define Laser. Write in detail about the production of Laser, physiological and therapeutic effects of it.", "Explain in detail about the production of Infra Red Radiation, Treatment techniques and precaution methods during treatment." ], "Apr 2023": [ "Explain in detail about types of Various Superficial Heating Modalities, its Physiological and Therapeutic effects.", "Define Ultra Violet Radiation and its types. Explain the production, physiological effects and therapeutic effects of Ultra Violet Radiation." ], "Nov 2023": [ "Mechanism of ultrasound production and methods and application for different conditions with therapeutic parameters.", "Describe in detail about principles and therapeutic effects of Pulsed Short wave Diathermy." ], "Aug 2024": [ "Define Short wave Diathermy. Explain the production, physiological effects and therapeutic effects of Short wave Diathermy.", "Define Infrared radiation. Explain in detail about types of generators, its Production, Indications, Contraindications, Physiological and Therapeutic effects." ], "Feb 2025": [ "Define LASER. Describe in detail about production, types, techniques and dosimetry.", "Define shortwave diathermy. Enumerate in detail about methods of application, precaution, indication and contraindication SWD." ], "Aug 2025": [ "Describe in detail about principle and therapeutic effects of Microwave diathermy.", "Define ultraviolet radiation. Elaborate Production classification and Principles of application." ] } # Group by topic topics = { "Cryotherapy": [], "Pulsed Shortwave Diathermy (PSWD)": [], "Ultrasound Therapy": [], "Microwave Diathermy (MWD)": [], "Infra Red Radiation (IRR)": [], "Ultraviolet Radiation (UVR)": [], "Shortwave Diathermy (SWD)": [], "LASER": [], "Superficial Heating Modalities": [], } for year, qs in questions.items(): for q in qs: ql = q.lower() if "cryo" in ql: topics["Cryotherapy"].append((year, q)) if "pulsed short" in ql or "pulsed shortwave" in ql or ("pulsed" in ql and "shortwave" in ql) or ("pulsed" in ql and "short wave" in ql): topics["Pulsed Shortwave Diathermy (PSWD)"].append((year, q)) if "ultrasound" in ql and "micro" not in ql: topics["Ultrasound Therapy"].append((year, q)) if "microwave" in ql or "mwd" in ql: topics["Microwave Diathermy (MWD)"].append((year, q)) if "infra red" in ql or "infrared" in ql or "irr" in ql: topics["Infra Red Radiation (IRR)"].append((year, q)) if "ultra violet" in ql or "ultraviolet" in ql or "uvr" in ql: topics["Ultraviolet Radiation (UVR)"].append((year, q)) if ("short wave diathermy" in ql or "shortwave diathermy" in ql or "swd" in ql) and "pulsed" not in ql: topics["Shortwave Diathermy (SWD)"].append((year, q)) if "laser" in ql: topics["LASER"].append((year, q)) if "superficial heating" in ql or "heating modalities" in ql: topics["Superficial Heating Modalities"].append((year, q)) print("=" * 80) print("TOPIC-WISE 15-MARK QUESTIONS WITH FREQUENCY") print("=" * 80) for topic, entries in topics.items(): if entries: print(f"\n{'='*70}") print(f"TOPIC: {topic} | ASKED: {len(entries)} TIME(S)") print(f"{'='*70}") for year, q in entries: print(f" [{year}] {q}") print("\n\n" + "=" * 80) print("SUMMARY TABLE - 15 MARK QUESTIONS BY TOPIC") print("=" * 80) print(f"{'Topic':<40} {'Times Asked':<15} {'Years'}") print("-" * 80) for topic, entries in sorted(topics.items(), key=lambda x: -len(x[1])): if entries: years = ", ".join([e[0] for e in entries]) print(f"{topic:<40} {len(entries):<15} {years}") EOF

Here is the complete analysis of all 15-mark questions from your BPT Paper II (Electrotherapy II - High Freq & Actinotherapy) previous year papers across 10 exams (Dec 2020 - Aug 2025).

ALL 15-MARK QUESTIONS - COMPLETE LIST (Year-wise)

YearQ1 (15 Marks)Q2 (15 Marks)
Dec 2020Cryotherapy - methods of application & therapeutic effectsPulsed Shortwave Diathermy - Principles & therapeutic effects
Sep 2021Ultrasound therapy - principles, production, thermal & non-thermal effectsMWD - production, physiological & therapeutic effects, dosage & dangers
Jan 2022Ultrasound - production, physiological & therapeutic effects, clinical applicationsInfra Red Radiation - luminous & non-luminous generators, physiological & therapeutic effects, precautions
Jun 2022Microwave Diathermy - production, techniques, dangersUVR - classification, types of generators & production
Oct 2022LASER - production, physiological & therapeutic effectsInfra Red Radiation - production, treatment techniques, precautions
Apr 2023Superficial Heating Modalities - types, physiological & therapeutic effectsUltra Violet Radiation - types, production, physiological & therapeutic effects
Nov 2023Ultrasound - mechanism of production, methods of application, therapeutic parametersPulsed Shortwave Diathermy - principles & therapeutic effects
Aug 2024Short Wave Diathermy - production, physiological & therapeutic effectsInfrared Radiation - generators, production, indications, contraindications, physiological & therapeutic effects
Feb 2025LASER - production, types, techniques & dosimetryShortwave Diathermy - methods of application, precautions, indications & contraindications
Aug 2025Microwave Diathermy - principles & therapeutic effectsUltraviolet Radiation - production, classification, principles of application

REPEATED TOPICS - FREQUENCY TABLE

TopicTimes AskedYearsPriority
Ultrasound Therapy3 timesSep 2021, Jan 2022, Nov 2023⭐⭐⭐ HIGH
Microwave Diathermy (MWD)3 timesSep 2021, Jun 2022, Aug 2025⭐⭐⭐ HIGH
Infra Red Radiation (IRR)3 timesJan 2022, Oct 2022, Aug 2024⭐⭐⭐ HIGH
Ultraviolet Radiation (UVR)3 timesJun 2022, Apr 2023, Aug 2025⭐⭐⭐ HIGH
Pulsed Shortwave Diathermy (PSWD)2 timesDec 2020, Nov 2023⭐⭐ MEDIUM
Shortwave Diathermy (SWD)2 timesAug 2024, Feb 2025⭐⭐ MEDIUM
LASER2 timesOct 2022, Feb 2025⭐⭐ MEDIUM
Cryotherapy1 timeDec 2020⭐ LOW
Superficial Heating Modalities1 timeApr 2023⭐ LOW

MOST REPEATED 15-MARK TOPICS - DETAILED BREAKDOWN

1. ULTRASOUND THERAPY (Asked 3 times)

  • Sep 2021: Principles and production; thermal and non-thermal effects
  • Jan 2022: Production, physiological effects, therapeutic effects, clinical applications
  • Nov 2023: Mechanism of production, methods of application, therapeutic parameters

2. MICROWAVE DIATHERMY (Asked 3 times)

  • Sep 2021: Production, physiological & therapeutic effects, dosage and dangers
  • Jun 2022: Production, technique of application and dangers
  • Aug 2025: Principle and therapeutic effects

3. INFRA RED RADIATION (Asked 3 times)

  • Jan 2022: Luminous & non-luminous generators, physiological & therapeutic effects, precautions
  • Oct 2022: Production, treatment techniques, precaution methods
  • Aug 2024: Types of generators, production, indications, contraindications, physiological & therapeutic effects

4. ULTRAVIOLET RADIATION (Asked 3 times)

  • Jun 2022: Classification, types of generators, production
  • Apr 2023: Types, production, physiological & therapeutic effects
  • Aug 2025: Production, classification, principles of application

5. PULSED SHORTWAVE DIATHERMY (Asked 2 times)

  • Dec 2020: Principles & therapeutic effects
  • Nov 2023: Principles and therapeutic effects (almost identical wording!)

6. SHORTWAVE DIATHERMY (Asked 2 times)

  • Aug 2024: Production, physiological & therapeutic effects
  • Feb 2025: Methods of application, precautions, indications & contraindications

7. LASER (Asked 2 times)

  • Oct 2022: Production, physiological & therapeutic effects
  • Feb 2025: Production, types, techniques & dosimetry

KEY TAKEAWAYS FOR EXAM PREP

  • Top 4 priority topics (each asked 3 times): Ultrasound, MWD, IRR, UVR - these are almost guaranteed to appear every exam.
  • PSWD question in Dec 2020 and Nov 2023 used nearly identical wording - very likely to repeat again.
  • SWD and LASER are rising topics - both appeared in the last 2 exams (2024-2025).
  • For each repeated topic, be ready to cover: production + physiological effects + therapeutic effects + techniques/application + dangers/precautions.

Create a study guide pdf with summary notes for all above the frequency table

Reading File
Running Command

mkdir -p /home/daytona/workspace/study-guide && echo "dir ready"

Writing File

~/study-guide/generate_study_guide.py

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

OUTPUT = "/home/daytona/workspace/study-guide/Electrotherapy_II_StudyGuide.pdf"

# ── colours ──────────────────────────────────────────────────────────────────
DARK_BLUE   = colors.HexColor("#1a3c6e")
MID_BLUE    = colors.HexColor("#2563ae")
LIGHT_BLUE  = colors.HexColor("#dce8f8")
ACCENT      = colors.HexColor("#e05c1a")
GOLD        = colors.HexColor("#f0a500")
LIGHT_GREY  = colors.HexColor("#f4f6fb")
MID_GREY    = colors.HexColor("#8d99ae")
GREEN       = colors.HexColor("#1a7a4a")
GREEN_LIGHT = colors.HexColor("#d4edda")
WARN_BG     = colors.HexColor("#fff3cd")
WARN_BORDER = colors.HexColor("#f0a500")
RED_LIGHT   = colors.HexColor("#fde8e8")
RED_DARK    = colors.HexColor("#c0392b")

styles = getSampleStyleSheet()

def S(name, **kw):
    return ParagraphStyle(name, **kw)

# ── custom styles ─────────────────────────────────────────────────────────────
cover_title = S("CoverTitle", fontSize=28, textColor=colors.white,
                fontName="Helvetica-Bold", alignment=TA_CENTER, leading=34)
cover_sub   = S("CoverSub", fontSize=14, textColor=GOLD,
                fontName="Helvetica-Bold", alignment=TA_CENTER, spaceAfter=6)
cover_body  = S("CoverBody", fontSize=11, textColor=colors.white,
                fontName="Helvetica", alignment=TA_CENTER, leading=16)

ch_title    = S("ChTitle", fontSize=20, textColor=colors.white,
                fontName="Helvetica-Bold", alignment=TA_LEFT, leading=26)
section_hd  = S("SectionHd", fontSize=14, textColor=DARK_BLUE,
                fontName="Helvetica-Bold", spaceBefore=10, spaceAfter=4, leading=18)
sub_hd      = S("SubHd", fontSize=12, textColor=MID_BLUE,
                fontName="Helvetica-Bold", spaceBefore=6, spaceAfter=3, leading=15)
body        = S("Body", fontSize=10, fontName="Helvetica",
                leading=14, spaceAfter=3, alignment=TA_JUSTIFY)
bullet_s    = S("Bullet", fontSize=10, fontName="Helvetica",
                leading=13, spaceAfter=2, leftIndent=14, firstLineIndent=-10)
small       = S("Small", fontSize=9, fontName="Helvetica",
                textColor=MID_GREY, leading=12, spaceAfter=2)
toc_item    = S("TocItem", fontSize=11, fontName="Helvetica",
                leading=16, leftIndent=10)
toc_num     = S("TocNum", fontSize=11, fontName="Helvetica-Bold",
                textColor=MID_BLUE, leading=16)
note_style  = S("Note", fontSize=10, fontName="Helvetica-Oblique",
                textColor=colors.HexColor("#5a4000"), leading=13,
                leftIndent=8, rightIndent=8)
exam_style  = S("Exam", fontSize=9, fontName="Helvetica",
                textColor=DARK_BLUE, leading=12, leftIndent=8)


def bullet(text, indent=0):
    pad = "&nbsp;" * (indent * 4)
    marker = "\u2022" if indent == 0 else "\u25e6"
    return Paragraph(f"{pad}{marker}  {text}", bullet_s)


def note_box(text):
    """Yellow warning / exam-tip box."""
    inner = Paragraph(text, note_style)
    t = Table([[inner]], colWidths=[16*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), WARN_BG),
        ("BOX",        (0,0), (-1,-1), 1.2, WARN_BORDER),
        ("TOPPADDING",    (0,0), (-1,-1), 6),
        ("BOTTOMPADDING", (0,0), (-1,-1), 6),
        ("LEFTPADDING",   (0,0), (-1,-1), 8),
        ("RIGHTPADDING",  (0,0), (-1,-1), 8),
    ]))
    return t


def chapter_banner(title, subtitle, asked, years, color=DARK_BLUE):
    """Full-width colored chapter header banner."""
    freq_text = f"Asked {asked}x  |  Years: {years}"
    inner = [
        Paragraph(title, ch_title),
        Paragraph(subtitle, S("ChSub", fontSize=10, textColor=GOLD,
                               fontName="Helvetica-Bold", leading=14)),
        Spacer(1, 4),
        Paragraph(freq_text, S("ChFreq", fontSize=9, textColor=colors.white,
                                fontName="Helvetica", leading=12)),
    ]
    t = Table([[inner]], colWidths=[17*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,-1), color),
        ("TOPPADDING",    (0,0), (-1,-1), 12),
        ("BOTTOMPADDING", (0,0), (-1,-1), 12),
        ("LEFTPADDING",   (0,0), (-1,-1), 14),
        ("RIGHTPADDING",  (0,0), (-1,-1), 14),
        ("ROUNDEDCORNERS",(0,0), (-1,-1), [4,4,4,4]),
    ]))
    return t


def two_col_table(left_items, right_items, left_title="", right_title=""):
    left_para  = [Paragraph(f"<b>{left_title}</b>",  sub_hd)] if left_title  else []
    right_para = [Paragraph(f"<b>{right_title}</b>", sub_hd)] if right_title else []
    left_para  += [bullet(i) for i in left_items]
    right_para += [bullet(i) for i in right_items]
    data = [[left_para, right_para]]
    t = Table(data, colWidths=[8.2*cm, 8.2*cm])
    t.setStyle(TableStyle([
        ("VALIGN",       (0,0), (-1,-1), "TOP"),
        ("TOPPADDING",   (0,0), (-1,-1), 6),
        ("BOTTOMPADDING",(0,0), (-1,-1), 6),
        ("LEFTPADDING",  (0,0), (-1,-1), 6),
        ("RIGHTPADDING", (0,0), (-1,-1), 6),
        ("BACKGROUND",   (0,0), (0,-1), LIGHT_BLUE),
        ("BACKGROUND",   (1,0), (1,-1), GREEN_LIGHT),
        ("BOX",          (0,0), (-1,-1), 0.5, MID_GREY),
        ("INNERGRID",    (0,0), (-1,-1), 0.5, MID_GREY),
    ]))
    return t


def ind_contra_table(indications, contraindications):
    return two_col_table(indications, contraindications,
                         "Indications", "Contraindications")


def simple_table(headers, rows, col_widths=None):
    if col_widths is None:
        col_widths = [16.4*cm / len(headers)] * len(headers)
    data = [[Paragraph(f"<b>{h}</b>", S("TH", fontSize=9, fontName="Helvetica-Bold",
                        textColor=colors.white, leading=12)) for h in headers]]
    for row in rows:
        data.append([Paragraph(str(c), S("TD", fontSize=9, fontName="Helvetica",
                                         leading=12)) for c in row])
    t = Table(data, colWidths=col_widths)
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,0),  DARK_BLUE),
        ("BACKGROUND",    (0,1), (-1,-1), LIGHT_GREY),
        ("ROWBACKGROUNDS",(0,1), (-1,-1), [LIGHT_GREY, colors.white]),
        ("BOX",           (0,0), (-1,-1), 0.5, MID_GREY),
        ("INNERGRID",     (0,0), (-1,-1), 0.3, MID_GREY),
        ("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"),
    ]))
    return t


# ══════════════════════════════════════════════════════════════════════════════
# CONTENT
# ══════════════════════════════════════════════════════════════════════════════

def build_cover(story):
    # cover page background via Table
    cover_content = [
        Spacer(1, 1.5*cm),
        Paragraph("BPT THIRD YEAR", S("CTop", fontSize=12, textColor=GOLD,
                   fontName="Helvetica-Bold", alignment=TA_CENTER)),
        Spacer(1, 0.3*cm),
        Paragraph("ELECTROTHERAPY – II", cover_title),
        Paragraph("(High Frequency &amp; Actinotherapy)", cover_sub),
        Spacer(1, 0.6*cm),
        HRFlowable(width="80%", thickness=1.5, color=GOLD, hAlign="CENTER"),
        Spacer(1, 0.6*cm),
        Paragraph("EXAM-FOCUSED STUDY GUIDE", S("EF", fontSize=16,
                   textColor=colors.white, fontName="Helvetica-Bold", alignment=TA_CENTER)),
        Spacer(1, 0.4*cm),
        Paragraph("Summary Notes for All High-Frequency 15-Mark Topics", cover_body),
        Spacer(1, 1.2*cm),
        Paragraph("Based on Previous Year Questions: Dec 2020 – Aug 2025", cover_body),
        Paragraph("Tamil Nadu Dr. M.G.R. Medical University", cover_body),
        Spacer(1, 1.5*cm),
        HRFlowable(width="60%", thickness=0.8, color=GOLD, hAlign="CENTER"),
        Spacer(1, 0.5*cm),
        Paragraph("7 High-Frequency Topics  |  10 Question Papers Analyzed", cover_body),
    ]
    cover_table = Table([[cover_content]], colWidths=[17*cm])
    cover_table.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,-1), DARK_BLUE),
        ("TOPPADDING",    (0,0), (-1,-1), 20),
        ("BOTTOMPADDING", (0,0), (-1,-1), 20),
        ("LEFTPADDING",   (0,0), (-1,-1), 20),
        ("RIGHTPADDING",  (0,0), (-1,-1), 20),
    ]))
    story.append(cover_table)
    story.append(PageBreak())


def build_toc(story):
    story.append(Paragraph("TABLE OF CONTENTS", S("TocH", fontSize=16,
                 textColor=DARK_BLUE, fontName="Helvetica-Bold",
                 alignment=TA_CENTER, spaceAfter=8)))
    story.append(HRFlowable(width="100%", thickness=1, color=MID_BLUE))
    story.append(Spacer(1, 0.4*cm))

    entries = [
        ("1", "Ultrasound Therapy",               "Asked 3x — HIGH PRIORITY"),
        ("2", "Microwave Diathermy (MWD)",         "Asked 3x — HIGH PRIORITY"),
        ("3", "Infra Red Radiation (IRR)",          "Asked 3x — HIGH PRIORITY"),
        ("4", "Ultraviolet Radiation (UVR)",        "Asked 3x — HIGH PRIORITY"),
        ("5", "Pulsed Shortwave Diathermy (PSWD)",  "Asked 2x — MEDIUM PRIORITY"),
        ("6", "Shortwave Diathermy (SWD)",          "Asked 2x — MEDIUM PRIORITY"),
        ("7", "LASER Therapy",                      "Asked 2x — MEDIUM PRIORITY"),
    ]
    rows = []
    for num, topic, freq in entries:
        freq_col = freq.replace("HIGH", "<font color='#c0392b'><b>HIGH</b></font>").replace("MEDIUM", "<font color='#e05c1a'><b>MEDIUM</b></font>")
        rows.append([
            Paragraph(f"<b>{num}</b>", S("N", fontSize=12, textColor=MID_BLUE,
                       fontName="Helvetica-Bold", alignment=TA_CENTER, leading=16)),
            Paragraph(f"<b>{topic}</b>", S("T", fontSize=11, fontName="Helvetica-Bold",
                       textColor=DARK_BLUE, leading=16)),
            Paragraph(freq_col, S("F", fontSize=9, fontName="Helvetica", leading=14)),
        ])
    t = Table(rows, colWidths=[1.2*cm, 10*cm, 5.8*cm])
    t.setStyle(TableStyle([
        ("ROWBACKGROUNDS",  (0,0), (-1,-1), [LIGHT_BLUE, colors.white]),
        ("BOX",             (0,0), (-1,-1), 0.5, MID_GREY),
        ("INNERGRID",       (0,0), (-1,-1), 0.3, MID_GREY),
        ("TOPPADDING",      (0,0), (-1,-1), 7),
        ("BOTTOMPADDING",   (0,0), (-1,-1), 7),
        ("LEFTPADDING",     (0,0), (-1,-1), 8),
        ("RIGHTPADDING",    (0,0), (-1,-1), 8),
        ("VALIGN",          (0,0), (-1,-1), "MIDDLE"),
        ("ALIGN",           (0,0), (0,-1),  "CENTER"),
    ]))
    story.append(t)
    story.append(PageBreak())


# ══════════════════════════════════════════════════════════════════════════════
# CHAPTER 1 – ULTRASOUND THERAPY
# ══════════════════════════════════════════════════════════════════════════════
def ch1_ultrasound(story):
    story.append(chapter_banner(
        "CHAPTER 1: ULTRASOUND THERAPY",
        "Paper II – Electrotherapy II (High Freq & Actinotherapy)",
        3, "Sep 2021, Jan 2022, Nov 2023", DARK_BLUE))
    story.append(Spacer(1, 0.3*cm))

    story.append(note_box("EXAM TIP: This is the MOST REPEATED topic. Always define, then cover Production -> Physiological Effects -> Therapeutic Effects -> Techniques -> Contraindications."))
    story.append(Spacer(1, 0.2*cm))

    # Definition
    story.append(Paragraph("1. DEFINITION", section_hd))
    story.append(Paragraph(
        "Ultrasound is a form of acoustic (sound) energy with a frequency greater than 20,000 Hz (20 kHz), "
        "above the range of human hearing. Therapeutic ultrasound uses frequencies of <b>0.5 to 3 MHz</b>. "
        "The most commonly used frequencies are <b>1 MHz</b> (deeper tissues, 3-5 cm) and <b>3 MHz</b> (superficial tissues, 1-2 cm).",
        body))
    story.append(Spacer(1, 0.1*cm))

    # Production
    story.append(Paragraph("2. PRODUCTION (Piezoelectric Effect)", section_hd))
    story.append(Paragraph("Ultrasound is produced by the <b>Reverse Piezoelectric Effect</b>:", body))
    for pt in [
        "A high-frequency alternating electrical current is applied to a piezoelectric crystal (quartz, lead zirconate titanate - PZT, or barium titanate).",
        "The crystal alternately expands and contracts (vibrates) at the applied frequency.",
        "These mechanical vibrations are transmitted to the tissues as longitudinal pressure waves (ultrasound).",
        "The transducer (sound head) houses the crystal and converts electrical energy to mechanical energy.",
        "Coupling medium (gel, water) is needed because ultrasound cannot travel through air.",
    ]:
        story.append(bullet(pt))
    story.append(Spacer(1, 0.15*cm))
    story.append(Paragraph("<b>Components of Ultrasound Machine:</b>", sub_hd))
    story.append(simple_table(
        ["Component", "Function"],
        [
            ["Oscillator circuit", "Produces high-frequency electrical oscillations"],
            ["Amplifier", "Amplifies the electrical signal"],
            ["Piezoelectric crystal", "Converts electrical energy to mechanical (sound) energy"],
            ["Coupling medium (gel)", "Transmits sound waves from transducer to tissues (eliminates air gap)"],
            ["ERA (Effective Radiating Area)", "The area of the transducer that actually emits ultrasound"],
        ],
        [5*cm, 11*cm]
    ))
    story.append(Spacer(1, 0.2*cm))

    # Ultrasonic Field
    story.append(Paragraph("3. ULTRASONIC FIELD", section_hd))
    story.append(simple_table(
        ["Zone", "Description"],
        [
            ["Near field (Fresnel zone)", "Region close to the transducer; intense, uneven beam; more biological effects"],
            ["Far field (Fraunhofer zone)", "Beam diverges; intensity decreases; more uniform"],
            ["Nodes & Antinodes", "Nodes = zero displacement points; Antinodes = maximum displacement points (can cause periosteal pain)"],
        ],
        [5*cm, 11*cm]
    ))
    story.append(Spacer(1, 0.2*cm))

    # Physiological Effects
    story.append(Paragraph("4. PHYSIOLOGICAL EFFECTS", section_hd))
    story.append(Paragraph("<b>A. Thermal Effects</b>", sub_hd))
    for pt in [
        "Increased tissue temperature due to absorption of sound energy.",
        "More heat produced at tissue interfaces (bone-muscle, tendon-muscle).",
        "Increased blood flow and metabolism.",
        "Increased extensibility of collagen (useful in contractures).",
        "Reduced muscle spasm and pain (due to heat).",
        "Increased nerve conduction velocity.",
    ]:
        story.append(bullet(pt))

    story.append(Paragraph("<b>B. Non-Thermal (Mechanical) Effects</b>", sub_hd))
    story.append(Paragraph("<u>Cavitation:</u>", S("U", fontSize=10, fontName="Helvetica-Bold", spaceAfter=2)))
    for pt in [
        "Stable cavitation: oscillation of gas bubbles in tissue fluids without collapse — beneficial (micro-massage effect, increased cell permeability).",
        "Unstable/transient cavitation: violent collapse of bubbles — destructive (avoided in therapy by using appropriate intensities).",
    ]:
        story.append(bullet(pt))

    story.append(Paragraph("<u>Acoustic Streaming:</u>", S("U", fontSize=10, fontName="Helvetica-Bold", spaceAfter=2)))
    story.append(bullet("Unidirectional movement of fluids along cell membranes due to ultrasound pressure gradients — increases cell membrane permeability and ion transport."))

    story.append(Paragraph("<u>Micro-massage Effect:</u>", S("U", fontSize=10, fontName="Helvetica-Bold", spaceAfter=2)))
    story.append(bullet("Compression and rarefaction cycles produce a micro-massage effect at cellular level, stimulating tissue repair and reducing oedema."))
    story.append(Spacer(1, 0.15*cm))

    # Therapeutic Effects
    story.append(Paragraph("5. THERAPEUTIC EFFECTS", section_hd))
    for pt in [
        "Pain relief (analgesic effect).",
        "Reduction of muscle spasm.",
        "Increased tissue extensibility — useful for scar tissue, adhesions, contractures.",
        "Accelerates tissue healing and repair (stimulates fibroblast activity).",
        "Reduces chronic inflammation.",
        "Absorption of calcium deposits (in calcific tendinitis).",
        "Phonophoresis — drives drugs (e.g., hydrocortisone, diclofenac) into tissues.",
        "Increases blood flow and lymphatic drainage.",
    ]:
        story.append(bullet(pt))
    story.append(Spacer(1, 0.15*cm))

    # Treatment Parameters
    story.append(Paragraph("6. TREATMENT PARAMETERS", section_hd))
    story.append(simple_table(
        ["Parameter", "Options / Values"],
        [
            ["Frequency",       "1 MHz (deep: 3-5 cm) or 3 MHz (superficial: 1-2 cm)"],
            ["Intensity",       "0.1 – 3.0 W/cm² (SATP). Thermal: >1 W/cm²; Non-thermal: 0.1-0.5 W/cm²"],
            ["Mode",            "Continuous (thermal) or Pulsed (non-thermal); common pulsed ratio 1:4 (duty cycle 20%)"],
            ["Duration",        "5-10 minutes per treatment area"],
            ["ERA",             "Effective Radiating Area of transducer head"],
            ["Duty Cycle",      "% of time ultrasound is ON: e.g., 20% = 2ms ON, 8ms OFF"],
        ],
        [4.5*cm, 12*cm]
    ))
    story.append(Spacer(1, 0.15*cm))

    # Techniques
    story.append(Paragraph("7. TECHNIQUES OF APPLICATION", section_hd))
    for pt in [
        "<b>Direct contact method:</b> Coupling gel applied directly; transducer moved slowly in overlapping circles (most common).",
        "<b>Water bath / immersion method:</b> Limb immersed in water; transducer held 1-2 cm from skin; used for irregular surfaces (hands, feet).",
        "<b>Bladder method / water-filled bag:</b> Plastic bag filled with water used as coupling medium over bony prominences.",
        "<b>Phonophoresis:</b> Drugs mixed with coupling gel and driven into tissue using ultrasound.",
        "<b>Underwater method:</b> Both patient and transducer submerged.",
    ]:
        story.append(bullet(pt))
    story.append(Spacer(1, 0.15*cm))

    # Indications & Contraindications
    story.append(Paragraph("8. INDICATIONS & CONTRAINDICATIONS", section_hd))
    story.append(ind_contra_table(
        ["Soft tissue injuries", "Tendinitis / tenosynovitis",
         "Bursitis", "Muscle spasm", "Scar tissue / adhesions",
         "Calcific deposits", "Frozen shoulder", "Plantar fasciitis",
         "Chronic inflammation", "OA knee, hip"],
        ["Over malignant tumours", "Over pregnant uterus",
         "Over pacemaker / heart", "Acute infections",
         "Over eyes / gonads", "Thrombophlebitis",
         "Over growing epiphyses (children)", "Over laminectomy sites",
         "Haemophilia / bleeding disorders", "Metal implants (relative CI)"],
    ))
    story.append(Spacer(1, 0.15*cm))
    story.append(note_box("KEY FACT: Periosteal pain during ultrasound = too high intensity or transducer kept stationary. Prevention: keep moving, reduce intensity."))
    story.append(PageBreak())


# ══════════════════════════════════════════════════════════════════════════════
# CHAPTER 2 – MICROWAVE DIATHERMY
# ══════════════════════════════════════════════════════════════════════════════
def ch2_mwd(story):
    story.append(chapter_banner(
        "CHAPTER 2: MICROWAVE DIATHERMY (MWD)",
        "Paper II – Electrotherapy II (High Freq & Actinotherapy)",
        3, "Sep 2021, Jun 2022, Aug 2025", colors.HexColor("#1a4f3a")))
    story.append(Spacer(1, 0.3*cm))
    story.append(note_box("EXAM TIP: Cover Definition -> Production (Magnetron) -> Frequency/Wavelength -> Physiological & Therapeutic Effects -> Techniques -> Dangers."))
    story.append(Spacer(1, 0.2*cm))

    story.append(Paragraph("1. DEFINITION", section_hd))
    story.append(Paragraph(
        "Microwave Diathermy (MWD) is a form of <b>electromagnetic diathermy</b> that uses electromagnetic radiation "
        "in the microwave band to produce deep heating in tissues. The standard therapeutic frequency is "
        "<b>2450 MHz</b> (wavelength 12.25 cm) or <b>915 MHz</b> (wavelength 32.8 cm). It lies between "
        "short waves and infrared on the electromagnetic spectrum.", body))
    story.append(Spacer(1, 0.1*cm))

    story.append(Paragraph("2. PRODUCTION", section_hd))
    story.append(Paragraph("<b>Device used: Magnetron (vacuum tube)</b>", sub_hd))
    for pt in [
        "A magnetron is a high-power vacuum tube that generates microwave energy.",
        "Electrons are emitted from a central cathode and spiral outward under influence of a strong magnetic field.",
        "The spiraling electrons induce oscillations in the resonant cavities of the anode, generating microwaves.",
        "Microwaves are directed from the magnetron to a dipole antenna/director via a coaxial cable.",
        "The director (emitter) focuses the beam onto the treatment area.",
        "A <b>Tridymite</b> ceramic window seals the magnetron and allows microwave transmission.",
    ]:
        story.append(bullet(pt))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("3. PHYSIOLOGICAL EFFECTS", section_hd))
    for pt in [
        "<b>Heating:</b> Tissues with high water content (muscle, skin) absorb microwaves more and heat more than fat.",
        "Depth of penetration: ~3 cm (2450 MHz) — less deep than SWD.",
        "Increased local blood flow and metabolism.",
        "Reduced muscle spasm.",
        "Increased tissue extensibility.",
        "Pain relief (gate control, increased endorphins).",
        "Resolution of chronic inflammation.",
        "<b>Skin heating</b> is more pronounced with MWD than SWD (can cause burns if not careful).",
    ]:
        story.append(bullet(pt))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("4. THERAPEUTIC EFFECTS", section_hd))
    for pt in [
        "Relief of pain in musculoskeletal conditions.",
        "Treatment of sub-acute/chronic soft tissue injuries.",
        "Muscle spasm reduction.",
        "Increased joint range of motion (pre-stretching).",
        "Resolution of chronic bursitis, tendinitis.",
        "Treatment of sinusitis (pulsed MWD).",
    ]:
        story.append(bullet(pt))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("5. TECHNIQUES OF APPLICATION", section_hd))
    story.append(simple_table(
        ["Technique", "Description"],
        [
            ["Direct method", "Director held 5-10 cm from skin; electromagnetic radiation transmitted through air (no contact needed)"],
            ["Round director", "For large flat areas (back, thigh)"],
            ["Rectangular director", "For medium areas (shoulder, knee)"],
            ["Cylindrical director", "For limbs"],
            ["Spacing", "Director must NOT touch skin — always maintain air gap of 5-10 cm to avoid burns"],
        ],
        [4.5*cm, 12*cm]
    ))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("6. DOSAGE", section_hd))
    story.append(simple_table(
        ["Dose", "Patient Sensation", "Use"],
        [
            ["Dose I", "No heat sensation", "Acute conditions"],
            ["Dose II", "Mild warmth", "Sub-acute conditions"],
            ["Dose III", "Comfortable warmth", "Chronic conditions"],
            ["Dose IV", "Strong warmth (near pain threshold)", "Rarely used — risk of burn"],
        ],
        [3*cm, 6*cm, 7*cm]
    ))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("7. DANGERS OF MWD", section_hd))
    story.append(ind_contra_table(
        ["Sub-acute & chronic musculoskeletal conditions",
         "Sinusitis, otitis media", "Bursitis, tendinitis",
         "Muscle spasm", "Chronic inflammation",
         "Pre-exercise heating"],
        ["Skin burns (most common danger)",
         "Over metal implants / pacemakers",
         "Over eyes (cataract formation)",
         "Over moist dressings (steam burns)",
         "Over testes / gonads",
         "Malignancies", "Pregnancy",
         "Children (growing epiphyses)",
         "Ischaemic areas (poor circulation)"],
    ))
    story.append(Spacer(1, 0.1*cm))
    story.append(note_box("KEY COMPARISON: MWD heats SKIN more (selective absorption by water). SWD heats DEEPER tissues. MWD cannot heat through air — director must face skin."))
    story.append(PageBreak())


# ══════════════════════════════════════════════════════════════════════════════
# CHAPTER 3 – INFRA RED RADIATION
# ══════════════════════════════════════════════════════════════════════════════
def ch3_irr(story):
    story.append(chapter_banner(
        "CHAPTER 3: INFRA RED RADIATION (IRR)",
        "Paper II – Electrotherapy II (High Freq & Actinotherapy)",
        3, "Jan 2022, Oct 2022, Aug 2024", colors.HexColor("#7a2d00")))
    story.append(Spacer(1, 0.3*cm))
    story.append(note_box("EXAM TIP: Define IRR -> Electromagnetic spectrum position -> Luminous vs Non-luminous generators -> Physiological & Therapeutic Effects -> Treatment technique -> Precautions & Contraindications."))
    story.append(Spacer(1, 0.2*cm))

    story.append(Paragraph("1. DEFINITION", section_hd))
    story.append(Paragraph(
        "Infrared Radiation (IRR) is a part of the <b>electromagnetic spectrum</b> with wavelengths ranging from "
        "<b>770 nm to 1 mm</b> (just beyond the visible red end of the spectrum). Therapeutic range: "
        "<b>near-infrared (770-1500 nm)</b> and <b>far-infrared (1500 nm - 1 mm)</b>. "
        "It produces heating by radiation and is classified as a superficial heating modality (penetrates 1-3 cm).", body))
    story.append(Spacer(1, 0.1*cm))

    story.append(Paragraph("2. TYPES OF GENERATORS", section_hd))
    story.append(simple_table(
        ["Feature", "Luminous (Near IR)", "Non-luminous (Far IR)"],
        [
            ["Wavelength",       "770–1500 nm (shorter)",           "1500 nm – 1 mm (longer)"],
            ["Temperature",      "~2500°C (very hot filament)",     "400–500°C (lower temp)"],
            ["Visible light",    "Yes (produces visible red glow)", "No (no visible light)"],
            ["Penetration",      "Deeper (3-10 mm)",                "Superficial (1-3 mm)"],
            ["Warm-up time",     "Instant (no warm-up needed)",     "15-20 minutes warm-up"],
            ["Examples",         "Radiant heat lamp, tungsten bulb","Electrically heated coil/carbon element lamp"],
            ["Treatment distance","45-75 cm from skin",             "45-75 cm from skin"],
        ],
        [3.5*cm, 6*cm, 6.5*cm]
    ))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("3. LAWS GOVERNING RADIATION", section_hd))
    story.append(simple_table(
        ["Law", "Statement"],
        [
            ["Inverse Square Law",    "Intensity of radiation is inversely proportional to the square of the distance from the source. I ∝ 1/d²"],
            ["Cosine Law (Lambert's)","Intensity of radiation on a surface is proportional to the cosine of the angle between the ray and the perpendicular to the surface. I = I₀ cos θ"],
            ["Grotthus-Draper Law",   "Only absorbed radiation produces a photochemical effect."],
            ["Bunsen-Roscoe Law",     "Photochemical effect = Intensity × Time (reciprocity law)"],
        ],
        [4.5*cm, 12*cm]
    ))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("4. PHYSIOLOGICAL EFFECTS", section_hd))
    for pt in [
        "<b>Vasodilation:</b> Local hyperaemia (increased blood flow to skin and superficial tissues).",
        "<b>Increased metabolism:</b> Van't Hoff's law — metabolic rate doubles for every 10°C rise in temperature.",
        "<b>Sedation:</b> Mild heating reduces pain and produces sedative effect on sensory nerves.",
        "<b>Muscle relaxation:</b> Reduces muscle spasm by heating muscle spindles and Golgi tendon organs.",
        "<b>Increased cell activity:</b> Speeds up tissue repair and regeneration.",
        "<b>Sweating:</b> Reflex sweating to regulate body temperature.",
        "<b>Skin erythema:</b> Superficial reddening due to vasodilation (not true erythema like UVR).",
    ]:
        story.append(bullet(pt))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("5. THERAPEUTIC EFFECTS", section_hd))
    for pt in [
        "Pain relief — musculoskeletal pain, neuralgia.",
        "Relief of muscle spasm and stiffness.",
        "Preparation for massage, exercises, mobilisation.",
        "Treatment of chronic arthritis.",
        "Helps resolve chronic inflammation.",
        "Wound healing (mild cases).",
        "Relaxation and sedation.",
    ]:
        story.append(bullet(pt))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("6. TREATMENT TECHNIQUE", section_hd))
    for pt in [
        "Position patient comfortably; expose area to be treated.",
        "Clean and dry skin. Remove any metal jewellery.",
        "Luminous lamp: no warm-up needed. Non-luminous: warm up 15-20 min before application.",
        "Position lamp at <b>45-75 cm</b> from skin (adjust based on intensity required).",
        "Lamp must be <b>perpendicular</b> to the skin surface (Cosine Law).",
        "Check patient's sensation every 2-3 minutes.",
        "Treatment duration: <b>15-30 minutes</b>.",
        "After treatment: dry skin, observe for erythema.",
    ]:
        story.append(bullet(pt))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("7. INDICATIONS & CONTRAINDICATIONS / PRECAUTIONS", section_hd))
    story.append(ind_contra_table(
        ["Chronic arthritis / arthralgia", "Muscle spasm", "Neuralgia",
         "Chronic soft tissue injuries", "Pre-exercise warm-up",
         "Skin conditions (e.g., acne — limited)", "Chronic wounds (secondary use)"],
        ["Over anaesthetic skin (cannot feel heat)", "Over ischaemic areas",
         "Over recent scars (within 3 months)", "Malignancy",
         "Pregnancy (over abdomen/pelvis)", "Over eyes (thermal cataract risk)",
         "Acute inflammation", "Haemorrhagic areas",
         "Over metal implants (relative CI)"],
    ))
    story.append(Spacer(1, 0.1*cm))
    story.append(note_box("EXAM DANGER POINT: Eyes must always be covered with wet pads during IRR treatment. Patient must NOT fall asleep."))
    story.append(PageBreak())


# ══════════════════════════════════════════════════════════════════════════════
# CHAPTER 4 – ULTRAVIOLET RADIATION
# ══════════════════════════════════════════════════════════════════════════════
def ch4_uvr(story):
    story.append(chapter_banner(
        "CHAPTER 4: ULTRAVIOLET RADIATION (UVR)",
        "Paper II – Electrotherapy II (High Freq & Actinotherapy)",
        3, "Jun 2022, Apr 2023, Aug 2025", colors.HexColor("#4a007a")))
    story.append(Spacer(1, 0.3*cm))
    story.append(note_box("EXAM TIP: Define & classify UVR -> Generators (Kromayer, Alpine Sun, Theraktin) -> Production -> Physiological Effects -> Therapeutic Effects -> Dosage (MED) -> Clinical applications (Psoriasis, Acne, Ulcers)."))
    story.append(Spacer(1, 0.2*cm))

    story.append(Paragraph("1. DEFINITION & CLASSIFICATION", section_hd))
    story.append(Paragraph(
        "Ultraviolet Radiation (UVR) is electromagnetic radiation with wavelengths from <b>100 nm to 400 nm</b>, "
        "below visible violet light on the electromagnetic spectrum. It is classified into:", body))
    story.append(simple_table(
        ["Type", "Wavelength", "Effect"],
        [
            ["UVA (Long-wave UV)", "320–400 nm", "Least erythemogenic; used in PUVA therapy; penetrates deeper; causes tanning"],
            ["UVB (Mid-wave UV)",  "280–320 nm", "Most erythemogenic; used therapeutically for psoriasis, vitamin D synthesis"],
            ["UVC (Short-wave UV)","100–280 nm", "Most germicidal (bactericidal); does not penetrate skin well; Kromayer lamp"],
        ],
        [3.5*cm, 3.5*cm, 9*cm]
    ))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("2. SOURCES / GENERATORS", section_hd))
    story.append(simple_table(
        ["Source", "Description", "Uses"],
        [
            ["Hot quartz (Mercury Vapour) lamp\n(Water-cooled medium pressure)",
             "High pressure mercury vapour in a quartz tube; water-cooled; emits UVB & UVC predominantly",
             "General irradiation, wound healing, psoriasis"],
            ["Kromayer lamp (Cold quartz)",
             "Low-pressure mercury in quartz tube; water-cooled; emits mainly UVC",
             "Local treatment of wounds, ulcers, acne, skin infections"],
            ["Alpine Sun lamp (Air-cooled)",
             "High pressure mercury in glass/quartz; air-cooled; emits UVA, UVB",
             "General body irradiation, psoriasis, rickets"],
            ["Theraktin tunnel",
             "Multiple fluorescent UV lamps arranged in a tunnel; patient lies inside",
             "Whole-body UVR treatment, psoriasis"],
            ["PUVA apparatus",
             "Combines psoralen (photosensitiser) + UVA; cabinet with UVA fluorescent tubes",
             "Psoriasis, vitiligo, eczema"],
        ],
        [3.5*cm, 6*cm, 6*cm]
    ))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("3. PHYSIOLOGICAL EFFECTS", section_hd))
    for pt in [
        "<b>Erythema:</b> Redness of skin due to vasodilation — appears 2-6 hours after exposure. Most important physiological effect.",
        "<b>Tanning (Pigmentation):</b> Stimulates melanin production in melanocytes. UVA causes immediate tanning; UVB causes delayed tanning.",
        "<b>Vitamin D synthesis:</b> UVB converts 7-dehydrocholesterol in skin to Vitamin D3 (cholecalciferol).",
        "<b>Bactericidal effect:</b> UVC destroys DNA of microorganisms.",
        "<b>Hyperplasia of epidermis:</b> Thickening of skin as a protective response (desquamation follows).",
        "<b>Desquamation:</b> Peeling of dead skin cells after erythema phase.",
        "<b>Photosensitisation:</b> Some drugs/chemicals increase sensitivity to UVR.",
    ]:
        story.append(bullet(pt))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("4. ERYTHEMA GRADES AND DOSAGE", section_hd))
    story.append(simple_table(
        ["Grade", "Name", "Appearance", "Duration", "Use"],
        [
            ["E0", "Sub-erythemal", "No visible redness", "—", "General tonic, tanning"],
            ["E1", "Minimal Erythema (MED)", "Faint pink, just visible", "Disappears within 24 h", "Starting dose for most treatments"],
            ["E2", "First Degree", "Definite redness, mild symptoms", "24–48 h", "Psoriasis, acne"],
            ["E3", "Second Degree", "Intense red, oedema, vesicles", "3–5 days", "Infected wounds, ulcers"],
            ["E4", "Third Degree", "Severe blistering, pain", ">5 days", "Rarely used — extreme"],
        ],
        [1.5*cm, 3*cm, 3.5*cm, 2.5*cm, 5.5*cm]
    ))
    story.append(Spacer(1, 0.1*cm))
    story.append(note_box("MED (Minimal Erythema Dose) = smallest dose that produces just visible erythema after 6-8 hours. Always determine MED before treating a patient."))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("5. THERAPEUTIC EFFECTS & CLINICAL USES", section_hd))
    story.append(simple_table(
        ["Condition", "Treatment Details"],
        [
            ["Psoriasis",       "UVB or PUVA (psoralen + UVA); E2 dose; theraktin tunnel or PUVA cabinet"],
            ["Acne vulgaris",   "UVB E2-E3; bactericidal effect of UV; Kromayer lamp locally"],
            ["Wound / Ulcer",   "UVC (Kromayer lamp); E3 dose; bactericidal, promotes granulation tissue"],
            ["Rickets",         "UVB stimulates vitamin D synthesis; general body irradiation"],
            ["Vitiligo",        "PUVA therapy; re-pigmentation of depigmented patches"],
            ["Alopecia",        "UVR + PUVA; stimulates hair follicles"],
            ["Pressure sores",  "Kromayer lamp; E3 dose; bactericidal, promotes healing"],
        ],
        [4*cm, 12*cm]
    ))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("6. CONTRAINDICATIONS & PRECAUTIONS", section_hd))
    story.append(ind_contra_table(
        ["Psoriasis, vitiligo", "Acne", "Wound/ulcer healing",
         "Rickets", "General tonic effect", "Pressure sores"],
        ["Photosensitive skin (SLE, porphyria)",
         "Drugs causing photosensitisation (sulfonamides, tetracyclines)",
         "Active pulmonary tuberculosis",
         "Acute eczema / dermatitis",
         "Carcinoma of skin",
         "Over eyes (goggles mandatory)",
         "Cardiac/renal failure",
         "Recent deep X-ray therapy",
         "Hyperthyroidism"],
    ))
    story.append(Spacer(1, 0.1*cm))
    story.append(note_box("SENSITIZERS (drugs increasing UV sensitivity): Tar, anthralin, rose bengal, quinine, sulfonamides, tetracyclines, psoralens. Filters: Wood's glass (passes UVA), Uviol glass (passes UVA+UVB), Schott glass."))
    story.append(PageBreak())


# ══════════════════════════════════════════════════════════════════════════════
# CHAPTER 5 – PULSED SHORTWAVE DIATHERMY
# ══════════════════════════════════════════════════════════════════════════════
def ch5_pswd(story):
    story.append(chapter_banner(
        "CHAPTER 5: PULSED SHORTWAVE DIATHERMY (PSWD)",
        "Paper II – Electrotherapy II (High Freq & Actinotherapy)",
        2, "Dec 2020, Nov 2023 (near-identical wording both times!)", colors.HexColor("#1a3c6e")))
    story.append(Spacer(1, 0.3*cm))
    story.append(note_box("EXAM TIP: This question appeared with nearly IDENTICAL wording in Dec 2020 and Nov 2023. Very likely to repeat. Cover: Principle -> Pulse parameters -> Non-thermal effects -> Therapeutic effects -> Clinical uses."))
    story.append(Spacer(1, 0.2*cm))

    story.append(Paragraph("1. DEFINITION & PRINCIPLE", section_hd))
    story.append(Paragraph(
        "Pulsed Shortwave Diathermy (PSWD) uses the same electromagnetic frequency as SWD (<b>27.12 MHz</b>) "
        "but delivers energy in <b>intermittent pulses</b> rather than continuously. By pulsing the output, "
        "thermal effects are minimised and <b>non-thermal (athermal) effects</b> predominate, "
        "making it suitable for acute and sub-acute conditions. It is also called <b>Pulsed Electromagnetic Energy (PEME)</b>.", body))
    story.append(Spacer(1, 0.1*cm))

    story.append(Paragraph("2. PULSE PARAMETERS", section_hd))
    story.append(simple_table(
        ["Parameter", "Definition", "Typical Values"],
        [
            ["Pulse duration (width)", "Time the pulse is ON", "65–400 microseconds"],
            ["Pulse frequency", "Number of pulses per second", "15–200 pulses per second (Hz)"],
            ["Pulse interval (OFF time)", "Rest time between pulses", "Allows heat to dissipate"],
            ["Duty cycle", "Pulse duration / (Pulse duration + Pulse interval) × 100", "e.g., 1:100 = very low thermal"],
            ["Mean power", "Average power output", "Depends on pulse settings"],
            ["Peak power", "Power during the ON phase", "Up to 1000 W (but very brief)"],
        ],
        [4*cm, 6.5*cm, 5.5*cm]
    ))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("3. NON-THERMAL (ATHERMAL) EFFECTS", section_hd))
    for pt in [
        "<b>Increased cell membrane permeability</b> — facilitates ion exchange, reduces oedema.",
        "<b>Enhanced fibroblast proliferation</b> — speeds tissue repair and collagen synthesis.",
        "<b>Stimulation of protein synthesis</b> — at sub-cellular level.",
        "<b>Reduction of oedema</b> — promotes lymphatic drainage, reduces swelling in acute injuries.",
        "<b>Pain relief</b> — reduces bradykinin and substance P release; gate control mechanism.",
        "<b>Stimulation of macrophage activity</b> — promotes phagocytosis and debris clearance.",
        "<b>Nerve regeneration</b> — promotes axonal regrowth.",
    ]:
        story.append(bullet(pt))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("4. THERAPEUTIC EFFECTS", section_hd))
    for pt in [
        "Reduction of post-traumatic oedema and haematoma.",
        "Accelerated wound healing.",
        "Pain relief in acute and sub-acute conditions.",
        "Resolution of inflammatory exudate.",
        "Treatment of soft tissue injuries in the acute phase.",
        "Can be used over metal implants (unlike continuous SWD — with care).",
    ]:
        story.append(bullet(pt))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("5. COMPARISON: CONTINUOUS SWD vs PULSED SWD", section_hd))
    story.append(simple_table(
        ["Feature", "Continuous SWD", "Pulsed SWD (PSWD)"],
        [
            ["Primary effect",  "Thermal (deep heating)", "Non-thermal / athermal"],
            ["Stage of injury", "Sub-acute / chronic",    "Acute / sub-acute"],
            ["Temperature rise","Significant",            "Minimal or none"],
            ["Metal implants",  "Contraindicated",        "Used with caution"],
            ["Oedema",          "Contraindicated (acute)","Reduces oedema"],
            ["Output",          "Continuous wave",        "Pulsed bursts"],
        ],
        [4.5*cm, 5.5*cm, 6*cm]
    ))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("6. CLINICAL APPLICATIONS", section_hd))
    for pt in [
        "Acute sprains and strains (within first 48 hours).",
        "Post-operative oedema.",
        "Haematomas and contusions.",
        "Acute back pain.",
        "Wound healing (surgical, pressure ulcers).",
        "Sinusitis (short-wave frequency in pulsed mode).",
        "Nerve injury rehabilitation.",
    ]:
        story.append(bullet(pt))
    story.append(Spacer(1, 0.1*cm))
    story.append(note_box("KEY MEMORY AID: PSWD = Pulse ON for microseconds -> heat dissipates during OFF time -> net thermal effect near zero -> safe for ACUTE conditions."))
    story.append(PageBreak())


# ══════════════════════════════════════════════════════════════════════════════
# CHAPTER 6 – SHORTWAVE DIATHERMY
# ══════════════════════════════════════════════════════════════════════════════
def ch6_swd(story):
    story.append(chapter_banner(
        "CHAPTER 6: SHORTWAVE DIATHERMY (SWD)",
        "Paper II – Electrotherapy II (High Freq & Actinotherapy)",
        2, "Aug 2024, Feb 2025", colors.HexColor("#7a1a00")))
    story.append(Spacer(1, 0.3*cm))
    story.append(note_box("EXAM TIP: Define -> Production (condenser/capacitor & inductance/coil field) -> Physiological & Therapeutic Effects -> Methods of Application -> Dosage -> Indications & Contraindications."))
    story.append(Spacer(1, 0.2*cm))

    story.append(Paragraph("1. DEFINITION", section_hd))
    story.append(Paragraph(
        "Shortwave Diathermy (SWD) uses <b>high-frequency alternating currents</b> at a frequency of "
        "<b>27.12 MHz</b> (wavelength 11 m) to produce deep tissue heating. The body is placed within "
        "the electromagnetic field produced by the SWD machine. It is the deepest heating modality available, "
        "reaching muscles and joints 5-7 cm deep.", body))
    story.append(Spacer(1, 0.1*cm))

    story.append(Paragraph("2. PRODUCTION", section_hd))
    for pt in [
        "<b>Valve oscillator circuit:</b> A triode valve (or transistor) is used to generate high-frequency oscillations at 27.12 MHz.",
        "The patient circuit (tuning circuit) must be <b>tuned</b> to resonate at the same frequency as the machine circuit for maximum energy transfer.",
        "Energy is transferred from the machine to patient tissues via electromagnetic induction (inductance) or electrostatic field (capacitance).",
        "<b>Eddy currents</b> are induced in tissues by the alternating electromagnetic field, causing molecular vibration and heat.",
    ]:
        story.append(bullet(pt))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("3. METHODS OF APPLICATION", section_hd))
    story.append(simple_table(
        ["Method", "Description", "Best For"],
        [
            ["Capacitor field method\n(Condenser field)",
             "Two electrode pads placed on either side of the body part. Electrostatic field passes through tissues. Spacing determines heating pattern.",
             "Joints, spine, large muscle groups"],
            ["Coplanar / Cross-fire method",
             "Electrodes on the same side of the body; for deep central structures",
             "Hip, pelvis, deep structures"],
            ["Inductance / Cable method",
             "Insulated cable wound around the limb in a coil; induces eddy currents in tissues",
             "Limbs (especially irregular surfaces)"],
            ["Drum method (monode)",
             "Coiled conductor inside a drum-shaped applicator; placed over the body part",
             "Shoulder, knee, hip"],
            ["Butterfly electrode",
             "Flat coil used for treating the lumbar spine or flat areas",
             "Lumbar spine, sacrum"],
        ],
        [3.5*cm, 7*cm, 5*cm]
    ))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("<b>Electrode Spacing Rules:</b>", sub_hd))
    for pt in [
        "Spacing between electrode and skin must be <b>equal on both sides</b> to produce uniform heating.",
        "Larger spacing = deeper, more uniform heating. Smaller spacing = superficial, uneven heating.",
        "<b>Minimum spacing:</b> 1-2 cm to avoid skin burns.",
        "Felt or towelling pads used to ensure proper spacing.",
    ]:
        story.append(bullet(pt))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("4. PHYSIOLOGICAL EFFECTS", section_hd))
    for pt in [
        "Rise in tissue temperature (up to 4-5°C above resting temp at therapeutic intensities).",
        "Vasodilation — increased blood flow, hyperaemia.",
        "Increased metabolic rate.",
        "Increased tissue extensibility — collagen softening.",
        "Muscle relaxation (reduces spasm).",
        "Pain relief — increased pain threshold.",
        "Increased lymphatic flow.",
    ]:
        story.append(bullet(pt))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("5. DOSAGE", section_hd))
    story.append(simple_table(
        ["Dose", "Sensation", "Indicator Light", "Use"],
        [
            ["I",   "No warmth",           "Meter at minimum", "Acute / post-acute"],
            ["II",  "Mild warmth",          "Mild deflection",  "Sub-acute"],
            ["III", "Comfortable warmth",   "Medium",           "Chronic conditions"],
            ["IV",  "Strong warmth / heat", "High",             "Very chronic; near tolerance limit"],
        ],
        [2*cm, 4*cm, 4.5*cm, 5.5*cm]
    ))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("6. INDICATIONS & CONTRAINDICATIONS", section_hd))
    story.append(ind_contra_table(
        ["Chronic arthritis / OA", "Sub-acute sprains",
         "Chronic back pain (LBP)", "Bursitis / tendinitis",
         "Muscle spasm", "Pelvic inflammatory conditions",
         "Sinusitis / otitis media", "Pre-exercise heating"],
        ["Metal implants in field",
         "Pacemaker / electronic implants",
         "Malignancy in treatment field",
         "Pregnancy (especially over pelvis)",
         "Haemorrhage / thrombosis",
         "Acute inflammation",
         "Moist dressings / plaster casts",
         "Over eyes / testes",
         "Areas of impaired sensation",
         "Peripheral vascular disease"],
    ))
    story.append(Spacer(1, 0.1*cm))
    story.append(note_box("DANGERS: Metal implants act as heat concentrators (focal burns). Moist areas overheat under SWD. Jewellery must always be removed. Patient must not touch metal parts of machine."))
    story.append(PageBreak())


# ══════════════════════════════════════════════════════════════════════════════
# CHAPTER 7 – LASER THERAPY
# ══════════════════════════════════════════════════════════════════════════════
def ch7_laser(story):
    story.append(chapter_banner(
        "CHAPTER 7: LASER THERAPY",
        "Paper II – Electrotherapy II (High Freq & Actinotherapy)",
        2, "Oct 2022, Feb 2025", colors.HexColor("#006060")))
    story.append(Spacer(1, 0.3*cm))
    story.append(note_box("EXAM TIP: Full form -> Properties of LASER -> Types (He-Ne, GaAs, Ruby, CO2) -> Production (stimulated emission) -> Physiological & Therapeutic effects -> Techniques -> Dosimetry -> Contraindications."))
    story.append(Spacer(1, 0.2*cm))

    story.append(Paragraph("1. DEFINITION", section_hd))
    story.append(Paragraph(
        "<b>LASER</b> = <b>L</b>ight <b>A</b>mplification by <b>S</b>timulated <b>E</b>mission of <b>R</b>adiation. "
        "It is a device that produces an intense, monochromatic, coherent, and highly collimated beam of light "
        "by stimulated emission of electromagnetic radiation. Therapeutic lasers (low-level/cold lasers) use "
        "power levels of <b>1–500 mW</b> and do NOT cause significant heating.", body))
    story.append(Spacer(1, 0.1*cm))

    story.append(Paragraph("2. PROPERTIES OF LASER", section_hd))
    story.append(simple_table(
        ["Property", "Meaning"],
        [
            ["Monochromatic",  "Single wavelength (one colour) — unlike ordinary light which has many wavelengths"],
            ["Coherence",      "All photons are in phase (same frequency, same direction) — temporal and spatial coherence"],
            ["Collimation",    "Beam does NOT diverge — remains parallel over long distances; allows precise targeting"],
            ["High intensity", "High energy density at the point of application"],
            ["Polarisation",   "All waves vibrate in the same plane"],
        ],
        [4*cm, 12.5*cm]
    ))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("3. PRODUCTION — STIMULATED EMISSION", section_hd))
    for pt in [
        "<b>Active medium:</b> The lasing material (gas, solid-state crystal, semiconductor diode).",
        "<b>Pumping source:</b> Energy source (electrical discharge, flash lamp) that excites atoms in the active medium to a higher energy state.",
        "<b>Population inversion:</b> More atoms in excited state than ground state — necessary for amplification.",
        "<b>Resonant cavity (optical cavity):</b> Two mirrors (one fully reflective, one partially transmissive) between which photons bounce back and forth, triggering stimulated emission.",
        "<b>Stimulated emission:</b> An excited atom is triggered by a passing photon to emit an identical photon — amplification occurs.",
        "The resulting beam exits through the partially reflective mirror as laser light.",
    ]:
        story.append(bullet(pt))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("4. TYPES OF THERAPEUTIC LASERS", section_hd))
    story.append(simple_table(
        ["Type", "Wavelength", "Medium", "Uses"],
        [
            ["Helium-Neon (He-Ne)", "632.8 nm (red, visible)", "Gas (He-Ne mixture)", "Wound healing, pain relief, superficial conditions"],
            ["Gallium Arsenide (GaAs)", "830–904 nm (near infrared)", "Semiconductor diode", "Deep tissue conditions, arthritis, musculoskeletal"],
            ["Gallium Aluminium Arsenide (GaAlAs)", "780–870 nm", "Semiconductor diode", "Pain, wounds, soft tissue"],
            ["Ruby laser", "694 nm (red)", "Solid-state (ruby crystal)", "Mainly dermatology; early therapeutic laser"],
            ["CO2 laser", "10,600 nm", "Gas", "Surgical cutting; NOT therapeutic (high power)"],
        ],
        [4*cm, 4*cm, 4*cm, 4*cm]
    ))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("5. PHYSIOLOGICAL EFFECTS", section_hd))
    for pt in [
        "<b>Biostimulation:</b> Low-level laser stimulates mitochondrial activity, increases ATP production.",
        "<b>Increased cell proliferation:</b> Stimulates fibroblasts, collagen synthesis.",
        "<b>Increased macrophage activity:</b> Accelerates phagocytosis and tissue repair.",
        "<b>Vasodilation and increased microcirculation.</b>",
        "<b>Endorphin release:</b> Pain relief via neuromodulation.",
        "<b>Anti-inflammatory effect:</b> Reduces prostaglandin synthesis.",
        "<b>Nerve regeneration:</b> Promotes axonal growth in peripheral nerve injuries.",
    ]:
        story.append(bullet(pt))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("6. THERAPEUTIC EFFECTS", section_hd))
    for pt in [
        "Pain relief — musculoskeletal, neuropathic, postoperative.",
        "Wound healing — surgical wounds, diabetic ulcers, pressure sores.",
        "Soft tissue healing — sprains, strains, tendinitis.",
        "Reduction of inflammation.",
        "Nerve regeneration.",
        "Treatment of trigger points and acupuncture points.",
    ]:
        story.append(bullet(pt))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("7. TECHNIQUES OF APPLICATION", section_hd))
    story.append(simple_table(
        ["Technique", "Description"],
        [
            ["Contact method",        "Probe placed directly on skin; most common method"],
            ["Non-contact method",    "Probe held 1-2 cm from skin; used for open wounds"],
            ["Scanning method",       "Probe moved slowly over the treatment area"],
            ["Cluster probe",         "Multiple diodes in one head for large area coverage"],
            ["Grid/point method",     "Systematic grid of points treated individually (e.g. for wounds)"],
        ],
        [4.5*cm, 12*cm]
    ))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("8. DOSIMETRY", section_hd))
    story.append(simple_table(
        ["Parameter", "Value / Description"],
        [
            ["Energy density (fluence)", "0.5–4 J/cm² for superficial; 4–10 J/cm² for deep"],
            ["Power output",             "1–500 mW (low-level / cold laser)"],
            ["Wavelength selection",     "He-Ne (632 nm) for superficial; GaAs (830 nm) for deep"],
            ["Treatment duration",       "30 seconds to 5 minutes per point"],
            ["Frequency",                "Daily or 3-5 times/week; 5-15 sessions typical"],
        ],
        [4.5*cm, 12*cm]
    ))
    story.append(Spacer(1, 0.15*cm))

    story.append(Paragraph("9. INDICATIONS & CONTRAINDICATIONS", section_hd))
    story.append(ind_contra_table(
        ["Wound healing", "Tendinitis / bursitis",
         "Soft tissue injuries", "Carpal tunnel syndrome",
         "Trigger points", "Nerve injuries",
         "Arthritis", "Post-operative scar"],
        ["Over eyes (MANDATORY goggles)",
         "Over malignancy",
         "Over pregnant uterus",
         "Over thyroid / endocrine glands",
         "Photo-sensitive patients",
         "Over pacemaker area",
         "Directly on epileptic focus",
         "Bleeding disorders (relative CI)"],
    ))
    story.append(Spacer(1, 0.1*cm))
    story.append(note_box("SAFETY RULE: ALWAYS wear laser-protective goggles. Never point laser beam at eyes. Super-luminous diodes (SLDs) are NOT true lasers — they lack coherence but have similar effects."))
    story.append(PageBreak())


# ══════════════════════════════════════════════════════════════════════════════
# QUICK REVISION TABLE
# ══════════════════════════════════════════════════════════════════════════════
def build_revision(story):
    story.append(Paragraph("QUICK REVISION — FREQUENCY & KEY PARAMETERS", S("RevH", fontSize=16,
                 textColor=DARK_BLUE, fontName="Helvetica-Bold", alignment=TA_CENTER, spaceAfter=8)))
    story.append(HRFlowable(width="100%", thickness=1, color=MID_BLUE))
    story.append(Spacer(1, 0.3*cm))

    story.append(simple_table(
        ["Topic", "Frequency/Wavelength", "Key Device", "Times Asked"],
        [
            ["Ultrasound",     "0.5–3 MHz",       "Piezoelectric transducer",  "3x"],
            ["Microwave Diathermy", "2450 MHz / 12.25 cm", "Magnetron", "3x"],
            ["Infra Red Radiation", "770 nm – 1 mm", "Luminous/Non-luminous lamp", "3x"],
            ["Ultraviolet Radiation","100–400 nm",  "Mercury vapour lamp / Kromayer", "3x"],
            ["PSWD",           "27.12 MHz (pulsed)", "SWD machine (pulsed mode)", "2x"],
            ["SWD",            "27.12 MHz",         "Triode oscillator + electrodes", "2x"],
            ["LASER",          "632–904 nm (therapy)", "He-Ne / GaAs diode",    "2x"],
        ],
        [4.5*cm, 4.5*cm, 5.5*cm, 2*cm]
    ))
    story.append(Spacer(1, 0.3*cm))

    story.append(Paragraph("ELECTROMAGNETIC SPECTRUM (Memory Aid — Low to High Frequency)", S("RevH2",
                 fontSize=12, textColor=DARK_BLUE, fontName="Helvetica-Bold", spaceAfter=6)))
    spectrum_data = [
        [Paragraph("<b>Radio waves</b>\n(SWD/MWD\n27 MHz / 2450 MHz)", small),
         Paragraph("<b>Infrared</b>\n(770 nm–1 mm)\nHeating", small),
         Paragraph("<b>Visible Light</b>\n(400–770 nm)\nLASER (He-Ne)", small),
         Paragraph("<b>Ultraviolet</b>\n(100–400 nm)\nUVA/UVB/UVC", small),
         Paragraph("<b>X-rays</b>\n(<1 nm)\nImaging", small),
    ]]
    st = Table(spectrum_data, colWidths=[3.2*cm]*5)
    st.setStyle(TableStyle([
        ("BACKGROUND",    (0,0),(0,-1), colors.HexColor("#dce8f8")),
        ("BACKGROUND",    (1,0),(1,-1), colors.HexColor("#fde8d8")),
        ("BACKGROUND",    (2,0),(2,-1), colors.HexColor("#fff8d6")),
        ("BACKGROUND",    (3,0),(3,-1), colors.HexColor("#e8d8f8")),
        ("BACKGROUND",    (4,0),(4,-1), colors.HexColor("#f8d8d8")),
        ("BOX",           (0,0),(-1,-1), 0.8, MID_GREY),
        ("INNERGRID",     (0,0),(-1,-1), 0.5, MID_GREY),
        ("ALIGN",         (0,0),(-1,-1), "CENTER"),
        ("VALIGN",        (0,0),(-1,-1), "MIDDLE"),
        ("TOPPADDING",    (0,0),(-1,-1), 8),
        ("BOTTOMPADDING", (0,0),(-1,-1), 8),
    ]))
    story.append(st)
    story.append(Spacer(1, 0.3*cm))

    # High-yield one-liners
    story.append(Paragraph("HIGH-YIELD ONE-LINERS FOR EXAM", S("HL", fontSize=13,
                 textColor=DARK_BLUE, fontName="Helvetica-Bold", spaceAfter=6)))
    one_liners = [
        "Ultrasound: 1 MHz = deep (3-5 cm); 3 MHz = superficial (1-2 cm). Piezoelectric effect.",
        "Ultrasound production: REVERSE piezoelectric effect (electrical -> mechanical).",
        "MWD frequency: 2450 MHz. Device: Magnetron. Heats water-rich tissues selectively.",
        "IRR: Luminous lamp = instant ON, deeper penetration. Non-luminous = 15-20 min warm-up, superficial.",
        "UVR bands: UVA (320-400 nm) = PUVA/tanning; UVB (280-320 nm) = vitamin D/erythema; UVC (100-280 nm) = germicidal.",
        "MED = Minimal Erythema Dose. Always determine before UVR treatment.",
        "PSWD: Same frequency as SWD (27.12 MHz) but pulsed -> non-thermal -> safe for ACUTE conditions.",
        "SWD electrode spacing: equal on both sides; larger spacing = deeper, more uniform heating.",
        "LASER: Monochromatic + Coherent + Collimated. Low-level laser (cold laser) = 1-500 mW.",
        "He-Ne laser (632.8 nm, red, gas) = superficial. GaAs laser (830-904 nm, near IR, semiconductor) = deep.",
        "LASER safety: ALWAYS wear protective goggles. Never look directly at beam.",
        "Phonophoresis = drug delivery by ultrasound. Iontophoresis = drug delivery by electrical current.",
        "Duty cycle = (ON time / total time) x 100. Low duty cycle = less thermal effect.",
        "Tridymite = ceramic material in magnetron window of MWD machine.",
        "Kromayer lamp = cold quartz, water-cooled = mainly UVC = bactericidal = wounds/ulcers.",
    ]
    for ol in one_liners:
        story.append(bullet(ol))

    story.append(PageBreak())


# ══════════════════════════════════════════════════════════════════════════════
# BUILD DOCUMENT
# ══════════════════════════════════════════════════════════════════════════════
def build():
    doc = SimpleDocTemplate(
        OUTPUT, pagesize=A4,
        leftMargin=2*cm, rightMargin=2*cm,
        topMargin=2*cm, bottomMargin=2*cm,
        title="Electrotherapy II Study Guide",
        author="BPT Study Guide Generator"
    )

    story = []
    build_cover(story)
    build_toc(story)
    ch1_ultrasound(story)
    ch2_mwd(story)
    ch3_irr(story)
    ch4_uvr(story)
    ch5_pswd(story)
    ch6_swd(story)
    ch7_laser(story)
    build_revision(story)

    doc.build(story)
    print(f"PDF saved: {OUTPUT}")

build()
Running Command

cd /home/daytona/workspace/study-guide && python3 generate_study_guide.py 2>&1

Running Command

ls -lh /home/daytona/workspace/study-guide/Electrotherapy_II_StudyGuide.pdf

Your study guide PDF is ready! Download it here:

Electrotherapy II StudyGuide

PDF Document · PDF


Here is what is included in the PDF:
Cover Page - BPT Third Year, Electrotherapy II, exam-focused branding
Table of Contents - All 7 topics colour-coded by priority
7 Full Chapter Notes (one chapter per topic):
ChapterTopicTimes Asked
1Ultrasound Therapy3x - HIGH
2Microwave Diathermy (MWD)3x - HIGH
3Infra Red Radiation (IRR)3x - HIGH
4Ultraviolet Radiation (UVR)3x - HIGH
5Pulsed Shortwave Diathermy (PSWD)2x - MEDIUM
6Shortwave Diathermy (SWD)2x - MEDIUM
7LASER Therapy2x - MEDIUM
Each chapter contains:
  • Definition
  • Production mechanism
  • Physiological effects
  • Therapeutic effects
  • Treatment techniques / methods of application
  • Dosage / parameters
  • Indications & Contraindications (side-by-side tables)
  • Highlighted exam tips and danger points
Quick Revision Section at the end:
  • Master frequency/wavelength table for all modalities
  • Electromagnetic spectrum visual chart
  • 15 high-yield one-liners for last-minute revision

This pdf is my subject previous year questions give me the repeted questions in every year in 5 mark and also give me the each every questions how many time asked and give me all 5 mark please

Running Command

python3 << 'EOF' import pdfplumber with pdfplumber.open("/home/daytona/workspace/attachments/e23a85d9-31bc-4e79-b9c0-b1ca546c86f5/HF (1).pdf") as pdf: print(f"Total pages: {len(pdf.pages)}") for i, page in enumerate(pdf.pages): text = page.extract_text() print(f"\n===== PAGE {i+1} =====") print(text) EOF

Running Command

python3 << 'EOF' from collections import defaultdict # All 5-mark (Write notes on) questions from each year five_mark = { "Dec 2020": [ "Techniques of application of SWD", "Moist hot packs", "Couplants and its uses", "Treatment Parameters used in Ultrasound Therapy", "Luminous and Non-luminous Generator", "Treatment and dosage for Acne Vulgaris", "Contrast bath", "Alpine sun lamp", "Radiation energy and its properties", "Water cooled medium pressure Mercury vapor Lamp", ], "Sep 2021": [ "Hydro collator pack and its application", "Types of Infra red radiation lamps", "Physiological & therapeutic effects of UVR", "Techniques of application of LASER", "Electrode spacing & electrode positioning of SWD", "Phonophoresis & contraindication", "Physiological effects of heat & laws governing radiation", "Application method and contraindication of Waxbath", "Cryotherapy in acute ankle sprain", "Whirlpool therapy and its precaution", ], "Jan 2022": [ "Difference between Capacitance and Inductance", "Ruby LASER", "Indications and contraindications of Contrast Bath", "Production of SWD and its uses", "Modalities of treatment and dosage for Psoriasis", "Methods of application of Wax therapy", "Cryokinetics", "Laws governing Radiation", "Physiological effects of Microwave Diathermy", "Modalities for Osteoarthritis Knee", ], "Jun 2022": [ "Photosensitization", "Indication and contraindication of short wave Diathermy", "Techniques of Cryotherapy", "Laws Governing Radiation", "Cable method of SWD", "Therapeutic effects of Ultrasound", "Filters used in Ultraviolet Radiation", "Types and properties of LASER", "PUVA Therapy", "Ice burn and its prevention", ], "Oct 2022": [ "Water bath method in Ultrasound Therapy", "Phonophoresis", "Kromayer Lamp", "Whirlpool Bath", "Pouring method in wax therapy", "Modality of treatment and dosage for alopecia totalis", "Vapocoolant Spray", "Cross fire method in short wave diathermy", "Lewis hunting reaction", "Hydrocollator packs", ], "Apr 2023": [ "PUVA apparatus", "Indication and contraindication of Infrared Radiation", "Application of techniques in Ultrasound", "Techniques of Application of LASER", "Microwave Diathermy", "Therapeutic uses of paraffin wax bath", "Whirlpool Bath", "Heat Transfer Methods", "Physiological and Therapeutic Effects of Cryotherapy", "Technique of application of Pulsed short wave diathermy", ], "Nov 2023": [ "Properties of LASER", "Explain cable field method in Short wave Diathermy", "Radiation energy and its properties", "Physiological effects of Infra Red radiations", "Theraktin tunnel", "Microwave Diathermy", "Biophysics of cryotherapy", "Kromayer lamp", "Physiological effects of wax therapy", "Treatments for ulcers", ], "Aug 2024": [ "General Body Bath", "Indication and contraindication of LASER", "Various techniques of application in Ultra Sound Therapy", "Cryotherapy - Physiological and Therapeutical benefits", "Micro wave Diathermy", "Hydro collator pack", "Various types of Paraffin Wax Application methods", "Hubbard Tank", "Ultrasonophoresis and mention commonly used drugs in Ultrasonophoresis", "Cryo Kinetics", ], "Feb 2025": [ "Describe in detail about whirl pool bath", "PUVA apparatus", "Physiological effects of cryotherapy", "Pulsed short wave diathermy", "Role of ultraviolet radiation in pressure sore", "Phonophoresis", "Method of application of ultrasound", "Depth of penetration in actinotherapy", "Physiological effects of wax bath", "Theraktin Tunnel", ], "Aug 2025": [ "Contrast bath", "Danger of shortwave diathermy", "Therapeutic effects of hydro collator packs", "Therapeutic effects of Infra red radiation", "Production of ultrasound", "Electromagnetic spectrum", "Paraffin Wax bath", "Grades and doses of Erythema", "Therapeutic effects of hydrocollator packs", "Difference between of dry and moist heat", ], } # Normalize and group similar topics def normalize(q): q = q.lower().strip() q = q.replace("hydro collator", "hydrocollator").replace("hydroco llator","hydrocollator") q = q.replace("ultra sound","ultrasound").replace("ultra violet","ultraviolet") q = q.replace("infra red","infrared") q = q.replace("short wave diathermy","shortwave diathermy").replace("swd","shortwave diathermy") q = q.replace("waxbath","wax bath").replace("wax therapy","wax bath").replace("paraffin wax bath","wax bath") q = q.replace("paraffin wax application methods","wax bath") q = q.replace("laser","laser") q = q.replace("microwave diathermy","microwave diathermy").replace("micro wave diathermy","microwave diathermy") q = q.replace("whirlpool bath","whirlpool bath").replace("whirl pool bath","whirlpool bath").replace("whirlpool therapy","whirlpool bath") q = q.replace("cryokinetics","cryokinetics").replace("cryo kinetics","cryokinetics") q = q.replace("hydrocollator pack and its application","hydrocollator packs") q = q.replace("hydro collator pack","hydrocollator packs") q = q.replace("therapeutic effects of hydro collator packs","hydrocollator packs") q = q.replace("therapeutic effects of hydrocollator packs","hydrocollator packs") q = q.replace("hydrocollator packs","hydrocollator packs") q = q.replace("techniques of application of laser","techniques of application of laser") q = q.replace("techniques of application of laser","techniques/application of laser") q = q.replace("application of techniques in ultrasound","techniques of application of ultrasound") q = q.replace("various techniques of application in ultrasound therapy","techniques of application of ultrasound") q = q.replace("water bath method in ultrasound therapy","techniques of application of ultrasound") q = q.replace("method of application of ultrasound","techniques of application of ultrasound") q = q.replace("production of ultrasound","techniques of application of ultrasound") # keep separate return q # Track each question with year topic_years = defaultdict(list) # Manual grouping by topic clusters clusters = { "Whirlpool Bath": ["Whirlpool therapy and its precaution", "Whirlpool Bath", "Whirlpool Bath", "Describe in detail about whirl pool bath"], "Phonophoresis / Ultrasonophoresis": ["Phonophoresis & contraindication", "Phonophoresis", "Phonophoresis", "Ultrasonophoresis and mention commonly used drugs in Ultrasonophoresis"], "LASER Techniques / Application": ["Techniques of application of LASER", "Techniques of Application of LASER"], "LASER Properties / Types": ["Types and properties of LASER", "Properties of LASER"], "LASER Indications / Contraindications": ["Indication and contraindication of LASER"], "Ruby LASER": ["Ruby LASER"], "Microwave Diathermy (MWD)": ["Physiological effects of Microwave Diathermy", "Microwave Diathermy", "Microwave Diathermy", "Micro wave Diathermy"], "Cryotherapy (general/effects)": ["Physiological and Therapeutic Effects of Cryotherapy", "Cryotherapy - Physiological and Therapeutical benefits", "Physiological effects of cryotherapy"], "Cryotherapy (specific/biophysics)": ["Cryotherapy in acute ankle sprain", "Biophysics of cryotherapy"], "Cryokinetics": ["Cryokinetics", "Cryo Kinetics"], "Hydrocollator Packs": ["Hydro collator pack and its application", "Hydrocollator packs", "Hydro collator pack", "Therapeutic effects of hydro collator packs", "Therapeutic effects of hydrocollator packs"], "Wax Therapy (methods/application)": ["Application method and contraindication of Waxbath", "Methods of application of Wax therapy", "Pouring method in wax therapy", "Various types of Paraffin Wax Application methods", "Paraffin Wax bath"], "Wax Therapy (physiological/therapeutic effects)": ["Therapeutic uses of paraffin wax bath", "Physiological effects of wax therapy", "Physiological effects of wax bath"], "Laws Governing Radiation": ["Physiological effects of heat & laws governing radiation", "Laws governing Radiation", "Laws Governing Radiation"], "Radiation Energy and Properties": ["Radiation energy and its properties", "Radiation energy and its properties"], "PUVA Therapy / Apparatus": ["PUVA Therapy", "PUVA apparatus", "PUVA apparatus"], "Contrast Bath": ["Contrast bath", "Indications and contraindications of Contrast Bath", "Contrast bath"], "Techniques of Ultrasound Application": ["Application of techniques in Ultrasound", "Various techniques of application in Ultra Sound Therapy", "Water bath method in Ultrasound Therapy", "Method of application of ultrasound"], "Production of Ultrasound": ["Production of ultrasound"], "Therapeutic Effects of Ultrasound": ["Therapeutic effects of Ultrasound"], "Treatment Parameters in Ultrasound": ["Treatment Parameters used in Ultrasound Therapy"], "Electrode Spacing / Positioning of SWD": ["Techniques of application of SWD", "Electrode spacing & electrode positioning of SWD"], "Cable Method of SWD": ["Cable method of SWD", "Explain cable field method in Short wave Diathermy"], "Cross Fire Method of SWD": ["Cross fire method in short wave diathermy"], "Indication & CI of SWD": ["Indication and contraindication of short wave Diathermy"], "Danger of SWD": ["Danger of shortwave diathermy"], "Production of SWD": ["Production of SWD and its uses"], "Pulsed SWD": ["Technique of application of Pulsed short wave diathermy", "Pulsed short wave diathermy"], "Infrared Radiation (Types/Lamps)": ["Types of Infra red radiation lamps", "Luminous and Non-luminous Generator"], "Infrared Radiation (Physiological Effects)": ["Physiological effects of Infra Red radiations", "Therapeutic effects of Infra red radiation"], "Infrared Radiation (Indications/CI)": ["Indication and contraindication of Infrared Radiation"], "UVR (Physiological & Therapeutic Effects)": ["Physiological & therapeutic effects of UVR"], "Photosensitization": ["Photosensitization"], "Filters in UVR": ["Filters used in Ultraviolet Radiation"], "Kromayer Lamp": ["Kromayer Lamp", "Kromayer lamp"], "Alpine Sun Lamp": ["Alpine sun lamp"], "Mercury Vapor Lamp": ["Water cooled medium pressure Mercury vapor Lamp"], "Theraktin Tunnel": ["Theraktin tunnel", "Theraktin Tunnel"], "Lewis Hunting Reaction": ["Lewis hunting reaction"], "Hydrocollator Packs (2)": [], # merged above "Moist Hot Packs": ["Moist hot packs"], "Heat Transfer Methods": ["Heat Transfer Methods"], "Diff between Capacitance & Inductance": ["Difference between Capacitance and Inductance"], "Modalities for Psoriasis": ["Modalities of treatment and dosage for Psoriasis"], "Modalities for OA Knee": ["Modalities for Osteoarthritis Knee"], "Modalities for Alopecia Totalis": ["Modality of treatment and dosage for alopecia totalis"], "Treatments for Ulcers": ["Treatments for ulcers"], "Vapocoolant Spray": ["Vapocoolant Spray"], "General Body Bath": ["General Body Bath"], "Hubbard Tank": ["Hubbard Tank"], "Role of UVR in Pressure Sore": ["Role of ultraviolet radiation in pressure sore"], "Depth of Penetration in Actinotherapy": ["Depth of penetration in actinotherapy"], "Electromagnetic Spectrum": ["Electromagnetic spectrum"], "Grades and Doses of Erythema": ["Grades and doses of Erythema"], "Diff Dry and Moist Heat": ["Difference between of dry and moist heat"], "Couplants and Uses": ["Couplants and its uses"], "Treatment for Acne Vulgaris": ["Treatment and dosage for Acne Vulgaris"], } # Now map each cluster to its years all_years = list(five_mark.keys()) result = {} for cluster, keywords in clusters.items(): years_found = [] for year, qs in five_mark.items(): for q in qs: for kw in keywords: if kw.lower() in q.lower() or q.lower() in kw.lower(): if year not in years_found: years_found.append(year) break if years_found: result[cluster] = years_found # Sort by frequency descending sorted_result = sorted(result.items(), key=lambda x: -len(x[1])) print("="*90) print("ALL 5-MARK QUESTIONS — TOPIC-WISE FREQUENCY ANALYSIS") print("="*90) print(f"\n{'Topic':<55} {'Count':<8} {'Years Asked'}") print("-"*90) for topic, years in sorted_result: print(f"{topic:<55} {len(years):<8} {', '.join(years)}") print("\n\n" + "="*90) print("REPEATED QUESTIONS (Asked 2 or more times)") print("="*90) for topic, years in sorted_result: if len(years) >= 2: print(f"\n[{len(years)}x] {topic}") print(f" Years: {', '.join(years)}") EOF

Here is the complete analysis of all 5-mark questions from your 10 question papers:

ALL 5-MARK QUESTIONS — COMPLETE LIST (Year-wise)

Dec 2020: Techniques of application of SWD | Moist hot packs | Couplants and its uses | Treatment Parameters in Ultrasound | Luminous and Non-luminous Generator | Treatment and dosage for Acne Vulgaris | Contrast bath | Alpine sun lamp | Radiation energy and its properties | Water cooled medium pressure Mercury vapor Lamp
Sep 2021: Hydro collator pack | Types of Infra red radiation lamps | Physiological & therapeutic effects of UVR | Techniques of application of LASER | Electrode spacing & positioning of SWD | Phonophoresis & contraindication | Physiological effects of heat & laws governing radiation | Application method and CI of Waxbath | Cryotherapy in acute ankle sprain | Whirlpool therapy
Jan 2022: Difference between Capacitance and Inductance | Ruby LASER | Indications & CI of Contrast Bath | Production of SWD | Modalities for Psoriasis | Methods of application of Wax therapy | Cryokinetics | Laws governing Radiation | Physiological effects of MWD | Modalities for OA Knee
Jun 2022: Photosensitization | Indication & CI of SWD | Techniques of Cryotherapy | Laws Governing Radiation | Cable method of SWD | Therapeutic effects of Ultrasound | Filters in UVR | Types and properties of LASER | PUVA Therapy | Ice burn and its prevention
Oct 2022: Water bath method in Ultrasound | Phonophoresis | Kromayer Lamp | Whirlpool Bath | Pouring method in wax therapy | Modality/dosage for alopecia totalis | Vapocoolant Spray | Cross fire method in SWD | Lewis hunting reaction | Hydrocollator packs
Apr 2023: PUVA apparatus | Indication & CI of Infrared Radiation | Application of techniques in Ultrasound | Techniques of Application of LASER | Microwave Diathermy | Therapeutic uses of paraffin wax bath | Whirlpool Bath | Heat Transfer Methods | Physiological and Therapeutic Effects of Cryotherapy | Technique of application of Pulsed SWD
Nov 2023: Properties of LASER | Cable field method in SWD | Radiation energy and its properties | Physiological effects of Infra Red radiations | Theraktin tunnel | Microwave Diathermy | Biophysics of cryotherapy | Kromayer lamp | Physiological effects of wax therapy | Treatments for ulcers
Aug 2024: General Body Bath | Indication & CI of LASER | Various techniques of application in Ultrasound | Cryotherapy - Physiological & Therapeutic benefits | Microwave Diathermy | Hydro collator pack | Various types of Paraffin Wax Application methods | Hubbard Tank | Ultrasonophoresis | Cryo Kinetics
Feb 2025: Whirlpool bath | PUVA apparatus | Physiological effects of cryotherapy | Pulsed SWD | Role of UVR in pressure sore | Phonophoresis | Method of application of ultrasound | Depth of penetration in actinotherapy | Physiological effects of wax bath | Theraktin Tunnel
Aug 2025: Contrast bath | Danger of shortwave diathermy | Therapeutic effects of hydrocollator packs | Therapeutic effects of Infra red radiation | Production of ultrasound | Electromagnetic spectrum | Paraffin Wax bath | Grades and doses of Erythema | (repeat) Therapeutic effects of hydrocollator packs | Difference between dry and moist heat

REPEATED TOPICS — FREQUENCY TABLE (Most Repeated First)

RankTopicTimes AskedYears
1Wax Therapy (methods/application)6xSep 2021, Jan 2022, Oct 2022, Apr 2023, Aug 2024, Aug 2025
2Whirlpool Bath4xSep 2021, Oct 2022, Apr 2023, Feb 2025
2Phonophoresis / Ultrasonophoresis4xSep 2021, Oct 2022, Aug 2024, Feb 2025
2Microwave Diathermy (MWD)4xJan 2022, Apr 2023, Nov 2023, Aug 2024
2Hydrocollator Packs4xSep 2021, Oct 2022, Aug 2024, Aug 2025
2Wax Therapy (physiological/therapeutic effects)4xApr 2023, Nov 2023, Feb 2025, Aug 2025
2Techniques of Ultrasound Application4xOct 2022, Apr 2023, Aug 2024, Feb 2025
8Cryotherapy (effects/physiological)3xApr 2023, Aug 2024, Feb 2025
8Laws Governing Radiation3xSep 2021, Jan 2022, Jun 2022
8PUVA Therapy / Apparatus3xJun 2022, Apr 2023, Feb 2025
8Contrast Bath3xDec 2020, Jan 2022, Aug 2025
12LASER Techniques / Application2xSep 2021, Apr 2023
12LASER Properties / Types2xJun 2022, Nov 2023
12Cryotherapy (specific/biophysics)2xSep 2021, Nov 2023
12Cryokinetics2xJan 2022, Aug 2024
12Radiation Energy and Properties2xDec 2020, Nov 2023
12Electrode Spacing / Positioning of SWD2xDec 2020, Sep 2021
12Cable Method of SWD2xJun 2022, Nov 2023
12Pulsed SWD2xApr 2023, Feb 2025
12Infrared Radiation (Types/Lamps)2xDec 2020, Sep 2021
12Infrared Radiation (Physiological Effects)2xNov 2023, Aug 2025
12Kromayer Lamp2xOct 2022, Nov 2023
12Theraktin Tunnel2xNov 2023, Feb 2025

KEY EXAM TAKEAWAYS (5-Mark Section)

  • Wax Therapy is the single most repeated 5-mark topic (6 out of 10 papers) - study ALL aspects: methods of application (dipping, pouring, brush, glove), physiological effects, and therapeutic uses separately.
  • Whirlpool Bath, Phonophoresis, MWD, Hydrocollator Packs, and Ultrasound Techniques - each appeared in 4 papers. These are near-guaranteed questions.
  • Cryotherapy, PUVA, Laws of Radiation, and Contrast Bath - each appeared 3 times.
  • Wax Therapy + Whirlpool Bath + Hydrocollator together = Hydrotherapy cluster - always appears every year in some form.
  • Topics with 2x repeats (LASER techniques, Cable method of SWD, Pulsed SWD, Kromayer lamp, Theraktin tunnel) are reliable medium-priority topics.

Create a study guide pdf with summary notes for all above the frequency table

Writing File

~/study-guide/generate_5mark_guide.py

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

OUTPUT = "/home/daytona/workspace/study-guide/Electrotherapy_II_5Mark_StudyGuide.pdf"

# ── palette ───────────────────────────────────────────────────────────────────
DARK_BLUE   = colors.HexColor("#1a3c6e")
MID_BLUE    = colors.HexColor("#2563ae")
LIGHT_BLUE  = colors.HexColor("#dce8f8")
ACCENT      = colors.HexColor("#e05c1a")
GOLD        = colors.HexColor("#f0a500")
LIGHT_GREY  = colors.HexColor("#f4f6fb")
MID_GREY    = colors.HexColor("#8d99ae")
GREEN       = colors.HexColor("#1a7a4a")
GREEN_LIGHT = colors.HexColor("#d4edda")
WARN_BG     = colors.HexColor("#fff3cd")
WARN_BORDER = colors.HexColor("#f0a500")
PURPLE      = colors.HexColor("#5a007a")
TEAL        = colors.HexColor("#006060")
BROWN       = colors.HexColor("#7a2d00")
RED_DARK    = colors.HexColor("#c0392b")

# ── style helpers ─────────────────────────────────────────────────────────────
def S(name, **kw): return ParagraphStyle(name, **kw)

body       = S("body",    fontSize=10, fontName="Helvetica",   leading=14, spaceAfter=3, alignment=TA_JUSTIFY)
bullet_s   = S("bul",    fontSize=10, fontName="Helvetica",   leading=13, spaceAfter=2, leftIndent=14, firstLineIndent=-10)
sub_hd     = S("subhd",  fontSize=12, textColor=MID_BLUE,     fontName="Helvetica-Bold", spaceBefore=6, spaceAfter=3, leading=15)
section_hd = S("sechd",  fontSize=13, textColor=DARK_BLUE,    fontName="Helvetica-Bold", spaceBefore=8, spaceAfter=4, leading=17)
note_sty   = S("note",   fontSize=10, fontName="Helvetica-Oblique", textColor=colors.HexColor("#5a4000"), leading=13, leftIndent=6, rightIndent=6)
small      = S("small",  fontSize=9,  fontName="Helvetica",   textColor=MID_GREY, leading=12)
ch_title   = S("chtit",  fontSize=18, textColor=colors.white, fontName="Helvetica-Bold", alignment=TA_LEFT, leading=24)
ch_sub     = S("chsub",  fontSize=10, textColor=GOLD,         fontName="Helvetica-Bold", leading=14)
ch_freq    = S("chfrq",  fontSize=9,  textColor=colors.white, fontName="Helvetica",      leading=12)

def bullet(text, indent=0):
    pad = "\u00a0" * (indent * 4)
    m = "\u2022" if indent == 0 else "\u25e6"
    return Paragraph(f"{pad}{m}  {text}", bullet_s)

def note(text):
    inner = Paragraph(text, note_sty)
    t = Table([[inner]], colWidths=[16.4*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0),(-1,-1), WARN_BG),
        ("BOX",           (0,0),(-1,-1), 1.2, WARN_BORDER),
        ("TOPPADDING",    (0,0),(-1,-1), 6),
        ("BOTTOMPADDING", (0,0),(-1,-1), 6),
        ("LEFTPADDING",   (0,0),(-1,-1), 8),
        ("RIGHTPADDING",  (0,0),(-1,-1), 8),
    ]))
    return t

def banner(title, sub, asked, years, color=DARK_BLUE):
    inner = [
        Paragraph(title, ch_title),
        Paragraph(sub,   ch_sub),
        Spacer(1,4),
        Paragraph(f"Asked {asked}x  |  Years: {years}", ch_freq),
    ]
    t = Table([[inner]], colWidths=[17*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0),(-1,-1), color),
        ("TOPPADDING",    (0,0),(-1,-1), 10),
        ("BOTTOMPADDING", (0,0),(-1,-1), 10),
        ("LEFTPADDING",   (0,0),(-1,-1), 14),
        ("RIGHTPADDING",  (0,0),(-1,-1), 14),
    ]))
    return t

def two_col(left_items, right_items, lt="Indications", rt="Contraindications"):
    lp = [Paragraph(f"<b>{lt}</b>", sub_hd)] + [bullet(i) for i in left_items]
    rp = [Paragraph(f"<b>{rt}</b>", sub_hd)] + [bullet(i) for i in right_items]
    t = Table([[lp, rp]], colWidths=[8.2*cm, 8.2*cm])
    t.setStyle(TableStyle([
        ("VALIGN",       (0,0),(-1,-1),"TOP"),
        ("TOPPADDING",   (0,0),(-1,-1), 6),
        ("BOTTOMPADDING",(0,0),(-1,-1), 6),
        ("LEFTPADDING",  (0,0),(-1,-1), 6),
        ("RIGHTPADDING", (0,0),(-1,-1), 6),
        ("BACKGROUND",   (0,0),(0,-1), LIGHT_BLUE),
        ("BACKGROUND",   (1,0),(1,-1), GREEN_LIGHT),
        ("BOX",          (0,0),(-1,-1), 0.5, MID_GREY),
        ("INNERGRID",    (0,0),(-1,-1), 0.5, MID_GREY),
    ]))
    return t

def stbl(headers, rows, widths=None):
    if not widths:
        widths = [16.4*cm / len(headers)] * len(headers)
    hrow = [Paragraph(f"<b>{h}</b>", S("th", fontSize=9, fontName="Helvetica-Bold",
             textColor=colors.white, leading=12)) for h in headers]
    data = [hrow]
    for row in rows:
        data.append([Paragraph(str(c), S("td", fontSize=9, fontName="Helvetica", leading=12)) for c in row])
    t = Table(data, colWidths=widths)
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0),(-1,0),  DARK_BLUE),
        ("ROWBACKGROUNDS",(0,1),(-1,-1), [LIGHT_GREY, colors.white]),
        ("BOX",           (0,0),(-1,-1), 0.5, MID_GREY),
        ("INNERGRID",     (0,0),(-1,-1), 0.3, MID_GREY),
        ("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"),
    ]))
    return t

# ══════════════════════════════════════════════════════════════════════════════
# COVER
# ══════════════════════════════════════════════════════════════════════════════
def build_cover(s):
    inner = [
        Spacer(1,1*cm),
        Paragraph("BPT THIRD YEAR", S("ct1",fontSize=12,textColor=GOLD,fontName="Helvetica-Bold",alignment=TA_CENTER)),
        Spacer(1,0.2*cm),
        Paragraph("ELECTROTHERAPY – II", S("ct2",fontSize=26,textColor=colors.white,fontName="Helvetica-Bold",alignment=TA_CENTER,leading=32)),
        Paragraph("(High Frequency &amp; Actinotherapy)", S("ct3",fontSize=13,textColor=GOLD,fontName="Helvetica-Bold",alignment=TA_CENTER,spaceAfter=6)),
        Spacer(1,0.5*cm),
        HRFlowable(width="80%",thickness=1.5,color=GOLD,hAlign="CENTER"),
        Spacer(1,0.5*cm),
        Paragraph("5-MARK EXAM STUDY GUIDE", S("ct4",fontSize=16,textColor=colors.white,fontName="Helvetica-Bold",alignment=TA_CENTER)),
        Spacer(1,0.3*cm),
        Paragraph("Complete Summary Notes for All Repeated 5-Mark Topics", S("ct5",fontSize=11,textColor=colors.white,fontName="Helvetica",alignment=TA_CENTER,leading=16)),
        Spacer(1,0.8*cm),
        Paragraph("Based on Previous Year Questions: Dec 2020 – Aug 2025", S("ct6",fontSize=10,textColor=colors.white,fontName="Helvetica",alignment=TA_CENTER,leading=14)),
        Paragraph("Tamil Nadu Dr. M.G.R. Medical University", S("ct7",fontSize=10,textColor=colors.white,fontName="Helvetica",alignment=TA_CENTER,leading=14)),
        Spacer(1,1*cm),
        HRFlowable(width="60%",thickness=0.8,color=GOLD,hAlign="CENTER"),
        Spacer(1,0.4*cm),
        Paragraph("23 Repeated Topics  |  10 Question Papers Analyzed", S("ct8",fontSize=10,textColor=colors.white,fontName="Helvetica",alignment=TA_CENTER)),
    ]
    t = Table([[inner]], colWidths=[17*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND",(0,0),(-1,-1),DARK_BLUE),
        ("TOPPADDING",(0,0),(-1,-1),20),("BOTTOMPADDING",(0,0),(-1,-1),20),
        ("LEFTPADDING",(0,0),(-1,-1),20),("RIGHTPADDING",(0,0),(-1,-1),20),
    ]))
    s.append(t); s.append(PageBreak())

# ══════════════════════════════════════════════════════════════════════════════
# TOC
# ══════════════════════════════════════════════════════════════════════════════
def build_toc(s):
    s.append(Paragraph("TABLE OF CONTENTS", S("toch",fontSize=16,textColor=DARK_BLUE,fontName="Helvetica-Bold",alignment=TA_CENTER,spaceAfter=8)))
    s.append(HRFlowable(width="100%",thickness=1,color=MID_BLUE))
    s.append(Spacer(1,0.3*cm))
    entries = [
        ("1","Wax Therapy – Methods of Application","6x","Sep 2021, Jan 2022, Oct 2022, Apr 2023, Aug 2024, Aug 2025"),
        ("2","Wax Therapy – Physiological & Therapeutic Effects","4x","Apr 2023, Nov 2023, Feb 2025, Aug 2025"),
        ("3","Whirlpool Bath","4x","Sep 2021, Oct 2022, Apr 2023, Feb 2025"),
        ("4","Phonophoresis / Ultrasonophoresis","4x","Sep 2021, Oct 2022, Aug 2024, Feb 2025"),
        ("5","Microwave Diathermy (MWD)","4x","Jan 2022, Apr 2023, Nov 2023, Aug 2024"),
        ("6","Hydrocollator Packs","4x","Sep 2021, Oct 2022, Aug 2024, Aug 2025"),
        ("7","Techniques of Ultrasound Application","4x","Oct 2022, Apr 2023, Aug 2024, Feb 2025"),
        ("8","Cryotherapy – Effects & Benefits","3x","Apr 2023, Aug 2024, Feb 2025"),
        ("9","Laws Governing Radiation","3x","Sep 2021, Jan 2022, Jun 2022"),
        ("10","PUVA Therapy / Apparatus","3x","Jun 2022, Apr 2023, Feb 2025"),
        ("11","Contrast Bath","3x","Dec 2020, Jan 2022, Aug 2025"),
        ("12","LASER – Techniques of Application","2x","Sep 2021, Apr 2023"),
        ("13","LASER – Properties & Types","2x","Jun 2022, Nov 2023"),
        ("14","Cryotherapy – Biophysics / Specific Uses","2x","Sep 2021, Nov 2023"),
        ("15","Cryokinetics","2x","Jan 2022, Aug 2024"),
        ("16","Radiation Energy and Properties","2x","Dec 2020, Nov 2023"),
        ("17","Electrode Spacing & Positioning of SWD","2x","Dec 2020, Sep 2021"),
        ("18","Cable Method of SWD","2x","Jun 2022, Nov 2023"),
        ("19","Pulsed Shortwave Diathermy (PSWD)","2x","Apr 2023, Feb 2025"),
        ("20","Infrared Radiation – Types & Lamps","2x","Dec 2020, Sep 2021"),
        ("21","Infrared Radiation – Physiological Effects","2x","Nov 2023, Aug 2025"),
        ("22","Kromayer Lamp","2x","Oct 2022, Nov 2023"),
        ("23","Theraktin Tunnel","2x","Nov 2023, Feb 2025"),
    ]
    rows=[]
    for num,topic,freq,years in entries:
        col = "<font color='#c0392b'><b>HIGH</b></font>" if "4x" in freq or "6x" in freq else \
              "<font color='#e05c1a'><b>MED</b></font>" if "3x" in freq else "<font color='#1a7a4a'><b>LOW</b></font>"
        rows.append([
            Paragraph(f"<b>{num}</b>",S("n",fontSize=10,textColor=MID_BLUE,fontName="Helvetica-Bold",alignment=TA_CENTER,leading=14)),
            Paragraph(f"<b>{topic}</b>",S("tt",fontSize=10,fontName="Helvetica-Bold",textColor=DARK_BLUE,leading=14)),
            Paragraph(f"<b>{freq}</b> {col}",S("ff",fontSize=9,fontName="Helvetica",leading=12)),
        ])
    t = Table(rows, colWidths=[1*cm,11.5*cm,4*cm])
    t.setStyle(TableStyle([
        ("ROWBACKGROUNDS",(0,0),(-1,-1),[LIGHT_BLUE,colors.white]),
        ("BOX",(0,0),(-1,-1),0.5,MID_GREY),("INNERGRID",(0,0),(-1,-1),0.3,MID_GREY),
        ("TOPPADDING",(0,0),(-1,-1),6),("BOTTOMPADDING",(0,0),(-1,-1),6),
        ("LEFTPADDING",(0,0),(-1,-1),6),("RIGHTPADDING",(0,0),(-1,-1),6),
        ("VALIGN",(0,0),(-1,-1),"MIDDLE"),("ALIGN",(0,0),(0,-1),"CENTER"),
    ]))
    s.append(t); s.append(PageBreak())

# ══════════════════════════════════════════════════════════════════════════════
# TOPICS
# ══════════════════════════════════════════════════════════════════════════════

def topic_wax_methods(s):
    s.append(banner("TOPIC 1: WAX THERAPY – METHODS OF APPLICATION",
                    "5-Mark Topic | Write notes on:", 6,
                    "Sep 2021, Jan 2022, Oct 2022, Apr 2023, Aug 2024, Aug 2025", BROWN))
    s.append(Spacer(1,0.2*cm))
    s.append(note("MOST REPEATED 5-mark topic! Appeared in 6 out of 10 papers. Know all methods, temperatures, and contraindications."))
    s.append(Spacer(1,0.2*cm))
    s.append(Paragraph("DEFINITION", section_hd))
    s.append(Paragraph("Paraffin wax therapy is a superficial heating modality using molten paraffin wax (melting point <b>52-54°C</b>) mixed with mineral oil (6:1 ratio) to lower the melting point to <b>42-52°C</b> for safe therapeutic application.", body))

    s.append(Paragraph("METHODS OF APPLICATION", section_hd))
    s.append(stbl(["Method","Description","Best For"],[
        ["1. Dipping method (Glove method)","Limb dipped into wax 8-10 times; each layer solidifies before next dip; covered with plastic bag + towel for 15-20 min","Hands, wrists, feet, ankles"],
        ["2. Immersion method","Limb immersed continuously in wax bath; maintained at constant temp","Feet and ankles"],
        ["3. Painting / Brushing method","Melted wax painted on with brush; 8-10 layers; covered with towel","Irregular surfaces, over wounds"],
        ["4. Pouring method","Wax poured over body part (e.g., shoulder, back) and covered","Shoulder, back, large areas"],
        ["5. Re-warming / Bandage method","Wax applied and wrapped with bandage to retain heat longer","Maintenance of heat"],
    ],[3.5*cm,8*cm,4.5*cm]))
    s.append(Spacer(1,0.15*cm))

    s.append(Paragraph("TREATMENT PARAMETERS", section_hd))
    for pt in ["Temperature: <b>42–52°C</b> (lower than plain water due to low thermal conductivity of wax).",
               "Duration: <b>15–20 minutes</b> per session.",
               "Frequency: Daily or alternate days.",
               "Wax-to-mineral oil ratio: <b>6:1</b>."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.15*cm))
    s.append(two_col(
        ["Rheumatoid arthritis (subacute/chronic)","Osteoarthritis of small joints","Stiff joints","Post-fracture stiffness","Scleroderma","Tenosynovitis","Pre-exercise warm-up"],
        ["Open wounds / skin infections","Skin diseases (eczema, psoriasis)","Impaired sensation","Peripheral vascular disease","Malignancy","Acute inflammation","Oedema"],
        "Indications","Contraindications"
    ))
    s.append(Spacer(1,0.1*cm))
    s.append(note("KEY ADVANTAGE of wax: low thermal conductivity → can tolerate higher temperature than water without burning. Ideal for small distal joints."))
    s.append(PageBreak())

def topic_wax_effects(s):
    s.append(banner("TOPIC 2: WAX THERAPY – PHYSIOLOGICAL & THERAPEUTIC EFFECTS",
                    "5-Mark Topic | Write notes on:", 4,
                    "Apr 2023, Nov 2023, Feb 2025, Aug 2025", BROWN))
    s.append(Spacer(1,0.2*cm))
    s.append(Paragraph("PHYSIOLOGICAL EFFECTS", section_hd))
    for pt in ["<b>Vasodilation:</b> Increased local blood flow and hyperaemia due to heat.",
               "<b>Increased metabolism:</b> Metabolic rate doubles for every 10°C rise (Van't Hoff's law).",
               "<b>Sedation:</b> Heat reduces sensory nerve conduction → pain relief and relaxation.",
               "<b>Muscle relaxation:</b> Reduces muscle spasm by heating muscle spindles.",
               "<b>Increased tissue extensibility:</b> Collagen softens with heat → improved joint mobility.",
               "<b>Sweating:</b> Mild reflex sweating.",
               "<b>Diaphoresis:</b> Increased perspiration; skin pores open (cleansing effect)."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.15*cm))
    s.append(Paragraph("THERAPEUTIC EFFECTS", section_hd))
    for pt in ["Pain relief in arthritic and stiff joints.",
               "Reduction of joint stiffness and improvement of range of motion.",
               "Reduction of muscle spasm around joints.",
               "Preparation for exercise and mobilisation.",
               "Softening of scar tissue and adhesions.",
               "Treatment of chronic tenosynovitis.",
               "Cosmetic benefit — skin softening and moisturising."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.1*cm))
    s.append(note("Wax therapy DOES NOT penetrate deep — it is purely a SUPERFICIAL modality. Maximum penetration: 1-2 cm. Compare: SWD penetrates 5-7 cm."))
    s.append(PageBreak())

def topic_whirlpool(s):
    s.append(banner("TOPIC 3: WHIRLPOOL BATH",
                    "5-Mark Topic | Write notes on:", 4,
                    "Sep 2021, Oct 2022, Apr 2023, Feb 2025", TEAL))
    s.append(Spacer(1,0.2*cm))
    s.append(Paragraph("DEFINITION", section_hd))
    s.append(Paragraph("Whirlpool bath is a hydrotherapy modality where the patient's limb or whole body is immersed in a tank of water agitated by a turbine motor, producing a whirlpool action combining the effects of <b>heat, buoyancy, hydrostatic pressure, and mechanical massage</b>.", body))

    s.append(Paragraph("TYPES OF WHIRLPOOL TANKS", section_hd))
    s.append(stbl(["Type","Size / Use"],[
        ["Extremity tank (Lowboy)","Small; for upper or lower limb treatment"],
        ["Leg tank (Highboy)","Taller; for entire lower limb"],
        ["Half-body tank","Waist-deep; for bilateral lower limb"],
        ["Full-body tank (Hubbard Tank)","Butterfly-shaped; for whole-body immersion; paraplegics, burns"],
    ],[4*cm,12*cm]))
    s.append(Spacer(1,0.15*cm))

    s.append(Paragraph("TREATMENT PARAMETERS", section_hd))
    s.append(stbl(["Parameter","Value"],[
        ["Water temperature (cold)","15–18°C (for acute conditions)"],
        ["Water temperature (tepid)","33–36°C (for wound care, neurological)"],
        ["Water temperature (warm)","37–40°C (for chronic musculoskeletal)"],
        ["Water temperature (hot)","40–43°C (for chronic stiffness, pre-exercise)"],
        ["Duration","15–20 minutes per session"],
        ["Turbine speed","Adjustable; lower for sensitive/wound areas"],
    ],[4.5*cm,12*cm]))
    s.append(Spacer(1,0.15*cm))

    s.append(Paragraph("PHYSIOLOGICAL EFFECTS", section_hd))
    for pt in ["<b>Thermal effect:</b> Vasodilation, increased blood flow, muscle relaxation.",
               "<b>Mechanical effect (turbulence):</b> Debridement of wounds, micro-massage, reduces oedema.",
               "<b>Buoyancy:</b> Reduces effect of gravity — assists movement of weak muscles.",
               "<b>Hydrostatic pressure:</b> Reduces peripheral oedema.",
               "<b>Pain relief:</b> Gate control mechanism + endorphin release."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.15*cm))

    s.append(two_col(
        ["Burns (wound debridement)","Post-fracture rehabilitation","Peripheral vascular disease (tepid)","Wound healing","Rheumatoid arthritis","Muscle spasm","Peripheral neuropathy","Post-amputation stump care"],
        ["Open fractures / infected wounds (CI for warm water)","Severe cardiac/pulmonary disease","Uncontrolled hypertension","Fever","Bladder / bowel incontinence","Thrombophlebitis","Severe peripheral vascular disease (hot water)"],
    ))
    s.append(Spacer(1,0.1*cm))
    s.append(note("PRECAUTIONS: Water temperature must be checked before immersion. Turbine OFF when inserting/removing patient. Epilepsy patients need supervision. Add antiseptic (e.g., Dettol) for wound care."))
    s.append(PageBreak())

def topic_phonophoresis(s):
    s.append(banner("TOPIC 4: PHONOPHORESIS / ULTRASONOPHORESIS",
                    "5-Mark Topic | Write notes on:", 4,
                    "Sep 2021, Oct 2022, Aug 2024, Feb 2025", DARK_BLUE))
    s.append(Spacer(1,0.2*cm))
    s.append(Paragraph("DEFINITION", section_hd))
    s.append(Paragraph("<b>Phonophoresis (Ultrasonophoresis)</b> is the use of therapeutic ultrasound to enhance the transdermal delivery (absorption) of topical drugs into deeper tissues. Ultrasound acts as a 'driver' to push drug molecules through the skin by mechanical and thermal mechanisms.", body))

    s.append(Paragraph("MECHANISM OF DRUG DELIVERY", section_hd))
    for pt in ["<b>Cavitation:</b> Formation and oscillation of microbubbles disrupts skin barrier (stratum corneum), increasing permeability.",
               "<b>Acoustic streaming:</b> Unidirectional fluid movement carries drug molecules deeper into tissues.",
               "<b>Thermal effect:</b> Heat increases skin permeability and blood flow, facilitating drug absorption.",
               "<b>Direct mechanical pressure:</b> Pressure waves force drug molecules into intercellular spaces."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.15*cm))

    s.append(Paragraph("COMMONLY USED DRUGS", section_hd))
    s.append(stbl(["Drug","Condition Treated"],[
        ["Hydrocortisone (1-10%)","Anti-inflammatory: tendinitis, bursitis, arthritis"],
        ["Diclofenac / Ketoprofen gel","Pain, soft tissue inflammation"],
        ["Dexamethasone","Severe inflammation, scar tissue"],
        ["Lignocaine (2%)","Pain relief, local anaesthesia"],
        ["Iodine","Wound infection, keloid scars"],
        ["Zinc oxide","Wound healing"],
        ["Salicylates","Arthritis, chronic pain"],
    ],[5*cm,11*cm]))
    s.append(Spacer(1,0.15*cm))

    s.append(Paragraph("TECHNIQUE", section_hd))
    for pt in ["Drug is mixed with aqueous coupling gel or applied directly to skin.",
               "Ultrasound transducer moved over the area in slow circular strokes.",
               "Frequency: <b>1 MHz</b> (deep drug delivery) or <b>3 MHz</b> (superficial).",
               "Intensity: <b>0.5–1.5 W/cm²</b> (continuous or pulsed mode).",
               "Duration: <b>5–10 minutes</b>.",
               "Mode: Continuous mode preferred for thermal + mechanical drug driving."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.15*cm))
    s.append(two_col(
        ["Tendinitis, bursitis","Arthritis","Scar tissue / keloids","Soft tissue injuries","Calcific deposits","Muscle spasm with local pain"],
        ["Known drug allergy","Open wounds (risk of drug toxicity)","Over malignancy","Over pacemaker","Pregnancy (over abdomen)","Impaired skin sensation"],
        "Indications","Contraindications"
    ))
    s.append(Spacer(1,0.1*cm))
    s.append(note("COMPARE: Phonophoresis = drug + ultrasound. Iontophoresis = drug + electrical current (DC). Both enhance transdermal drug delivery by different mechanisms."))
    s.append(PageBreak())

def topic_mwd(s):
    s.append(banner("TOPIC 5: MICROWAVE DIATHERMY (MWD)",
                    "5-Mark Topic | Write notes on:", 4,
                    "Jan 2022, Apr 2023, Nov 2023, Aug 2024", colors.HexColor("#1a4f3a")))
    s.append(Spacer(1,0.2*cm))
    s.append(Paragraph("DEFINITION & FREQUENCY", section_hd))
    s.append(Paragraph("Microwave Diathermy uses electromagnetic radiation at <b>2450 MHz</b> (wavelength 12.25 cm) or <b>915 MHz</b> (wavelength 32.8 cm) for deep tissue heating. The device is a <b>Magnetron</b> (vacuum tube). Microwaves lie between shortwave and infrared on the electromagnetic spectrum.", body))

    s.append(Paragraph("PRODUCTION", section_hd))
    for pt in ["Magnetron: high-power vacuum tube. Electrons from cathode spiral under magnetic field.",
               "Spiraling electrons create oscillations in resonant cavities → microwaves generated.",
               "Directed via coaxial cable to dipole antenna/director placed over treatment area.",
               "<b>Tridymite</b> ceramic window seals the magnetron and transmits microwaves.",
               "Director must NOT touch skin — maintain <b>5–10 cm air gap</b>."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.15*cm))

    s.append(Paragraph("PHYSIOLOGICAL EFFECTS", section_hd))
    for pt in ["Selective heating of <b>high-water-content tissues</b> (muscle, skin) over fat.",
               "Depth of penetration: ~3 cm (2450 MHz).",
               "Vasodilation, increased blood flow and metabolism.",
               "Muscle relaxation and pain relief.",
               "Resolution of chronic inflammation."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.15*cm))

    s.append(Paragraph("DOSAGE", section_hd))
    s.append(stbl(["Dose","Sensation","Use"],[
        ["Dose I","No heat","Acute"],["Dose II","Mild warmth","Sub-acute"],
        ["Dose III","Comfortable warmth","Chronic"],["Dose IV","Strong warmth","Very chronic (with caution)"],
    ],[3*cm,6*cm,7*cm]))
    s.append(Spacer(1,0.15*cm))
    s.append(two_col(
        ["Chronic musculoskeletal conditions","Bursitis, tendinitis","Sinusitis","Muscle spasm","Sub-acute soft tissue injuries"],
        ["Metal implants in field","Pacemakers","Over eyes (cataract)","Over testes / gonads","Malignancy","Pregnancy","Moist dressings (steam burns)","Children (growing epiphyses)"],
    ))
    s.append(Spacer(1,0.1*cm))
    s.append(note("MWD vs SWD: MWD heats SKIN + superficial muscle more (water content). SWD penetrates DEEPER (5–7 cm). MWD director must always face skin with air gap — no contact."))
    s.append(PageBreak())

def topic_hydrocollator(s):
    s.append(banner("TOPIC 6: HYDROCOLLATOR PACKS (Hot Packs / Moist Hot Packs)",
                    "5-Mark Topic | Write notes on:", 4,
                    "Sep 2021, Oct 2022, Aug 2024, Aug 2025", colors.HexColor("#7a4500")))
    s.append(Spacer(1,0.2*cm))
    s.append(Paragraph("DEFINITION", section_hd))
    s.append(Paragraph("Hydrocollator packs (hot packs / moist heat packs) are canvas packs filled with <b>silica gel</b> (hydrophilic compound) that retains water. They are heated in a <b>hydrocollator unit</b> (thermostatically controlled hot water tank) at <b>71–79°C</b> and applied to the patient wrapped in towels.", body))

    s.append(Paragraph("COMPONENTS & PREPARATION", section_hd))
    for pt in ["<b>Pack material:</b> Canvas bag filled with silica gel (absorbs and retains water well).",
               "<b>Hydrocollator unit:</b> Stainless steel tank with thermostat; maintains water at 71–79°C.",
               "<b>Pack sizes:</b> Standard (cervical, shoulder, back), cervical/neck packs (contour packs).",
               "<b>Wrapping:</b> Pack wrapped in <b>6–8 layers of towelling</b> before placing on patient.",
               "<b>Application temperature:</b> Patient should feel comfortable warmth, NOT hot."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.15*cm))

    s.append(Paragraph("PHYSIOLOGICAL & THERAPEUTIC EFFECTS", section_hd))
    for pt in ["Vasodilation → increased blood flow and hyperaemia.",
               "Muscle relaxation → reduced spasm.",
               "Pain relief (heat raises pain threshold).",
               "Increased tissue extensibility → better mobilisation.",
               "<b>Moist heat</b> penetrates more effectively than dry heat at same temperature.",
               "Duration of effect: <b>20–30 minutes</b>.",
               "Penetration: superficial (1–2 cm) — suitable for pre-exercise warm-up."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.15*cm))
    s.append(two_col(
        ["Muscle spasm","Chronic pain (LBP, neck pain)","Pre-exercise warm-up","Arthritis","Chronic soft tissue injuries","Preparation for massage / mobilisation"],
        ["Impaired sensation (burns risk)","Acute inflammation","Oedema (hot packs worsen it)","Malignancy","Peripheral vascular disease","Open wounds","Areas with poor circulation"],
    ))
    s.append(Spacer(1,0.1*cm))
    s.append(note("CHECK SENSATION before applying! Patient must NOT lie on top of pack (pressure + heat = burn). Recheck every 5 min. Towel layers reduce temperature by ~1°C per layer."))
    s.append(PageBreak())

def topic_us_techniques(s):
    s.append(banner("TOPIC 7: TECHNIQUES OF ULTRASOUND APPLICATION",
                    "5-Mark Topic | Write notes on:", 4,
                    "Oct 2022, Apr 2023, Aug 2024, Feb 2025", DARK_BLUE))
    s.append(Spacer(1,0.2*cm))
    s.append(stbl(["Technique","Description","Best Used For"],[
        ["1. Direct contact method","Coupling gel applied to skin; transducer moved in slow overlapping circles directly on skin","Most common; any accessible body surface"],
        ["2. Water bath / Immersion method","Limb immersed in degassed water; transducer held 1–2 cm from skin underwater; both patient and transducer submerged","Irregular surfaces — hands, feet, ankles"],
        ["3. Bladder / Water-bag method","Small plastic bag filled with water used as coupling medium between transducer and bony prominence","Bony prominences, acromion, patella"],
        ["4. Phonophoresis","Drug gel used as coupling medium; drug driven into tissues by ultrasound","Drug delivery: tendinitis, scars, arthritis"],
        ["5. Underwater technique","Both patient body part and transducer submerged in water-filled container","Finger/toe joints"],
    ],[3.5*cm,7.5*cm,5*cm]))
    s.append(Spacer(1,0.15*cm))
    s.append(Paragraph("GENERAL TECHNIQUE PRINCIPLES", section_hd))
    for pt in ["Coupling medium is <b>mandatory</b> — ultrasound cannot travel through air.",
               "Move transducer <b>slowly and continuously</b> in overlapping circles (2 cm/sec).",
               "<b>Never hold transducer stationary</b> — causes periosteal pain and burns at nodes.",
               "ERA (Effective Radiating Area) should cover the treatment area adequately.",
               "Keep transducer perpendicular to skin surface for maximum energy transmission.",
               "Check patient sensation regularly — warmth is acceptable, pain is not."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.1*cm))
    s.append(note("PERIOSTEAL PAIN during US: transducer stationary too long → hotspot at bone surface. Prevention: keep moving, reduce intensity."))
    s.append(PageBreak())

def topic_cryo_effects(s):
    s.append(banner("TOPIC 8: CRYOTHERAPY – PHYSIOLOGICAL & THERAPEUTIC EFFECTS",
                    "5-Mark Topic | Write notes on:", 3,
                    "Apr 2023, Aug 2024, Feb 2025", colors.HexColor("#0a5088")))
    s.append(Spacer(1,0.2*cm))
    s.append(Paragraph("DEFINITION", section_hd))
    s.append(Paragraph("Cryotherapy is the therapeutic application of <b>cold</b> (below body temperature) to produce physiological and therapeutic effects. Temperature used: <b>0–18°C</b>.", body))
    s.append(Paragraph("PHYSIOLOGICAL EFFECTS", section_hd))
    for pt in ["<b>Vasoconstriction</b> (initial): reduces blood flow, controls bleeding and acute oedema.",
               "<b>Lewis hunting reaction:</b> After prolonged cold application, cyclic vasodilation (every 7–10 min) occurs to prevent tissue damage — alternating vasoconstriction and vasodilation.",
               "<b>Reduced metabolism:</b> Cold slows cellular metabolic rate → reduced demand for O₂ → tissue protection.",
               "<b>Analgesia:</b> Cold numbs sensory nerve endings (raises pain threshold); slows nerve conduction velocity.",
               "<b>Reduced muscle spasm:</b> Inhibits muscle spindle activity → reduces tone.",
               "<b>Reduced inflammation:</b> Reduces inflammatory mediators (prostaglandins, histamine).",
               "<b>Reduced oedema:</b> Vasoconstriction limits plasma exudate into tissues."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.15*cm))
    s.append(Paragraph("THERAPEUTIC EFFECTS", section_hd))
    for pt in ["Control of acute swelling and bruising (RICE protocol).",
               "Pain relief in acute and chronic conditions.",
               "Muscle spasm reduction.",
               "Preparation for stretching (cryokinetics).",
               "Control of spasticity in neurological conditions.",
               "Post-surgical oedema control."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.15*cm))
    s.append(two_col(
        ["Acute sprains/strains (0–48 h)","Acute haematoma","Spasticity","Post-operative swelling","Headache / migraine","Burns (mild)"],
        ["Raynaud's disease / phenomenon","Cold allergy / cold urticaria","Impaired circulation (PVD)","Impaired sensation","Over regenerating nerves","Cryoglobulinaemia"],
    ))
    s.append(Spacer(1,0.1*cm))
    s.append(note("ICE BURN prevention: Never apply ice directly to skin. Always use wet towel/cloth between ice pack and skin. Limit application to 15–20 minutes."))
    s.append(PageBreak())

def topic_laws_radiation(s):
    s.append(banner("TOPIC 9: LAWS GOVERNING RADIATION",
                    "5-Mark Topic | Write notes on:", 3,
                    "Sep 2021, Jan 2022, Jun 2022", DARK_BLUE))
    s.append(Spacer(1,0.2*cm))
    s.append(stbl(["Law","Statement","Clinical Relevance"],[
        ["Inverse Square Law","Intensity of radiation is inversely proportional to the square of the distance from the source.\nI ∝ 1/d²  →  I₁/I₂ = d₂²/d₁²",
         "Doubling distance reduces intensity to 1/4. Lamp must be placed at correct distance."],
        ["Cosine Law (Lambert's Law)","Intensity of radiation falling on a surface = I₀ × cos θ, where θ = angle between the ray and the perpendicular to the surface.",
         "Lamp must be perpendicular to skin (θ = 0, cos 0 = 1 = maximum intensity). Oblique angle = less effective."],
        ["Grotthus-Draper Law","Only radiation that is ABSORBED by a substance can produce a photochemical effect. Reflected or transmitted radiation has no effect.",
         "UVR must be absorbed by skin chromophores (melanin, proteins) to cause erythema or tanning."],
        ["Bunsen-Roscoe Law (Reciprocity Law)","Photochemical effect = Intensity × Time (I × T = constant). Same effect produced by high intensity short time OR low intensity long time.",
         "Basis of MED calculation. Used to adjust UV dose safely."],
        ["Stefan-Boltzmann Law","Total radiation emitted ∝ T⁴ (fourth power of absolute temperature).",
         "Hotter lamps emit much more radiation — used to compare luminous vs non-luminous IRR lamps."],
        ["Wien's Displacement Law","Wavelength of peak emission (λ_max) = constant / Temperature. Higher temp → shorter peak wavelength.",
         "Luminous lamp (2500°C) peaks at shorter wavelength (near IR) than non-luminous (400°C peaks at far IR)."],
    ],[3.5*cm,6.5*cm,6*cm]))
    s.append(Spacer(1,0.1*cm))
    s.append(note("EXAM ESSENTIALS: Know Inverse Square Law formula (I ∝ 1/d²) and Cosine Law formula (I = I₀ cos θ). These two are the most commonly tested laws."))
    s.append(PageBreak())

def topic_puva(s):
    s.append(banner("TOPIC 10: PUVA THERAPY / APPARATUS",
                    "5-Mark Topic | Write notes on:", 3,
                    "Jun 2022, Apr 2023, Feb 2025", PURPLE))
    s.append(Spacer(1,0.2*cm))
    s.append(Paragraph("DEFINITION", section_hd))
    s.append(Paragraph("<b>PUVA = Psoralen + Ultraviolet A (UVA 320–400 nm)</b>. It is a photochemotherapy technique where a photosensitising drug (psoralen) is combined with UVA irradiation to treat skin conditions.", body))
    s.append(Paragraph("MECHANISM", section_hd))
    for pt in ["Psoralen (8-MOP, 5-MOP) is administered <b>orally</b> (1–2 hours before) or <b>topically</b> (30 min before).",
               "UVA activates psoralen → forms <b>DNA cross-links</b> in rapidly dividing skin cells.",
               "Inhibits DNA synthesis → reduces abnormal cell proliferation (psoriasis, vitiligo).",
               "Stimulates melanocyte activity → repigmentation (vitiligo)."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.15*cm))
    s.append(Paragraph("PUVA APPARATUS (CABINET)", section_hd))
    for pt in ["Walk-in cabinet or whole-body irradiation unit.",
               "Multiple <b>fluorescent UVA tubes</b> (320–400 nm) line the walls.",
               "Timed exposure control.",
               "Patient stands inside for whole-body treatment.",
               "Eye protection (UV-blocking goggles) <b>mandatory</b>."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.15*cm))
    s.append(two_col(
        ["Psoriasis (most common use)","Vitiligo","Mycosis fungoides","Chronic eczema / atopic dermatitis","Alopecia areata","Parapsoriasis"],
        ["Pregnancy","Children < 10 years","SLE / photosensitive disorders","Renal / hepatic failure","History of skin cancer","Cataracts (eye protection essential)","Long-term: increased skin cancer risk"],
    ))
    s.append(Spacer(1,0.1*cm))
    s.append(note("PUVA regimen: 2–3 sessions per week; NOT on consecutive days. Start with minimum MED dose; increase by 10-20% per session. Continue for 20–30 sessions for psoriasis."))
    s.append(PageBreak())

def topic_contrast_bath(s):
    s.append(banner("TOPIC 11: CONTRAST BATH",
                    "5-Mark Topic | Write notes on:", 3,
                    "Dec 2020, Jan 2022, Aug 2025", TEAL))
    s.append(Spacer(1,0.2*cm))
    s.append(Paragraph("DEFINITION", section_hd))
    s.append(Paragraph("Contrast bath involves the <b>alternating immersion</b> of a body part (usually a limb) in warm and cold water in sequence, producing a pumping action on the peripheral blood vessels (vascular exercise).", body))
    s.append(Paragraph("TECHNIQUE", section_hd))
    s.append(stbl(["Step","Water","Temperature","Duration"],[
        ["Start","Warm water","38–44°C","10 minutes (initial immersion)"],
        ["Alternate: Cold","Cold water","10–18°C","1 minute"],
        ["Alternate: Warm","Warm water","38–44°C","4 minutes"],
        ["Repeat","Cold → Warm","As above","Repeat 3–5 times"],
        ["Finish","Warm water","38–44°C","End with warm (except for acute oedema — end cold)"],
    ],[1.5*cm,3*cm,3*cm,8.5*cm]))
    s.append(Spacer(1,0.15*cm))
    s.append(Paragraph("PHYSIOLOGICAL EFFECTS", section_hd))
    for pt in ["<b>Vascular exercise / pumping action:</b> Rapid alternating vasodilation (warm) and vasoconstriction (cold) improves peripheral circulation.",
               "Reduces chronic oedema.",
               "Stimulates sensory receptors — useful in desensitisation.",
               "Pain relief.",
               "Increases tissue nutrition and healing."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.15*cm))
    s.append(two_col(
        ["Sub-acute and chronic oedema","Reflex Sympathetic Dystrophy (CRPS)","Post-fracture oedema","Peripheral neuropathy","Chronic ankle sprain","Desensitisation","Rheumatoid arthritis"],
        ["Acute inflammation (warm = worsens)","Arterial insufficiency","Impaired sensation","Raynaud's disease","Cold urticaria","Peripheral vascular disease","Malignancy","Hypertension (if whole body)"],
    ))
    s.append(Spacer(1,0.1*cm))
    s.append(note("END with WARM in most cases. End with COLD only for acute/subacute oedema reduction. Ratio warm:cold = 4:1 minutes."))
    s.append(PageBreak())

def topic_laser_tech(s):
    s.append(banner("TOPIC 12: LASER – TECHNIQUES OF APPLICATION",
                    "5-Mark Topic | Write notes on:", 2,
                    "Sep 2021, Apr 2023", TEAL))
    s.append(Spacer(1,0.2*cm))
    s.append(stbl(["Technique","Description","Used For"],[
        ["Contact method","Probe placed directly on skin surface; most common","General soft tissue treatment, trigger points"],
        ["Non-contact method","Probe held 1–2 cm above skin","Open wounds, sensitive areas"],
        ["Scanning method","Probe moved slowly and systematically over entire area","Large wound areas, scars"],
        ["Cluster probe","Multiple diodes in one head; covers large area at once","Large treatment areas, wound beds"],
        ["Grid / Point method","Treatment area divided into grid; each point treated individually","Systematic wound treatment, large scars"],
        ["Intra-articular (via optical fibre)","Optical fibre delivers laser inside joint","Joint conditions (specialist use)"],
    ],[3.5*cm,7*cm,5.5*cm]))
    s.append(Spacer(1,0.15*cm))
    s.append(Paragraph("DOSIMETRY", section_hd))
    for pt in ["<b>Energy density (fluence):</b> 0.5–4 J/cm² (superficial); 4–10 J/cm² (deep).",
               "<b>Power:</b> 1–500 mW (low-level / cold laser).",
               "<b>Wavelength:</b> He-Ne (632.8 nm) for superficial; GaAs (830 nm) for deep.",
               "<b>Duration:</b> 30 sec – 5 min per point.",
               "<b>Frequency:</b> Daily or 3–5 times/week; 5–15 sessions typical."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.1*cm))
    s.append(note("SAFETY: Protective goggles ALWAYS. Never point at eyes. Never apply over malignancy, thyroid, or reproductive organs."))
    s.append(PageBreak())

def topic_laser_props(s):
    s.append(banner("TOPIC 13: LASER – PROPERTIES & TYPES",
                    "5-Mark Topic | Write notes on:", 2,
                    "Jun 2022, Nov 2023", TEAL))
    s.append(Spacer(1,0.2*cm))
    s.append(Paragraph("LASER = Light Amplification by Stimulated Emission of Radiation", section_hd))
    s.append(Paragraph("PROPERTIES OF LASER", section_hd))
    s.append(stbl(["Property","Explanation"],[
        ["Monochromatic","Single wavelength — unlike ordinary white light which contains all wavelengths"],
        ["Coherence","All photons are in phase (same frequency, phase, direction) — temporal + spatial coherence"],
        ["Collimation","Beam does not diverge — remains parallel over long distances; high precision targeting"],
        ["High intensity","Very high energy density at the target point"],
        ["Polarisation","Waves vibrate in a single plane"],
    ],[4*cm,12.5*cm]))
    s.append(Spacer(1,0.15*cm))
    s.append(Paragraph("TYPES OF THERAPEUTIC LASERS", section_hd))
    s.append(stbl(["Type","Wavelength","Medium","Key Use"],[
        ["He-Ne (Helium-Neon)","632.8 nm (red, visible)","Gas","Superficial wounds, pain, trigger points"],
        ["GaAs (Gallium Arsenide)","830–904 nm (near infrared)","Semiconductor diode","Deep tissue, arthritis, nerve injuries"],
        ["GaAlAs (Gallium Aluminium Arsenide)","780–870 nm","Semiconductor diode","Pain relief, musculoskeletal"],
        ["Ruby","694 nm (red)","Solid crystal","Dermatology, early therapeutic use"],
        ["Super Luminous Diode (SLD)","Broad spectrum","Semiconductor","Similar to laser but NOT truly coherent"],
    ],[4*cm,3.5*cm,3.5*cm,5*cm]))
    s.append(Spacer(1,0.1*cm))
    s.append(note("SLD (Super Luminous Diode) is NOT a true laser — it lacks coherence. But it has similar biostimulation effects and is safer."))
    s.append(PageBreak())

def topic_cryo_specific(s):
    s.append(banner("TOPIC 14: CRYOTHERAPY – BIOPHYSICS & SPECIFIC APPLICATIONS",
                    "5-Mark Topic | Write notes on:", 2,
                    "Sep 2021 (acute ankle sprain), Nov 2023 (biophysics)", colors.HexColor("#0a5088")))
    s.append(Spacer(1,0.2*cm))
    s.append(Paragraph("BIOPHYSICS OF CRYOTHERAPY", section_hd))
    for pt in ["Cold extracts heat from tissues by <b>conduction</b> (direct contact) or <b>evaporation</b> (vapocoolant spray).",
               "Tissue cooling reduces enzymatic activity and cellular metabolism.",
               "<b>Lewis Hunting Reaction:</b> After 7–10 min of cold → reflex vasodilation (prevents tissue freezing). Repeats cyclically every 7–10 min.",
               "Cold reduces <b>nerve conduction velocity</b> → analgesia (A-delta and C fibres affected first).",
               "Cold reduces <b>muscle spindle activity</b> → decreased muscle tone/spasm.",
               "Cold reduces <b>inflammatory mediator release</b> (histamine, bradykinin, prostaglandins).",
               "Reduces capillary permeability → limits exudate formation → controls oedema."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.15*cm))
    s.append(Paragraph("CRYOTHERAPY IN ACUTE ANKLE SPRAIN", section_hd))
    s.append(Paragraph("Apply <b>RICE protocol</b>: Rest, Ice, Compression, Elevation within first 48 hours.", body))
    for pt in ["Ice pack (crushed ice in wet towel) applied for <b>15–20 minutes</b>.",
               "Apply every 2–3 hours in first 24–48 hours.",
               "Reduces acute swelling, bruising, and pain.",
               "After 48 hours: can begin gentle active movements.",
               "Cryostretch can begin after acute phase — apply ice → stretch while numb.",
               "Cryokinetics: ice analgesia → progressive active exercises."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.1*cm))
    s.append(note("METHODS of cold application: Ice pack, ice massage, ice towel, vapocoolant spray (ethyl chloride / fluoromethane), cold water immersion, cryogenic unit."))
    s.append(PageBreak())

def topic_cryokinetics(s):
    s.append(banner("TOPIC 15: CRYOKINETICS",
                    "5-Mark Topic | Write notes on:", 2,
                    "Jan 2022, Aug 2024", colors.HexColor("#0a5088")))
    s.append(Spacer(1,0.2*cm))
    s.append(Paragraph("DEFINITION", section_hd))
    s.append(Paragraph("<b>Cryokinetics</b> is the combination of <b>cryotherapy (cold application)</b> followed by <b>active exercise</b>. Cold is used to achieve sufficient analgesia (numbness) so that the patient can perform functional exercises without pain inhibition.", body))
    s.append(Paragraph("PROCEDURE", section_hd))
    for pt in ["Apply ice pack / ice immersion to the affected area for <b>10–20 minutes</b> until numbness is achieved.",
               "Test sensation — patient should feel numbness (cannot feel sharp touch).",
               "Immediately perform <b>active progressive exercises</b> (range of motion, weight-bearing).",
               "When sensation returns (warm up), reapply cold for 3–5 minutes.",
               "Repeat cycle 3–5 times per session.",
               "Progress exercise intensity as healing improves."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.15*cm))
    s.append(Paragraph("ADVANTAGES", section_hd))
    for pt in ["Allows earlier mobilisation → faster recovery.",
               "Prevents muscle atrophy from immobilisation.",
               "Maintains joint mobility during healing.",
               "Safe — no risk of burns (no heat involved).",
               "Reduces pain-inhibition reflex that limits exercise."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.1*cm))
    s.append(two_col(
        ["Acute ankle sprain (after 48 h)","Post-fracture rehabilitation","Post-surgical rehabilitation","Ligament injuries","Muscle strains"],
        ["Impaired circulation (PVD)","Raynaud's disease","Cold urticaria","Impaired skin sensation","Open wounds"],
    ))
    s.append(note("COMPARE: Cryokinetics = ice + active exercise. Cryostretch = ice + passive/active stretching. Both use cold analgesia to overcome pain barrier."))
    s.append(PageBreak())

def topic_radiation_energy(s):
    s.append(banner("TOPIC 16: RADIATION ENERGY AND ITS PROPERTIES",
                    "5-Mark Topic | Write notes on:", 2,
                    "Dec 2020, Nov 2023", DARK_BLUE))
    s.append(Spacer(1,0.2*cm))
    s.append(Paragraph("DEFINITION", section_hd))
    s.append(Paragraph("Radiation energy is the transfer of energy through electromagnetic waves (photons) without requiring a material medium. It travels at the speed of light (<b>3 × 10⁸ m/s</b>) in a vacuum.", body))
    s.append(Paragraph("PROPERTIES OF ELECTROMAGNETIC RADIATION", section_hd))
    for pt in ["Travels at speed of light (3 × 10⁸ m/s) in vacuum.",
               "Does NOT need a medium for propagation (unlike ultrasound which needs a medium).",
               "Transverse wave (vibrations perpendicular to direction of travel).",
               "Can be reflected, refracted, diffracted, absorbed, and transmitted.",
               "Obeys Inverse Square Law (intensity ∝ 1/d²).",
               "Obeys Cosine Law (intensity ∝ cos θ).",
               "Higher frequency = higher energy (E = hf, where h = Planck's constant).",
               "Wavelength × Frequency = Speed of light (λ × f = c).",
               "Shows both wave and particle (photon) behaviour."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.15*cm))
    s.append(Paragraph("ELECTROMAGNETIC SPECTRUM (Therapeutic Range)", section_hd))
    s.append(stbl(["Radiation","Wavelength","Therapeutic Use"],[
        ["Shortwave (SWD)","11 m (27.12 MHz)","Deep heating"],
        ["Microwave (MWD)","12.25 cm (2450 MHz)","Deep heating"],
        ["Infrared (IRR)","770 nm – 1 mm","Superficial heating"],
        ["Visible light","400–770 nm","Photobiomodulation (LASER)"],
        ["Ultraviolet (UVR)","100–400 nm","Phototherapy (psoriasis, wounds, vitamin D)"],
    ],[4*cm,4.5*cm,8*cm]))
    s.append(Spacer(1,0.1*cm))
    s.append(note("Radiation energy → Infrared, UV, LASER, SWD, MWD. Acoustic energy → Ultrasound. Electrical energy → TENS, IFT, galvanic. Know the difference."))
    s.append(PageBreak())

def topic_electrode_swd(s):
    s.append(banner("TOPIC 17: ELECTRODE SPACING & POSITIONING IN SWD",
                    "5-Mark Topic | Write notes on:", 2,
                    "Dec 2020, Sep 2021", DARK_BLUE))
    s.append(Spacer(1,0.2*cm))
    s.append(Paragraph("SWD ELECTRODE TYPES", section_hd))
    s.append(stbl(["Electrode Type","Description"],[
        ["Capacitor (condenser) pads","Metal plates enclosed in rubber; placed on either side of body part; electrostatic field"],
        ["Drum (monode) electrode","Coiled conductor inside a drum; placed over area; inductive field"],
        ["Cable / coil electrode","Insulated rubber cable wound around limb; inductive eddy currents"],
        ["Butterfly electrode","Flat coil electrode for back / lumbar spine"],
    ],[5*cm,11*cm]))
    s.append(Spacer(1,0.15*cm))
    s.append(Paragraph("ELECTRODE SPACING RULES", section_hd))
    for pt in ["Spacing between electrode pad and skin: <b>minimum 1–2 cm</b> (use felt spacers or towelling).",
               "<b>Equal spacing on both sides</b> is essential — unequal spacing concentrates heat on the closer side → burn risk.",
               "<b>Larger spacing</b> → deeper, more uniform heating; less surface heating.",
               "<b>Smaller spacing</b> → more superficial, concentrated heating.",
               "If treatment area is curved or uneven → use <b>coplanar</b> or <b>cable method</b> instead.",
               "Always check patient sensation during treatment — should feel warmth, NOT pain."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.15*cm))
    s.append(Paragraph("ELECTRODE POSITIONING METHODS", section_hd))
    s.append(stbl(["Method","Electrode Position","Best For"],[
        ["Bipolar (contraplanar)","One electrode either side of body part","Joints (knee, wrist, shoulder)"],
        ["Coplanar","Both electrodes on same side","Deep central structures"],
        ["Longitudinal","Electrodes along long axis","Limbs"],
        ["Cross-fire","Two treatments at right angles","Pelvic/deep conditions"],
    ],[3.5*cm,5.5*cm,7*cm]))
    s.append(Spacer(1,0.1*cm))
    s.append(note("DANGERS: Metal in field = heat concentrator → focal burn. Moist dressings under electrode = steam burn. Jewellery MUST be removed."))
    s.append(PageBreak())

def topic_cable_swd(s):
    s.append(banner("TOPIC 18: CABLE METHOD OF SWD",
                    "5-Mark Topic | Write notes on:", 2,
                    "Jun 2022, Nov 2023", DARK_BLUE))
    s.append(Spacer(1,0.2*cm))
    s.append(Paragraph("DEFINITION", section_hd))
    s.append(Paragraph("The cable (coil) method is an <b>inductive method</b> of SWD application. A rubber-insulated cable carrying the high-frequency current is wound in coils around the limb. The alternating current in the cable induces <b>eddy currents</b> in the underlying tissues, producing heat.", body))
    s.append(Paragraph("TECHNIQUE", section_hd))
    for pt in ["Cable is wound around the limb in <b>non-overlapping coils</b>.",
               "Each turn of the cable is separated by <b>2–3 cm</b> (turns must NOT touch each other or the patient's skin).",
               "The cable must be <b>insulated</b> from patient skin — wrap in towelling if needed.",
               "Usually <b>3–6 turns</b> around a limb.",
               "The electromagnetic field induced is strongest in tissues <b>closest to the cable</b>.",
               "Direction of current in adjacent coils must be <b>same direction</b> for additive effect."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.15*cm))
    s.append(Paragraph("ADVANTAGES", section_hd))
    for pt in ["Can treat <b>irregular surfaces</b> (ankle, forearm, knee).",
               "Even heating along length of limb.",
               "Good for treating conditions affecting the whole limb (e.g., arthritis of hand/wrist/forearm).",
               "No electrode spacing error possible (unlike pad method)."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.1*cm))
    s.append(note("PRECAUTION: Cable turns must NOT touch — touching causes short-circuit, uneven heating, or burn. Check insulation before use. Keep turns parallel and evenly spaced."))
    s.append(PageBreak())

def topic_pswd(s):
    s.append(banner("TOPIC 19: PULSED SHORTWAVE DIATHERMY (PSWD)",
                    "5-Mark Topic | Write notes on:", 2,
                    "Apr 2023, Feb 2025", DARK_BLUE))
    s.append(Spacer(1,0.2*cm))
    s.append(Paragraph("DEFINITION", section_hd))
    s.append(Paragraph("Pulsed Shortwave Diathermy (PSWD) uses the same <b>27.12 MHz</b> electromagnetic frequency as SWD but delivers energy in short <b>intermittent bursts (pulses)</b>. The long OFF time between pulses allows heat to dissipate → <b>non-thermal (athermal) effects dominate</b>. Also called Pulsed Electromagnetic Energy (PEME).", body))
    s.append(Paragraph("PULSE PARAMETERS", section_hd))
    s.append(stbl(["Parameter","Description","Values"],[
        ["Pulse duration","Duration of each ON pulse","65–400 microseconds"],
        ["Pulse frequency","Number of pulses per second","15–200 Hz"],
        ["Duty cycle","ON time / (ON + OFF) × 100","Low = 1–10% → minimal heat"],
        ["Peak power","Power during ON phase","Up to 1000 W (very brief)"],
        ["Mean power","Average power","Very low (heat dissipates during OFF)"],
    ],[4*cm,7*cm,5*cm]))
    s.append(Spacer(1,0.15*cm))
    s.append(Paragraph("NON-THERMAL EFFECTS", section_hd))
    for pt in ["Increased cell membrane permeability → ion exchange, reduces oedema.",
               "Stimulates fibroblast proliferation → tissue repair.",
               "Reduces post-traumatic oedema and haematoma.",
               "Pain relief (bradykinin, substance P reduction).",
               "Stimulates macrophage activity → phagocytosis.",
               "Promotes nerve regeneration."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.1*cm))
    s.append(note("KEY POINT: PSWD = same machine/frequency as SWD, but PULSED output → non-thermal effects → SAFE for ACUTE conditions, oedema, and (with care) near metal implants."))
    s.append(PageBreak())

def topic_irr_types(s):
    s.append(banner("TOPIC 20: INFRARED RADIATION – TYPES & LAMPS",
                    "5-Mark Topic | Write notes on:", 2,
                    "Dec 2020 (Luminous/Non-luminous), Sep 2021 (Types of IR lamps)", BROWN))
    s.append(Spacer(1,0.2*cm))
    s.append(stbl(["Feature","Luminous (Near IR)","Non-luminous (Far IR)"],[
        ["Wavelength","770–1500 nm (shorter)","1500 nm – 1 mm (longer)"],
        ["Filament temp","~2500°C","400–500°C"],
        ["Visible glow","Yes (red glow)","No (invisible)"],
        ["Warm-up time","Instant (no warm-up)","15–20 minutes warm-up"],
        ["Penetration depth","Deeper (up to 10 mm)","Superficial (1–3 mm)"],
        ["Heat production","More heat in deeper tissues","More superficial heating"],
        ["Treatment distance","45–75 cm","45–75 cm"],
        ["Examples","Radiant heat lamp, tungsten filament bulb, Sollux lamp","Electrically heated carbon element / coil lamp"],
        ["Advantages","Instant on/off, suitable for short sessions","More uniform superficial heat"],
    ],[4*cm,6*cm,6*cm]))
    s.append(Spacer(1,0.15*cm))
    s.append(Paragraph("TREATMENT TECHNIQUE (Both Types)", section_hd))
    for pt in ["Expose area; clean and dry skin; remove jewellery.",
               "Non-luminous: warm up 15–20 min before application.",
               "Position lamp at <b>45–75 cm</b>, <b>perpendicular</b> to skin (Cosine Law).",
               "Check sensation every 2–3 minutes.",
               "Duration: <b>15–30 minutes</b>.",
               "Cover eyes with wet pads."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.1*cm))
    s.append(note("REMEMBER: Luminous = brighter, deeper, quicker. Non-luminous = duller, more superficial, needs warm-up time."))
    s.append(PageBreak())

def topic_irr_effects(s):
    s.append(banner("TOPIC 21: INFRARED RADIATION – PHYSIOLOGICAL & THERAPEUTIC EFFECTS",
                    "5-Mark Topic | Write notes on:", 2,
                    "Nov 2023, Aug 2025", BROWN))
    s.append(Spacer(1,0.2*cm))
    s.append(Paragraph("PHYSIOLOGICAL EFFECTS", section_hd))
    for pt in ["<b>Vasodilation:</b> Local hyperaemia — increased blood flow to skin and superficial muscle.",
               "<b>Increased metabolism:</b> Van't Hoff's law — metabolic rate doubles per 10°C rise; increased O₂ consumption.",
               "<b>Sedation:</b> Heat depresses sensory nerve endings → pain relief and muscle relaxation.",
               "<b>Muscle relaxation:</b> Heat reduces muscle spindle sensitivity → reduced spasm.",
               "<b>Increased cell activity:</b> Fibroblast and leucocyte activity stimulated → tissue repair.",
               "<b>Sweating:</b> Reflex sweating to dissipate excess heat.",
               "<b>Skin erythema:</b> Superficial reddening (diffuse, not fixed like UVR erythema — disappears quickly)."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.15*cm))
    s.append(Paragraph("THERAPEUTIC EFFECTS", section_hd))
    for pt in ["Pain relief: chronic musculoskeletal pain, neuralgia, arthralgia.",
               "Relief of muscle spasm: back pain, neck pain.",
               "Preparation for massage, mobilisation, and exercises.",
               "Resolution of chronic inflammation.",
               "Wound healing (secondary benefit via vasodilation).",
               "Relaxation and general sedative effect."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.1*cm))
    s.append(note("IRR PRECAUTIONS: Always cover eyes. Patient must NOT fall asleep during treatment. Check sensation before (never apply to anaesthetic skin). Do NOT apply immediately after cold treatment."))
    s.append(PageBreak())

def topic_kromayer(s):
    s.append(banner("TOPIC 22: KROMAYER LAMP",
                    "5-Mark Topic | Write notes on:", 2,
                    "Oct 2022, Nov 2023", PURPLE))
    s.append(Spacer(1,0.2*cm))
    s.append(Paragraph("DEFINITION", section_hd))
    s.append(Paragraph("The Kromayer lamp is a <b>water-cooled, low-pressure mercury vapour lamp</b> made of quartz glass. It emits predominantly <b>UVC (100–280 nm)</b> with some UVB. It is a <b>cold quartz lamp</b> — water cooling keeps the outer surface cool enough for <b>direct contact</b> with skin.", body))
    s.append(Paragraph("CONSTRUCTION", section_hd))
    for pt in ["Mercury vapour enclosed in a quartz tube (quartz transmits UVC; ordinary glass blocks it).",
               "Surrounded by a water jacket for cooling.",
               "Available in various shapes: flat, cylindrical, and tunnel-shaped applicators.",
               "Operates at low pressure — emits mainly UVC (bactericidal wavelengths)."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.15*cm))
    s.append(Paragraph("USES / THERAPEUTIC APPLICATIONS", section_hd))
    for pt in ["<b>Wound treatment</b> (most common use): bactericidal UVC cleans infected wounds.",
               "<b>Pressure sores:</b> UVC promotes granulation tissue and healing.",
               "<b>Ulcers</b> (varicose, diabetic): local UVC irradiation at E3 dose.",
               "<b>Acne vulgaris:</b> Bactericidal effect on Propionibacterium acnes.",
               "<b>Sinusitis:</b> Quartz rod applicator inserted into nasal cavity.",
               "<b>Infected conditions:</b> Impetigo, infected eczema (local)."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.15*cm))
    s.append(Paragraph("DOSAGE", section_hd))
    for pt in ["Determine MED (Minimal Erythema Dose) first.",
               "For wounds/ulcers: Use <b>E3 dose</b> (2nd degree erythema — intense redness, mild oedema).",
               "Placed in <b>direct contact</b> with skin (unlike other UV sources which need distance).",
               "Treatment area is small and localized."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.1*cm))
    s.append(note("KEY FEATURE: Kromayer = CONTACT lamp (water-cooled cool surface). Alpine Sun = AIR-COOLED lamp (needs 45–75 cm distance). Both are UV sources but different applications."))
    s.append(PageBreak())

def topic_theraktin(s):
    s.append(banner("TOPIC 23: THERAKTIN TUNNEL",
                    "5-Mark Topic | Write notes on:", 2,
                    "Nov 2023, Feb 2025", PURPLE))
    s.append(Spacer(1,0.2*cm))
    s.append(Paragraph("DEFINITION", section_hd))
    s.append(Paragraph("The Theraktin tunnel is a <b>whole-body UVR irradiation device</b> consisting of a tunnel-shaped cabinet lined with multiple <b>fluorescent UV lamps</b>. The patient lies inside the tunnel and receives uniform ultraviolet radiation over the entire body surface.", body))
    s.append(Paragraph("CONSTRUCTION", section_hd))
    for pt in ["Tunnel-shaped cabinet approximately 2 m long.",
               "Lined with <b>UVB + UVA fluorescent lamps</b> on all surfaces.",
               "Patient lies on a trolley that slides inside the tunnel.",
               "Timed exposure control.",
               "Ventilation fan to prevent overheating."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.15*cm))
    s.append(Paragraph("USES", section_hd))
    for pt in ["<b>Psoriasis:</b> Most common use — whole-body UVB treatment; efficient for widespread psoriasis.",
               "<b>Generalised skin conditions:</b> Widespread eczema, generalised pruritus.",
               "<b>Vitamin D synthesis:</b> For patients with rickets or vitamin D deficiency.",
               "<b>General tonic effect:</b> Stimulates pigmentation and immune response."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.15*cm))
    s.append(Paragraph("PROCEDURE", section_hd))
    for pt in ["Determine MED before first treatment.",
               "Patient removes all clothing; eyes protected with UV goggles.",
               "Slides into tunnel on trolley.",
               "Exposure starts at sub-erythemal or E1 dose; increased by 10–15% per session.",
               "Typical session: <b>2–3 times per week</b>; 15–30 sessions for psoriasis."]:
        s.append(bullet(pt))
    s.append(Spacer(1,0.1*cm))
    s.append(note("COMPARE: Theraktin tunnel = whole-body UVR (tunnel shape, patient inside). PUVA cabinet = whole-body UVA (patient stands inside box). Kromayer = LOCAL treatment only (contact lamp)."))
    s.append(PageBreak())

# ══════════════════════════════════════════════════════════════════════════════
# QUICK REVISION
# ══════════════════════════════════════════════════════════════════════════════
def build_revision(s):
    s.append(Paragraph("QUICK REVISION — 5-MARK TOPICS AT A GLANCE", S("rh",fontSize=16,textColor=DARK_BLUE,fontName="Helvetica-Bold",alignment=TA_CENTER,spaceAfter=8)))
    s.append(HRFlowable(width="100%",thickness=1,color=MID_BLUE))
    s.append(Spacer(1,0.3*cm))
    s.append(stbl(
        ["#","Topic","Key Device / Temp","Times Asked"],
        [
            ["1","Wax Therapy (methods)","Paraffin wax 42–52°C; 6:1 ratio","6x"],
            ["2","Wax Therapy (effects)","Superficial heat; 1–2 cm penetration","4x"],
            ["3","Whirlpool Bath","Turbine motor; 37–43°C (warm); Hubbard tank","4x"],
            ["4","Phonophoresis","Ultrasound + drug gel; 1 MHz deep, 3 MHz superficial","4x"],
            ["5","Microwave Diathermy","Magnetron; 2450 MHz; 5–10 cm air gap","4x"],
            ["6","Hydrocollator Packs","Silica gel; heated at 71–79°C; 6–8 towel layers","4x"],
            ["7","Ultrasound Techniques","Direct contact / Water bath / Bladder method","4x"],
            ["8","Cryotherapy (effects)","0–18°C; Lewis hunting reaction; RICE protocol","3x"],
            ["9","Laws of Radiation","Inverse Square Law (1/d²); Cosine Law (cosθ)","3x"],
            ["10","PUVA","Psoralen + UVA; psoriasis, vitiligo","3x"],
            ["11","Contrast Bath","Warm 38–44°C / Cold 10–18°C; ratio 4:1","3x"],
            ["12","LASER Techniques","Contact / Non-contact / Scanning / Cluster","2x"],
            ["13","LASER Properties/Types","Monochromatic, Coherent, Collimated; He-Ne / GaAs","2x"],
            ["14","Cryotherapy (biophysics/specific)","Lewis hunting; ankle sprain RICE","2x"],
            ["15","Cryokinetics","Ice → analgesia → active exercise; faster rehab","2x"],
            ["16","Radiation Energy","EM spectrum; λ×f=c; E=hf","2x"],
            ["17","Electrode Spacing SWD","Equal spacing; 1–2 cm min; larger = deeper","2x"],
            ["18","Cable Method SWD","Coil around limb; non-overlapping; inductive field","2x"],
            ["19","Pulsed SWD","27.12 MHz pulsed; non-thermal; safe for acute","2x"],
            ["20","IR Types & Lamps","Luminous (instant) vs Non-luminous (15 min warm-up)","2x"],
            ["21","IR Physiological Effects","Vasodilation; sedation; muscle relaxation","2x"],
            ["22","Kromayer Lamp","Water-cooled; quartz; UVC; contact application","2x"],
            ["23","Theraktin Tunnel","Whole-body UVR; fluorescent UV lamps; psoriasis","2x"],
        ],
        [0.7*cm,7.5*cm,5.5*cm,1.8*cm]
    ))
    s.append(Spacer(1,0.3*cm))
    s.append(Paragraph("HIGH-YIELD ONE-LINERS FOR 5-MARK SECTION", S("hl",fontSize=13,textColor=DARK_BLUE,fontName="Helvetica-Bold",spaceAfter=6)))
    for ol in [
        "Paraffin wax temp: 42–52°C. Wax:oil = 6:1. Dipping = most common method for hands/feet.",
        "Hydrocollator heated at 71–79°C; applied with 6–8 towel layers; patient MUST NOT lie on it.",
        "Whirlpool: warm = 37–40°C; hot = 40–43°C; cold = 15–18°C. Turbine produces mechanical + thermal + buoyancy effects.",
        "Phonophoresis: ultrasound drives drugs (hydrocortisone, diclofenac) through skin. 1 MHz = deep, 3 MHz = superficial.",
        "MWD frequency: 2450 MHz. Device: Magnetron. Director air gap: 5–10 cm. Tridymite = ceramic window.",
        "Laws of Radiation: Inverse Square Law (I ∝ 1/d²); Cosine Law (I = I₀ cos θ).",
        "PUVA = Psoralen + UVA. Used for psoriasis, vitiligo. 2–3 sessions/week. Eye protection mandatory.",
        "Contrast bath: warm 38–44°C / cold 10–18°C; ratio 4:1 minutes; end with warm (or cold for acute oedema).",
        "Cryokinetics = ice → numb → active exercise. Cryostretch = ice → stretch. Both use cold analgesia.",
        "Lewis hunting reaction = reflex vasodilation after 7–10 min of cold (prevents tissue damage).",
        "Electrode spacing SWD: equal both sides; min 1–2 cm; larger spacing = deeper heating.",
        "Cable method SWD: coil wound around limb; turns must NOT touch each other (short-circuit risk).",
        "PSWD = pulsed SWD; non-thermal effects dominate; safe for acute oedema and injuries.",
        "Luminous IR lamp: instant ON, 770–1500 nm, deeper. Non-luminous: 15-20 min warm-up, 1500 nm-1 mm, superficial.",
        "Kromayer = cold quartz water-cooled UVC lamp; CONTACT application; wounds, ulcers, acne.",
        "Theraktin tunnel = whole-body UVR tunnel; fluorescent UV lamps; used for psoriasis.",
        "LASER properties: Monochromatic + Coherent + Collimated + Polarised. He-Ne = red (632 nm). GaAs = near IR (830 nm).",
        "Cryotherapy CIs: Raynaud's, cold urticaria, PVD, impaired sensation, cryoglobulinaemia.",
    ]:
        s.append(bullet(ol))
    s.append(PageBreak())

# ══════════════════════════════════════════════════════════════════════════════
# BUILD
# ══════════════════════════════════════════════════════════════════════════════
def build():
    doc = SimpleDocTemplate(
        OUTPUT, pagesize=A4,
        leftMargin=2*cm, rightMargin=2*cm,
        topMargin=2*cm, bottomMargin=2*cm,
        title="Electrotherapy II 5-Mark Study Guide",
    )
    s = []
    build_cover(s)
    build_toc(s)
    topic_wax_methods(s)
    topic_wax_effects(s)
    topic_whirlpool(s)
    topic_phonophoresis(s)
    topic_mwd(s)
    topic_hydrocollator(s)
    topic_us_techniques(s)
    topic_cryo_effects(s)
    topic_laws_radiation(s)
    topic_puva(s)
    topic_contrast_bath(s)
    topic_laser_tech(s)
    topic_laser_props(s)
    topic_cryo_specific(s)
    topic_cryokinetics(s)
    topic_radiation_energy(s)
    topic_electrode_swd(s)
    topic_cable_swd(s)
    topic_pswd(s)
    topic_irr_types(s)
    topic_irr_effects(s)
    topic_kromayer(s)
    topic_theraktin(s)
    build_revision(s)
    doc.build(s)
    print(f"PDF saved: {OUTPUT}")

build()
Running Command

cd /home/daytona/workspace/study-guide && python3 generate_5mark_guide.py 2>&1

Running Command

ls -lh /home/daytona/workspace/study-guide/Electrotherapy_II_5Mark_StudyGuide.pdf

Your 5-mark study guide PDF is ready! Download it here:

Electrotherapy II 5Mark StudyGuide

PDF Document · PDF


Here is exactly what is inside the PDF:
Cover Page - BPT Third Year, 5-Mark Exam Study Guide branding
Table of Contents - All 23 topics with repeat count and priority level (HIGH / MED / LOW)
23 Full Topic Notes (one topic per chapter):
#TopicTimes Asked
1Wax Therapy - Methods of Application6x
2Wax Therapy - Physiological & Therapeutic Effects4x
3Whirlpool Bath4x
4Phonophoresis / Ultrasonophoresis4x
5Microwave Diathermy (MWD)4x
6Hydrocollator Packs4x
7Techniques of Ultrasound Application4x
8Cryotherapy - Physiological & Therapeutic Effects3x
9Laws Governing Radiation3x
10PUVA Therapy / Apparatus3x
11Contrast Bath3x
12LASER - Techniques of Application2x
13LASER - Properties & Types2x
14Cryotherapy - Biophysics & Specific Uses2x
15Cryokinetics2x
16Radiation Energy and Properties2x
17Electrode Spacing & Positioning of SWD2x
18Cable Method of SWD2x
19Pulsed Shortwave Diathermy (PSWD)2x
20Infrared Radiation - Types & Lamps2x
21Infrared Radiation - Physiological Effects2x
22Kromayer Lamp2x
23Theraktin Tunnel2x
Each topic includes: Definition, mechanism/construction, physiological effects, therapeutic effects, technique/parameters, indications & contraindications (side-by-side tables), and highlighted exam tips.
Quick Revision Section: Master summary table + 18 high-yield one-liners for last-minute revision.

This pdf is my subject previous year questions give me the repeted questions in every year in 2 mark and also give me the each every questions how many time asked and give me all 2 mark please

Running Command

python3 << 'EOF' import pdfplumber with pdfplumber.open("/home/daytona/workspace/attachments/e23a85d9-31bc-4e79-b9c0-b1ca546c86f5/HF (2).pdf") as pdf: print(f"Total pages: {len(pdf.pages)}") for i, page in enumerate(pdf.pages): text = page.extract_text() print(f"\n===== PAGE {i+1} =====") print(text) EOF

Running Command

python3 << 'EOF' from collections import defaultdict two_mark = { "Dec 2020": [ "Electrode spacing for SWD", "Electrostatic field", "Reverse piezo electric effect", "Nodes and Antinodes", "Ultrasonic field", "Photosensitization", "Super luminous diode Laser", "Dangers of SWD", "Properties of laser", "Hubbard Tank", ], "Sep 2021": [ "Drugs used in Phonophoresis", "Difference between 1MHz & 3MHz frequency in ultrasound", "PUVA regimen", "Use of butterfly electrode in SWD", "Refraction", "Properties of High frequency currents", "Laws governing radiation", "Coherence", "Fluidotherapy", "Name the sensitizers used in UVR", ], "Jan 2022": [ "Electric burn", "Triode valve", "Nodes & Antinodes", "Care of UVR lamp", "What is Pulsed Electro Magnetic energy", "Joule's law", "Types of pain / Contraindications of MWD", "Whirl pool bath", "Electro magnetic spectrum", "Duty Cycle", ], "Jun 2022": [ "Buoyancy", "Cosine law", "Eddy currents", "Heliotherapy", "Cold LASER", "Erythema", "Indications of Wax Therapy", "Define Ultrasound", "Quick Ice", "Duty Cycle", ], "Oct 2022": [ "Grid", "Tridymite formation", "Minimal Erythema Dose (MED)", "Cryostretch", "Prevention of Periosteal Pain in Ultrasonic Therapy", "Pressure Sore", "Ice Towel Method", "Attenuation", "Conduction", "Desquamation", ], "Apr 2023": [ "Hydro collator pack", "Cryo stretch", "Tridymite formation", "Coupling media", "PUVA", "Acne Vulgaris", "Kromayer Lamp", "Sensitizers", "Ice pack", "Physical effects of Heat", ], "Nov 2023": [ "Structure of skin", "Laws of refraction", "Precautions of Ultra violet radiations", "Ice massage", "Contrast Bath", "Psoriasis", "Cooling of lamp", "Ohms Law", "Indications and contraindications of Microwave Diathermy", "Preparation of short wave diathermy machine", ], "Aug 2024": [ "Inductance", "Lewis Hunting reaction", "PUVA", "Photosensitisers", "Cold pack", "Types of LASER", "Moist Hot packs", "Mercury vapor lamp and its uses", "Ice burn", "Magnetron", ], "Feb 2025": [ "Cryo kinetics", "Erythema", "Psoriasis", "Helium-neon laser", "Drugs used in phonophoresis", "Piezo electric effect", "Adhesive capsulitis", "Cryospray", "Layers of Skin", "Cooling lamp", ], "Aug 2025": [ "Ruby LASER", "Cavitation", "Cryostretch", "Lewis hunting reaction", "Tenosynovitis", "Hubbard tank", "Ohm's law", "Magnetron", "Rickets", "Treatment for Acne", ], } # Normalise for grouping clusters = { "Duty Cycle": ["Duty Cycle", "Duty Cycle"], "Nodes and Antinodes": ["Nodes and Antinodes", "Nodes & Antinodes"], "Erythema": ["Erythema", "Erythema"], "Cryostretch": ["Cryostretch", "Cryo stretch", "Cryostretch"], "Tridymite Formation": ["Tridymite formation", "Tridymite formation"], "PUVA / PUVA Regimen": ["PUVA regimen", "PUVA", "PUVA"], "Lewis Hunting Reaction": ["Lewis Hunting reaction", "Lewis hunting reaction"], "Psoriasis": ["Psoriasis", "Psoriasis"], "Magnetron": ["Magnetron", "Magnetron"], "Ohm's Law": ["Ohms Law", "Ohm's law"], "Drugs used in Phonophoresis": ["Drugs used in Phonophoresis", "Drugs used in phonophoresis"], "Sensitizers (UVR)": ["Name the sensitizers used in UVR", "Sensitizers"], "Photosensitization / Photosensitisers": ["Photosensitization", "Photosensitisers"], "Properties of Laser": ["Properties of laser", "Super luminous diode Laser"], "Types of LASER / Cold LASER": ["Cold LASER", "Types of LASER"], "Hubbard Tank": ["Hubbard Tank", "Hubbard tank"], "Kromayer Lamp": ["Kromayer Lamp"], "Layers / Structure of Skin": ["Structure of skin", "Layers of Skin"], "Laws Governing Radiation": ["Laws governing radiation"], "Cosine Law": ["Cosine law"], "Cooling of Lamp": ["Cooling of lamp", "Cooling lamp"], "Electrode Spacing for SWD": ["Electrode spacing for SWD"], "Dangers of SWD": ["Dangers of SWD"], "Minimal Erythema Dose (MED)": ["Minimal Erythema Dose (MED)"], "Electromagnetic Spectrum": ["Electro magnetic spectrum"], "Ice Burn": ["Ice burn"], "Ice pack / Cold pack": ["Ice pack", "Cold pack"], "Hydrocollator Pack": ["Hydro collator pack"], "Coupling Media / Couplants": ["Coupling media"], "Cryokinetics": ["Cryo kinetics"], "Piezoelectric Effect": ["Piezo electric effect", "Reverse piezo electric effect"], "Contrast Bath": ["Contrast Bath"], "Pulsed Electromagnetic Energy": ["What is Pulsed Electro Magnetic energy"], "Moist Hot Packs": ["Moist Hot packs"], "Heliotherapy": ["Heliotherapy"], "Buoyancy": ["Buoyancy"], "Eddy Currents": ["Eddy currents"], "Coherence": ["Coherence"], "Fluidotherapy": ["Fluidotherapy"], "Triode Valve": ["Triode valve"], "Joule's Law": ["Joule's law"], "Whirlpool Bath": ["Whirl pool bath"], "Electrostatic Field": ["Electrostatic field"], "Ultrasonic Field": ["Ultrasonic field"], "Define Ultrasound": ["Define Ultrasound"], "Attenuation": ["Attenuation"], "Quick Ice": ["Quick Ice"], "Indications of Wax Therapy": ["Indications of Wax Therapy"], "Electric burn": ["Electric burn"], "Care of UVR Lamp": ["Care of UVR lamp"], "Contraindications of MWD": ["Types of pain / Contraindications of MWD","Indications and contraindications of Microwave Diathermy"], "Prevention of Periosteal Pain": ["Prevention of Periosteal Pain in Ultrasonic Therapy"], "Pressure Sore": ["Pressure Sore"], "Ice Towel Method": ["Ice Towel Method"], "Conduction": ["Conduction"], "Desquamation": ["Desquamation"], "Grid": ["Grid"], "Acne Vulgaris": ["Acne Vulgaris"], "Ice Massage": ["Ice massage"], "Preparation of SWD Machine": ["Preparation of short wave diathermy machine"], "Laws of Refraction": ["Laws of refraction", "Refraction"], "Precautions of UVR": ["Precautions of Ultra violet radiations"], "Inductance": ["Inductance"], "Physical Effects of Heat": ["Physical effects of Heat"], "Cryospray": ["Cryospray"], "Adhesive Capsulitis": ["Adhesive capsulitis"], "Helium-Neon Laser": ["Helium-neon laser"], "Ruby LASER": ["Ruby LASER"], "Cavitation": ["Cavitation"], "Tenosynovitis": ["Tenosynovitis"], "Rickets": ["Rickets"], "Treatment for Acne": ["Treatment for Acne"], "Mercury Vapor Lamp": ["Mercury vapor lamp and its uses"], "Use of Butterfly Electrode": ["Use of butterfly electrode in SWD"], "Properties of HF Currents": ["Properties of High frequency currents"], "Difference 1MHz vs 3MHz US": ["Difference between 1MHz & 3MHz frequency in ultrasound"], "Filters in UVR": [], } # Compute years for each cluster result = {} for cluster, keywords in clusters.items(): years_found = [] for year, qs in two_mark.items(): for q in qs: for kw in keywords: if kw.lower() in q.lower() or q.lower() in kw.lower(): if year not in years_found: years_found.append(year) break if years_found: result[cluster] = years_found sorted_result = sorted(result.items(), key=lambda x: -len(x[1])) print("="*90) print("ALL 2-MARK QUESTIONS — COMPLETE TOPIC-WISE FREQUENCY ANALYSIS") print("="*90) print(f"\n{'Topic':<55} {'Count':<8} {'Years Asked'}") print("-"*90) for topic, years in sorted_result: print(f"{topic:<55} {len(years):<8} {', '.join(years)}") print("\n\n" + "="*90) print("REPEATED QUESTIONS (Asked 2 or more times)") print("="*90) for topic, years in sorted_result: if len(years) >= 2: print(f"\n[{len(years)}x] {topic}") print(f" Years: {', '.join(years)}") EOF

Here is the complete analysis of all 2-mark questions across all 10 papers:

ALL 2-MARK QUESTIONS — COMPLETE LIST (Year-wise)

Dec 2020: Electrode spacing for SWD | Electrostatic field | Reverse piezoelectric effect | Nodes and Antinodes | Ultrasonic field | Photosensitization | Super luminous diode Laser | Dangers of SWD | Properties of laser | Hubbard Tank
Sep 2021: Drugs used in Phonophoresis | Difference between 1MHz & 3MHz in ultrasound | PUVA regimen | Use of butterfly electrode in SWD | Refraction | Properties of High frequency currents | Laws governing radiation | Coherence | Fluidotherapy | Name the sensitizers used in UVR
Jan 2022: Electric burn | Triode valve | Nodes & Antinodes | Care of UVR lamp | Pulsed Electromagnetic energy | Joule's law | Contraindications of MWD | Whirlpool bath | Electromagnetic spectrum | Duty Cycle
Jun 2022: Buoyancy | Cosine law | Eddy currents | Heliotherapy | Cold LASER | Erythema | Indications of Wax Therapy | Define Ultrasound | Quick Ice | Duty Cycle
Oct 2022: Grid | Tridymite formation | Minimal Erythema Dose (MED) | Cryostretch | Prevention of Periosteal Pain in Ultrasound | Pressure Sore | Ice Towel Method | Attenuation | Conduction | Desquamation
Apr 2023: Hydrocollator pack | Cryostretch | Tridymite formation | Coupling media | PUVA | Acne Vulgaris | Kromayer Lamp | Sensitizers | Ice pack | Physical effects of Heat
Nov 2023: Structure of skin | Laws of refraction | Precautions of UVR | Ice massage | Contrast Bath | Psoriasis | Cooling of lamp | Ohm's Law | Indications & CI of Microwave Diathermy | Preparation of SWD machine
Aug 2024: Inductance | Lewis Hunting reaction | PUVA | Photosensitisers | Cold pack | Types of LASER | Moist Hot packs | Mercury vapor lamp and its uses | Ice burn | Magnetron
Feb 2025: Cryokinetics | Erythema | Psoriasis | Helium-neon laser | Drugs used in phonophoresis | Piezoelectric effect | Adhesive capsulitis | Cryospray | Layers of Skin | Cooling lamp
Aug 2025: Ruby LASER | Cavitation | Cryostretch | Lewis hunting reaction | Tenosynovitis | Hubbard tank | Ohm's law | Magnetron | Rickets | Treatment for Acne

REPEATED TOPICS — FREQUENCY TABLE (Most Repeated First)

RankTopicTimes AskedYears
1Erythema3xJun 2022, Oct 2022, Feb 2025
1Cryostretch3xOct 2022, Apr 2023, Aug 2025
1PUVA / PUVA Regimen3xSep 2021, Apr 2023, Aug 2024
1Minimal Erythema Dose (MED)3xJun 2022, Oct 2022, Feb 2025
5Duty Cycle2xJan 2022, Jun 2022
5Nodes and Antinodes2xDec 2020, Jan 2022
5Tridymite Formation2xOct 2022, Apr 2023
5Lewis Hunting Reaction2xAug 2024, Aug 2025
5Psoriasis2xNov 2023, Feb 2025
5Magnetron2xAug 2024, Aug 2025
5Ohm's Law2xNov 2023, Aug 2025
5Drugs used in Phonophoresis2xSep 2021, Feb 2025
5Sensitizers (UVR)2xSep 2021, Apr 2023
5Photosensitization / Photosensitisers2xDec 2020, Aug 2024
5Types of LASER / Cold LASER2xJun 2022, Aug 2024
5Hubbard Tank2xDec 2020, Aug 2025
5Layers / Structure of Skin2xNov 2023, Feb 2025
5Cooling of Lamp (UVR)2xNov 2023, Feb 2025
5Ice pack / Cold pack2xApr 2023, Aug 2024
5Piezoelectric Effect2xDec 2020, Feb 2025
5Contraindications of MWD2xJan 2022, Nov 2023
5Laws of Refraction2xSep 2021, Nov 2023

KEY EXAM TAKEAWAYS (2-Mark Section)

  • Erythema, Cryostretch, PUVA, and MED - each appeared 3 times - top priority short answers. Learn definitions + 2-3 key lines for each.
  • 22 topics repeated in 2 or more papers — 2-mark answers only need 3-5 crisp lines; definition + key point.
  • Magnetron, Lewis Hunting Reaction, Ohm's Law — all appeared in the last 2 consecutive papers (Aug 2024 + Aug 2025) — very likely to repeat.
  • Psoriasis, Layers of Skin, Cooling of Lamp — all appeared in Nov 2023 + Feb 2025 — rising trend.
  • Piezoelectric Effect appeared as both Reverse piezoelectric (Dec 2020) and Piezoelectric effect (Feb 2025).

Create a study guide pdf with summary notes for all above the frequency table

Writing File

~/study-guide/generate_2mark_guide.py

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

OUTPUT = "/home/daytona/workspace/study-guide/Electrotherapy_II_2Mark_StudyGuide.pdf"

# ── palette ───────────────────────────────────────────────────────────────────
DARK_BLUE   = colors.HexColor("#1a3c6e")
MID_BLUE    = colors.HexColor("#2563ae")
LIGHT_BLUE  = colors.HexColor("#dce8f8")
GOLD        = colors.HexColor("#f0a500")
LIGHT_GREY  = colors.HexColor("#f4f6fb")
MID_GREY    = colors.HexColor("#8d99ae")
GREEN_LIGHT = colors.HexColor("#d4edda")
WARN_BG     = colors.HexColor("#fff3cd")
WARN_BORDER = colors.HexColor("#f0a500")
PURPLE      = colors.HexColor("#5a007a")
TEAL        = colors.HexColor("#006060")
BROWN       = colors.HexColor("#7a2d00")
GREEN_D     = colors.HexColor("#1a4f3a")
RED_BG      = colors.HexColor("#fde8e8")
RED_D       = colors.HexColor("#c0392b")

def S(name, **kw): return ParagraphStyle(name, **kw)

body    = S("body",   fontSize=10, fontName="Helvetica",      leading=14, spaceAfter=3, alignment=TA_JUSTIFY)
bul     = S("bul",    fontSize=10, fontName="Helvetica",      leading=13, spaceAfter=2, leftIndent=14, firstLineIndent=-10)
sub_hd  = S("subhd",  fontSize=11, textColor=MID_BLUE,        fontName="Helvetica-Bold", spaceBefore=5, spaceAfter=2, leading=14)
sec_hd  = S("sechd",  fontSize=12, textColor=DARK_BLUE,       fontName="Helvetica-Bold", spaceBefore=6, spaceAfter=3, leading=16)
note_st = S("note",   fontSize=10, fontName="Helvetica-Oblique", textColor=colors.HexColor("#5a4000"), leading=13, leftIndent=6, rightIndent=6)
small   = S("small",  fontSize=9,  fontName="Helvetica",      textColor=MID_GREY, leading=12)
ch_tit  = S("chtit",  fontSize=15, textColor=colors.white,    fontName="Helvetica-Bold", alignment=TA_LEFT, leading=20)
ch_sub  = S("chsub",  fontSize=9,  textColor=GOLD,            fontName="Helvetica-Bold", leading=13)
ch_frq  = S("chfrq",  fontSize=8,  textColor=colors.white,    fontName="Helvetica",      leading=11)

def B(text):
    return Paragraph(f"\u2022  {text}", bul)

def note(text):
    t = Table([[Paragraph(text, note_st)]], colWidths=[16.4*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND",   (0,0),(-1,-1), WARN_BG),
        ("BOX",          (0,0),(-1,-1), 1.0, WARN_BORDER),
        ("TOPPADDING",   (0,0),(-1,-1), 5),
        ("BOTTOMPADDING",(0,0),(-1,-1), 5),
        ("LEFTPADDING",  (0,0),(-1,-1), 7),
        ("RIGHTPADDING", (0,0),(-1,-1), 7),
    ]))
    return t

def banner(title, asked, years, color=DARK_BLUE):
    inner = [
        Paragraph(title, ch_tit),
        Spacer(1, 3),
        Paragraph(f"Asked {asked}x  |  Years: {years}", ch_frq),
    ]
    t = Table([[inner]], colWidths=[17*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0),(-1,-1), color),
        ("TOPPADDING",    (0,0),(-1,-1), 9),
        ("BOTTOMPADDING", (0,0),(-1,-1), 9),
        ("LEFTPADDING",   (0,0),(-1,-1), 12),
        ("RIGHTPADDING",  (0,0),(-1,-1), 12),
    ]))
    return t

def stbl(headers, rows, widths=None):
    if not widths:
        widths = [16.4*cm / len(headers)] * len(headers)
    hrow = [Paragraph(f"<b>{h}</b>", S("th", fontSize=9, fontName="Helvetica-Bold",
             textColor=colors.white, leading=12)) for h in headers]
    data = [hrow] + [[Paragraph(str(c), S("td", fontSize=9, fontName="Helvetica", leading=12)) for c in r] for r in rows]
    t = Table(data, colWidths=widths)
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0),(-1,0),  DARK_BLUE),
        ("ROWBACKGROUNDS",(0,1),(-1,-1), [LIGHT_GREY, colors.white]),
        ("BOX",           (0,0),(-1,-1), 0.5, MID_GREY),
        ("INNERGRID",     (0,0),(-1,-1), 0.3, MID_GREY),
        ("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"),
    ]))
    return t

# ─────────────────────────────────────────────────────────────────────────────
# Each 2-mark topic is a compact "card" — definition + 3-5 key bullet points
# All 22 repeated topics + all 1x topics packed in a grid layout
# ─────────────────────────────────────────────────────────────────────────────

def card(title, freq_label, freq_color, years_str, content_paras):
    """A compact card for a single 2-mark topic."""
    # header row
    hdr = Table([[Paragraph(f"<b>{title}</b>", S("ct", fontSize=10, textColor=colors.white,
                  fontName="Helvetica-Bold", leading=13)),
                  Paragraph(f"<b>{freq_label}</b>", S("cf", fontSize=9, textColor=GOLD,
                  fontName="Helvetica-Bold", leading=13, alignment=TA_LEFT))]],
                colWidths=[11*cm, 5.4*cm])
    hdr.setStyle(TableStyle([
        ("BACKGROUND",    (0,0),(-1,-1), freq_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),
        ("VALIGN",        (0,0),(-1,-1), "MIDDLE"),
    ]))
    yr = Paragraph(f"Years: {years_str}", S("yr", fontSize=8, fontName="Helvetica-Oblique",
                   textColor=MID_GREY, leading=11))
    body_rows = [[yr]] + [[p] for p in content_paras]
    body_tbl = Table(body_rows, colWidths=[16.4*cm])
    body_tbl.setStyle(TableStyle([
        ("BACKGROUND",    (0,0),(-1,-1), LIGHT_GREY),
        ("TOPPADDING",    (0,0),(-1,-1), 3),
        ("BOTTOMPADDING", (0,0),(-1,-1), 3),
        ("LEFTPADDING",   (0,0),(-1,-1), 8),
        ("RIGHTPADDING",  (0,0),(-1,-1), 8),
        ("BOX",           (0,0),(-1,-1), 0.5, MID_GREY),
    ]))
    outer = Table([[hdr], [body_tbl]], colWidths=[16.4*cm])
    outer.setStyle(TableStyle([
        ("BOX",           (0,0),(-1,-1), 1, MID_GREY),
        ("TOPPADDING",    (0,0),(-1,-1), 0),
        ("BOTTOMPADDING", (0,0),(-1,-1), 0),
        ("LEFTPADDING",   (0,0),(-1,-1), 0),
        ("RIGHTPADDING",  (0,0),(-1,-1), 0),
    ]))
    return outer

def freq_color(n):
    if n >= 3: return RED_D
    if n == 2: return MID_BLUE
    return GREEN_D

# ══════════════════════════════════════════════════════════════════════════════
# COVER
# ══════════════════════════════════════════════════════════════════════════════
def build_cover(s):
    inner = [
        Spacer(1,0.8*cm),
        Paragraph("BPT THIRD YEAR", S("c1",fontSize=11,textColor=GOLD,fontName="Helvetica-Bold",alignment=TA_CENTER)),
        Spacer(1,0.2*cm),
        Paragraph("ELECTROTHERAPY – II", S("c2",fontSize=24,textColor=colors.white,fontName="Helvetica-Bold",alignment=TA_CENTER,leading=30)),
        Paragraph("(High Frequency &amp; Actinotherapy)", S("c3",fontSize=12,textColor=GOLD,fontName="Helvetica-Bold",alignment=TA_CENTER)),
        Spacer(1,0.5*cm),
        HRFlowable(width="80%",thickness=1.5,color=GOLD,hAlign="CENTER"),
        Spacer(1,0.5*cm),
        Paragraph("2-MARK EXAM STUDY GUIDE", S("c4",fontSize=15,textColor=colors.white,fontName="Helvetica-Bold",alignment=TA_CENTER)),
        Spacer(1,0.3*cm),
        Paragraph("Complete Summary Notes for All Repeated 2-Mark Topics", S("c5",fontSize=11,textColor=colors.white,fontName="Helvetica",alignment=TA_CENTER,leading=15)),
        Spacer(1,0.8*cm),
        Paragraph("Dec 2020 – Aug 2025  |  Tamil Nadu Dr. M.G.R. Medical University", S("c6",fontSize=10,textColor=colors.white,fontName="Helvetica",alignment=TA_CENTER)),
        Spacer(1,1*cm),
        HRFlowable(width="60%",thickness=0.8,color=GOLD,hAlign="CENTER"),
        Spacer(1,0.4*cm),
        Paragraph("22 Repeated Topics  |  10 Question Papers", S("c7",fontSize=10,textColor=colors.white,fontName="Helvetica",alignment=TA_CENTER)),
    ]
    t = Table([[inner]], colWidths=[17*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND",(0,0),(-1,-1),DARK_BLUE),
        ("TOPPADDING",(0,0),(-1,-1),20),("BOTTOMPADDING",(0,0),(-1,-1),20),
        ("LEFTPADDING",(0,0),(-1,-1),20),("RIGHTPADDING",(0,0),(-1,-1),20),
    ]))
    s.append(t); s.append(PageBreak())

# ══════════════════════════════════════════════════════════════════════════════
# TOC / FREQUENCY MASTER TABLE
# ══════════════════════════════════════════════════════════════════════════════
def build_toc(s):
    s.append(Paragraph("FREQUENCY TABLE — ALL REPEATED 2-MARK TOPICS",
        S("th",fontSize=15,textColor=DARK_BLUE,fontName="Helvetica-Bold",alignment=TA_CENTER,spaceAfter=6)))
    s.append(HRFlowable(width="100%",thickness=1,color=MID_BLUE))
    s.append(Spacer(1,0.3*cm))
    rows = [
        ("Erythema",                         "3x","Jun 2022, Oct 2022, Feb 2025"),
        ("Cryostretch",                      "3x","Oct 2022, Apr 2023, Aug 2025"),
        ("PUVA / PUVA Regimen",              "3x","Sep 2021, Apr 2023, Aug 2024"),
        ("Minimal Erythema Dose (MED)",      "3x","Jun 2022, Oct 2022, Feb 2025"),
        ("Duty Cycle",                       "2x","Jan 2022, Jun 2022"),
        ("Nodes and Antinodes",              "2x","Dec 2020, Jan 2022"),
        ("Tridymite Formation",              "2x","Oct 2022, Apr 2023"),
        ("Lewis Hunting Reaction",           "2x","Aug 2024, Aug 2025"),
        ("Psoriasis",                        "2x","Nov 2023, Feb 2025"),
        ("Magnetron",                        "2x","Aug 2024, Aug 2025"),
        ("Ohm's Law",                        "2x","Nov 2023, Aug 2025"),
        ("Drugs used in Phonophoresis",      "2x","Sep 2021, Feb 2025"),
        ("Sensitizers (UVR)",                "2x","Sep 2021, Apr 2023"),
        ("Photosensitization / Photosensitisers","2x","Dec 2020, Aug 2024"),
        ("Types of LASER / Cold LASER",      "2x","Jun 2022, Aug 2024"),
        ("Hubbard Tank",                     "2x","Dec 2020, Aug 2025"),
        ("Layers / Structure of Skin",       "2x","Nov 2023, Feb 2025"),
        ("Cooling of Lamp (UVR)",            "2x","Nov 2023, Feb 2025"),
        ("Ice pack / Cold pack",             "2x","Apr 2023, Aug 2024"),
        ("Piezoelectric Effect",             "2x","Dec 2020, Feb 2025"),
        ("Contraindications of MWD",         "2x","Jan 2022, Nov 2023"),
        ("Laws of Refraction",               "2x","Sep 2021, Nov 2023"),
    ]
    tbl_rows = []
    for i,(topic,freq,years) in enumerate(rows,1):
        n = int(freq[0])
        if n >= 3:
            fc = Paragraph(f"<b>{freq} ⭐HIGH</b>", S("f",fontSize=9,fontName="Helvetica-Bold",textColor=RED_D,leading=12))
        else:
            fc = Paragraph(f"<b>{freq} MED</b>", S("f",fontSize=9,fontName="Helvetica-Bold",textColor=MID_BLUE,leading=12))
        tbl_rows.append([
            Paragraph(f"<b>{i}</b>",S("n",fontSize=10,textColor=MID_BLUE,fontName="Helvetica-Bold",alignment=TA_CENTER,leading=14)),
            Paragraph(f"<b>{topic}</b>",S("t",fontSize=10,fontName="Helvetica-Bold",textColor=DARK_BLUE,leading=14)),
            fc,
            Paragraph(years,S("y",fontSize=9,fontName="Helvetica",textColor=MID_GREY,leading=12)),
        ])
    t = Table(tbl_rows, colWidths=[0.8*cm,7.5*cm,2.2*cm,6*cm])
    t.setStyle(TableStyle([
        ("ROWBACKGROUNDS",(0,0),(-1,-1),[LIGHT_BLUE,colors.white]),
        ("BOX",(0,0),(-1,-1),0.5,MID_GREY),("INNERGRID",(0,0),(-1,-1),0.3,MID_GREY),
        ("TOPPADDING",(0,0),(-1,-1),6),("BOTTOMPADDING",(0,0),(-1,-1),6),
        ("LEFTPADDING",(0,0),(-1,-1),5),("RIGHTPADDING",(0,0),(-1,-1),5),
        ("VALIGN",(0,0),(-1,-1),"MIDDLE"),("ALIGN",(0,0),(0,-1),"CENTER"),
    ]))
    s.append(t); s.append(PageBreak())

# ══════════════════════════════════════════════════════════════════════════════
# SECTION 1 — HIGH PRIORITY (3x topics)
# ══════════════════════════════════════════════════════════════════════════════
def section_high(s):
    s.append(Paragraph("SECTION A — HIGH PRIORITY TOPICS (Asked 3 Times)",
        S("sh",fontSize=14,textColor=colors.white,fontName="Helvetica-Bold",
          alignment=TA_CENTER,leading=18)))
    t = Table([[Paragraph("SECTION A — HIGH PRIORITY TOPICS (Asked 3 Times)",
        S("sh2",fontSize=14,textColor=colors.white,fontName="Helvetica-Bold",alignment=TA_CENTER,leading=18))]],
        colWidths=[17*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND",(0,0),(-1,-1),RED_D),
        ("TOPPADDING",(0,0),(-1,-1),10),("BOTTOMPADDING",(0,0),(-1,-1),10),
    ]))
    s.pop()
    s.append(t)
    s.append(Spacer(1,0.3*cm))

    # ── ERYTHEMA ──────────────────────────────────────────────────────────────
    s.append(KeepTogether([
        card("1. ERYTHEMA", "3x — HIGH", RED_D, "Jun 2022, Oct 2022, Feb 2025", [
            B("<b>Definition:</b> Erythema is redness of the skin caused by vasodilation of superficial blood vessels, induced by ultraviolet radiation (UVR), infrared radiation, or other stimuli."),
            B("<b>Mechanism (UVR erythema):</b> UVR damages epidermal cells → release of histamine, prostaglandins, kinins → vasodilation → redness."),
            B("<b>Onset:</b> Appears 2–6 hours after UV exposure; maximum at 12–24 hours."),
            B("<b>True erythema (UVR)</b> is fixed, well-demarcated, and outlasts the stimulus. <b>IRR erythema</b> is diffuse, fades quickly after removal of heat."),
            note("GRADES: E0 = Sub-erythemal (no redness) | E1 = Minimal (just visible, fades <24 h) | E2 = First degree (24–48 h, distinct red) | E3 = Second degree (blistering, 3–5 days) | E4 = Third degree (severe, >5 days). MED produces E1."),
        ]),
        Spacer(1,0.2*cm),
    ]))

    # ── CRYOSTRETCH ───────────────────────────────────────────────────────────
    s.append(KeepTogether([
        card("2. CRYOSTRETCH", "3x — HIGH", RED_D, "Oct 2022, Apr 2023, Aug 2025", [
            B("<b>Definition:</b> Cryostretch is the application of cold (cryotherapy) followed immediately by passive or active <b>stretching</b> of the cooled muscle or soft tissue."),
            B("<b>Rationale:</b> Cold numbs pain receptors and reduces muscle spindle sensitivity → allows greater range of stretch without triggering stretch reflex or pain inhibition."),
            B("<b>Technique:</b> Apply ice pack / ice massage for 10–15 min → test numbness → perform slow, sustained stretch while tissue is numb → repeat cold if sensation returns."),
            B("<b>Uses:</b> Muscle contractures, chronic tightness, scar tissue mobility, hamstring/calf tightness, post-immobilisation stiffness."),
            note("COMPARE: Cryostretch = ice + STRETCH. Cryokinetics = ice + ACTIVE EXERCISE. Both use cold analgesia to overcome pain barrier."),
        ]),
        Spacer(1,0.2*cm),
    ]))

    # ── PUVA ─────────────────────────────────────────────────────────────────
    s.append(KeepTogether([
        card("3. PUVA / PUVA REGIMEN", "3x — HIGH", RED_D, "Sep 2021, Apr 2023, Aug 2024", [
            B("<b>PUVA = Psoralen + UltraViolet A (320–400 nm).</b> Photochemotherapy for skin conditions."),
            B("<b>Mechanism:</b> Psoralen (8-MOP / 5-MOP) is taken orally 1–2 h before or applied topically 30 min before → UVA activates psoralen → DNA cross-links → inhibits proliferating skin cells; stimulates melanocytes."),
            B("<b>Regimen:</b> 2–3 sessions per week (never on consecutive days); start at sub-erythemal MED; increase dose by 10–20% each session; 20–30 sessions for psoriasis."),
            B("<b>Uses:</b> Psoriasis, vitiligo, mycosis fungoides, chronic eczema, alopecia areata."),
            note("SAFETY: Protective UV goggles mandatory (eye cataracts risk). Avoid sun exposure on treatment days. Long-term risk: increased skin cancer with prolonged use."),
        ]),
        Spacer(1,0.2*cm),
    ]))

    # ── MED ──────────────────────────────────────────────────────────────────
    s.append(KeepTogether([
        card("4. MINIMAL ERYTHEMA DOSE (MED)", "3x — HIGH", RED_D, "Jun 2022, Oct 2022, Feb 2025", [
            B("<b>Definition:</b> MED is the smallest dose of UVR that produces just visible erythema (E1 grade — faint pink) on the patient's skin, observed 6–8 hours after irradiation."),
            B("<b>Purpose:</b> MED is the baseline (starting dose) for all UVR treatments. Every patient has a different MED — must be individually determined before treatment begins."),
            B("<b>How to determine:</b> Apply UV to a series of small skin areas (e.g., inner forearm) for progressively increasing time durations (e.g., 15, 30, 45, 60 seconds) → examine 6–8 h later → smallest exposure causing just-visible pink = MED."),
            B("<b>Factors affecting MED:</b> Skin pigmentation (darker skin = higher MED), body site (face < back < limbs), prior UV exposure, photosensitising drugs."),
            note("MED IS ALWAYS DETERMINED FIRST before any UV treatment. Never treat without knowing the patient's MED — prevents burns. E1 = 1 MED. E2 = 2.5 MED. E3 = 5 MED."),
        ]),
        Spacer(1,0.2*cm),
    ]))
    s.append(PageBreak())

# ══════════════════════════════════════════════════════════════════════════════
# SECTION 2 — MEDIUM PRIORITY (2x topics)
# ══════════════════════════════════════════════════════════════════════════════
def section_med(s):
    t = Table([[Paragraph("SECTION B — MEDIUM PRIORITY TOPICS (Asked 2 Times)",
        S("sm",fontSize=14,textColor=colors.white,fontName="Helvetica-Bold",alignment=TA_CENTER,leading=18))]],
        colWidths=[17*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND",(0,0),(-1,-1),MID_BLUE),
        ("TOPPADDING",(0,0),(-1,-1),10),("BOTTOMPADDING",(0,0),(-1,-1),10),
    ]))
    s.append(t)
    s.append(Spacer(1,0.3*cm))

    topics_2x = [
        ("5. DUTY CYCLE", "2x", "Jan 2022, Jun 2022", [
            B("<b>Definition:</b> Duty cycle is the ratio of the ON time (pulse duration) to the total cycle time (ON + OFF), expressed as a percentage."),
            B("<b>Formula:</b> Duty Cycle (%) = [Pulse ON time / (ON time + OFF time)] × 100"),
            B("<b>Example:</b> Pulse ON = 2 ms, OFF = 8 ms → Duty cycle = 2/10 × 100 = <b>20%</b>"),
            B("<b>Significance:</b> Low duty cycle (e.g., 10–20%) = predominantly non-thermal effect (used in pulsed US/SWD for acute conditions). High duty cycle (100% = continuous) = thermal effect."),
            note("Low duty cycle → heat dissipates during OFF time → non-thermal / athermal effect → safe for ACUTE, oedematous conditions."),
        ]),
        ("6. NODES AND ANTINODES", "2x", "Dec 2020, Jan 2022", [
            B("<b>Nodes:</b> Points in a standing wave where displacement of particles is <b>zero</b> (minimum) and pressure change is maximum. Standing wave = overlap of incident + reflected waves."),
            B("<b>Antinodes:</b> Points where displacement is <b>maximum</b> and pressure change is minimum."),
            B("<b>Clinical relevance (Ultrasound):</b> Standing waves form when US beam reflects back from bone surface → antinodes create localized high-intensity zones → <b>periosteal pain</b>, possible tissue damage."),
            B("<b>Prevention:</b> Move the transducer continuously (no standing waves can form with a moving transducer)."),
            note("DISTANCE between consecutive nodes (or antinodes) = half wavelength (λ/2)."),
        ]),
        ("7. TRIDYMITE FORMATION", "2x", "Oct 2022, Apr 2023", [
            B("<b>Definition:</b> Tridymite is a high-temperature polymorph (crystalline form) of silica (SiO₂) that forms at temperatures above 870°C."),
            B("<b>In MWD context:</b> The ceramic window (Tridymite) seals the magnetron vacuum tube in a Microwave Diathermy machine — it transmits microwave energy while maintaining the vacuum inside the magnetron."),
            B("<b>Significance:</b> Tridymite has low thermal expansion and excellent microwave transmission properties, making it ideal for this application."),
            B("<b>Also relevant:</b> Tridymite can form inside quartz tubes of UV lamps at very high temperatures, weakening the tube structure."),
            note("Tridymite = ceramic/silica window of the MAGNETRON in MWD. It transmits microwaves without absorbing them."),
        ]),
        ("8. LEWIS HUNTING REACTION", "2x", "Aug 2024, Aug 2025", [
            B("<b>Definition:</b> Lewis Hunting Reaction (or Hunting response) is a reflex cyclic alternation of <b>vasoconstriction and vasodilation</b> occurring during prolonged cold application."),
            B("<b>Mechanism:</b> Initial cold → vasoconstriction → after 7–10 min, the tissue is near-freezing → reflex vasodilation (protective mechanism to prevent frostbite) → repeats every 7–10 min."),
            B("<b>Observed as:</b> Skin appears red/pink despite cold application (paradoxical flushing after initial pallor)."),
            B("<b>Clinical importance:</b> Indicates adequate cold application duration. Also why prolonged cryotherapy is safe — the body self-regulates tissue temperature."),
            note("Lewis Hunting = PROTECTIVE mechanism against cold injury. Occurs every 7–10 minutes. Prevents frostbite during cryotherapy."),
        ]),
        ("9. PSORIASIS", "2x", "Nov 2023, Feb 2025", [
            B("<b>Definition:</b> Psoriasis is a chronic, autoimmune, inflammatory skin disease characterised by well-demarcated, erythematous plaques covered with silvery-white scales."),
            B("<b>Pathology:</b> Abnormally rapid epidermal cell turnover (3–4 days instead of normal 28 days) → accumulation of immature keratinocytes → scaling plaques."),
            B("<b>Common sites:</b> Extensor surfaces (elbows, knees), scalp, lower back, nails."),
            B("<b>Physiotherapy treatment:</b> UVB phototherapy (E2 dose), PUVA (psoralen + UVA), Theraktin tunnel for whole-body treatment."),
            note("ELECTROTHERAPY for Psoriasis: UVB (most common), PUVA, Theraktin tunnel. Modalities of treatment and dosage = UVB 3x/week, start at MED, increase 10–15%/session."),
        ]),
        ("10. MAGNETRON", "2x", "Aug 2024, Aug 2025", [
            B("<b>Definition:</b> A magnetron is a high-power vacuum tube (crossed-field device) used to generate microwave energy in Microwave Diathermy (MWD) machines."),
            B("<b>Construction:</b> Central cathode (electron source) surrounded by anode with multiple resonant cavities; strong external magnetic field causes electrons to spiral in circular paths."),
            B("<b>Working:</b> Spiralling electrons interact with resonant cavities of the anode → induce oscillations → generate microwave radiation at <b>2450 MHz</b>."),
            B("<b>Output:</b> Microwaves exit through a Tridymite (ceramic) window → fed via coaxial cable to the treatment director/antenna."),
            note("Magnetron = HEART of MWD machine. Generates 2450 MHz microwaves. The Tridymite ceramic window allows microwave transmission from the sealed vacuum tube."),
        ]),
        ("11. OHM'S LAW", "2x", "Nov 2023, Aug 2025", [
            B("<b>Statement:</b> At constant temperature, the current flowing through a conductor is directly proportional to the voltage (potential difference) applied across it."),
            B("<b>Formula:</b> V = I × R  (Voltage = Current × Resistance)"),
            B("<b>Units:</b> V = Volts (V), I = Amperes (A), R = Ohms (Ω)"),
            B("<b>Derived formulas:</b> I = V/R (Current = Voltage ÷ Resistance);  R = V/I (Resistance = Voltage ÷ Current)"),
            B("<b>Clinical relevance:</b> In electrotherapy, Ohm's law determines current flow through body tissues. Skin resistance decreases with moisture → increased current → risk of burns."),
            note("OHM'S LAW: V = IR. High resistance = low current for same voltage. Wet skin has LOWER resistance → HIGHER current → BURN RISK in electrotherapy."),
        ]),
        ("12. DRUGS USED IN PHONOPHORESIS", "2x", "Sep 2021, Feb 2025", [
            B("<b>Phonophoresis</b> = drug delivery through skin using ultrasound."),
            stbl(["Drug","Concentration","Condition Treated"],[
                ["Hydrocortisone","1–10%","Tendinitis, bursitis, arthritis — anti-inflammatory"],
                ["Dexamethasone","0.4%","Severe inflammation, scar tissue"],
                ["Diclofenac / Ketoprofen","1–2.5% gel","Soft tissue pain, inflammation"],
                ["Lignocaine (Lidocaine)","2–5%","Local analgesia, pain relief"],
                ["Iodine","Up to 10%","Infected wounds, keloids"],
                ["Zinc oxide","20%","Wound healing"],
                ["Salicylates","Topical","Arthritis, musculoskeletal pain"],
            ],[4*cm,3*cm,9*cm]),
        ]),
        ("13. SENSITIZERS (UVR)", "2x", "Sep 2021, Apr 2023", [
            B("<b>Definition:</b> Sensitizers (photosensitizers) are substances that increase the sensitivity of skin to ultraviolet radiation, lowering the MED and enhancing UV effects."),
            B("<b>Types:</b>"),
            B("Natural sensitizers: Tar, anthralin, rose bengal, quinine, furocoumarins (found in plants).", 1),
            B("Drug sensitizers: Sulfonamides, tetracyclines, psoralens (8-MOP, 5-MOP), phenothiazines, thiazides.", 1),
            B("<b>Use in therapy:</b> Psoralens used deliberately in PUVA therapy to enhance UVA effects for psoriasis/vitiligo."),
            note("SENSITIZERS REDUCE MED → lower dose needed for same effect. Always ask patients about medications before UVR treatment — many common drugs are photosensitisers (tetracyclines, diuretics, NSAIDs)."),
        ]),
        ("14. PHOTOSENSITIZATION / PHOTOSENSITISERS", "2x", "Dec 2020, Aug 2024", [
            B("<b>Photosensitization:</b> The process by which a chemical substance (photosensitiser) absorbs light energy and then transfers that energy to another molecule, enhancing its reactivity or the photochemical reaction in tissues."),
            B("<b>In UVR therapy:</b> Photosensitisers lower the MED → skin reacts to lower UV doses than normal."),
            B("<b>Common photosensitising drugs:</b> Sulfonamides, tetracyclines, chlorpromazine, thiazide diuretics, quinine, psoralens, amiodarone, fluoroquinolones."),
            B("<b>Clinical importance:</b> Always check patient medications before UVR treatment — photosensitising drugs can cause severe burns/reactions at normal therapeutic doses."),
            note("Photosensitization = sensitizer + UV → enhanced reaction. INTENTIONAL in PUVA (psoralen). UNINTENTIONAL with drugs = hazard. Always screen for photosensitising medications."),
        ]),
        ("15. TYPES OF LASER / COLD LASER", "2x", "Jun 2022, Aug 2024", [
            stbl(["Type","Wavelength","Medium","Use"],[
                ["He-Ne (Helium-Neon)","632.8 nm (red, visible)","Gas","Superficial wounds, pain, trigger points"],
                ["GaAs (Gallium Arsenide)","830–904 nm (near IR)","Semiconductor diode","Deep tissue, arthritis, nerve injuries"],
                ["GaAlAs","780–870 nm","Semiconductor","Musculoskeletal, pain"],
                ["Ruby","694 nm (red)","Solid crystal (ruby)","Dermatology; early therapeutic"],
                ["CO₂","10,600 nm","Gas","Surgical cutting (NOT therapeutic)"],
                ["Super Luminous Diode (SLD)","Broad near-IR","Semiconductor","Similar to laser; NOT coherent — COLD laser"],
            ],[3.5*cm,3.5*cm,3.5*cm,5.5*cm]),
            note("Cold LASER = low-level laser therapy (LLLT), 1–500 mW. No significant heating. Biostimulation: increases ATP, fibroblast activity, reduces inflammation."),
        ]),
        ("16. HUBBARD TANK", "2x", "Dec 2020, Aug 2025", [
            B("<b>Definition:</b> The Hubbard Tank is a large, butterfly-shaped (figure-8) full-body hydrotherapy tank designed for total body immersion during physiotherapy treatment."),
            B("<b>Features:</b> Stainless steel construction; accommodates entire body including limbs extended; turbine agitator for whirlpool effect; lift/trolley for patient transfer."),
            B("<b>Therapeutic effects:</b> Combines heat, buoyancy, hydrostatic pressure, and mechanical massage (turbulence)."),
            B("<b>Uses:</b> Burns patients (wound debridement), spinal cord injuries (SCI), multiple joint arthritis, bilateral lower limb conditions, neurological rehabilitation."),
            note("Hubbard Tank = FULL BODY whirlpool. Used for burns, paralysis, extensive skin conditions. Patient trolleyed in. Turbine creates gentle water agitation for debridement."),
        ]),
        ("17. LAYERS / STRUCTURE OF SKIN", "2x", "Nov 2023, Feb 2025", [
            stbl(["Layer (Deep → Surface)","Sublayers / Features","Function"],[
                ["Epidermis (superficial)","5 layers: Basale, Spinosum, Granulosum, Lucidum (palms/soles), Corneum","Barrier; UV absorption; vitamin D synthesis; pigmentation (melanocytes in basale)"],
                ["Dermis (deep)","Papillary (superficial) + Reticular (deep) layers","Contains blood vessels, nerves, hair follicles, sweat/sebaceous glands, collagen"],
                ["Hypodermis (subcutaneous)","Adipose tissue, loose connective tissue","Insulation, energy storage, shock absorption"],
            ],[5*cm,5.5*cm,5.5*cm]),
            note("EPIDERMIS layers (deep to surface): Basale → Spinosum → Granulosum → Lucidum (palms/soles only) → Corneum. Mnemonic: 'Be Specific, Get Low Clearance'"),
        ]),
        ("18. COOLING OF UVR LAMP", "2x", "Nov 2023, Feb 2025", [
            B("<b>Purpose:</b> UV lamps generate intense heat during operation. Cooling is essential to: (1) maintain safe lamp temperature, (2) prevent tube damage, (3) allow appropriate wavelength output."),
            B("<b>Types of cooling:</b>"),
            B("Air cooling: Fan-cooled lamps (e.g., Alpine Sun lamp, Theraktin). Lamp heats up and must warm-up 15–20 min before use.", 1),
            B("Water cooling: Water jacket surrounds quartz tube (e.g., Kromayer lamp). Allows direct skin contact as outer surface stays cool.", 1),
            B("<b>Effect on wavelength:</b> Proper cooling maintains lamp temperature → stable wavelength output. Overheating shifts wavelength output."),
            B("<b>Cooling lamp / Warm-up:</b> Non-luminous IR and UV lamps need 15–20 min warm-up before treatment to reach stable operating temperature."),
            note("Kromayer = WATER cooled = contact safe. Alpine Sun / Theraktin = AIR cooled = needs 15–20 min warm-up, must maintain 45–75 cm distance."),
        ]),
        ("19. ICE PACK / COLD PACK", "2x", "Apr 2023, Aug 2024", [
            B("<b>Ice pack:</b> Crushed ice wrapped in a wet towel/cloth and applied to the affected area. Most common and cost-effective cryotherapy method."),
            B("<b>Cold pack (gel pack):</b> Commercial reusable gel-filled pack stored in a freezer at -5°C. Used in clinical settings."),
            B("<b>Application technique:</b> Never apply ice directly to skin (ice burn risk) — always use a damp cloth barrier. Apply for <b>15–20 minutes</b>. Allow skin to rewarm before reapplication."),
            B("<b>Effects:</b> Vasoconstriction → reduces oedema and bleeding. Pain relief (numbing). Reduces muscle spasm. Reduces metabolic rate → protects tissue."),
            note("RICE protocol for acute injury: Rest, Ice (cold pack), Compression, Elevation. Cold pack applied within first 0–48 hours. ICE BURN occurs with direct ice on skin — always use cloth barrier."),
        ]),
        ("20. PIEZOELECTRIC EFFECT", "2x", "Dec 2020 (Reverse), Feb 2025", [
            B("<b>Piezoelectric effect (Direct):</b> When mechanical pressure is applied to certain crystals (quartz, PZT, barium titanate), an electric charge (voltage) is generated across the crystal. Mechanical energy → Electrical energy."),
            B("<b>Reverse Piezoelectric effect:</b> When an alternating electrical current is applied to a piezoelectric crystal, it alternately expands and contracts (mechanical vibrations). Electrical energy → Mechanical (acoustic) energy."),
            B("<b>Application in Ultrasound:</b> Reverse piezoelectric effect is used to PRODUCE ultrasound — the transducer crystal vibrates at the frequency of the applied current, generating sound waves."),
            B("<b>Application in hydrophones:</b> Direct piezoelectric effect is used to DETECT ultrasound — incoming sound waves compress the crystal → generates measurable voltage."),
            note("REVERSE piezoelectric = Used to PRODUCE ultrasound (electrical → mechanical). DIRECT piezoelectric = Used to DETECT ultrasound (mechanical → electrical). Both occur in the same crystal."),
        ]),
        ("21. CONTRAINDICATIONS OF MWD", "2x", "Jan 2022, Nov 2023", [
            stbl(["Contraindication","Reason"],[
                ["Metal implants in treatment field","Concentrate microwave energy → focal burns"],
                ["Pacemakers / electronic implants","Electromagnetic interference → malfunction"],
                ["Over eyes","Thermal cataract formation — eyes absorb microwaves strongly"],
                ["Over testes / gonads","Heat damages sperm production; potential genetic effects"],
                ["Malignancy in treatment field","Heat may stimulate tumour growth / spread"],
                ["Pregnancy","Potential harm to foetus"],
                ["Moist dressings","Steam burns under dressings"],
                ["Children (growing epiphyses)","Heat may damage growth plates"],
                ["Impaired circulation (PVD)","Cannot dissipate heat → burns"],
                ["Ischaemic areas","Poor blood flow cannot remove heat"],
            ],[5*cm,11*cm]),
        ]),
        ("22. LAWS OF REFRACTION", "2x", "Sep 2021, Nov 2023", [
            B("<b>Refraction:</b> The bending of a wave (light, sound) as it passes from one medium to another of different density/optical property."),
            B("<b>Snell's Law (1st Law of Refraction):</b> The incident ray, refracted ray, and normal at the point of incidence all lie in the same plane."),
            B("<b>Snell's Law (2nd Law):</b> sin i / sin r = n₂/n₁ = constant (where i = angle of incidence, r = angle of refraction, n = refractive index)."),
            B("<b>When light goes from less dense to more dense medium:</b> bends toward the normal (angle decreases)."),
            B("<b>Clinical relevance:</b> Refraction occurs at interfaces in biological tissues (skin, fat, muscle). Explains why IR and UV beams must be perpendicular to skin for maximum effect (Cosine Law)."),
            note("Refraction vs Reflection: Refraction = bending of transmitted ray. Reflection = ray bouncing back. In UVR/IRR therapy, refraction at skin surface reduces effective dose — hence perpendicular positioning is important."),
        ]),
    ]

    for i,(title,freq,years,content) in enumerate(topics_2x):
        s.append(KeepTogether([card(title, freq, MID_BLUE, years, content), Spacer(1,0.2*cm)]))
        if (i+1) % 3 == 0:
            s.append(PageBreak())

    s.append(PageBreak())

# ══════════════════════════════════════════════════════════════════════════════
# SECTION 3 — ALL OTHER 1x TOPICS (compact 2-col grid)
# ══════════════════════════════════════════════════════════════════════════════
def section_onex(s):
    t = Table([[Paragraph("SECTION C — ALL OTHER 2-MARK TOPICS (Asked Once) — QUICK REFERENCE",
        S("sc",fontSize=13,textColor=colors.white,fontName="Helvetica-Bold",alignment=TA_CENTER,leading=18))]],
        colWidths=[17*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND",(0,0),(-1,-1),GREEN_D),
        ("TOPPADDING",(0,0),(-1,-1),9),("BOTTOMPADDING",(0,0),(-1,-1),9),
    ]))
    s.append(t); s.append(Spacer(1,0.3*cm))

    entries = [
        ("Electrode Spacing for SWD","Equal spacing both sides; minimum 1–2 cm using felt/towel spacers. Larger gap = deeper, more uniform heating. Unequal spacing = burn risk on closer side."),
        ("Dangers of SWD","Metal implants (burn), pacemaker interference, moist dressings (steam burns), over eyes/testes, acute inflammation, haemorrhage, malignancy, pregnancy."),
        ("Electromagnetic Spectrum","Order (low→high freq): Radio waves → Microwaves → Infrared → Visible → UV → X-rays → Gamma rays. SWD=27 MHz, MWD=2450 MHz, IRR=770nm–1mm, UVR=100–400nm."),
        ("Ice Burn","Tissue injury from prolonged direct ice contact. Prevention: always use damp cloth between ice and skin; limit to 15–20 min; never apply ice directly."),
        ("Hydrocollator Pack","Canvas bag with silica gel; heated in tank at 71–79°C; wrapped in 6–8 towel layers; applied 15–30 min. Used for chronic pain, muscle spasm."),
        ("Coupling Media","Substances used between ultrasound transducer and skin to eliminate air gap. Examples: aqueous gel (most common), water, mineral oil. Must have similar acoustic impedance to soft tissue."),
        ("Cryokinetics","Cold application → pain relief/numbness → immediate active exercise. Promotes early mobilisation. Ice 10–20 min → active exercises → repeat. Used for ankle sprains, post-surgical rehab."),
        ("Contrast Bath","Alternate immersion in warm (38–44°C) and cold (10–18°C) water. Ratio 4:1 (warm:cold). End with warm (or cold for acute oedema). Promotes peripheral circulation."),
        ("Pulsed EM Energy (PEME)","= Pulsed SWD. Delivers 27.12 MHz EM energy in pulses → athermal / non-thermal effects dominate. Used for acute oedema, tissue repair."),
        ("Moist Hot Packs","Hydrocollator packs = silica gel bags heated at 71–79°C; applied with 6–8 towel layers; moist heat penetrates more effectively than dry heat; 15–30 min duration."),
        ("Heliotherapy","Therapeutic use of sunlight (natural UVR). Used for vitamin D synthesis, rickets, psoriasis (historical). Sunlight = UVA + UVB + visible + IR. Climate-dependent."),
        ("Buoyancy","Upward force exerted by water on an immersed object (Archimedes' principle). In hydrotherapy: reduces gravitational load → facilitates movement of weak muscles → early mobilisation."),
        ("Eddy Currents","Circular induced electrical currents generated in conducting material (body tissues) by changing magnetic fields. In SWD (cable/inductive method) → eddy currents heat muscle tissue."),
        ("Coherence","All photons in a laser beam are in phase — same frequency, same direction, same phase relationship. Gives laser its precision and directionality. Temporal coherence = same frequency; Spatial coherence = same direction."),
        ("Fluidotherapy","Dry heat modality — fine cellulose particles suspended in warm air stream (38–48°C) in a cabinet. Limb inserted; particles act as fluid. Provides heat + gentle massage + desensitisation."),
        ("Triode Valve","A vacuum tube with 3 electrodes: cathode (emits electrons), anode (collects electrons), and control grid (regulates current). Used in older SWD machines as the oscillator to generate 27.12 MHz current."),
        ("Joule's Law","Heat produced in a conductor = I²Rt (where I = current, R = resistance, t = time). Basis of diathermy heating. Greater current × greater resistance = more heat generated."),
        ("Whirlpool Bath","Hydrotherapy using water agitated by turbine. Combines heat, buoyancy, hydrostatic pressure, mechanical massage. Temperatures: cold=15–18°C, tepid=33–36°C, warm=37–40°C, hot=40–43°C."),
        ("Electrostatic Field","Electric field produced between two capacitor (condenser) plates in SWD. Tissues placed in the field undergo molecular vibration (esp. polar molecules like water) → heating."),
        ("Ultrasonic Field","The region of ultrasound propagation from the transducer: Near field (Fresnel zone) = close to transducer, uneven, intense. Far field (Fraunhofer zone) = diverging, more uniform, less intense."),
        ("Define Ultrasound","Acoustic (sound) energy at frequency > 20,000 Hz (20 kHz), above the human hearing range. Therapeutic range: 0.5–3 MHz. Produced by reverse piezoelectric effect. Needs a medium to propagate."),
        ("Attenuation","Reduction in intensity / energy of ultrasound as it travels through tissue, due to absorption + scattering + reflection. Measured in dB. Tissues with high protein (muscle, tendon) attenuate more than fat."),
        ("Quick Ice","Rapid brief application of ice (e.g., ice massage for 2–3 min) to achieve quick analgesia before exercise or stretching, without full cryotherapy session. Used in sports physiotherapy."),
        ("Indications of Wax Therapy","Rheumatoid arthritis (small joints), osteoarthritis (hands, wrists, feet), post-fracture stiffness, tenosynovitis, scleroderma, Dupuytren's contracture, pre-exercise warm-up."),
        ("Electric Burn","Tissue injury from electrical current. Due to joule heating (I²Rt). Causes: high current, small electrode contact area, long duration. Prevention: proper electrode sizing, good skin contact, avoid current concentration."),
        ("Care of UVR Lamp","Clean with alcohol swab; allow to cool before handling; check quartz tube for cracks; water-cooled (Kromayer) needs water before switching on; keep distance 45–75 cm; regular MED checks on same patient."),
        ("Prevention of Periosteal Pain","Move transducer continuously (no stationary application). Reduce intensity if pain occurs. Use water bath method over bony prominences. Avoid direct application over thin bone."),
        ("Pressure Sore","Skin/tissue necrosis from prolonged pressure (ischaemia). Stages I–IV. Treatment: UVR (Kromayer lamp, E3 dose) for bactericidal effect, promote granulation. Also: pulsed SWD, laser."),
        ("Ice Towel Method","Cold application using a towel soaked in iced water, wrung out, and placed over the affected area. Provides mild cryotherapy. Changed frequently as it warms up. Used for large areas."),
        ("Conduction","Heat transfer through direct contact between two objects at different temperatures (e.g., hot packs, wax therapy, ice packs). Rate depends on temperature gradient, thermal conductivity, surface area, contact time."),
        ("Desquamation","Shedding/peeling of superficial epidermal cells (keratinocytes) following UVR exposure. Occurs 3–10 days after E2/E3 erythema as damaged cells separate. Normal sequel of UV treatment."),
        ("Grid (Ultrasound)","Systematic mapping of a treatment area into a grid of points for ultrasound application. Each grid point treated individually. Used for large wound areas or where even coverage is needed."),
        ("Acne Vulgaris (treatment)","UVR treatment: Kromayer lamp (UVC) or Alpine Sun lamp; E2 dose; bactericidal effect on Propionibacterium acnes; 2–3 sessions/week. Mild photosensitisers (salicylic acid) may be used."),
        ("Ice Massage","Direct massage of affected area with a large piece of ice. Provides intense localised cooling. Applied for 5–10 min until skin is numb. Combines cooling + mechanical massage benefit."),
        ("Preparation of SWD Machine","Check leads and electrodes; tuning of patient circuit to machine frequency; ensure spacing pads are in place; check for metal (remove jewellery/implant check); warn patient about sensation; start with low dose."),
        ("Precautions of UVR","Cover eyes (goggles mandatory); protect surrounding skin; determine MED first; screen for photosensitising drugs; check skin type; adequate ventilation (ozone production); do not exceed prescribed dose."),
        ("Inductance","Inductance (L) is the property of a coil/conductor to oppose changes in current by generating an opposing EMF (electromagnetic induction). Unit: Henry (H). In SWD: inductive field method uses coil/cable to induce eddy currents."),
        ("Physical Effects of Heat","Vasodilation, increased metabolic rate (Van't Hoff's law: doubles per 10°C), increased cell permeability, increased tissue extensibility, increased nerve conduction velocity, muscle relaxation."),
        ("Cryospray","Application of cryotherapy via pressurised spray of vapocoolant chemicals (ethyl chloride, fluoromethane). Rapid surface cooling. Used for acute pain relief, trigger points, pre-stretching."),
        ("Adhesive Capsulitis","Frozen shoulder — inflammation and fibrosis of the glenohumeral joint capsule → severe restriction of shoulder ROM in all planes. Physiotherapy: heat (SWD, US, IRR) + stretching exercises + TENS for pain."),
        ("Helium-Neon Laser (He-Ne)","He-Ne laser: wavelength <b>632.8 nm</b> (visible red), gas laser. Low power (1–50 mW). Penetration: superficial (1–2 mm). Uses: wound healing, trigger points, superficial pain, acupuncture point stimulation."),
        ("Ruby LASER","Solid-state laser using synthetic ruby crystal (chromium in aluminium oxide). Wavelength: <b>694 nm</b> (red). First laser ever built (1960). Used mainly in dermatology (tattoo removal, pigmented lesions). Early therapeutic laser."),
        ("Cavitation","Formation and behaviour of gas-filled bubbles in a liquid under ultrasound. Stable cavitation: bubbles oscillate without collapse → beneficial (micro-massage, increased cell permeability). Unstable/transient cavitation: violent bubble collapse → tissue damage (avoided therapeutically)."),
        ("Tenosynovitis","Inflammation of a tendon and its synovial sheath. Symptoms: pain, swelling, crepitus along tendon. Treatment: US therapy (phonophoresis with hydrocortisone), TENS, ice (acute), wax therapy (chronic), rest."),
        ("Rickets","Softening/weakening of bones in children due to vitamin D, calcium, or phosphate deficiency. UVB radiation converts 7-dehydrocholesterol in skin → Vitamin D3 → promotes calcium absorption. Treatment: UVR (general body irradiation, Alpine Sun lamp, Theraktin)."),
        ("Treatment for Acne","UVR (UVC via Kromayer lamp, E2 dose) → bactericidal. Alpine Sun lamp for general facial acne. 2–3 sessions/week. Avoid photosensitising creams. Keep surrounding skin protected."),
        ("Mercury Vapor Lamp","High/medium pressure mercury vapour in a quartz envelope. Types: air-cooled (Alpine Sun) and water-cooled (Kromayer). Emits UV (UVB+UVC predominantly). Alpine Sun needs 15–20 min warm-up; placed 45–75 cm from skin."),
        ("Use of Butterfly Electrode","Flat coil SWD electrode used over the lumbar spine or sacral area. Placed behind patient on treatment table. Produces an inductive electromagnetic field over the lumbar region for treatment of chronic LBP."),
        ("Properties of HF Currents","Frequency > 100 kHz. No electrolytic (galvanic) effects. No muscle contraction (nerves don't respond at HF). Produces heat by molecular friction. Examples: SWD (27.12 MHz), MWD (2450 MHz). Can be safely applied to body."),
        ("Difference 1MHz vs 3MHz (US)","1 MHz: longer wavelength, deeper penetration (3–5 cm), treats deep muscles/joints. 3 MHz: shorter wavelength, more superficial penetration (1–2 cm), more quickly absorbed. 3 MHz heats superficial tissue faster. Use 1 MHz for hip/deep structures; 3 MHz for tendons/surface lesions."),
        ("Laws Governing Radiation","Inverse Square Law: I ∝ 1/d². Cosine Law: I = I₀cosθ. Grotthus-Draper: only absorbed radiation produces effect. Bunsen-Roscoe: effect = I × T. Stefan-Boltzmann: emission ∝ T⁴."),
        ("Cosine Law","I = I₀ × cos θ. Intensity of radiation is proportional to cosine of angle of incidence. Maximum when perpendicular (θ=0, cos0°=1). Zero when parallel (θ=90°, cos90°=0). Hence lamps must be positioned perpendicular to skin."),
    ]

    for i in range(0, len(entries), 2):
        row_items = []
        left = entries[i]
        row_items.append([
            Paragraph(f"<b>{left[0]}</b>", S("lh",fontSize=9,fontName="Helvetica-Bold",textColor=DARK_BLUE,leading=12,spaceBefore=3)),
            Paragraph(left[1], S("lb",fontSize=9,fontName="Helvetica",leading=12,spaceAfter=3)),
        ])
        if i+1 < len(entries):
            right = entries[i+1]
            row_items.append([
                Paragraph(f"<b>{right[0]}</b>", S("rh",fontSize=9,fontName="Helvetica-Bold",textColor=DARK_BLUE,leading=12,spaceBefore=3)),
                Paragraph(right[1], S("rb",fontSize=9,fontName="Helvetica",leading=12,spaceAfter=3)),
            ])
        else:
            row_items.append([Paragraph("", S("e",fontSize=9,fontName="Helvetica",leading=12))])

        left_col  = [p for p in row_items[0]]
        right_col = [p for p in row_items[1]] if len(row_items)>1 else [Paragraph("",S("e",fontSize=9,fontName="Helvetica",leading=12))]

        t = Table([[left_col, right_col]], colWidths=[8.1*cm, 8.3*cm])
        t.setStyle(TableStyle([
            ("VALIGN",       (0,0),(-1,-1),"TOP"),
            ("TOPPADDING",   (0,0),(-1,-1), 5),
            ("BOTTOMPADDING",(0,0),(-1,-1), 5),
            ("LEFTPADDING",  (0,0),(-1,-1), 6),
            ("RIGHTPADDING", (0,0),(-1,-1), 6),
            ("BACKGROUND",   (0,0),(0,-1), LIGHT_BLUE),
            ("BACKGROUND",   (1,0),(1,-1), GREEN_LIGHT),
            ("BOX",          (0,0),(-1,-1), 0.5, MID_GREY),
            ("INNERGRID",    (0,0),(-1,-1), 0.5, MID_GREY),
        ]))
        s.append(t)
        s.append(Spacer(1,0.15*cm))
        if (i+2) % 12 == 0:
            s.append(PageBreak())

    s.append(PageBreak())

# ══════════════════════════════════════════════════════════════════════════════
# REVISION FLASH PAGE
# ══════════════════════════════════════════════════════════════════════════════
def build_revision(s):
    s.append(Paragraph("LAST-MINUTE REVISION — 2-MARK ONE-LINERS",
        S("rv",fontSize=15,textColor=DARK_BLUE,fontName="Helvetica-Bold",alignment=TA_CENTER,spaceAfter=6)))
    s.append(HRFlowable(width="100%",thickness=1,color=MID_BLUE))
    s.append(Spacer(1,0.3*cm))
    lines = [
        "Erythema = redness due to vasodilation. UVR erythema appears 2–6 h after exposure.",
        "Cryostretch = ice → numbness → passive/active STRETCH. Reduces stretch reflex inhibition.",
        "PUVA = Psoralen + UVA. Used for psoriasis, vitiligo. Never on consecutive days.",
        "MED = Minimal Erythema Dose = smallest UV dose causing just-visible E1 erythema at 6–8 h. ALWAYS determine before UVR treatment.",
        "Duty Cycle (%) = (ON time / Total time) × 100. Low duty cycle = non-thermal effect.",
        "Nodes = zero displacement; Antinodes = maximum displacement in standing ultrasound wave. Cause periosteal pain if transducer stationary.",
        "Tridymite = silica ceramic window of MWD Magnetron. Transmits microwaves without absorbing them.",
        "Lewis Hunting Reaction = cyclic vasodilation every 7–10 min during prolonged cold — protective against frostbite.",
        "Psoriasis = autoimmune skin disease with silvery plaques. Treated with UVB, PUVA, Theraktin tunnel.",
        "Magnetron = vacuum tube generating 2450 MHz microwaves in MWD. Electrons spiral under magnetic field.",
        "Ohm's Law: V = IR. In electrotherapy, wet skin → lower resistance → higher current → burn risk.",
        "Phonophoresis drugs: hydrocortisone (anti-inflammatory), lignocaine (analgesia), diclofenac (pain).",
        "Sensitizers (UVR): psoralens, tar, tetracyclines, sulfonamides. They LOWER MED → enhanced UV reaction.",
        "Photosensitization = chemical + UV → enhanced photochemical reaction. Screen all patients for photosensitising drugs.",
        "Cold LASER = low-level laser (1–500 mW). He-Ne = 632.8 nm (red, superficial). GaAs = 830 nm (deep).",
        "Hubbard Tank = butterfly-shaped full-body whirlpool. Used for burns, SCI, multiple joint conditions.",
        "Skin layers (deep→surface): Basale → Spinosum → Granulosum → Lucidum → Corneum (EPIDERMIS) + Dermis + Hypodermis.",
        "Cooling of UVR lamp: Kromayer = water-cooled (contact safe). Alpine Sun = air-cooled (15–20 min warm-up, 45–75 cm distance).",
        "Ice pack: never directly on skin. Use cloth barrier. Apply 15–20 min. Part of RICE protocol for acute injury.",
        "Piezoelectric effect: Direct = mechanical→electrical. REVERSE = electrical→mechanical (PRODUCES ultrasound in transducer).",
        "MWD contraindications: metal implants, pacemaker, over eyes, testes, malignancy, moist dressings, pregnancy.",
        "Laws of Refraction (Snell's Law): sin i / sin r = n₂/n₁ = constant. Incident ray bends at tissue interface.",
        "Eddy currents = circular induced currents in tissues from SWD cable/inductive field → generate heat.",
        "Cavitation: Stable = oscillating bubbles (beneficial). Unstable = collapsing bubbles (harmful, avoid in therapy).",
        "Attenuation = loss of US intensity in tissue. High protein tissues (muscle, tendon) = high attenuation.",
        "Cryokinetics = ice → numb → ACTIVE EXERCISE. Allows earlier mobilisation after acute injury.",
        "Buoyancy = upward force in water (Archimedes). Reduces gravity → assists weak muscle movement in hydrotherapy.",
        "1 MHz US = deep (3–5 cm). 3 MHz US = superficial (1–2 cm). Use 3 MHz for tendons, 1 MHz for deep joints.",
        "Coherence (laser) = all photons in same phase, frequency, direction. Gives laser precision and collimation.",
        "Joule's Law: H = I²Rt. Basis of diathermy heating. More current + more resistance = more heat generated.",
    ]
    for l in lines:
        s.append(B(l))

# ══════════════════════════════════════════════════════════════════════════════
# BUILD
# ══════════════════════════════════════════════════════════════════════════════
def build():
    doc = SimpleDocTemplate(OUTPUT, pagesize=A4,
        leftMargin=2*cm, rightMargin=2*cm,
        topMargin=2*cm, bottomMargin=2*cm,
        title="Electrotherapy II 2-Mark Study Guide")
    s = []
    build_cover(s)
    build_toc(s)
    section_high(s)
    section_med(s)
    section_onex(s)
    build_revision(s)
    doc.build(s)
    print(f"PDF saved: {OUTPUT}")

build()
Running Command

cd /home/daytona/workspace/study-guide && python3 generate_2mark_guide.py 2>&1

Running Command

cd /home/daytona/workspace/study-guide && sed -i 's/B("Natural sensitizers: Tar, anthralin, rose bengal, quinine, furocoumarins (found in plants).", 1)/B("\u00a0\u00a0\u00a0\u00a0\u25e6 Natural sensitizers: Tar, anthralin, rose bengal, quinine, furocoumarins (found in plants).")/' generate_2mark_guide.py && sed -i 's/B("Drug sensitizers: Sulfonamides, tetracyclines, psoralens (8-MOP, 5-MOP), phenothiazines, thiazides.", 1)/B("\u00a0\u00a0\u00a0\u00a0\u25e6 Drug sensitizers: Sulfonamides, tetracyclines, psoralens (8-MOP, 5-MOP), phenothiazines, thiazides.")/' generate_2mark_guide.py && python3 generate_2mark_guide.py 2>&1

Editing File

~/study-guide/generate_2mark_guide.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/study-guide/generate_2mark_guide.py'
Running Command

cd /home/daytona/workspace/study-guide && python3 generate_2mark_guide.py 2>&1

Running Command

python3 -c " import re with open('/home/daytona/workspace/study-guide/generate_2mark_guide.py','r') as f: content = f.read() # Fix all B(\"...\", 1) calls -> B(\" ◦ ...\") fixed = re.sub(r'B\(\"(.*?)\", 1\)', lambda m: 'B(\"\u00a0\u00a0\u00a0\u25e6 ' + m.group(1) + '\")', content) with open('/home/daytona/workspace/study-guide/generate_2mark_guide.py','w') as f: f.write(fixed) print('Fixed all B(text,1) calls') "

Running Command

cd /home/daytona/workspace/study-guide && python3 generate_2mark_guide.py 2>&1

Running Command

ls -lh /home/daytona/workspace/study-guide/Electrotherapy_II_2Mark_StudyGuide.pdf

Your 2-mark study guide PDF is ready! Download it here:

Electrotherapy II 2Mark StudyGuide

PDF Document · PDF


Here is exactly what is inside the PDF:
Cover Page - BPT Third Year, 2-Mark Exam Study Guide
Frequency Master Table - All 22 repeated topics with count and years at a glance

SECTION A — HIGH PRIORITY (Asked 3 Times)
#TopicTimes
1Erythema3x
2Cryostretch3x
3PUVA / PUVA Regimen3x
4Minimal Erythema Dose (MED)3x
Each with: definition, mechanism, clinical relevance, and exam tip box.

SECTION B — MEDIUM PRIORITY (Asked 2 Times) — 18 topics with colour-coded cards:
Duty Cycle | Nodes & Antinodes | Tridymite Formation | Lewis Hunting Reaction | Psoriasis | Magnetron | Ohm's Law | Drugs in Phonophoresis | Sensitizers (UVR) | Photosensitization | Types of LASER | Hubbard Tank | Layers of Skin | Cooling of Lamp | Ice Pack/Cold Pack | Piezoelectric Effect | Contraindications of MWD | Laws of Refraction

SECTION C — ALL OTHER 1x TOPICS — Quick reference 2-column grid covering ALL 50+ remaining 2-mark topics that appeared once (Electrode spacing, Ohm's law, Eddy currents, Cavitation, Attenuation, Fluidotherapy, Triode valve, Joule's law, etc.)

Last-Minute Revision Flash Page - 30 crisp one-liners covering every high-yield 2-mark answer for last-minute reading before the exam.
This is a shared conversation. Sign in to Orris to start your own chat.