CREATE EASY TO LEARN NOTES FOR THIS PDF. YOU HAVE TO INCLUDE TREATMENTS FOR ALL DISEASES YOU CAN SKIP THE DOSES

Reading File
Running Command

cd /home/daytona/workspace/attachments/8bf8757f-8a92-463c-8180-5a0f67828953/ && python3 -c " import pdfplumber with pdfplumber.open('DERMATITIS.pdf') as pdf: print(f'Total pages: {len(pdf.pages)}') for i, page in enumerate(pdf.pages): text = page.extract_text() print(f'--- PAGE {i+1} ---') print(text) print() "

Reading File
Running Command

ls /home/daytona/workspace/ && mkdir -p /home/daytona/workspace/dermatitis-notes

Writing File

~/dermatitis-notes/create_notes.js

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

// ─── Color palette ───────────────────────────────────────────────────────────
const C = {
  navy:     '1F3864',
  teal:     '0070C0',
  green:    '375623',
  red:      'C00000',
  orange:   'E36C0A',
  purple:   '7030A0',
  darkgrey: '404040',
  bgLight:  'DEEAF1',   // light blue bg
  bgGreen:  'E2EFDA',   // light green bg
  bgOrange: 'FCE4D6',   // light orange bg
  bgPurple: 'EAD1DC',   // light purple bg
  bgYellow: 'FFF2CC',   // light yellow bg
  bgRed:    'FFD7D7',   // light red bg
  white:    'FFFFFF',
};

// ─── Helpers ─────────────────────────────────────────────────────────────────

function h1(text) {
  return new Paragraph({
    heading: HeadingLevel.HEADING_1,
    spacing: { before: 320, after: 120 },
    children: [new TextRun({ text, color: C.white, bold: true, size: 32, font: 'Calibri' })],
    shading: { type: ShadingType.SOLID, color: C.navy, fill: C.navy },
  });
}

function h2(text, color = C.teal) {
  return new Paragraph({
    heading: HeadingLevel.HEADING_2,
    spacing: { before: 240, after: 80 },
    children: [new TextRun({ text, color, bold: true, size: 26, font: 'Calibri' })],
    border: { bottom: { style: BorderStyle.SINGLE, size: 6, color } },
  });
}

function h3(text, color = C.navy) {
  return new Paragraph({
    heading: HeadingLevel.HEADING_3,
    spacing: { before: 160, after: 60 },
    children: [new TextRun({ text: '▶ ' + text, color, bold: true, size: 22, font: 'Calibri' })],
  });
}

function h4(text, color = C.darkgrey) {
  return new Paragraph({
    spacing: { before: 120, after: 40 },
    children: [new TextRun({ text: '◆ ' + text, color, bold: true, size: 20, font: 'Calibri' })],
  });
}

function body(text) {
  return new Paragraph({
    spacing: { before: 40, after: 40 },
    children: [new TextRun({ text, size: 20, font: 'Calibri', color: C.darkgrey })],
  });
}

function bullet(text, level = 0) {
  const indent = 360 * (level + 1);
  return new Paragraph({
    spacing: { before: 30, after: 30 },
    indent: { left: indent, hanging: 280 },
    children: [
      new TextRun({ text: (level === 0 ? '• ' : '  ◦ ') + text, size: 20, font: 'Calibri', color: C.darkgrey }),
    ],
  });
}

function bulletBold(label, text, color = C.teal) {
  return new Paragraph({
    spacing: { before: 30, after: 30 },
    indent: { left: 360, hanging: 280 },
    children: [
      new TextRun({ text: '• ', size: 20, font: 'Calibri' }),
      new TextRun({ text: label + ': ', size: 20, font: 'Calibri', bold: true, color }),
      new TextRun({ text, size: 20, font: 'Calibri', color: C.darkgrey }),
    ],
  });
}

function tip(emoji, text, bg = C.bgYellow) {
  return new Paragraph({
    spacing: { before: 60, after: 60 },
    indent: { left: 360 },
    shading: { type: ShadingType.SOLID, color: bg, fill: bg },
    children: [new TextRun({ text: emoji + '  ' + text, size: 20, font: 'Calibri', color: C.darkgrey })],
  });
}

function divider() {
  return new Paragraph({
    spacing: { before: 160, after: 160 },
    border: { bottom: { style: BorderStyle.SINGLE, size: 6, color: 'AAAAAA' } },
    children: [],
  });
}

function pageBreak() {
  return new Paragraph({ children: [new TextRun({ break: 1 })] });
}

function labelRow(label, value, bg = C.bgLight) {
  return new TableRow({
    children: [
      new TableCell({
        width: { size: 30, type: WidthType.PERCENTAGE },
        shading: { type: ShadingType.SOLID, color: bg, fill: bg },
        children: [new Paragraph({ children: [new TextRun({ text: label, bold: true, size: 20, font: 'Calibri', color: C.navy })] })],
      }),
      new TableCell({
        width: { size: 70, type: WidthType.PERCENTAGE },
        children: [new Paragraph({ children: [new TextRun({ text: value, size: 20, font: 'Calibri', color: C.darkgrey })] })],
      }),
    ],
  });
}

function makeTable(headers, rows, headerBg = C.navy) {
  const headerRow = new TableRow({
    children: headers.map(h => new TableCell({
      shading: { type: ShadingType.SOLID, color: headerBg, fill: headerBg },
      children: [new Paragraph({ children: [new TextRun({ text: h, bold: true, size: 20, font: 'Calibri', color: C.white })] })],
    })),
  });
  const dataRows = rows.map((row, i) => new TableRow({
    children: row.map(cell => new TableCell({
      shading: i % 2 === 0 ? { type: ShadingType.SOLID, color: 'F5F5F5', fill: 'F5F5F5' } : undefined,
      children: [new Paragraph({ children: [new TextRun({ text: cell, size: 19, font: 'Calibri', color: C.darkgrey })] })],
    })),
  }));
  return new Table({ width: { size: 100, type: WidthType.PERCENTAGE }, rows: [headerRow, ...dataRows] });
}

// ─── DOCUMENT ────────────────────────────────────────────────────────────────

const doc = new Document({
  creator: 'Orris AI',
  title: 'Dermatitis – Easy Study Notes',
  sections: [{
    headers: {
      default: new Header({
        children: [new Paragraph({
          alignment: AlignmentType.RIGHT,
          children: [new TextRun({ text: 'DERMATITIS – STUDY NOTES  |  Habif\'s Clinical Dermatology', size: 18, font: 'Calibri', color: '888888' })],
        })],
      }),
    },
    children: [

// ════════════════════════════════════════════════════════════
//  TITLE PAGE
// ════════════════════════════════════════════════════════════
new Paragraph({
  alignment: AlignmentType.CENTER,
  spacing: { before: 600, after: 120 },
  shading: { type: ShadingType.SOLID, color: C.navy, fill: C.navy },
  children: [new TextRun({ text: '🩺  DERMATITIS', bold: true, size: 56, font: 'Calibri', color: C.white })],
}),
new Paragraph({
  alignment: AlignmentType.CENTER,
  spacing: { before: 0, after: 60 },
  shading: { type: ShadingType.SOLID, color: C.navy, fill: C.navy },
  children: [new TextRun({ text: 'COMPLETE STUDY NOTES', bold: true, size: 28, font: 'Calibri', color: C.bgLight })],
}),
new Paragraph({
  alignment: AlignmentType.CENTER,
  spacing: { before: 0, after: 480 },
  shading: { type: ShadingType.SOLID, color: C.navy, fill: C.navy },
  children: [new TextRun({ text: 'Eczema  •  Contact Dermatitis  •  Atopic Dermatitis', size: 22, font: 'Calibri', color: 'A0C4E8' })],
}),
tip('📋', 'Source: Habif\'s Clinical Dermatology, Chapters 3, 4 & 5', C.bgLight),
tip('⚠️', 'Doses are intentionally excluded from these notes. Always refer to current prescribing information.', C.bgOrange),

pageBreak(),

// ════════════════════════════════════════════════════════════
//  CHAPTER 1 – ECZEMA & STAGES
// ════════════════════════════════════════════════════════════
h1('CHAPTER 1  —  ECZEMA & ECZEMATOUS INFLAMMATION'),

h2('1.1  What Is Eczema?', C.teal),
body('Eczema (eczematous inflammation) is the most common inflammatory skin disease. The cardinal feature is ITCH — some degree of itching is always present.'),
tip('💡', '"Dermatitis" means inflammation of the skin and is NOT synonymous with eczema — eczema is a specific type of dermatitis.', C.bgLight),

h2('1.2  Three Stages of Eczema', C.teal),
body('All three stages exist on a continuum and may coexist in the same patient. Each stage requires different treatment.'),

new Paragraph({ spacing: { before: 120, after: 80 }, children: [] }),

makeTable(
  ['Stage', 'Skin Appearance', 'Symptoms', 'Common Causes'],
  [
    ['ACUTE', 'Bright red, swollen; tiny clear serum-filled vesicles; may progress to blisters; linear lesions common', 'INTENSE itch; pain from hot water temporarily relieves itch; heat worsens it', 'Contact allergy (poison ivy), severe irritation, id reaction, pompholyx, stasis dermatitis, fungal infections'],
    ['SUBACUTE', 'Redness + scaling; dry or "parched" surface; indistinct borders; scalded appearance; fissuring', 'Slight–moderate itch; pain, stinging, burning', 'Contact allergy, atopic dermatitis, stasis dermatitis, nummular eczema, asteatotic eczema, fingertip eczema, fungal infections'],
    ['CHRONIC', 'Thickened skin; accentuated skin lines (lichenification = "washboard"); excoriations; fissuring', 'Moderate–intense itch; scratching becomes violent; subconscious', 'Atopic dermatitis, habitual scratching, lichen simplex chronicus, chapped fissured feet, nummular eczema'],
  ]
),

h2('1.3  Treatment by Stage', C.teal),

h3('Acute Eczema Treatment'),
bulletBold('Cool Wet Dressings', 'Evaporative cooling → vasoconstriction → suppresses inflammation. Use clean cotton cloth soaked in cool water, placed over affected area for 30 min. Change cloth frequently. Do NOT cover with towels/plastic wrap.', C.teal),
bulletBold('Oral Corticosteroids', 'Prednisone for intense/widespread inflammation (e.g., severe poison ivy). Short courses — do NOT taper. Avoid commercial dose packs (inadequate amount, cause rebound).', C.red),
bulletBold('Topical Steroids', 'Limited use in acute stage — cream cannot penetrate through vesicles well.', C.orange),
bulletBold('Antihistamines', 'Diphenhydramine, hydroxyzine — relieve itch and provide sedation. Doxepin (TCA) has potent antihistamine activity for itch control.', C.green),
bulletBold('Antibiotics', 'Use if signs of secondary infection (pustules, crusts). Oral antibiotics (cephalexin, dicloxacillin) > topical. MRSA: doxycycline, minocycline, or trimethoprim/sulfamethoxazole.', C.purple),

h3('Subacute Eczema Treatment'),
tip('⚠️', 'STOP wet dressings when transitioning from acute to subacute — excess drying causes cracks and fissures!', C.bgOrange),
bulletBold('Topical Corticosteroids', 'First-line. Group III–V for rapid control. Apply 2–4×/day. Weaker products (triamcinolone 0.1%) give excellent results. Tacrolimus/pimecrolimus are alternatives.', C.teal),
bulletBold('Topical Calcineurin Inhibitors', 'Tacrolimus ointment (0.03%, 0.1%) and pimecrolimus cream — inhibit T-cell cytokines; no atrophy. Approved ≥ 2 years. Response slower than steroids.', C.green),
bulletBold('Crisaborole (Eucrisa)', 'PDE-4 inhibitor; mild-moderate atopic dermatitis; ≥ 2 years. Common SE: pain at application site.', C.green),
bulletBold('Doxepin 5% Cream', 'Topical antipruritic for adults and children > 12 yrs. SE: stinging, drowsiness.', C.orange),
bulletBold('Lubrication', 'Essential! Lubricants prevent relapse. Apply 1–4×/day, especially after bathing.', C.purple),
bulletBold('Antibiotics', 'For infected subacute eczema (bright red despite steroids) — systemic > topical.', C.red),
bulletBold('Tar', 'Alternative for chronic/recurrent eczema. Tar ointments between steroid courses.', C.navy),

h3('Chronic Eczema Treatment'),
tip('💡', 'Chronic eczema is resistant and requires POTENT therapy. Scratching becomes habitual — address the habit.', C.bgYellow),
bulletBold('Topical Steroids + Occlusion', 'Group II–V under occlusion at night. Group I without occlusion. Usually clears in 1–3 weeks. Tacrolimus 0.1% as primary or alternating.', C.teal),
bulletBold('Intralesional Steroid Injection', 'Triamcinolone acetonide — very effective. Inject until plaque blanches. Repeat every 3–4 weeks for resistant plaques.', C.red),
bulletBold('Antihistamines + Antibiotics + Lubrication', 'Adjuncts as needed.', C.orange),

divider(),

// ════════════════════════════════════════════════════════════
//  CHAPTER 2 – HAND ECZEMA
// ════════════════════════════════════════════════════════════
h1('CHAPTER 2  —  HAND ECZEMA'),

h2('2.1  Overview', C.teal),
bullet('One of the most common dermatological problems; significantly impacts daily life and work'),
bullet('Prevalence ~5.4%; 2× more common in females'),
bullet('Most common type: Irritant contact dermatitis (35%) > Atopic (22%) > Allergic (19%)'),
bullet('High-risk occupations: cleaners (21.3%), hairdressers, healthcare workers, food handlers'),
tip('💡', 'There is almost NO association between clinical pattern and etiology in hand eczema — patch testing is often needed!', C.bgLight),

h2('2.2  Types of Hand Eczema (Etiologic)', C.teal),
makeTable(
  ['Type', 'Key Features', 'Diagnosis'],
  [
    ['Irritant Contact Dermatitis', 'Most common. Repeated exposure to irritants (wet work, solvents). No allergy involved.', 'Exclude allergy via patch testing'],
    ['Atopic Hand Dermatitis', 'History of asthma/hay fever/"childhood eczema". Backs of hands most affected.', 'Clinical history + IgE'],
    ['Allergic Contact Dermatitis', 'Delayed type IV hypersensitivity. Common allergens: nickel, chromate, rubber, fragrances, formaldehyde, lanolin.', 'Patch testing positive'],
    ['Pompholyx (Dyshidrotic)', 'Symmetric vesicles on palms and sides of fingers. Intense itch. Unknown cause.', 'Clinical; rule out fungi/allergy'],
    ['Hyperkeratotic', 'Thick yellow-brown dense scale on palms; deep cracks; mainly men; chronic.', 'Clinical; rule out psoriasis'],
    ['Fingertip Eczema', 'Very dry, cracked, fissured fingertips; peeling from distal tips. Chronic, resistant.', 'Clinical; rule out allergy/psoriasis'],
    ['Nummular Hand Eczema', 'Round coin-shaped plaques on backs of hands.', 'Clinical'],
    ['Dry Fissured', 'No vesicles; chronic; fissures and dryness.', 'Clinical'],
  ]
),

h2('2.3  Irritant Hand Dermatitis', C.teal),
h3('Who Is at Risk?'),
bullet('Mothers with young children (wet diapers)'),
bullet('Surgeons, dentists, dishwashers, bartenders, fishermen'),
bullet('Industrial workers exposed to chemicals, cutting oils'),
bullet('Patients with atopic diathesis'),
h3('Stages of Irritant Hand Dermatitis'),
bulletBold('Earliest', 'Dryness and chapping; painful cracks in joint creases and fingertips'),
bulletBold('Subacute', 'Red, smooth, shiny, delicate surface that splits easily'),
bulletBold('Acute', 'Vesicles, oozing, crusting; infection possible'),
bulletBold('Severe', 'Necrosis, ulceration, scarring (if caustic chemical)'),
h3('Treatment'),
bullet('Treat per stage (see Chapter 1 stages)'),
bullet('Lubrication and irritant avoidance essential for prevention'),
bullet('Barrier creams at least 2×/day on exposed areas'),
tip('📋', 'Patient Education: Wash hands in cool/lukewarm water as infrequently as possible. Use rubber gloves with cotton liners. Avoid direct contact with detergents and household cleaners.', C.bgLight),

h2('2.4  Pompholyx (Dyshidrosis)', C.teal),
bullet('Symmetric vesicular hand and foot dermatitis of unknown cause'),
bullet('Itching precedes vesicles → vesicles resolve in 3–4 weeks → rings of scale remain'),
bullet('PAIN > itch is chief complaint'),
bullet('Causes (study of 120 pts): mycosis (10%), allergic contact (67.5%), idiopathic (15%)'),
h3('Treatment'),
bulletBold('First Line', 'Topical steroids + cool wet compresses ± oral antibiotics'),
bulletBold('Acute Flares', 'Short courses of oral steroids'),
bulletBold('Resistant', 'PUVA therapy; methotrexate (low dose); oxybutynin for anticholinergic effect'),
bulletBold('Nickel-sensitive', 'Low-nickel diet — 64% improved, 78% cleared on strict diet'),
tip('💡', 'Nickel, cobalt, and chromium ingestion can elicit pompholyx even in patch-test negative patients!', C.bgYellow),

h2('2.5  Fingertip Eczema', C.teal),
bullet('Very dry, peeling, fissured fingertips; skin lines lost; chronic and resistant'),
bullet('May affect one or several fingers'),
h3('Treatment'),
bullet('Topical steroids ± occlusion (temporary relief)'),
bullet('Rule out allergy and psoriasis first'),
bullet('Manage like subacute/chronic eczema: avoid irritants, lubricate frequently'),
bullet('Pimecrolimus, tacrolimus, crisaborole sometimes effective'),
bullet('Tar creams twice daily may provide relief'),

h2('2.6  Hyperkeratotic Eczema', C.teal),
bullet('Thick, dense yellow-brown scale on palms; deep cracks ("cracked riverbed")'),
bullet('Almost exclusively in men; chronic, persists for years'),
bullet('DDx: psoriasis, lichen simplex chronicus'),
h3('Treatment'),
bullet('Group II steroid cream + occlusion — responds but recurs frequently'),
bullet('Patch testing for recurrent disease'),

h2('2.7  Nummular Eczema', C.teal),
bullet('Coin-shaped (1–5 cm) red plaques; unknown cause; primarily middle-aged/elderly'),
bullet('Back of hands most common site; also extensor forearms, lower legs, flanks, hips'),
bullet('Chronic, variable course; worsens in winter; may resemble psoriasis (but scale is thin/sparse)'),
h3('Treatment'),
bullet('Same as subacute or chronic eczema (Group I–V topical steroids intermittently)'),
bullet('Tacrolimus 0.1% alone or alternating with topical steroids'),

h2('2.8  Recurrent Focal Palmar Peeling', C.teal),
bullet('Common, chronic, noninflammatory bilateral peeling of palms; unknown cause'),
bullet('Most common in summer; associated with sweaty palms'),
bullet('Resolves in 1–3 weeks; no therapy other than lubrication needed'),

divider(),

// ════════════════════════════════════════════════════════════
//  CHAPTER 3 – OTHER ECZEMA VARIANTS
// ════════════════════════════════════════════════════════════
h1('CHAPTER 3  —  OTHER ECZEMA VARIANTS'),

h2('3.1  Asteatotic Eczema (Eczema Craquelé)', C.teal),
bullet('Occurs after excess drying, especially in winter and in elderly'),
bullet('Most common on anterolateral lower legs'),
bullet('Appearance: dry, scaly → red plaques with thin horizontal fissures → "cracked porcelain / crazy paving" pattern'),
bullet('Pain > itch is chief complaint; scratching/drying lotions (calamine) worsen it'),
h3('Associated Conditions'),
bullet('Malignancy (lymphoma, leukemia, solid tumors), malnutrition, anorexia nervosa, Sjögren syndrome, medications (retinoids), CHF, nephrotic syndrome, cirrhosis'),
h3('Treatment'),
bulletBold('Initial (subacute)', 'Group III–IV topical steroid ointments'),
bulletBold('Severe (acute)', 'Wet compresses + antibiotics first → then Group V topical steroids + lubricants'),
tip('⚠️', 'AVOID oral steroids — disease flares within 1–2 days after stopping!', C.bgRed),
tip('⚠️', 'Wet compresses: short-term only (1–2 days). Prolonged use → excessive drying.', C.bgOrange),

h2('3.2  Chapped Fissured Feet (Sweaty Sock Dermatitis)', C.teal),
bullet('Primarily in children (mean onset 7.3 yrs, remission 14.3 yrs); onset in early fall'),
bullet('Pressure areas, toes, metatarsal regions become dry, brittle, fissured'),
bullet('Soreness and pain > itch'),
h3('Differential Diagnosis'),
bullet('Psoriasis (darker red, shedding scales vs adherent scales with bleeding)'),
bullet('Tinea pedis (rare in children; pale brown, fine scale)'),
bullet('Allergic contact dermatitis to shoes (dorsal aspect, bright red, scaly)'),
h3('Treatment'),
bullet('Group II–III topical steroids twice daily, preferably with plastic wrap occlusion at bedtime'),
bullet('Tacrolimus ointment may be effective'),
bullet('Lubricating creams several times daily, especially after removing moist socks'),
bullet('Prevention: change into light leather shoes at school; change cotton socks 1–2 times/day'),

h2('3.3  Id Reaction', C.teal),
bullet('Itchy, dyshidrotic-like vesicular eruption triggered by active distant inflammation (e.g., stasis dermatitis, acute fungal infection)'),
bullet('Most common on sides of fingers; may be generalized'),
bullet('Resolves when primary inflammatory process is controlled'),
tip('💡', 'Do NOT diagnose id reaction unless there is an active acute inflammatory process at a DISTANT site AND the id reaction disappears after treating the primary site.', C.bgYellow),

divider(),

// ════════════════════════════════════════════════════════════
//  CHAPTER 4 – SELF-INFLICTED DERMATOSES
// ════════════════════════════════════════════════════════════
h1('CHAPTER 4  —  SELF-INFLICTED DERMATOSES'),

h2('4.1  Lichen Simplex Chronicus', C.teal),
bullet('= Circumscribed neurodermatitis — habitual scratching of a single localized area'),
bullet('More common in adults; sites of easy reach (outer lower leg, scrotum/vulva/anal area, wrists/ankles, neck, eyelids, etc.)'),
bullet('Red papules → red, scaly, thick plaque with accentuated skin lines (lichenification)'),
h3('Treatment'),
bulletBold('First Line', 'Topical steroids + plastic occlusion; Cordran tape (flurandrenolide tape)'),
bulletBold('Resistant', 'Intralesional steroid injections; clobetasol for neck, legs, wrists, vulva'),
bulletBold('Scalp', 'Fluocinonide (group II) twice daily; oral prednisone for extensive scalp'),
bulletBold('Intertriginous areas', 'Group V–VI topical steroids (not potent needed)'),
tip('💡', 'Patient must understand: rash will NOT clear until scratching completely stops — even minor scratching!', C.bgYellow),

h2('4.2  Prurigo Nodularis', C.teal),
bullet('Nodular form of lichen simplex chronicus; intractable pruritus; unknown cause'),
bullet('0.5–2 cm hard, dome-shaped, red/brown nodules on extensor arms and legs'),
bullet('Hypertrophy of papillary dermal nerves'),
h3('Treatments (Evidence-Based)'),
makeTable(
  ['Treatment', 'Notes'],
  [
    ['Betamethasone 0.1% ointment (topical)', 'Twice daily; better under occlusion; alternate with calcipotriol or pimecrolimus'],
    ['Calcipotriol 50mcg/g ointment (topical)', 'Twice daily; may be MORE effective than betamethasone'],
    ['Pimecrolimus 1% cream (topical)', 'Twice daily; discuss FDA black-box warning'],
    ['Tacrolimus 0.1% ointment (topical)', 'Twice daily; discuss FDA black-box warning'],
    ['Capsaicin 0.025–0.3% cream (topical)', '4–6 times daily; depletes neuropeptides; low compliance due to high frequency'],
    ['Fexofenadine + montelukast (oral)', 'Combined reduces pruritus in some patients'],
    ['Naltrexone 50 mg/day (oral)', 'Opiate antagonist; high exacerbation rate after stopping (41%)'],
    ['Gabapentin 900 mg/day (oral)', 'Inhibits excitatory neurotransmitters; taper to 300–600 mg maintenance'],
    ['Pregabalin 25 mg 3×/day (oral)', 'More efficacious than antihistamines and naltrexone'],
    ['Cyclosporine (oral)', '3–5 mg/kg daily; effective in one study'],
    ['Intralesional steroids', 'Repeated monthly injections; very effective'],
    ['Cryotherapy', 'Sometimes successful'],
    ['Thalidomide / Lenalidomide (oral)', 'Most recalcitrant cases only; special registry required'],
  ]
),

h2('4.3  Neurotic Excoriations', C.teal),
bullet('Patient-induced linear excoriations; most aware they create the lesions'),
bullet('Common psychiatric associations: OCD, perfectionistic traits, depression, anxiety'),
bullet('Appearance: groups of excoriations on easily reached areas; linear/round scars; white scars surrounded by brown hyperpigmentation'),
h3('Treatment'),
bulletBold('Skin', 'Group I steroids twice daily OR Group V steroids under plastic wrap occlusion + systemic antibiotics'),
bulletBold('Resistant lesions', 'Monthly intralesional triamcinolone acetonide injections'),
bulletBold('Psychiatric', 'Empathic, supportive approach. SSRIs/SSNRIs/TCAs for depression. CBT for OCD.'),
tip('💡', 'Supportive approach is significantly more effective than insight-oriented psychotherapy.', C.bgGreen),

h2('4.4  Psychogenic Parasitosis (Delusional Infestation)', C.teal),
bullet('Conviction that skin is infested with organisms/materials despite no evidence'),
bullet('"Matchbox sign" — patient brings skin debris, dried blood, insect parts as "proof"'),
bullet('Predominantly female; long history; many prior medical contacts'),
h3('Classification'),
bullet('Anxiety/hypochondriasis → may accept doubt'),
bullet('Anxiety/hypochondriasis with depression → may accept psychiatric referral'),
bullet('Delusional parasitosis → convinced; no doubt'),
bullet('Delusional parasitosis with depression → underlying major depression'),
h3('Management'),
bulletBold('Short-term illness', 'May be cured with suggestion'),
bulletBold('> 3 months', 'Suggestion alone usually fails'),
bulletBold('Unshakable belief', 'Antipsychotics: pimozide (Orap), risperidone, olanzapine, quetiapine — usually prescribed by psychiatrist'),
tip('⚠️', 'Do NOT suggest the diagnosis is obvious on the first visit. Show concern, examine carefully, and collect specimens for later evaluation.', C.bgOrange),

divider(),

// ════════════════════════════════════════════════════════════
//  CHAPTER 5 – STASIS DERMATITIS & VENOUS ULCERS
// ════════════════════════════════════════════════════════════
h1('CHAPTER 5  —  STASIS DERMATITIS & VENOUS ULCERS'),

h2('5.1  Stasis Dermatitis', C.teal),
bullet('Eczematous eruption on lower legs in patients with venous insufficiency'),
bullet('May be acute, subacute, or chronic and recurrent'),
bullet('Cause unknown — possibly allergic response to epidermal protein antigens from hydrostatic pressure'),
bullet('Brown staining (hemosiderin) = iron from lysed RBCs leaked due to venous hypertension'),
tip('⚠️', 'Avoid topical agents containing lanolin, benzocaine, parabens, and neomycin — high sensitization risk in stasis patients!', C.bgRed),

h3('Stages & Presentation'),
bulletBold('Subacute', 'Begins winter; dry, scaly legs; brown staining; scratching → chronic inflammation'),
bulletBold('Acute', 'Red superficial itchy plaque suddenly on lower leg; may be eczema + cellulitis; weeping + crusts; id reaction possible on palms/trunk'),
bulletBold('Chronic', 'Cyanotic red plaque over medial malleolus; fibrosis → permanent skin thickening; cobblestone appearance; brown hyperpigmentation'),

h3('Treatment'),
bulletBold('Subacute stage', 'Group II–V topical steroid creams or ointments + lubricating creams'),
bulletBold('Cellulitis present', 'Oral antibiotics (antistaphylococcal, e.g., cephalexin)'),
bulletBold('Moist/exudative', 'Tepid wet compresses (Burow\'s solution, saline, or water) for 30–60 min several times daily + Group V topical steroids at periphery of ulcer'),
tip('⚠️', 'Do NOT place steroid cream ON the ulcer — stops the healing process!', C.bgRed),

h2('5.2  Venous Leg Ulcers', C.teal),

h3('Three Types of Leg Ulcers'),
makeTable(
  ['Feature', 'Venous', 'Arterial', 'Neuropathic'],
  [
    ['Location', 'Medial malleolus', 'Distal, over bony prominences', 'Pressure points on feet (metatarsal head, heel)'],
    ['Appearance', 'Shallow, irregular borders; granulation tissue develops', 'Punched-out, well-demarcated; yellow/necrotic base', 'Callus surrounding; blister, hemorrhage, necrosis'],
    ['Physical exam', 'Varicose veins, edema, lipodermatosclerosis, skin changes', 'Loss of hair, shiny skin, absent/decreased pulses', 'No sensation to monofilament, claw toes, Charcot joints'],
    ['Symptoms', 'Pain, odor, copious drainage, pruritus', 'Claudication, resting ischemic pain', 'Numbness, burning, paresthesia'],
    ['ABI', '> 0.9', '< 0.7 suggests arterial disease', 'Normal (unless arterial component)'],
    ['Risk factors', 'DVT, leg injury, obesity', 'Diabetes, hypertension, smoking', 'Diabetes, leprosy, frostbite'],
    ['Treatment pearl', 'Compression therapy, leg elevation', 'Pentoxifylline, vascular surgery; must quit smoking', 'Surgical debridement, pressure avoidance, total contact cast'],
  ]
),

h3('Venous Ulcer Treatment Summary'),
bulletBold('Reduce edema', 'Bed rest, leg elevation, compression bandages/stockings'),
bulletBold('Control inflammation', 'Wet compresses + topical steroids at periphery'),
bulletBold('Infection', 'Systemic antibiotics; topical (iodoflex, silver) for heavy contamination'),
bulletBold('Debride ulcer', 'Enzyme-debriding agents; surgical/mechanical debridement'),
bulletBold('Occlusive dressings', 'Promote healing; keep wound moist'),
bulletBold('Compression', 'CORNERSTONE of therapy. Compression bandages during healing → compression stockings after healing to prevent recurrence'),
bulletBold('Adjuncts', 'Pentoxifylline (improves healing by 50%), aspirin, vitamins C & E + zinc, doxycycline (antiinflammatory doses), flavonoids'),
bulletBold('Difficult cases', 'Skin grafts, bioengineered skin, growth factors, negative pressure wound therapy'),

h3('Compression Therapy — ABI Guide'),
makeTable(
  ['ABI', 'Compression Level'],
  [
    ['0.8–1.2', 'High compression therapy'],
    ['0.5–0.8', 'Modified compression (≤ 20 mm Hg)'],
    ['< 0.5', 'NO compression therapy'],
  ]
),

tip('⚠️', 'Always measure ankle-brachial pressure index (ABI) BEFORE applying compression to avoid necrosis/gangrene of the foot!', C.bgRed),

h2('5.3  Postphlebitic Syndromes', C.teal),
makeTable(
  ['Syndrome', 'Features', 'Treatment'],
  [
    ['Dependent edema + ulceration', 'Pitting edema reversed by elevation; hyperpigmentation', 'Compression bandages, Unna boot, bed rest, elevation'],
    ['Lipodermatosclerosis + ulceration', 'Induration of skin + subcutaneous tissue; extensive hyperpigmentation; fibrin deposits', 'Fibrinolytic therapy, stanozolol, hyperbaric O₂'],
    ['Atrophie blanche', 'White smooth flat scars with dilated capillaries; small painful ulcers precede', 'Antiplatelet therapy (aspirin), compression, elevation'],
    ['Ankle blow-out syndrome', 'Multiple small tortuous veins below malleoli; ulcers above/behind medial malleolus', 'Surgical ligation of incompetent veins'],
    ['Secondary venous varicosity', 'Tortuous saphenous veins', 'Compression bandages, hyperbaric O₂'],
    ['Secondary lymphedema', 'Nonpitting edema complicating lipodermatosclerosis', 'Hyperbaric O₂'],
  ]
),

divider(),

// ════════════════════════════════════════════════════════════
//  CHAPTER 6 – CONTACT DERMATITIS
// ════════════════════════════════════════════════════════════
h1('CHAPTER 6  —  CONTACT DERMATITIS & PATCH TESTING'),

h2('6.1  Irritant vs Allergic Contact Dermatitis', C.teal),
makeTable(
  ['Feature', 'Irritant', 'Allergic'],
  [
    ['People at risk', 'Everyone', 'Genetically predisposed only'],
    ['Mechanism', 'Nonimmunologic; physical/chemical damage to epidermis', 'Delayed type IV hypersensitivity (T-cell mediated)'],
    ['Exposures needed', 'Few to many depending on skin barrier', 'One or several to sensitize; then rapid (12–48 h) on re-exposure'],
    ['Substance', 'Organic solvents, soaps (high concentration)', 'Low-molecular-weight haptens (metals, formalin, epoxy)'],
    ['Distribution', 'Borders usually indistinct; confined to contact area', 'May correspond exactly to contactant; may spread beyond'],
    ['Investigation', 'Trial of avoidance', 'Trial of avoidance + patch testing'],
    ['Management', 'Protection + reduced exposure', 'COMPLETE avoidance of allergen'],
  ]
),

h2('6.2  Allergic Contact Dermatitis — Mechanism', C.teal),
h3('Two Phases'),
bulletBold('Sensitization Phase', 'Antigen penetrates stratum corneum → Langerhans cells / dermal dendritic cells carry allergen to lymph nodes → activate antigen-specific T cells → enter circulation'),
bulletBold('Elicitation Phase', 'Re-exposure → sensitized T cells trigger inflammatory cascade → itch + rash within 12–48 hours → persists 3–4 weeks'),
tip('💡', 'Blister fluid does NOT spread allergic contact dermatitis — it does not contain the allergen!', C.bgYellow),

h2('6.3  Rhus Dermatitis (Poison Ivy/Oak/Sumac)', C.teal),
bullet('Most common cause of allergic contact dermatitis in the US'),
bullet('Allergen: urushiol (catechol mixture in resinous sap); all plant parts contain sap'),
bullet('Linear lesions = classic sign (dragging plant across skin while scratching)'),
bullet('New lesions 1 week later ≠ spread by blister fluid — smaller amounts of allergen absorb more slowly'),
h3('Prevention'),
bulletBold('Wash immediately', 'Any soap removes urushiol — 10 min = 50% removed; 30 min = 10%; 60 min = none'),
bulletBold('Barrier cream', 'Quaternium-18 bentonite lotion (IvyBlock) prevents dermatitis in > 50% of exposed sensitized patients'),
h3('Treatment'),
bulletBold('Wet compresses', 'Cold; for blisters and intense erythema; 15–30 min several times/day for 1–3 days'),
bulletBold('Topical steroids', 'Group I–V creams/gels for mild-moderate erythema; 2–4×/day'),
bulletBold('Antihistamines', 'Hydroxyzine, diphenhydramine for itch/sleep'),
bulletBold('Prednisone', 'For severe/widespread poison ivy. Avoid tapering for short courses. Avoid dose packs (cause rebound).'),
tip('⚠️', 'Avoid commercially available steroid dose packs (e.g., Medrol Dosepak) — insufficient amount, cause rebound!', C.bgRed),

h2('6.4  Natural Rubber Latex (NRL) Allergy', C.teal),
h3('Three Types of Reactions'),
bulletBold('Irritant Contact Dermatitis', 'Nonimmune; from moisture/heat/friction under gloves'),
bulletBold('Allergic Contact Dermatitis (Type IV)', 'T-cell mediated; rubber accelerators (thiurams, carbamates, mercapto compounds); patch testing confirms'),
bulletBold('Immediate Type I Hypersensitivity', 'IgE-mediated; contact urticaria → anaphylaxis; latex in air can cause asthma; can be fatal during surgery'),
h3('Diagnosis'),
bullet('Type I: RAST for latex-specific IgE; use test or skin-prick test (with life support available)'),
bullet('Type IV: Patch testing with standard series'),
h3('Treatment'),
bulletBold('Type IV', 'Alternative rubber using different manufacturing chemicals; hypoallergenic surgical gloves (Elastyren, Tactylon); vinyl gloves'),
bulletBold('Type I', 'Nonlatex gloves for healthcare workers; latex-safe hospital environment for affected patients'),
tip('⚠️', 'Do NOT perform skin-prick testing in patients with history of latex anaphylaxis!', C.bgRed),

h2('6.5  Shoe Allergy', C.teal),
bullet('Subacute eczema on dorsa of feet, especially toes; interdigital spaces SPARED (unlike tinea)'),
bullet('Most common allergen: rubber (mercaptobenzothiazole) → chromate → p-tert-butylphenol formaldehyde resin → colophony'),
h3('Treatment'),
bullet('Control perspiration (aluminum chloride hexahydrate 20% = Drysol at bedtime)'),
bullet('Change socks at least once/day; use absorbent powder'),
bullet('Vinyl shoes as substitute for rubber/chrome-sensitive patients'),

h2('6.6  Nickel Allergy', C.teal),
bullet('Leading cause of allergic contact dermatitis worldwide; far more common in women'),
bullet('Most common symptom: reacting to jewelry'),
bullet('Sources: earrings, necklaces, jean buttons/zippers, watchbands, scissors, keys, coins, belt buckles'),
h3('Treatment'),
bulletBold('Avoidance', 'Avoid all nickel-containing items; use stainless steel or plastic earrings'),
bulletBold('Low-nickel diet', 'For pompholyx-like eruptions in nickel-sensitive patients. Avoid: mussels, dark chocolate, nuts, soybeans, legumes, oatmeal. Eat: meat, poultry, eggs, milk, refined rice/wheat.'),
tip('💡', 'Baboon syndrome (bright red anogenital lesions + symmetric eczema) = systemic type IV reaction to nickel/other allergens.', C.bgLight),

h2('6.7  Patch Testing', C.teal),
body('Patch testing is the definitive test for allergic contact dermatitis. It is NOT useful for irritant contact dermatitis.'),
h3('T.R.U.E. TEST'),
bullet('36 allergens + allergen mixes covering ~80% of allergic contact dermatitis'),
bullet('Applied to back for 48 hours → first reading at 48 hrs → second reading at 4–7 days'),
h3('Grading'),
bulletBold('+', 'Weak positive: erythema, infiltration, possible papules'),
bulletBold('++', 'Strong positive: edematous or vesicular'),
bulletBold('+++', 'Extreme positive: spreading, bullous, ulcerative'),
bulletBold('IR', 'Irritant reaction (NOT a positive allergy test)'),
h3('Top 15 Most Common Allergens (NACDG 2013–2014)'),
makeTable(
  ['Rank', 'Allergen', '% Positive'],
  [
    ['1', 'Nickel sulfate', '20.1%'],
    ['2', 'Fragrance mix', '11.9%'],
    ['3', 'Methylisothiazolinone', '10.9%'],
    ['4', 'Neomycin', '8.4%'],
    ['5', 'Bacitracin', '7.4%'],
    ['6', 'Cobalt chloride', '7.4%'],
    ['7', 'Myroxylon pereirae (Balsam of Peru)', '7.2%'],
    ['8', 'p-Phenylenediamine', '7.0%'],
    ['9', 'Formaldehyde', '7.0%'],
    ['10', 'MCI/MI (Kathon CG)', '6.4%'],
  ]
),
h3('When NOT to Patch Test'),
bullet('Active, flaring dermatitis > 25% body surface area (→ "angry back reaction" with false positives)'),
bullet('Recent systemic corticosteroids or immunosuppressants (defer 1–2 weeks)'),
bullet('Recent phototherapy (PUVA or UVB)'),
tip('💡', 'Excited Skin Syndrome (Angry Back): multiple strong patch test reactions cause false-positive reactions at other test sites. Retest one antigen at a time.', C.bgYellow),

divider(),

// ════════════════════════════════════════════════════════════
//  CHAPTER 7 – ATOPIC DERMATITIS
// ════════════════════════════════════════════════════════════
h1('CHAPTER 7  —  ATOPIC DERMATITIS (AD)'),

h2('7.1  Definition & Epidemiology', C.teal),
bullet('Chronic, pruritic inflammatory skin disease; most common in children but affects adults'),
bullet('Often associated with elevated IgE + personal/family history of hay fever, asthma, or eczema'),
bullet('15–25% of children and 7.2% of adults affected in US'),
bullet('45% begin within first 6 months; 60% in first year; 85% before age 5'),
bullet('Concordance: monozygotic twins 77% vs dizygotic 15% → polygenic inheritance'),
tip('💡', '"Atopy" = group with personal/family history of hay fever, asthma, dry skin, and eczema. AD is NOT caused by allergy — it is caused by environmental stress on genetically compromised skin.', C.bgLight),

h2('7.2  Pathogenesis', C.teal),
h3('Key Mechanisms'),
bulletBold('Filaggrin (FLG) defect', 'Decreased filaggrin → disrupted lipid lamellae → increased skin permeability → reduced microbiome diversity → S. aureus dominates in severe AD'),
bulletBold('TH-2 cytokine dominance', 'IL-4, IL-5, IL-13 overexpressed → reduces innate immunity (TLRs, antimicrobial peptides) → down-regulates filaggrin, loricrin, involucrin'),
bulletBold('IgE', 'Elevated in most but 20% have normal IgE. Level does NOT correlate with disease activity — only supporting evidence.'),
bulletBold('Staphylococcus aureus', 'Predominant organism in AD lesions; antibiotics dramatically improve AD'),
bulletBold('Pruritus mechanism', 'Multifactorial: hyperinnervation of epidermis, histamine (H1, H4), substance P, TSLP, IL-31 signaling, lowered nerve thresholds'),

h3('Intrinsic vs Extrinsic AD'),
bulletBold('Extrinsic', 'Elevated IgE; FLG mutations; early onset; TH-2 dominant — most common'),
bulletBold('Intrinsic', 'Normal IgE; no FLG mutations; adult onset; TH-17 and TH-22 activation'),

h2('7.3  Clinical Phases', C.teal),

h3('Infant Phase (Birth – 2 Years)'),
bullet('Starts month 3; dry red scaling areas on CHEEKS — spares perioral and paranasal areas'),
bullet('Chin often more inflamed (drooling + washing irritation)'),
bullet('Habitual lip licking → oozing, crusting, scaling around mouth'),
bullet('Generalized cases: papules, redness, scaling, lichenification in fossae/crease areas'),
bullet('Diaper area often SPARED (protected from scratching)'),
bullet('Resolves by 18 months in ~50%; others progress to childhood phase'),

h3('Childhood Phase (2–12 Years)'),
bullet('Classic: inflammation in FLEXURAL AREAS — antecubital fossae, popliteal fossae, wrists, ankles, neck'),
bullet('Perspiration in flexural areas → burning/intense itch → itch-scratch cycle'),
bullet('Papules → coalesce → lichenified plaques'),
bullet('Destruction of melanocytes → areas of hypopigmentation'),

h3('Adult Phase (12+ Years)'),
bullet('Resurgence at puberty; localized inflammation with lichenification'),
bullet('Patterns: flexural inflammation, hand dermatitis, eyelid inflammation, anogenital lichenification'),
bullet('Inflammation around eyelids: habitual rubbing with back of hand; patch test if persistent'),

h2('7.4  Associated Features', C.teal),
makeTable(
  ['Feature', 'Description', 'Treatment'],
  [
    ['Dry Skin / Xerosis', 'Itchy; worsens in winter; leads to eczema cycle; especially lower legs', 'Mild soaps (Dove, Cetaphil), moisturizing creams after bathing'],
    ['Ichthyosis Vulgaris', 'Dry rectangular scales on extensor arms/legs; associated with keratosis pilaris and hyperlinear palms', '12% ammonium lactate lotion/cream or urea cream'],
    ['Keratosis Pilaris', '1–2 mm rough follicular papules; posterolateral upper arms, anterior thighs; peaks in adolescence', 'Short courses Group V steroids; ammonium lactate, urea, or salicylic acid lotion'],
    ['Hyperlinear Palmar Creases', 'Accentuated palm skin creases; marker of atopic state', 'Moisturizers soften but do not correct creases'],
    ['Pityriasis Alba', 'Hypopigmented scaly patches on face, upper arms, thighs; asymptomatic; self-resolving', 'Lubrication; tacrolimus 0.1% for eczematous patches'],
    ['Atopic Pleats', 'Extra line on lower eyelid (Dennie-Morgan fold) — unreliable sign', 'N/A'],
    ['Ocular Complications', 'Cataracts (1–25%), glaucoma risk with topical/systemic steroids', 'Ophthalmology referral; switch to calcineurin inhibitors if possible'],
  ]
),

h2('7.5  Triggering Factors', C.teal),
bulletBold('Temperature changes / Sweating', 'Hot showers, warm blankets, physical exertion → intense itch in fossae'),
bulletBold('Decreased humidity', 'Fall/winter → dry air → dry skin → itch → eczema cycle'),
bulletBold('Excessive washing', 'Removes water-binding lipids from stratum corneum'),
bulletBold('Irritants', 'Wool, household chemicals, cosmetics, harsh soaps, cigarette smoke'),
bulletBold('Contact allergy', 'Lower incidence than normal; patch test if not responding to treatment'),
bulletBold('Aeroallergens', 'House-dust mite most important; also pollen, pets, molds'),
bulletBold('Staphylococcus aureus', 'Colonizes AD skin; greatly increases inflammation; antibiotics often dramatically improve AD'),
bulletBold('Food', 'Most common in infants/young children: eggs, peanuts, milk, fish, soy, wheat'),
bulletBold('Emotional stress', 'Can rapidly flare stable disease; AD is NOT caused by emotions but worsened by stress'),

h2('7.6  Prevention of AD', C.teal),
bullet('Skin barrier protection from birth may prevent/modify AD development'),
bullet('Petrolatum applied early in life may be protective'),
bullet('Cetaphil cream applied within 3 minutes after bathing improves barrier function'),
bullet('Emollients (creams or ointments) are effective at preventing flares in established AD'),
bullet('Fragrance-free mild cleanser; minimize soap exposure during bathing'),

h2('7.7  Treatment of AD', C.teal),
tip('💡', 'Goals: eliminate inflammation + infection, preserve stratum corneum barrier (emollients), reduce itch to prevent scratching damage, control triggers.', C.bgGreen),

h3('Dry Skin Control'),
bullet('Daily bathing IS okay IF moisturizer applied within 3 minutes of patting skin dry'),
bullet('Use unscented moisturizers (ointments > creams > lotions for efficacy)'),
bullet('Petroleum jelly, Aquaphor, Eucerin — highly effective'),

h3('Topical Steroids'),
bullet('First-line anti-inflammatory therapy'),
bullet('Use mid- to high-strength initially to achieve rapid control'),
bullet('Apply for 2 weeks, then rest 1 week before restarting'),
bullet('Ointments preferred for dry skin'),
bullet('Infants/facial: Group V–VI (e.g., fluticasone propionate 0.05% safe from 3 months)'),
bullet('Lichenified plaques: Group II–V + occlusion; Group I in adults for 1–4 weeks'),
bullet('Maintenance: once daily on weekends (pulse therapy) prevents relapse'),

h3('Topical Nonsteroidal Anti-inflammatory Agents'),
makeTable(
  ['Drug', 'Class', 'Key Points'],
  [
    ['Pimecrolimus 1% cream (Elidel)', 'Calcineurin inhibitor', 'Mild-moderate AD; ≥ 2 years; apply twice daily; burns/stings; no atrophy; avoid excess UV exposure; FDA black-box warning'],
    ['Tacrolimus 0.03% / 0.1% ointment (Protopic)', 'Calcineurin inhibitor', 'Moderate-severe AD; ≥ 2 years (0.03% for children, 0.1% for adults); burns in 31–61%; no atrophy; safe around eyes; FDA black-box warning'],
    ['Crisaborole 2% ointment (Eucrisa)', 'PDE-4 inhibitor', 'Mild-moderate AD; ≥ 2 years; pain at application site; combine with Group V–VI steroid to reduce pain'],
  ]
),
tip('💡', 'Proactive use of tacrolimus twice weekly for 12 months effectively PREVENTS AD exacerbations!', C.bgGreen),

h3('Antibiotics'),
bullet('Antistaphylococcal (cephalexin, cefadroxil, dicloxacillin) for infected eczema'),
bullet('Start antibiotics 2 days BEFORE initiating topical steroid treatment'),
bullet('Bleach baths (¼–½ cup sodium hypochlorite in full adult tub) daily to weekly — reduces S. aureus colonization'),
bullet('Intranasal mupirocin for recurrent infections'),

h3('Antihistamines'),
bullet('Sedating antihistamines (hydroxyzine, doxepin) — useful for sleep; limited objective evidence for itch'),
bullet('Topical doxepin 5% cream — up to 8 days for adults/children > 12; drowsiness common if > 10% BSA'),
bullet('Nonsedating antihistamines — useful for coexisting rhinitis/urticaria'),

h3('Phototherapy'),
bulletBold('UVA1 (340–400 nm)', 'Superior to conventional UVA-UVB for severe AD'),
bulletBold('Narrowband 311 nm UVB', 'Effective for moderate-severe AD as monotherapy'),
bulletBold('Combined UVA-UVB', 'Effective'),
bulletBold('PUVA', 'Effective but largely abandoned due to long-term carcinogenicity risk'),

h3('Systemic Immunosuppressants (Severe Refractory AD)'),
makeTable(
  ['Drug', 'Mechanism', 'Key Notes'],
  [
    ['Cyclosporine (CsA)', 'Inhibits T cells + cytokine gene expression', 'Effective + well-tolerated; short-term preferred; may use up to 1 year in exceptional cases; doses up to 5 mg/kg/day'],
    ['Methotrexate', 'Inhibits folic acid; impairs DNA synthesis', 'Weekly dosing; folic acid supplementation required'],
    ['Azathioprine', 'Purine analog; affects T and B cells', 'Dose determined by thiopurine methyltransferase level'],
    ['Mycophenolate mofetil (MMF)', 'Impairs purine synthesis; selective for B and T cells', 'Oral 500 mg–1 g twice daily; highly effective, minimal serious adverse effects'],
  ]
),

h3('Biologic Therapy'),
bullet('Dupilumab (Dupixent): monoclonal antibody blocking IL-4Rα → inhibits IL-4 and IL-13 signaling'),
bullet('Indicated for moderate-severe AD in adults and adolescents'),
bullet('Administration: initial 600 mg SC, then 300 mg every other week (adults); adjusted for adolescents by weight'),
bullet('Conjunctivitis occurs in ~16% — refer unresponsive cases to ophthalmology'),
bullet('Avoid live vaccines while on dupilumab'),

h3('Tar'),
bullet('Topical coal tar — effective alternative; use in bath (Balnetar) or directly on skin (T/Derm, Fototar) twice daily'),
bullet('Can use same time as topical steroids or with phototherapy (Goeckerman regimen)'),
bullet('Useful for chronic superficial plaques after inflammation controlled with steroids'),

h3('Hospitalization / Intensive Treatment'),
bullet('For severely resistant AD not responding to topical therapy'),
bullet('Wet dressings over topical corticosteroids (mean treatment time 3.6 days) → rapid control'),
bullet('Home hospitalization protocol: complete bed rest, cotton bedclothes, temp 68–70°F, humidity 70%, tepid bath with bath oil, Group II–V steroid cream twice daily, antibiotics if needed, sedating antihistamines'),

divider(),

// ════════════════════════════════════════════════════════════
//  CHAPTER 8 – AD AND FOOD/ENVIRONMENTAL ALLERGIES
// ════════════════════════════════════════════════════════════
h1('CHAPTER 8  —  AD, FOOD ALLERGY & ENVIRONMENTAL ALLERGIES'),

h2('8.1  Food Allergy in AD', C.teal),
bullet('Up to 40% of children with AD have food allergies'),
bullet('Most common offenders in children: eggs, peanuts, milk, fish, soy, wheat'),
bullet('Most common in adults: shellfish, fish, peanuts, tree nuts'),
h3('When to Consider Food Allergy Testing'),
bullet('Infants/young children with moderate-severe AD'),
bullet('History of immediate allergic reaction after food exposure'),
bullet('Refractory AD despite good topical therapy'),
tip('⚠️', 'Do NOT do broad food elimination diets based on positive IgE alone — low specificity, risk of nutritional deficiency and paradoxical sensitization!', C.bgRed),
h3('Natural History of Common Food Allergies'),
makeTable(
  ['Food', 'Usual Onset', 'Resolution'],
  [
    ['Hen\'s egg', '6–24 months', '75% resolve by 7 years'],
    ['Cow\'s milk', '6–12 months', '76% resolve by 5 years'],
    ['Wheat', '6–24 months', '80% resolve by 5 years'],
    ['Soybeans', '6–24 months', '67% resolve by 2 years'],
    ['Peanuts', '6–24 months', 'Persistent (20% resolve by 5 years)'],
    ['Tree nuts', '1–7 years', 'Persistent (9% resolve after 5 years)'],
    ['Fish / Shellfish', 'Late childhood–adulthood', 'Persistent'],
  ]
),

h2('8.2  Peanut Allergy Prevention (NIAID Guidelines)', C.teal),
makeTable(
  ['Guideline', 'Infant Group', 'Recommendation', 'Age of Introduction'],
  [
    ['1', 'Severe eczema + egg allergy', 'Evaluate with sIgE/SPT; introduce based on results', '4–6 months'],
    ['2', 'Mild-moderate eczema', 'Introduce peanut-containing foods', 'Around 6 months'],
    ['3', 'No eczema or food allergy', 'Introduce per family preferences', 'Age-appropriate'],
  ]
),
tip('💡', 'Early introduction and regular consumption of peanuts DECREASES development of peanut allergy in children with AD!', C.bgGreen),

h2('8.3  Aeroallergens', C.teal),
bullet('House-dust mite most important aeroallergen in AD'),
bullet('Minimize: animal dander, dust mites (covers, weekly bedding washes, carpet removal), pollen'),
bullet('Immunotherapy (sublingual or injection) should be considered for significant aeroallergen sensitization'),

divider(),

// ════════════════════════════════════════════════════════════
//  QUICK REFERENCE SUMMARY
// ════════════════════════════════════════════════════════════
h1('QUICK REFERENCE — TREATMENTS AT A GLANCE'),

h2('Topical Steroids — Potency Guide', C.teal),
makeTable(
  ['Use Case', 'Potency Group'],
  [
    ['Face, eyelids, intertriginous areas', 'Group V–VII (low)'],
    ['Subacute eczema (general body)', 'Group III–V (mid)'],
    ['Chronic eczema / lichenified plaques', 'Group II–V with occlusion'],
    ['Lichen simplex chronicus (neck, legs, vulva)', 'Group I–II (high, e.g., clobetasol)'],
    ['Prurigo nodularis', 'Group I (betamethasone); intralesional if resistant'],
  ]
),

h2('Antibiotics in Dermatitis', C.teal),
makeTable(
  ['Organism', 'First Line', 'MRSA'],
  [
    ['S. aureus / Streptococcus (eczema)', 'Cephalexin or dicloxacillin', 'Doxycycline, minocycline, TMP-SMX'],
    ['Infected atopic dermatitis', 'Cephalexin (Keflex) or cefadroxil (Duricef)', 'Per culture sensitivity'],
  ]
),

h2('Key Drug Classes', C.teal),
makeTable(
  ['Drug', 'Class', 'Main Use'],
  [
    ['Pimecrolimus (Elidel)', 'Calcineurin inhibitor', 'Mild-moderate AD, contact dermatitis'],
    ['Tacrolimus (Protopic)', 'Calcineurin inhibitor', 'Moderate-severe AD; safe on face'],
    ['Crisaborole (Eucrisa)', 'PDE-4 inhibitor', 'Mild-moderate AD ≥ 2 years'],
    ['Dupilumab (Dupixent)', 'Anti-IL-4Rα monoclonal antibody', 'Moderate-severe AD refractory to topicals'],
    ['Cyclosporine', 'Calcineurin inhibitor (systemic)', 'Severe refractory AD'],
    ['Methotrexate', 'Folate antagonist', 'Severe AD, pompholyx'],
    ['Naltrexone', 'Opiate antagonist', 'Prurigo nodularis'],
    ['Gabapentin/Pregabalin', 'Calcium channel modulator', 'Prurigo nodularis, neuropathic itch'],
    ['Pimozide/Risperidone/Olanzapine', 'Antipsychotics', 'Psychogenic parasitosis / delusional infestation'],
    ['Pentoxifylline', 'Hemorheologic agent', 'Venous leg ulcers (improves healing 50%)'],
    ['Capsaicin cream', 'Neuropeptide depletor', 'Prurigo nodularis (4–6×/day)'],
  ]
),

h2('Key Diagnostic Pearls', C.teal),
tip('🔑', 'Acute eczema: intense itch + vesicles + serum-filled blisters. Heat worsens, cold compresses help.', C.bgLight),
tip('🔑', 'Subacute eczema: erythema + scaling + dry "parched" surface with indistinct borders. Stop wet dressings.', C.bgLight),
tip('🔑', 'Chronic eczema: lichenified (washboard) skin + deep skin lines + habitual scratching. Needs potent steroids.', C.bgLight),
tip('🔑', 'Atopic dermatitis in infants: cheeks involved, perioral SPARED, diaper area SPARED.', C.bgLight),
tip('🔑', 'Pompholyx: symmetric vesicles on palms, sides of fingers, soles. PAIN > itch. Low-nickel diet for nickel-sensitive.', C.bgLight),
tip('🔑', 'Stasis dermatitis: medial malleolus, hemosiderin staining. NEVER steroid on the ulcer itself!', C.bgLight),
tip('🔑', 'Allergic contact dermatitis: 12–48 h onset after re-exposure. Patch test to confirm. Complete allergen avoidance.', C.bgLight),
tip('🔑', 'Patch test contraindicated: > 25% active dermatitis, recent steroids/immunosuppressants, recent phototherapy.', C.bgLight),
tip('🔑', 'Adult-onset recalcitrant eczema → always consider cutaneous T-cell lymphoma / Hodgkin lymphoma!', C.bgRed),

new Paragraph({
  alignment: AlignmentType.CENTER,
  spacing: { before: 400, after: 100 },
  children: [new TextRun({ text: '— End of Dermatitis Study Notes —', size: 22, font: 'Calibri', color: '888888', italics: true })],
}),

    ], // end children
  }], // end sections
});

Packer.toBuffer(doc).then(buffer => {
  fs.writeFileSync('/home/daytona/workspace/dermatitis-notes/Dermatitis_Study_Notes.docx', buffer);
  console.log('Done! File saved.');
}).catch(err => {
  console.error('Error:', err);
  process.exit(1);
});
Running Command

cd /home/daytona/workspace/dermatitis-notes && npm install docx 2>&1 | tail -5

Running Command

find /home/daytona/skills/docx -name "*.js" | head -5 && ls /home/daytona/skills/docx/

Running Command

ls /home/daytona/skills/docx/scripts/ && node -e "require('docx')" 2>&1 | head -3

Your credits are exhausted. You can purchase a top-up or subscribe to a plan to continue using Orris. If you're already subscribed, your daily credits will reset tomorrow.

CREATE EASY TO LEARN NOTES FOR THIS PDF. YOU HAVE TO INCLUDE TREATMENTS FOR ALL DISEASES YOU CAN SKIP THE DOSES

Your credits are exhausted. You can purchase a top-up or subscribe to a plan to continue using Orris. If you're already subscribed, your daily credits will reset tomorrow.

CREATE EASY TO LEARN NOTES FOR THIS PDF. YOU HAVE TO INCLUDE TREATMENTS FOR ALL DISEASES YOU CAN SKIP THE DOSES

Your credits are exhausted. You can purchase a top-up or subscribe to a plan to continue using Orris. If you're already subscribed, your daily credits will reset tomorrow.
This is a shared conversation. Sign in to Orris to start your own chat.