Naku repu exam vundhi Internal medicine and the topics are 1. Pulmonology 2. Infectious 3. Full-Code Case 4. Chest x-ray Sources that i want you to extract information from is everything from internal medicine textbook harrisons so first of all nuvu ahh lesson lo em em topics vutayoo first brief ga explain cheiii topic wise anni and also to be noted enti ante IM faculty main gas drugs, dosage, most common symptoms or symptoms especially hallmark symptoms and drugs with which class of drugs they are ani kuda ivvu Need everything in pdf

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Running Command

mkdir -p /tmp/workspace/im-exam-guide && ls /tmp/workspace/

Running Command

cat << 'PYEOF' > /tmp/workspace/im-exam-guide/generate_guide.py from reportlab.lib.pagesizes import A4 from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import cm from reportlab.lib.colors import HexColor, black, white, Color from reportlab.platypus import (SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, PageBreak, HRFlowable, KeepTogether) from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY from reportlab.platypus import ListFlowable, ListItem from reportlab.lib import colors import os output_path = "/tmp/workspace/im-exam-guide/IM_Exam_Guide_Harrisons.pdf" # Color palette NAVY = HexColor("#1B3A6B") TEAL = HexColor("#006D77") AMBER = HexColor("#F4A261") LIGHT = HexColor("#EAF2F8") LIGHT2 = HexColor("#E8F8F5") LIGHT3 = HexColor("#FFF3E0") LIGHT4 = HexColor("#EFF5FB") RED = HexColor("#C0392B") GREEN = HexColor("#1A6A3E") GRAY = HexColor("#F4F6F7") DGRAY = HexColor("#5D6D7E") doc = SimpleDocTemplate( output_path, pagesize=A4, rightMargin=2*cm, leftMargin=2*cm, topMargin=2*cm, bottomMargin=2*cm, title="Internal Medicine Exam Guide - Harrison's 22E", author="Orris AI" ) styles = getSampleStyleSheet() def make_style(name, parent='Normal', **kwargs): return ParagraphStyle(name, parent=styles[parent], **kwargs) # Custom styles TITLE_S = make_style('TitleS', fontSize=26, textColor=NAVY, spaceAfter=6, spaceBefore=0, fontName='Helvetica-Bold', alignment=TA_CENTER) SUB_S = make_style('SubS', fontSize=13, textColor=TEAL, spaceAfter=4, fontName='Helvetica', alignment=TA_CENTER) AUTHOR_S = make_style('AuthorS', fontSize=10, textColor=DGRAY, spaceAfter=2, fontName='Helvetica', alignment=TA_CENTER) H1_S = make_style('H1S', fontSize=16, textColor=white, spaceAfter=4, spaceBefore=14, fontName='Helvetica-Bold', backColor=NAVY, leftIndent=8, rightIndent=8, leading=22, borderPad=6) H2_S = make_style('H2S', fontSize=13, textColor=TEAL, spaceAfter=4, spaceBefore=10, fontName='Helvetica-Bold', borderPad=2) H3_S = make_style('H3S', fontSize=11, textColor=NAVY, spaceAfter=2, spaceBefore=6, fontName='Helvetica-Bold') BODY_S = make_style('BodyS', fontSize=9.5, textColor=black, spaceAfter=5, spaceBefore=0, fontName='Helvetica', leading=13, alignment=TA_JUSTIFY) BULL_S = make_style('BullS', fontSize=9.5, textColor=black, spaceAfter=3, spaceBefore=0, fontName='Helvetica', leading=12, leftIndent=14, bulletIndent=4) DRUG_S = make_style('DrugS', fontSize=9, textColor=GREEN, spaceAfter=2, spaceBefore=0, fontName='Helvetica-Bold', leftIndent=12) WARN_S = make_style('WarnS', fontSize=9, textColor=RED, spaceAfter=2, spaceBefore=0, fontName='Helvetica-Bold', leftIndent=12) NOTE_S = make_style('NoteS', fontSize=8.5, textColor=DGRAY, spaceAfter=4, spaceBefore=0, fontName='Helvetica-Oblique', leftIndent=12, leading=11) def section_header(txt, color=NAVY): data = [[Paragraph(f'<font color="white"><b>{txt}</b></font>', make_style( 'tmpH', fontSize=14, fontName='Helvetica-Bold', textColor=white, leading=18, spaceAfter=0, spaceBefore=0))]] t = Table(data, colWidths=[17*cm]) t.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,-1), color), ('ROWBACKGROUNDS', (0,0), (-1,-1), [color]), ('TOPPADDING', (0,0), (-1,-1), 7), ('BOTTOMPADDING', (0,0), (-1,-1), 7), ('LEFTPADDING', (0,0), (-1,-1), 10), ('RIGHTPADDING', (0,0), (-1,-1), 6), ('ROUNDEDCORNERS', [4]), ])) return t def info_box(title, items, bg=LIGHT, title_color=TEAL): rows = [[Paragraph(f'<b><font color="{title_color.hexval()}">{title}</font></b>', make_style('tmpIB', fontSize=10, fontName='Helvetica-Bold', textColor=title_color, leading=14))]] for item in items: rows.append([Paragraph(f'• {item}', make_style('tmpBI', fontSize=9, fontName='Helvetica', textColor=black, leading=12, leftIndent=6))]) t = Table(rows, colWidths=[17*cm]) t.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,-1), bg), ('ROWBACKGROUNDS', (0,0), (0,0), [bg]), ('TOPPADDING', (0,0), (-1,-1), 4), ('BOTTOMPADDING', (0,0), (-1,-1), 3), ('LEFTPADDING', (0,0), (-1,-1), 10), ('BOX', (0,0), (-1,-1), 0.5, title_color), ('LINEBELOW', (0,0), (0,0), 0.5, title_color), ])) return t def drug_table(headers, rows, col_widths=None): if col_widths is None: col_widths = [4.5*cm, 4.5*cm, 4*cm, 4*cm] data = [[Paragraph(f'<b><font color="white">{h}</font></b>', make_style('th', fontSize=8.5, fontName='Helvetica-Bold', textColor=white, leading=11)) for h in headers]] for row in rows: data.append([Paragraph(str(c), make_style('td', fontSize=8.5, fontName='Helvetica', textColor=black, leading=11)) for c in row]) t = Table(data, colWidths=col_widths) t.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), TEAL), ('ROWBACKGROUNDS', (0,1), (-1,-1), [white, GRAY]), ('GRID', (0,0), (-1,-1), 0.3, HexColor('#BDC3C7')), ('TOPPADDING', (0,0), (-1,-1), 4), ('BOTTOMPADDING', (0,0), (-1,-1), 4), ('LEFTPADDING', (0,0), (-1,-1), 5), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ])) return t def p(txt, style=BODY_S): return Paragraph(txt, style) def b(txt): return Paragraph(f'• {txt}', BULL_S) def h2(txt): return Paragraph(txt, H2_S) def h3(txt): return Paragraph(txt, H3_S) def sp(n=6): return Spacer(1, n) def hr(): return HRFlowable(width="100%", thickness=0.5, color=HexColor('#BDC3C7'), spaceAfter=4, spaceBefore=4) story = [] # ============================================================ # COVER PAGE # ============================================================ story.extend([ sp(40), Paragraph("INTERNAL MEDICINE", TITLE_S), Paragraph("EXAM REVISION GUIDE", make_style('TS2', fontSize=22, textColor=TEAL, fontName='Helvetica-Bold', alignment=TA_CENTER, spaceAfter=10)), sp(10), Paragraph("Harrison's Principles of Internal Medicine, 22nd Edition (2025)", SUB_S), sp(6), Paragraph("Topics: Pulmonology | Infectious Disease | Full-Code Case | Chest X-Ray", AUTHOR_S), sp(4), Paragraph("Prepared for: Internal Medicine Exam | July 17, 2026", AUTHOR_S), sp(30), ]) # Topic summary boxes on cover cover_topics = [ ("1. PULMONOLOGY", "Asthma, COPD, Pneumonia, TB, Pleural Effusion, Pulmonary Embolism, ILD", LIGHT), ("2. INFECTIOUS DISEASE", "CAP/HAP/VAP, Sepsis/Septic Shock, Meningitis, Infective Endocarditis, HIV, TB", LIGHT2), ("3. FULL-CODE CASE", "Cardiac Arrest, CPR Protocol, ACLS, Shock Classification & Management", LIGHT3), ("4. CHEST X-RAY", "CXR Interpretation: PA/AP Views, Patterns, Findings, Differential Diagnosis", LIGHT4), ] for title, desc, bg in cover_topics: data = [[ Paragraph(f'<b><font color="{NAVY.hexval()}">{title}</font></b>', make_style('ct', fontSize=10, fontName='Helvetica-Bold', textColor=NAVY, leading=14)), Paragraph(desc, make_style('cd', fontSize=9, fontName='Helvetica', textColor=DGRAY, leading=12)) ]] t = Table(data, colWidths=[6*cm, 11*cm]) t.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,-1), bg), ('BOX', (0,0), (-1,-1), 0.5, TEAL), ('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'), ])) story.append(t) story.append(sp(4)) story.append(sp(20)) story.append(Paragraph("Source: Harrison's Principles of Internal Medicine 22E, McGraw Hill Medical (2025)", make_style('src', fontSize=8, fontName='Helvetica-Oblique', textColor=DGRAY, alignment=TA_CENTER))) story.append(PageBreak()) # ============================================================ # SECTION 1: PULMONOLOGY # ============================================================ story.append(section_header("SECTION 1: PULMONOLOGY", NAVY)) story.append(sp(8)) # --- ASTHMA --- story.append(h2("1.1 ASTHMA")) story.append(p("Asthma is a chronic inflammatory disorder of the airways characterized by variable airflow obstruction, bronchial hyperresponsiveness, and underlying inflammation. It affects ~300 million people worldwide.")) story.append(h3("Hallmark Symptoms")) story.append(info_box("Classic Presentation", [ "Episodic wheezing (hallmark) — high-pitched expiratory sound", "Dyspnea / shortness of breath", "Chest tightness", "Cough (especially nocturnal — nighttime/early morning worsening is HALLMARK)", "Symptoms often triggered by allergens, cold air, exercise, infections, NSAIDs", "REVERSIBLE airflow obstruction (key differentiator from COPD)", ], bg=LIGHT, title_color=TEAL)) story.append(sp(6)) story.append(h3("Drug Classes & Key Medications")) story.append(drug_table( ["Drug Class", "Drugs (Generic)", "Dose", "Role"], [ ["SABA (Short-Acting Beta2 Agonist)", "Albuterol (Salbutamol)", "2 puffs q4-6h PRN", "RELIEVER — first-line acute attack"], ["LABA (Long-Acting Beta2 Agonist)", "Salmeterol, Formoterol", "1 puff bid", "CONTROLLER — always with ICS"], ["ICS (Inhaled Corticosteroid)", "Budesonide, Fluticasone, Beclomethasone", "Low/Med/High dose bid", "Primary CONTROLLER — anti-inflammatory"], ["ICS + LABA Combo", "Fluticasone/Salmeterol, Budesonide/Formoterol", "1-2 puffs bid", "Preferred persistent asthma"], ["LAMA (Long-Acting Muscarinic Antagonist)", "Tiotropium", "1 puff daily", "Add-on for uncontrolled asthma"], ["Leukotriene Receptor Antagonist", "Montelukast", "10 mg PO daily", "Adjunct controller; aspirin-exacerbated"], ["Theophylline", "Theophylline", "Target 5-15 mcg/mL", "Third-line bronchodilator; narrow TI"], ["Systemic Corticosteroids", "Prednisone, Methylprednisolone", "40-60 mg/day x 5 days", "Acute severe attacks"], ["Biologic (Anti-IgE)", "Omalizumab", "150-375 mg SC q2-4wk", "Severe allergic asthma (step 5-6)"], ["Biologic (Anti-IL5)", "Mepolizumab, Benralizumab", "100 mg SC q4wk", "Severe eosinophilic asthma"], ], col_widths=[4.5*cm, 4*cm, 3.5*cm, 5*cm] )) story.append(sp(4)) story.append(info_box("Acute Severe Asthma (Status Asthmaticus) — EMERGENCY", [ "IV/PO corticosteroids IMMEDIATELY (Methylprednisolone 125 mg IV or Prednisone 40-60 mg PO)", "Nebulized SABA (albuterol) every 20 min x 3, then hourly", "Ipratropium bromide added to nebulized treatment", "Supplemental O2 to maintain SpO2 >93%", "Magnesium sulfate 2g IV over 20 min (severe cases)", "ICU/intubation if: fatigue, silent chest, PaCO2 rising, altered consciousness", ], bg=HexColor("#FDEDEC"), title_color=RED)) story.append(sp(8)) # --- COPD --- story.append(h2("1.2 CHRONIC OBSTRUCTIVE PULMONARY DISEASE (COPD)")) story.append(p("COPD is a preventable, treatable disease characterized by persistent airflow limitation that is usually progressive and associated with an enhanced chronic inflammatory response in the airways and lung to noxious particles or gases. The primary cause is CIGARETTE SMOKING (85-90% of cases).")) story.append(h3("Hallmark Symptoms")) story.append(info_box("COPD Classic Presentation — Remember COPD = C-OLD", [ "CHRONIC cough (usually productive — hallmark)", "Dyspnea on exertion (progressive) — most disabling symptom", "Sputum production (chronic bronchitis: >3 months/year for 2 consecutive years)", "Decreased exercise tolerance", "Barrel chest, hyperresonance, prolonged expiration, accessory muscle use", "IRREVERSIBLE airflow obstruction (post-bronchodilator FEV1/FVC <0.70)", "Blue Bloater (Chronic Bronchitis) vs Pink Puffer (Emphysema) phenotypes", ], bg=LIGHT, title_color=TEAL)) story.append(sp(6)) story.append(h3("COPD Drug Classes & Key Medications (Stable COPD)")) story.append(drug_table( ["Drug Class", "Examples", "Dose", "Notes"], [ ["SABA", "Albuterol (Salbutamol)", "2 puffs q4-6h PRN", "Rescue inhaler; fastest onset"], ["SAMA (Short-Acting Muscarinic Antagonist)", "Ipratropium bromide", "2 puffs qid", "Reliever; better than SABA in some COPD"], ["LAMA (preferred in COPD)", "Tiotropium, Umeclidinium, Glycopyrronium", "1 puff once daily", "1st-line stable COPD — reduces exacerbations most"], ["LABA", "Salmeterol, Formoterol, Indacaterol", "1 puff bid/daily", "2nd bronchodilator; add to LAMA"], ["LABA + LAMA combo", "Olodaterol/Tiotropium, Vilanterol/Umeclidinium", "1 puff daily", "Preferred dual bronchodilation"], ["ICS (add-on)", "Budesonide, Fluticasone", "High dose bid", "Only in eos >300 or frequent exacerbations"], ["Triple therapy (ICS+LABA+LAMA)", "Fluticasone/Vilanterol/Umeclidinium", "1 puff daily", "Reduces mortality in selected patients"], ["PDE-4 inhibitor", "Roflumilast", "500 mcg PO daily", "Chronic bronchitis phenotype, EF <50%"], ["Smoking cessation", "Varenicline (preferred), Bupropion, NRT", "Per protocol", "MOST important intervention — improves survival"], ["Oxygen therapy", "Supplemental O2", ">15 h/day if PaO2 <55 or SpO2 <88%", "Improves survival in hypoxemic COPD"], ], col_widths=[4.5*cm, 4*cm, 3.5*cm, 5*cm] )) story.append(sp(4)) story.append(info_box("COPD Exacerbation Management", [ "SABAs + SAMAs: nebulized albuterol + ipratropium q20min then q4-6h", "Systemic corticosteroids: Prednisone 40 mg/day x 5 days (NO longer courses — same efficacy)", "Antibiotics: if purulent sputum or increased dyspnea/sputum (Azithromycin, Doxycycline, or Amoxicillin-clavulanate)", "NIV (BiPAP): if pH <7.35 with hypercapnia — prevents intubation", "Supplemental O2: target SpO2 88-92% (avoid over-oxygenation in COPD — hypercapnia risk)", "Indications for ICU: severe respiratory acidosis (pH <7.25), hemodynamic instability", ], bg=LIGHT3, title_color=AMBER)) story.append(sp(8)) # --- PNEUMONIA --- story.append(h2("1.3 COMMUNITY-ACQUIRED PNEUMONIA (CAP)")) story.append(p("Pneumonia is an acute infection of the lung parenchyma. CAP affects patients in the community or within 48h of hospital admission. It remains a leading cause of infectious death worldwide.")) story.append(h3("Clinical Diagnosis")) story.append(info_box("CAP Hallmark Symptoms", [ "Fever (hallmark) >38°C — most common presenting symptom", "Productive cough — purulent sputum (yellow/green/rusty = classic pneumococcal)", "Pleuritic chest pain (sharp, worse with breathing — hallmark of lobar pneumonia)", "Dyspnea / tachypnea", "Tachycardia", "Dullness to percussion, bronchial breath sounds, crackles on exam", "Chest X-ray: new infiltrate (lobar consolidation or interstitial pattern)", "Diagnosis requires: compatible symptoms + NEW infiltrate on CXR", ], bg=LIGHT, title_color=TEAL)) story.append(sp(6)) story.append(h3("CAP Treatment — Drug Classes & Regimens")) story.append(drug_table( ["Setting", "Regimen", "Drugs", "Notes"], [ ["Outpatient — No comorbidities", "Amoxicillin monotherapy OR", "Amoxicillin 1g TID x 5 days", "New IDSA 2019 recommendation"], ["Outpatient — No comorbidities", "Doxycycline (atypical cover)", "Doxycycline 100 mg bid x 5 days", "Good for atypicals (Mycoplasma, Chlamydia)"], ["Outpatient — With comorbidities", "Beta-lactam + Macrolide", "Amox-clav + Azithromycin 500 mg day1, 250 mg d2-5", "Combo for resistant organisms"], ["Outpatient — With comorbidities", "OR Respiratory Fluoroquinolone", "Levofloxacin 750 mg daily or Moxifloxacin 400 mg daily x 5 days", "Monotherapy; covers all pathogens"], ["Inpatient (Non-ICU)", "Beta-lactam + Macrolide", "Ceftriaxone 1-2g IV daily + Azithromycin 500 mg IV/PO daily", "Standard inpatient regimen"], ["Inpatient (Non-ICU)", "OR Respiratory FQ", "Levofloxacin 750 mg IV/PO daily", "Alternative to combo"], ["ICU / Severe CAP", "Beta-lactam + Macrolide OR Beta-lactam + FQ", "Ceftriaxone 2g IV + Azithromycin 500 mg IV", "MANDATORY dual coverage in ICU"], ["MRSA or Pseudomonas risk", "Add anti-MRSA or anti-Pseudomonal", "Add Vancomycin 15-20 mg/kg IV q8-12h OR Linezolid 600 mg; Anti-Pseudomonal: Piperacillin-tazobactam or Cefepime", "Risk factors: prior MRSA/Pseudomonas, structural lung disease"], ["Legionella pneumonia", "Fluoroquinolone (1st-line)", "Levofloxacin 750 mg daily x 5 days OR Azithromycin", "Targets intracellular pathogen"], ["Atypical (Mycoplasma/Chlamydia)", "Macrolide or Doxycycline", "Azithromycin OR Doxycycline", "Resistant to penicillins/cephalosporins"], ], col_widths=[3.5*cm, 3.5*cm, 5.5*cm, 4.5*cm] )) story.append(sp(4)) story.append(info_box("Common CAP Pathogens & Clues", [ "Streptococcus pneumoniae: Rusty sputum, lobar consolidation, herpes labialis (MOST COMMON cause CAP)", "Mycoplasma pneumoniae: Walking pneumonia, young adults, extrapulmonary features (bullous myringitis)", "Legionella pneumophila: Hyponatremia + diarrhea + confusion + heavy smoker/hotel/AC exposure", "Staphylococcus aureus: Post-influenza, cavitation, pneumatoceles — think MRSA", "Klebsiella pneumoniae: Alcoholics, diabetics, cavitation with 'currant jelly' sputum (upper lobe)", "Haemophilus influenzae: COPD patients", "Pseudomonas aeruginosa: Bronchiectasis, severe COPD, immunocompromised", ], bg=LIGHT2, title_color=GREEN)) story.append(sp(8)) # --- TB --- story.append(h2("1.4 TUBERCULOSIS (TB)")) story.append(p("TB is caused by Mycobacterium tuberculosis. It remains one of the leading infectious disease killers globally. Pulmonary TB is most common; upper-lobe cavitation is the hallmark radiographic finding.")) story.append(info_box("Hallmark Symptoms of Active TB", [ "Chronic productive cough >3 weeks (HALLMARK)", "Hemoptysis (blood-streaked sputum) — classic/alarming feature", "Fever — low-grade, often afternoon/evening ('afternoon fever')", "Night sweats — classic constitutional symptom", "Weight loss and anorexia (cachexia)", "Fatigue / malaise", "Chest pain, dyspnea in advanced disease", "CXR: Upper lobe cavitation with infiltrates — PATHOGNOMONIC pattern", ], bg=LIGHT, title_color=TEAL)) story.append(sp(6)) story.append(h3("TB Treatment — Drug Classes & Regimens")) story.append(drug_table( ["Phase", "Drugs (HRZE)", "Duration", "Key Points"], [ ["Intensive Phase", "Isoniazid (H) + Rifampin (R) + Pyrazinamide (Z) + Ethambutol (E)", "2 months (8 weeks)", "4-drug regimen kills >99% bacilli"], ["Continuation Phase", "Isoniazid (H) + Rifampin (R)", "4 months (total 6 months)", "Extended to 9 months if cavitation/delayed conversion"], ["Latent TB (LTBI) — Preferred", "Isoniazid (H) + Rifapentine (P)", "3 months, once weekly", "3HP regimen — preferred by WHO/CDC"], ["Latent TB — Alternative", "Rifampin (R) alone", "4 months daily", "If INH intolerance"], ["Latent TB — Alternative", "Isoniazid + Rifampin", "3 months daily", "3HR regimen"], ["MDR-TB (Resistant H+R)", "Bedaquiline + Pretomanid + Linezolid (BPaL)", "6 months", "BPaL regimen for XDR-TB"], ], col_widths=[3.5*cm, 6*cm, 3*cm, 4.5*cm] )) story.append(sp(4)) story.append(info_box("TB Drug Side Effects (HIGH YIELD)", [ "Isoniazid (INH): Peripheral neuropathy (prevented by Pyridoxine/Vit B6), hepatotoxicity, drug-induced lupus", "Rifampin: Orange/red discoloration of body fluids, hepatotoxicity, drug interactions (CYP450 inducer)", "Pyrazinamide: Hyperuricemia (gout), hepatotoxicity", "Ethambutol: Optic neuritis (color vision loss — monthly eye exams required), retrobulbar neuritis", ], bg=HexColor("#FDEDEC"), title_color=RED)) story.append(sp(8)) # --- PLEURAL EFFUSION --- story.append(h2("1.5 PLEURAL EFFUSION")) story.append(p("Pleural effusion = excess fluid in the pleural space. ~1.5 million Americans/year. Key differentiation: TRANSUDATE vs EXUDATE using Light's criteria.")) story.append(drug_table( ["Criterion (Light's)", "Exudate", "Transudate", "Notes"], [ ["Pleural fluid protein/serum protein", ">0.5", "<0.5", "Ratio >0.5 = exudate"], ["Pleural fluid LDH/serum LDH", ">0.6", "<0.6", "Ratio >0.6 = exudate"], ["Pleural fluid LDH", ">2/3 upper limit serum LDH", "Below threshold", "Any 1 criterion = exudate"], ], col_widths=[5.5*cm, 3*cm, 3*cm, 5.5*cm] )) story.append(sp(4)) story.append(info_box("Common Causes", [ "TRANSUDATE: CHF (most common), Cirrhosis (hepatic hydrothorax), Nephrotic syndrome, PE", "EXUDATE: Bacterial pneumonia (parapneumonic), Malignancy, Pulmonary embolism, TB, Viral infection", "Parapneumonic effusion -> if pH <7.2, glucose <60, LDH >1000 -> COMPLICATED -> drain with chest tube", "Empyema (pus in pleural space) -> urgent chest tube drainage + antibiotics (IV penicillin or metronidazole)", ], bg=LIGHT2, title_color=GREEN)) story.append(sp(8)) # --- PULMONARY EMBOLISM --- story.append(h2("1.6 PULMONARY EMBOLISM (PE)")) story.append(info_box("Hallmark Symptoms of PE", [ "Sudden onset dyspnea (MOST COMMON symptom — 80%)", "Pleuritic chest pain (sharp, worse with breathing)", "Hemoptysis — classic but present in <30%", "Tachycardia (HR >100) — most common sign", "Hypotension/syncope in massive PE (right heart failure)", "Signs of DVT: unilateral leg swelling, calf tenderness, erythema", "Classic triad: Dyspnea + Chest pain + Hemoptysis (only ~20% have all three)", ], bg=LIGHT, title_color=TEAL)) story.append(sp(4)) story.append(drug_table( ["Severity", "Treatment", "Drug/Dose", "Notes"], [ ["Low/Intermediate risk", "Anticoagulation", "LMWH: Enoxaparin 1 mg/kg SC bid OR UFH IV OR DOAC: Rivaroxaban 15mg bid x21d then 20mg daily", "DOACs preferred (Rivaroxaban, Apixaban)"], ["High risk (massive PE)", "Systemic thrombolysis", "Alteplase (tPA) 100 mg IV over 2h", "Only if hemodynamic instability"], ["Absolute tPA contraindication", "Surgical embolectomy or catheter-directed therapy", "Per intervention", "If thrombolysis contraindicated"], ["Anticoagulation duration", "3 months (provoked) to indefinite (unprovoked/cancer)", "Rivaroxaban, Apixaban, Warfarin INR 2-3", "DOACs superior to warfarin in most cases"], ], col_widths=[3.5*cm, 3.5*cm, 5.5*cm, 4.5*cm] )) story.append(PageBreak()) # ============================================================ # SECTION 2: INFECTIOUS DISEASE # ============================================================ story.append(section_header("SECTION 2: INFECTIOUS DISEASE", HexColor("#1A5276"))) story.append(sp(8)) story.append(h2("2.1 SEPSIS & SEPTIC SHOCK")) story.append(p("Sepsis-3 Definition (2016): Life-threatening organ dysfunction caused by a dysregulated host response to infection. Organ dysfunction is defined as an increase of ≥2 in SOFA score from baseline.")) story.append(info_box("Sepsis Recognition — qSOFA Screen (any 2 = high risk)", [ "Respiratory rate ≥22 breaths/min", "Altered mental status (GCS <15)", "Systolic BP ≤100 mmHg", "SEPTIC SHOCK = Sepsis + vasopressor required to maintain MAP >65 mmHg + Lactate >2 mmol/L despite fluid resuscitation", ], bg=HexColor("#FDEDEC"), title_color=RED)) story.append(sp(6)) story.append(h3("Sepsis Bundle — 1-Hour Bundle (Surviving Sepsis Campaign 2021)")) story.append(drug_table( ["Step", "Action", "Drug/Details", "Timing"], [ ["1", "Measure lactate", "Target: lactate <2 mmol/L; repeat if initial >2", "Immediately"], ["2", "Blood cultures x2", "Before antibiotics — at least 2 sets", "Before antibiotics"], ["3", "Broad-spectrum antibiotics", "Empirical within 1h of shock recognition (7-8% mortality per hour of delay)", "<1 hour"], ["4", "IV crystalloid resuscitation", "30 mL/kg IV crystalloid (NS or Lactated Ringer's) for hypotension or lactate ≥4", "Within 3 hours"], ["5", "Vasopressors if no response", "Norepinephrine (1st-line) — target MAP ≥65 mmHg", "If hypotension persists"], ], col_widths=[1.5*cm, 3.5*cm, 7*cm, 5*cm] )) story.append(sp(4)) story.append(drug_table( ["Vasopressor", "Mechanism", "Dose", "First-Line?"], [ ["Norepinephrine", "Alpha1 + Beta1 agonist (alpha dominant)", "0.01-3 mcg/kg/min IV", "YES — First-line vasopressor"], ["Vasopressin", "V1 receptor (vasoconstriction)", "Fixed 0.03-0.04 units/min", "Add to NE; steroid-sparing"], ["Epinephrine", "Alpha1 + Beta1 + Beta2", "0.01-1 mcg/kg/min", "Add-on for refractory shock"], ["Dopamine", "Dopamine/Adrenergic dose-dependent", "2-20 mcg/kg/min", "Avoid — higher arrhythmia risk"], ["Dobutamine", "Beta1 dominant (inotropy)", "2-20 mcg/kg/min", "Cardiogenic shock or low CO"], ], col_widths=[3.5*cm, 4*cm, 4*cm, 5.5*cm] )) story.append(sp(4)) story.append(info_box("Empiric Antibiotic Selection for Sepsis (based on source)", [ "Unknown source / Community-acquired: Ceftriaxone 2g IV daily OR Piperacillin-tazobactam 4.5g IV q8h", "Hospital-acquired / Pseudomonas risk: Cefepime 2g IV q8h OR Piperacillin-tazobactam OR Carbapenem (Meropenem/Imipenem)", "MRSA risk (prior MRSA, healthcare-associated): Add Vancomycin 15-20 mg/kg IV q8-12h OR Linezolid 600 mg IV/PO", "Candida risk (immunocompromised, prolonged abx): Add Echinocandin (Micafungin, Caspofungin)", "Duration: De-escalate at 48-72h based on cultures; typical 7-10 days", "Hydrocortisone 200 mg/day IV if refractory shock despite vasopressors", ], bg=LIGHT2, title_color=GREEN)) story.append(sp(8)) story.append(h2("2.2 HOSPITAL-ACQUIRED PNEUMONIA (HAP) & VENTILATOR-ASSOCIATED PNEUMONIA (VAP)")) story.append(p("HAP: Pneumonia ≥48h after admission, not incubating at admission. VAP: Pneumonia ≥48h after mechanical ventilation. Important: organisms are usually RESISTANT — anti-Pseudomonal and anti-MRSA coverage often needed.")) story.append(drug_table( ["Regimen", "Drug Options", "Class", "When to Use"], [ ["Anti-Pseudomonal Beta-Lactam", "Piperacillin-tazobactam 4.5g IV q8h", "Beta-lactam/beta-lactamase inhibitor", "Standard coverage"], ["Anti-Pseudomonal Beta-Lactam", "Cefepime 2g IV q8h", "4th-gen cephalosporin", "Standard coverage"], ["Anti-Pseudomonal Carbapenem", "Meropenem 1g IV q8h or Imipenem", "Carbapenem", "MDR organisms, high-risk"], ["MRSA Coverage", "Vancomycin 15-20 mg/kg IV q8-12h (trough 15-20)", "Glycopeptide", "Risk factors for MRSA: prior MRSA, IV drug use"], ["MRSA Coverage", "Linezolid 600 mg IV/PO q12h", "Oxazolidinone", "Better lung penetration than vancomycin"], ["Aztreonam", "Aztreonam 2g IV q8h", "Monobactam", "Penicillin allergy with Gram-neg coverage"], ], col_widths=[3.5*cm, 4.5*cm, 3.5*cm, 5.5*cm] )) story.append(sp(8)) story.append(h2("2.3 INFECTIVE ENDOCARDITIS (IE)")) story.append(info_box("Hallmark Symptoms & Signs (Duke Criteria)", [ "FEVER (most common, >90%) — persistent, remitting", "New or changed heart murmur (regurgitant)", "Osler nodes: Painful nodes on finger/toe pads (immune complex — RIGHT-SIDED IE hallmark)", "Janeway lesions: Painless hemorrhagic macules on palms/soles (septic emboli — LEFT-SIDED IE)", "Roth spots: Oval hemorrhages with pale center in retina", "Splinter hemorrhages: Linear hemorrhages under nails", "Splenomegaly, arthralgia, back pain", "Duke Major Criteria: Positive blood cultures x2 + Echocardiographic evidence (vegetation/abscess)", ], bg=LIGHT, title_color=TEAL)) story.append(sp(4)) story.append(drug_table( ["Organism", "Drug of Choice", "Drug Class", "Dose/Duration"], [ ["Streptococcus viridans (PCN-sensitive)", "Penicillin G or Ceftriaxone", "Beta-lactam", "Pen G 12-18 MU/day IV x 4 wks OR Ceftriaxone 2g IV daily x 4 wks"], ["Enterococcus", "Ampicillin + Gentamicin", "Beta-lactam + Aminoglycoside", "Ampicillin 12g/day + Gent x 4-6 wks"], ["MSSA (Staph aureus, methicillin-sensitive)", "Nafcillin or Oxacillin", "Anti-staphylococcal penicillin", "2g IV q4h x 6 wks"], ["MRSA (methicillin-resistant Staph aureus)", "Vancomycin", "Glycopeptide", "15-20 mg/kg IV q8-12h x 6 wks"], ["HACEK organisms", "Ceftriaxone", "3rd-gen cephalosporin", "2g IV daily x 4 wks"], ["Native valve empiric (before cultures)", "Vancomycin + Gentamicin", "Broad spectrum", "Adjust to culture results"], ], col_widths=[3.5*cm, 3.5*cm, 3.5*cm, 6.5*cm] )) story.append(sp(8)) story.append(h2("2.4 BACTERIAL MENINGITIS")) story.append(info_box("Classic Triad + Signs (HIGH YIELD)", [ "CLASSIC TRIAD: Fever + Neck stiffness (nuchal rigidity) + Altered mental status/headache", "Kernig sign: Resistance to knee extension with hip flexed", "Brudzinski sign: Passive neck flexion causes involuntary knee flexion", "Photophobia and phonophobia", "Petechial/purpuric rash — N. meningitidis (Waterhouse-Friderichsen syndrome if bilateral adrenal hemorrhage)", "Elevated ICP: Papilledema, cranial nerve palsies, Cushing triad (hypertension + bradycardia + irregular respirations)", ], bg=HexColor("#FDEDEC"), title_color=RED)) story.append(sp(4)) story.append(drug_table( ["Age/Scenario", "Likely Organism", "Empiric Antibiotic", "Add Dexamethasone?"], [ ["Neonate (<1 month)", "GBS, E. coli, Listeria", "Ampicillin + Cefotaxime/Gent", "No"], ["Infant 1-3 months", "GBS, E. coli, S. pneumoniae, N. meningitidis", "Vancomycin + Cefotaxime", "Yes"], ["Child/Adult", "S. pneumoniae, N. meningitidis", "Vancomycin + Ceftriaxone 2g IV q12h", "YES — 0.15 mg/kg IV q6h x 4 days"], [">50 years or immunocompromised", "S. pneumoniae + Listeria", "Vancomycin + Ceftriaxone + Ampicillin", "YES"], ["Post-neurosurgery/trauma/shunt", "S. aureus, Gram negatives", "Vancomycin + Cefepime/Meropenem", "No"], ], col_widths=[3.5*cm, 4*cm, 5*cm, 4.5*cm] )) story.append(sp(4)) story.append(info_box("Dexamethasone in Meningitis — KEY POINT", [ "Give BEFORE or WITH first antibiotic dose (not after — must precede antibiotics)", "Dose: 0.15 mg/kg IV q6h x 4 days", "Reduces neurologic sequelae (hearing loss, death) — proven for S. pneumoniae", "CSF Analysis: Bacterial: WBC >1000 (PMN), low glucose (<45), high protein (>200 mg/dL)", ], bg=LIGHT3, title_color=AMBER)) story.append(PageBreak()) # ============================================================ # SECTION 3: FULL-CODE CASE / CRITICAL CARE # ============================================================ story.append(section_header("SECTION 3: FULL-CODE CASE & CRITICAL CARE", HexColor("#7D3C98"))) story.append(sp(8)) story.append(h2("3.1 CARDIAC ARREST & CPR (BLS/ACLS)")) story.append(info_box("Out-of-Hospital Chain of Survival (AHA)", [ "1. Recognize arrest & activate emergency response (call 911)", "2. Initiate HIGH-QUALITY CPR immediately — chest compressions", "3. Defibrillation ASAP — apply AED as soon as available", "4. Advanced life support (paramedics/emergency team)", "5. Post-cardiac arrest care (targeted temperature management, PCI if STEMI)", "6. Recovery — rehabilitation", ], bg=LIGHT3, title_color=AMBER)) story.append(sp(4)) story.append(h3("High-Quality CPR — Technical Requirements (CRITICAL)")) story.append(drug_table( ["Parameter", "Target", "Rationale", "Common Error"], [ ["Compression rate", "100-120/min", "Optimal cardiac output", "Too slow or too fast"], ["Compression depth", "≥5 cm (2 inches)", "Adequate ventricular emptying", "Too shallow"], ["Chest recoil", "FULL recoil between compressions", "Allows ventricular filling", "Leaning on chest"], ["Compression fraction", ">80%", "Minimize hands-off time", "Too many pauses"], ["Ventilation ratio (untrained)", "Hands-only CPR (no breaths)", "Equal benefit, easier to perform", "Don't delay compressions"], ["Ventilation ratio (trained)", "30:2 compressions to breaths", "Until advanced airway placed", "Over-ventilation bad"], ["Rescuer switch", "Every 2 minutes", "Prevent fatigue and rate degradation", "Infrequent switching"], ], col_widths=[4.5*cm, 3.5*cm, 4.5*cm, 4.5*cm] )) story.append(sp(6)) story.append(h2("3.2 ACLS ALGORITHM — SHOCKABLE vs NON-SHOCKABLE RHYTHMS")) story.append(drug_table( ["Rhythm", "Shockable?", "First Intervention", "Drugs Used"], [ ["Ventricular Fibrillation (VF)", "YES", "Defibrillate immediately (200J biphasic)", "Epinephrine 1mg IV q3-5min; Amiodarone 300mg IV bolus (or Lidocaine)"], ["Pulseless VT (pVT)", "YES", "Defibrillate immediately (200J biphasic)", "Same as VF"], ["Pulseless Electrical Activity (PEA)", "NO", "CPR + identify/treat H's & T's", "Epinephrine 1mg IV q3-5min; NO amiodarone"], ["Asystole", "NO", "CPR (2 min) + Epinephrine", "Epinephrine 1mg IV q3-5min; NO defibrillation"], ], col_widths=[3.5*cm, 2.5*cm, 5*cm, 6*cm] )) story.append(sp(4)) story.append(info_box("H's and T's — Reversible Causes of Cardiac Arrest", [ "H: Hypovolemia | Hypoxia | Hydrogen ion (acidosis) | Hypo/Hyperkalemia | Hypothermia", "T: Tension pneumothorax | Tamponade (cardiac) | Toxins | Thrombosis (PE or MI)", "MEMORY TIP: Always think of reversible causes in PEA/Asystole — these are TREATABLE!", ], bg=LIGHT3, title_color=AMBER)) story.append(sp(4)) story.append(h3("ACLS Drug Details")) story.append(drug_table( ["Drug", "Class", "Dose", "Indication in ACLS"], [ ["Epinephrine (Adrenaline)", "Catecholamine (alpha+beta agonist)", "1 mg IV/IO every 3-5 minutes", "ALL cardiac arrest rhythms — VF/pVT after 2nd shock; PEA/Asystole immediately"], ["Amiodarone", "Class III antiarrhythmic (K+ channel blocker)", "300 mg IV bolus; 2nd dose 150 mg", "Shock-refractory VF/pVT"], ["Lidocaine", "Class IB antiarrhythmic (Na+ channel)", "1-1.5 mg/kg IV bolus", "Alternative to amiodarone"], ["Sodium Bicarbonate", "Alkalinizing agent", "1 mEq/kg IV", "Hyperkalemia, TCA overdose, pre-existing metabolic acidosis"], ["Calcium Chloride", "Calcium salt", "1g IV (10 mL of 10%)", "Hyperkalemia, Hypocalcemia, Ca-channel blocker OD"], ["Atropine", "Muscarinic antagonist", "0.5-1 mg IV q3-5 min (max 3 mg)", "Symptomatic bradycardia (NOT cardiac arrest)"], ["Adenosine", "Purine nucleoside", "6 mg rapid IV push; then 12 mg", "SVT (not VT/AF/flutter)"], ["Magnesium sulfate", "Electrolyte", "1-2g IV", "Torsades de Pointes (polymorphic VT with long QT)"], ], col_widths=[3*cm, 3.5*cm, 3.5*cm, 7*cm] )) story.append(sp(8)) story.append(h2("3.3 SHOCK — CLASSIFICATION & MANAGEMENT")) story.append(p("Shock = inadequate oxygen delivery to tissues leading to cellular hypoxia and organ dysfunction. Three phases: Compensated -> Decompensated -> Irreversible.")) story.append(drug_table( ["Type of Shock", "Mechanism", "Key Findings", "Primary Treatment"], [ ["Distributive (Septic)", "Vasodilation, low SVR, high CO", "Fever, warm extremities, bounding pulse, low BP", "Antibiotics + IV fluids + Norepinephrine"], ["Distributive (Anaphylactic)", "Massive histamine/IgE-mediated vasodilation", "Urticaria, angioedema, bronchospasm, hypotension", "EPINEPHRINE 0.3 mg IM (thigh) IMMEDIATELY"], ["Cardiogenic", "Pump failure, low CO, high SVR, high PCWP", "Cold/clammy, JVD, crackles, S3, Killip IV", "Norepinephrine/Dopamine + Dobutamine; revascularization"], ["Hypovolemic", "Low preload (bleeding, dehydration)", "Tachycardia, poor skin turgor, flat JVP, decreased UO", "IV crystalloids/blood products; stop bleeding"], ["Obstructive (PE/Tamponade)", "Mechanical obstruction, low CO, high SVR", "JVD, Beck's triad (tamponade), tracheal deviation (tension PTX)", "PE: thrombolysis; Tamponade: pericardiocentesis; PTX: needle decompression"], ], col_widths=[3*cm, 3.5*cm, 5*cm, 5.5*cm] )) story.append(sp(4)) story.append(info_box("Anaphylaxis Management — TIME-CRITICAL", [ "1. EPINEPHRINE 1:1000, 0.3-0.5 mg IM (anterolateral thigh) — FIRST AND MOST IMPORTANT", "2. Lay patient flat, raise legs (Trendelenburg if BP low)", "3. IV access + normal saline 1-2L bolus", "4. Diphenhydramine 25-50 mg IV/IM (H1 blocker)", "5. Ranitidine/Famotidine 20mg IV (H2 blocker)", "6. Corticosteroids: Methylprednisolone 125 mg IV (prevents biphasic reaction)", "7. Nebulized albuterol if bronchospasm", "NEVER delay epinephrine — it is the ONLY life-saving drug in anaphylaxis", ], bg=HexColor("#FDEDEC"), title_color=RED)) story.append(PageBreak()) # ============================================================ # SECTION 4: CHEST X-RAY # ============================================================ story.append(section_header("SECTION 4: CHEST X-RAY (CXR) INTERPRETATION", HexColor("#117864"))) story.append(sp(8)) story.append(h2("4.1 APPROACH TO CXR — SYSTEMATIC METHOD")) story.append(info_box("Systematic CXR Reading (ABCDE Approach)", [ "A — Airway: Trachea midline? Carina angle (<70 degrees = normal), Mainstem bronchi visible?", "B — Bones & soft tissue: Rib fractures, clavicle, vertebrae, soft tissue calcifications", "C — Cardiac: Cardiothoracic ratio <0.5 (PA film); Heart borders (right = RA, left = LV/LA/aortic knuckle); Normal cardiac silhouette", "D — Diaphragm: Right hemidiaphragm higher (liver); Air under diaphragm = perforation; Blunted costophrenic angles = effusion", "E — Everything else: Mediastinum width, lung fields, hila, pleura, devices (ETT, central lines, NG tube, pacemaker)", "F — Fields (Lung parenchyma): Compare both sides; look for opacity, consolidation, cavitation, nodules", ], bg=LIGHT4, title_color=HexColor("#117864"))) story.append(sp(6)) story.append(h2("4.2 CXR VIEWS")) story.append(drug_table( ["View", "How Taken", "Clinical Use", "Key Differences"], [ ["Posteroanterior (PA)", "Patient stands, X-ray from behind; cassette at front", "Standard outpatient CXR", "Best for cardiac silhouette size; less magnification"], ["Anteroposterior (AP)", "Portable (bedside); X-ray from front", "ICU/bedbound patients", "Heart appears larger (magnified); often rotated"], ["Lateral", "Patient sideways to detector", "Localize lesions", "Identifies retrocardiac opacity; fissure lines"], ["Lateral Decubitus", "Patient lying on side", "Confirm free-flowing effusion", "Effusion layers along dependent wall if free-flowing"], ], col_widths=[3.5*cm, 4*cm, 4*cm, 5.5*cm] )) story.append(sp(6)) story.append(h2("4.3 CXR PATTERNS & DIFFERENTIAL DIAGNOSIS (HIGH YIELD)")) story.append(drug_table( ["CXR Finding", "Description", "Differential Diagnosis / Causes"], [ ["Lobar Consolidation", "Dense homogeneous opacity occupying a lobe; air bronchograms", "Lobar pneumonia (S. pneumoniae), post-obstructive"], ["Interstitial Pattern", "Reticular, reticulonodular opacities; ground-glass; Kerley B lines", "Interstitial lung disease, pulmonary edema (CHF), viral pneumonia, lymphangitic carcinomatosis"], ["Cavitation", "Thick-walled air-filled space within opacity", "TB (upper lobe!), lung abscess, Klebsiella pneumonia, fungal infection, Wegener's, cancer"], ["Miliary Pattern", "Countless tiny nodules (millet seeds) throughout both lungs", "Miliary TB, sarcoidosis, metastatic cancer, fungal infection (histoplasmosis)"], ["Upper Lobe Infiltrates", "Opacity in upper lobes with/without cavitation", "TB (reactivation), aspiration (if erect position), Klebsiella"], ["Pleural Effusion", "Blunting of costophrenic angle; fluid opacity; meniscus sign", "CHF (bilateral), parapneumonic (unilateral), malignancy, PE, cirrhosis"], ["Pneumothorax", "Absent lung markings, visible pleural line, deep sulcus sign (AP)", "Spontaneous (tall thin males), trauma, mechanical ventilation, iatrogenic"], ["Mediastinal Widening", "Mediastinum >8 cm on PA CXR", "Aortic dissection (emergency!), lymphoma, sarcoidosis, teratoma, thymoma"], ["Cardiomegaly", "CTR >0.5 (PA); double shadow; increased vascular markings", "CHF, dilated cardiomyopathy, pericardial effusion"], ["Pulmonary Edema (CHF)", "Bilateral perihilar opacities ('bat-wing'); Kerley B lines; effusions", "Left heart failure; Kerley B = engorged lymphatics"], ["Air Bronchograms", "Air-filled bronchi visible within opacity", "CONSOLIDATION (pathognomonic) — pneumonia, ARDS, pulmonary edema"], ["Hampton's Hump", "Wedge-shaped pleural-based opacity", "Pulmonary infarction from PE (classic but uncommon)"], ["Westermark Sign", "Localized hyperlucency distal to PE", "Pulmonary embolism (oligemia)"], ], col_widths=[4*cm, 5*cm, 8*cm] )) story.append(sp(6)) story.append(h2("4.4 CXR FINDINGS BY DISEASE — RAPID REFERENCE")) story.append(drug_table( ["Disease", "Hallmark CXR Finding", "Additional CXR Features"], [ ["Lobar Pneumonia (CAP)", "Lobar or segmental consolidation", "Air bronchograms; silhouette sign (RML/RLL)"], ["Atypical Pneumonia (Mycoplasma)", "Bilateral patchy infiltrates", "Interstitial pattern; worse than clinical exam suggests"], ["TB (Primary)", "Hilar lymphadenopathy ± consolidation", "Middle/lower lobe; Ghon complex"], ["TB (Reactivation)", "Upper lobe cavitation (HALLMARK)", "Fibronodular infiltrates, apical scarring, volume loss"], ["COPD / Emphysema", "Hyperinflation, flat diaphragm, increased AP diameter", ">6 anterior ribs visible on PA; bullae; decreased vascular markings"], ["Asthma (Acute)", "Usually NORMAL (important!)", "Hyperinflation during severe attack; no consolidation"], ["Pulmonary Edema (CHF)", "Bilateral perihilar opacities; Kerley B lines", "Cardiomegaly; pleural effusions (bilateral)"], ["Pulmonary Embolism", "Often NORMAL", "Hampton hump, Westermark sign, small pleural effusion"], ["Tension Pneumothorax", "Tracheal deviation AWAY from affected side", "Absent lung markings; depressed diaphragm; shift of mediastinum"], ["Pleural Effusion", "Blunting of costophrenic angle; meniscus", "Mediastinal shift to opposite side if large"], ["Sarcoidosis", "Bilateral hilar lymphadenopathy (BHL) — CLASSIC", "Stage I: BHL only; Stage II: BHL + parenchymal infiltrates; Stage III: infiltrates only"], ["Malignancy (primary)", "Solitary pulmonary nodule or mass", "Irregular margins, pleural effusion, mediastinal LN"], ["ARDS", "Bilateral diffuse alveolar infiltrates", "Normal heart size (distinguishes from CHF); no Kerley B lines"], ["Aortic Dissection", "Widened mediastinum (>8 cm) ± left pleural effusion", "Loss of aortic knuckle; double aortic contour"], ], col_widths=[4.5*cm, 5.5*cm, 7*cm] )) story.append(sp(8)) # SILHOUETTE SIGN story.append(h2("4.5 SILHOUETTE SIGN (HIGH YIELD FOR EXAMS)")) story.append(p("The silhouette sign occurs when a pathologic density (consolidation, mass, effusion) contacts a normal border, OBLITERATING it. This localizes the lesion.")) story.append(drug_table( ["Obliterated Border", "Structure Lost", "Location of Lesion"], [ ["Right heart border", "Right atrium silhouette lost", "Right middle lobe (RML) or medial segment"], ["Left heart border", "Left ventricle silhouette lost", "Left upper lobe lingula"], ["Right hemidiaphragm", "Diaphragm contour lost on right", "Right lower lobe (RLL)"], ["Left hemidiaphragm", "Diaphragm contour lost on left", "Left lower lobe (LLL)"], ["Aortic knuckle", "Aortic arch silhouette lost", "Left upper lobe (LUL)"], ], col_widths=[5*cm, 5*cm, 7*cm] )) story.append(sp(6)) # Quick Reference Summary story.append(section_header("RAPID REVIEW — HIGH-YIELD EXAM POINTS", HexColor("#884EA0"))) story.append(sp(8)) story.append(drug_table( ["Topic", "Hallmark Symptom/Sign", "First-Line Drug", "Key Drug Class"], [ ["Asthma (acute)", "Wheezing + nocturnal cough", "Albuterol (SABA) inhaler", "Beta2 Agonist"], ["Asthma (chronic persistent)", "Recurrent episodic wheezing", "ICS (e.g., Budesonide)", "Inhaled Corticosteroid"], ["COPD (stable)", "Progressive exertional dyspnea + chronic cough", "Tiotropium (LAMA)", "Muscarinic Antagonist"], ["COPD Exacerbation", "Acute worsening dyspnea + purulent sputum", "Prednisone + Azithromycin + Nebs", "Corticosteroid + Antibiotic"], ["CAP (Outpatient)", "Fever + productive cough + CXR infiltrate", "Amoxicillin 1g TID or Doxycycline", "Beta-lactam or Tetracycline"], ["CAP (Inpatient)", "Same + admitted", "Ceftriaxone + Azithromycin", "Cephalosporin + Macrolide"], ["Legionella CAP", "Hyponatremia + diarrhea + pneumonia", "Levofloxacin 750 mg daily", "Fluoroquinolone"], ["TB (Active)", "Hemoptysis + night sweats + upper lobe cavitation", "HRZE x 2 months then HR x 4 months", "Anti-TB regimen"], ["PE", "Sudden dyspnea + tachycardia", "Rivaroxaban or Apixaban (DOAC)", "Direct Oral Anticoagulant"], ["Septic Shock", "Fever + hypotension + lactate >2", "Norepinephrine + Broad-spectrum abx", "Vasopressor + Antibiotic"], ["VF/pVT Arrest", "No pulse + shockable rhythm", "Defibrillate 200J + Epinephrine 1mg", "Catecholamine"], ["PEA/Asystole", "No pulse + non-shockable", "CPR + Epinephrine 1mg IV q3-5min", "Catecholamine"], ["Anaphylaxis", "Urticaria + bronchospasm + hypotension", "Epinephrine 0.3 mg IM IMMEDIATELY", "Catecholamine"], ["Bacterial Meningitis", "Fever + neck stiffness + altered consciousness", "Vancomycin + Ceftriaxone 2g IV q12h", "Glycopeptide + Cephalosporin"], ["Infective Endocarditis (MRSA)", "Fever + new murmur + Osler nodes", "Vancomycin 15-20 mg/kg IV", "Glycopeptide"], ["CXR: Lobar consolidation", "Fever + cough + dullness", "→ Pneumonia (CAP)", "Lobar pneumonia pattern"], ["CXR: Upper lobe cavitation", "Chronic cough + hemoptysis + weight loss", "→ TB (Reactivation TB)", "TB hallmark on CXR"], ["CXR: Bilateral perihilar opacity", "Dyspnea + edema + S3", "→ CHF / Pulmonary Edema", "Kerley B lines"], ["CXR: Tracheal deviation + absent marks", "Sudden severe dyspnea + hypotension", "→ Tension Pneumothorax", "Needle decompression 2nd ICS MCL"], ["CXR: Bilateral hilar lymphadenopathy", "Young adult + skin/eye lesions", "→ Sarcoidosis", "Non-caseating granulomas"], ], col_widths=[4*cm, 4.5*cm, 4.5*cm, 4*cm] )) story.append(sp(8)) story.append(p("Source: Harrison's Principles of Internal Medicine, 22nd Edition (2025, McGraw Hill Medical). All drug dosages should be verified with current clinical guidelines before use.", NOTE_S)) doc.build(story) print(f"PDF saved to: {output_path}") PYEOF python3 /tmp/workspace/im-exam-guide/generate_guide.py

Running Command

ls -lh /tmp/workspace/im-exam-guide/

Exam guide ready! Download below:

IM Exam Guide Harrisons

PDF Document · PDF


What's Inside — Topic-by-Topic Breakdown

All content is sourced directly from Harrison's Principles of Internal Medicine, 22nd Edition (2025).

SECTION 1: PULMONOLOGY

Sub-topicKey HallmarksImportant Drugs
AsthmaEpisodic wheezing + nocturnal cough (HALLMARK), reversible obstructionSABA (Albuterol) = reliever; ICS (Budesonide) = controller; Biologic: Omalizumab/Mepolizumab
COPDProgressive exertional dyspnea + chronic productive cough, IRREVERSIBLE obstructionLAMA (Tiotropium) = 1st-line; Triple therapy ICS+LABA+LAMA reduces mortality
CAP (Pneumonia)Fever + productive cough + NEW CXR infiltrate; Rusty sputum = Pneumococcal HALLMARKOutpatient: Amoxicillin 1g TID or Doxycycline; Inpatient: Ceftriaxone + Azithromycin
TuberculosisChronic cough + hemoptysis + night sweats + weight loss; Upper lobe cavitation on CXRHRZE x 2 months → HR x 4 months; INH SE: peripheral neuropathy (give Vit B6); Ethambutol SE: optic neuritis
Pleural EffusionDyspnea + blunted costophrenic angleLight's criteria to differentiate transudate vs exudate
PESudden dyspnea + tachycardia; Classic triad only in 20%DOAC (Rivaroxaban/Apixaban) for anticoagulation; Alteplase for massive PE

SECTION 2: INFECTIOUS DISEASE

Sub-topicKey HallmarksImportant Drugs
Sepsis/Septic ShockqSOFA ≥2; Septic shock = MAP <65 + lactate >2 despite fluidsNorepinephrine (1st-line vasopressor); broad-spectrum abx within 1h of shock recognition
HAP/VAPHospital pneumonia ≥48h; resistant organismsPiperacillin-tazobactam / Cefepime ± Vancomycin (MRSA coverage)
Infective EndocarditisFever + new murmur + Osler nodes (painful) + Janeway lesions (painless)S. viridans: Penicillin G / Ceftriaxone; MRSA: Vancomycin 6 weeks
Bacterial MeningitisFever + neck stiffness + altered mental status (classic triad)Vancomycin + Ceftriaxone + Dexamethasone BEFORE first antibiotic dose

SECTION 3: FULL-CODE CASE

TopicKey PointsDrugs
CPR QualityRate 100-120/min, depth ≥5 cm, full recoil, minimize interruptions-
VF/pVT (Shockable)Defibrillate 200J immediatelyEpinephrine 1mg q3-5min + Amiodarone 300mg bolus
PEA/Asystole (Non-shockable)CPR + H's & T'sEpinephrine 1mg q3-5min (NO defibrillation)
AnaphylaxisUrticaria + bronchospasm + hypotensionEpinephrine 0.3 mg IM FIRST - never delay
Septic ShockMAP <65 + lactate >2Norepinephrine + broad abx + 30 mL/kg crystalloid

SECTION 4: CHEST X-RAY

CXR FindingThink of...Hallmark Feature
Upper lobe cavitationTB (Reactivation)Fibronodular infiltrates + cavitation
Lobar consolidation + air bronchogramsLobar PneumoniaSilhouette sign
Bilateral perihilar opacities + Kerley B linesCHF / Pulmonary EdemaCardiomegaly + effusions
Tracheal deviation AWAY + absent lung markingsTension PneumothoraxEMERGENCY - needle decompression 2nd ICS MCL
Bilateral hilar lymphadenopathySarcoidosisYoung adult + no other cause
Normal CXR in sick patient with dyspneaPE or AsthmaWestermark/Hampton hump in PE

Best of luck for tomorrow's exam! All the best! 🙌
This is a shared conversation. Sign in to Orris to start your own chat.