pneumonia investigation and management
"community-acquired pneumonia" AND "guideline"
pneumonia investigation and management guideline 2024 2025 CURB-65 antibiotics
make a chart of investigation and management for asthma,copd,dengue , malaria ,TB , leptospirosis, abcess,
| Condition | Key Investigations | Management |
|---|---|---|
| Asthma | - Spirometry - the most useful confirmatory test: obstructive pattern (reduced FEV1/FVC) with reversibility (≥12% and 200 mL improvement in FEV1 post-bronchodilator) - Textbook of Family Medicine 9e - Peak expiratory flow (PEF) - useful for monitoring/self-management, not primary diagnosis - Textbook of Family Medicine 9e - Bronchoprovocation testing (methacholine challenge) if spirometry normal but suspicion high - Harrison's 22E - FeNO (fractional exhaled nitric oxide), allergy skin/IgE testing for atopic triggers - CXR to exclude alternative diagnosis (not routine) | - Stepwise therapy (GINA): as-needed SABA/low-dose ICS-formoterol (mild) → low-dose ICS-LABA maintenance → medium/high-dose ICS-LABA → add-on LAMA, biologics (anti-IgE, anti-IL5, anti-IL4R) for severe eosinophilic/allergic asthma - Acute exacerbation: oxygen to target SpO2 94-98%, nebulized salbutamol +/- ipratropium, systemic corticosteroids (oral prednisolone or IV hydrocortisone), IV magnesium sulfate if severe/life-threatening; escalate to ICU for silent chest, exhaustion, rising CO2 - Trigger avoidance, inhaler technique review, written action plan, vaccination (influenza/pneumococcal) |
| COPD | - Spirometry - mandatory for diagnosis: post-bronchodilator FEV1/FVC <0.70 confirms persistent airflow limitation (GOLD) - Symptom to Diagnosis; Murray & Nadel's - GOLD grading (1-4) by FEV1 % predicted, plus symptom/exacerbation-based ABE grouping - Fishman's Pulmonary Diseases - CXR/CT chest (hyperinflation, bullae, exclude malignancy), ABG if hypoxemic/hypercapnic, alpha-1 antitrypsin level if early-onset/family history, sputum culture during exacerbations, FBC (polycythemia/anemia), pulse oximetry, 6-minute walk/BODE index for prognosis | - Stable disease: smoking cessation (single most effective intervention), bronchodilators (LAMA/LABA), add ICS if frequent exacerbations with eosinophilia, pulmonary rehabilitation, long-term oxygen if PaO2 <55 mmHg, vaccinations - Acute exacerbation: controlled oxygen (avoid hyperoxia in hypercapnic patients), nebulized bronchodilators, oral corticosteroids (5 days), antibiotics if increased purulent sputum, NIV for hypercapnic respiratory failure, escalate to invasive ventilation if NIV fails - Categorized by GOLD grade/exacerbation frequency to guide escalation - Textbook of Family Medicine 9e |
| Dengue | - NS1 antigen - detectable early (first 1-7 days), highly specific - Goldman-Cecil Medicine; Park's Textbook of PSM - IgM/IgG serology (ELISA) - IgM rises after day 3-5; if early sample IgM-negative, test RNA/NS1 - Brenner & Rector's The Kidney - RT-PCR for dengue RNA for early confirmation/serotyping - FBC (thrombocytopenia, rising hematocrit/hemoconcentration - key warning sign), LFTs, tourniquet test (capillary fragility), serial hematocrit and platelet monitoring, USG/CXR for pleural effusion/ascites in severe dengue | - No specific antiviral - supportive care is mainstay - Fluid management guided by hematocrit trend (careful judicious IV fluids in severe/warning-sign cases; oral fluids for uncomplicated cases) - Avoid NSAIDs/aspirin (bleeding risk) - use paracetamol for fever/pain - Close monitoring for warning signs (abdominal pain, persistent vomiting, mucosal bleeding, lethargy, rapid hematocrit rise with falling platelets) heralding progression to severe dengue/dengue shock syndrome - Severe dengue: managed in center experienced with careful fluid resuscitation +/- blood products; reduces mortality substantially - Goldman-Cecil Medicine |
| Malaria | - Thick and thin blood film (Giemsa stain) - gold standard; thick film for detection, thin film for species ID and parasitemia % - Tietz Textbook of Laboratory Medicine - Rapid diagnostic tests (RDT) - antigen-based (HRP-2, pLDH), useful when microscopy unavailable - Harrison's 22E - Repeat films if initial negative but clinical suspicion high (P. falciparum smear may be falsely negative early) - Tintinalli's Emergency Medicine - Parasitemia % (>20% mature-form parasitemia predicts poor prognosis), FBC, glucose, renal/liver function, lactate for severity | - Uncomplicated P. falciparum: artemisinin-based combination therapy (ACT) e.g., artemether-lumefantrine - Uncomplicated non-falciparum (P. vivax/ovale): chloroquine (if sensitive) + primaquine/tafenoquine for radical cure of liver-stage hypnozoites (check G6PD first) - Severe/complicated malaria: IV artesunate is first-line; do not delay treatment awaiting confirmation - Tintinalli's Emergency Medicine - Supportive care for complications: correct hypoglycemia, manage seizures, dialysis for renal failure, exchange transfusion considered in extreme hyperparasitemia - Chemoprophylaxis and vector control for prevention |
| Tuberculosis | - Sputum smear microscopy (acid-fast bacilli / Ziehl-Neelsen) - three specimens recommended - Goldman-Cecil Medicine - GeneXpert MTB/RIF (molecular PCR) - rapid detection plus rifampin resistance - Tietz Textbook of Laboratory Medicine - Mycobacterial culture (liquid/solid media) - gold standard, also needed for full drug-susceptibility testing - CXR (cavitation, upper lobe infiltrates, hilar lymphadenopathy), CT chest for extrapulmonary/complicated disease - TST (Mantoux) or IGRA for latent TB infection screening - Red Book 2021 - HIV testing (co-testing recommended in all TB patients) | - Active TB: standard 6-month regimen - 2 months intensive phase (isoniazid, rifampin, pyrazinamide, ethambutol = RIPE) followed by 4 months continuation (isoniazid + rifampin); directly observed therapy (DOT) recommended - Drug-resistant TB (MDR/RR-TB): longer regimens with second-line agents (e.g., bedaquiline-based) per WHO guidance - Latent TB: isoniazid preventive therapy (6-9 months) or shorter rifapentine-based regimens in appropriate contacts - Contact tracing, airborne isolation for smear-positive pulmonary disease, notify public health authorities, monitor LFTs (hepatotoxicity) and visual acuity (ethambutol) |
| Leptospirosis | - Serology is the primary diagnostic method (MAT - microscopic agglutination test is reference standard; ELISA IgM for rapid screening) - Sherris & Ryan's Medical Microbiology - Note: serologic tests can have poor sensitivity in the first week of illness - Jawetz Melnick & Adelberg's - Blood culture (first week/leptospiremic phase) or urine culture (second week/leptospiruric phase) can confirm diagnosis - Sleisenger & Fordtran's - PCR for early detection, FBC, renal function (creatinine - renal impairment common), LFTs (jaundice in Weil's disease), CK (myositis), CXR if pulmonary hemorrhage suspected | - Mild disease: oral doxycycline 100 mg twice daily for 1 week is effective if started early - Andrews' Diseases of the Skin - Severe leptospirosis (Weil's disease): IV penicillin as soon as diagnosis is considered, or ceftriaxone as alternative - Harrison's 22E; Sherris & Ryan's - Supportive care for complications: dialysis for acute kidney injury, transfusion/ventilatory support for pulmonary hemorrhage, careful fluid/electrolyte management - Watch for Jarisch-Herxheimer-like reaction after starting antibiotics |
| Abscess (skin/soft tissue or visceral) | - Clinical exam: fluctuance, erythema, warmth, tenderness +/- systemic signs of sepsis - Ultrasound - useful bedside tool to confirm fluid collection and guide drainage - CT (with contrast) for deep/visceral abscesses (hepatic, intra-abdominal, intraperitoneal) - Sabiston Textbook of Surgery; Yamada's Gastroenterology - Blood cultures, FBC/inflammatory markers (CRP, WBC) if systemic involvement, pus culture and sensitivity from aspirate/drainage to guide antibiotic choice | - Core principle: source control - drainage (incision and drainage, or image-guided percutaneous aspiration/catheter drainage) is the definitive treatment; antibiotics alone are inadequate for most abscesses ≥3-5 cm - Mulholland & Greenfield's Surgery - Small abscesses (<3 cm, e.g., in diverticulitis) may respond to antibiotics alone; larger ones need drainage plus antibiotics - Mulholland & Greenfield's Surgery - Broad-spectrum empirical antibiotics pending culture, then narrow based on sensitivities; cover anaerobes for intra-abdominal/dental sources, MRSA-active agents for skin/soft tissue abscesses with risk factors - Identify and treat the underlying cause (e.g., perforation, foreign body, hematogenous seeding) to prevent recurrence - Yamada's Gastroenterology - Surgical drainage remains mainstay when percutaneous approach fails or is inaccessible (e.g., loculated empyema, deep-seated collections) |
Create a downloadable PDF quick-reference guide for these diagnoses
mkdir -p /tmp/workspace/medical-quickref/output && ls -la /tmp/workspace/
~/medical-quickref/build_pdf.py
# -*- coding: utf-8 -*-
from reportlab.lib.pagesizes import letter
from reportlab.lib import colors
from reportlab.lib.units import inch
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
PageBreak, HRFlowable, KeepTogether
)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT
from reportlab.pdfgen import canvas
OUT = "/tmp/workspace/medical-quickref/output/Quick_Reference_Guide_Diagnoses.pdf"
styles = getSampleStyleSheet()
title_style = ParagraphStyle('TitleStyle', parent=styles['Title'], fontSize=26,
textColor=colors.HexColor('#0B3D66'), spaceAfter=6, alignment=TA_CENTER)
subtitle_style = ParagraphStyle('SubtitleStyle', parent=styles['Normal'], fontSize=13,
textColor=colors.HexColor('#444444'), alignment=TA_CENTER, spaceAfter=4)
disclaimer_style = ParagraphStyle('Disclaimer', parent=styles['Normal'], fontSize=8.5,
textColor=colors.HexColor('#777777'), alignment=TA_CENTER)
cond_title_style = ParagraphStyle('CondTitle', parent=styles['Heading1'], fontSize=19,
textColor=colors.white, spaceAfter=0, spaceBefore=0,
leftIndent=0)
section_head_style = ParagraphStyle('SectionHead', parent=styles['Heading3'], fontSize=12.5,
textColor=colors.HexColor('#0B3D66'), spaceBefore=8, spaceAfter=4)
body_style = ParagraphStyle('BodyCell', parent=styles['Normal'], fontSize=9.3, leading=12.5)
bullet_style = ParagraphStyle('BulletCell', parent=styles['Normal'], fontSize=9.3, leading=12.8,
leftIndent=8, bulletIndent=0)
toc_style = ParagraphStyle('TOCItem', parent=styles['Normal'], fontSize=12, leading=20,
textColor=colors.HexColor('#0B3D66'))
ACCENT = {
"Pneumonia": "#1B4F72",
"Asthma": "#1E8449",
"COPD": "#6C3483",
"Dengue": "#B03A2E",
"Malaria": "#B9770E",
"Tuberculosis (TB)": "#117864",
"Leptospirosis": "#2C3E50",
"Abscess": "#7B241C",
}
def bl(items):
"""Build bullet list HTML for a Paragraph cell."""
return "<br/>".join(f"• {i}" for i in items)
def make_condition_table(name, investigations, management, key_points=None):
color = colors.HexColor(ACCENT.get(name, "#0B3D66"))
flow = []
# Header bar
header_tbl = Table([[Paragraph(name.upper(), cond_title_style)]], colWidths=[6.9*inch])
header_tbl.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), color),
('TOPPADDING', (0,0), (-1,-1), 10),
('BOTTOMPADDING', (0,0), (-1,-1), 10),
('LEFTPADDING', (0,0), (-1,-1), 12),
]))
flow.append(header_tbl)
flow.append(Spacer(1, 10))
# Investigations / Management two-column table
inv_para = Paragraph(bl(investigations), body_style)
mgmt_para = Paragraph(bl(management), body_style)
data = [
[Paragraph("<b>INVESTIGATIONS</b>", section_head_style),
Paragraph("<b>MANAGEMENT</b>", section_head_style)],
[inv_para, mgmt_para]
]
t = Table(data, colWidths=[3.4*inch, 3.5*inch])
t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,0), colors.HexColor('#EAF1F8')),
('BOX', (0,0), (-1,-1), 0.75, colors.HexColor('#B0B0B0')),
('INNERGRID', (0,0), (-1,-1), 0.5, colors.HexColor('#CCCCCC')),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('LEFTPADDING', (0,0), (-1,-1), 8),
('RIGHTPADDING', (0,0), (-1,-1), 8),
('TOPPADDING', (0,0), (-1,-1), 6),
('BOTTOMPADDING', (0,0), (-1,-1), 8),
]))
flow.append(t)
if key_points:
flow.append(Spacer(1, 8))
kp_tbl = Table([[Paragraph("<b>RED FLAGS / KEY POINTS</b><br/>" + bl(key_points), body_style)]],
colWidths=[6.9*inch])
kp_tbl.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), colors.HexColor('#FDF2E9')),
('BOX', (0,0), (-1,-1), 0.75, colors.HexColor('#E5B98C')),
('LEFTPADDING', (0,0), (-1,-1), 10),
('RIGHTPADDING', (0,0), (-1,-1), 10),
('TOPPADDING', (0,0), (-1,-1), 6),
('BOTTOMPADDING', (0,0), (-1,-1), 6),
]))
flow.append(kp_tbl)
return flow
CONDITIONS = [
{
"name": "Pneumonia",
"investigations": [
"Severity score: CURB-65 (Confusion, Urea>7, RR≥30, BP≤90/60, Age≥65) or CRB-65 in primary care",
"Pulse oximetry / ABG if hypoxic or severe",
"FBC, U&E/creatinine, LFTs, CRP or procalcitonin",
"Chest X-ray - confirm infiltrate, extent, effusion/cavitation",
"Sputum Gram stain & culture (best pre-antibiotics)",
"Blood cultures (moderate-severe CAP, all HAP)",
"Urinary antigen: S. pneumoniae, Legionella (mod-severe cases)",
"Respiratory viral PCR panel (flu, RSV, SARS-CoV-2)",
"Pleural fluid sampling if significant effusion",
"CT chest if complication suspected (abscess/empyema)",
],
"management": [
"Oxygen to target SpO2 94-98% (88-92% if CO2 retention risk)",
"Low severity: amoxicillin PO 5 days (doxycycline/clarithromycin if allergic)",
"Moderate: amoxicillin + macrolide, or doxycycline",
"High severity (CURB-65 3-5): IV beta-lactam + macrolide; consider corticosteroid 4-7 days",
"HAP/VAP: cover MRSA/Pseudomonas if risk factors present",
"Review IV->oral switch at 48h; treat 5 days minimum if stable",
"IV fluids, VTE prophylaxis, analgesia, chest physiotherapy",
"Escalate to HDU/ICU for shock or respiratory failure",
"Repeat CXR at 6 weeks if persistent symptoms, smoker, or age>50",
],
"key_points": [
"Failure to improve at 48-72h: re-image, repeat cultures, consider empyema/resistant organism",
"Watch for parapneumonic effusion/empyema (3-5% of cases), lung abscess, sepsis, ARDS",
],
},
{
"name": "Asthma",
"investigations": [
"Spirometry: obstructive pattern with reversibility (≥12% & 200mL FEV1 rise post-bronchodilator)",
"Peak expiratory flow (PEF) - monitoring/self-management, not primary diagnosis",
"Bronchoprovocation (methacholine challenge) if spirometry normal but suspicion high",
"FeNO (fractional exhaled NO), allergy skin-prick/IgE testing",
"CXR only to exclude alternative diagnosis",
],
"management": [
"Stepwise (GINA): as-needed SABA/low-dose ICS-formoterol → low-dose ICS-LABA → medium/high-dose ICS-LABA → add LAMA/biologics",
"Acute exacerbation: O2 to target 94-98%, nebulized salbutamol +/- ipratropium",
"Systemic corticosteroids (oral prednisolone / IV hydrocortisone)",
"IV magnesium sulfate if severe/life-threatening",
"ICU escalation for silent chest, exhaustion, rising CO2",
"Written action plan, inhaler technique review, trigger avoidance, vaccination",
],
"key_points": [
"Life-threatening features: silent chest, cyanosis, bradycardia, hypotension, exhaustion, confusion, SpO2<92%",
],
},
{
"name": "COPD",
"investigations": [
"Spirometry mandatory: post-bronchodilator FEV1/FVC <0.70 confirms diagnosis (GOLD)",
"GOLD grading 1-4 by FEV1% predicted + ABE symptom/exacerbation grouping",
"CXR/CT chest - hyperinflation, bullae, exclude malignancy",
"ABG if hypoxemic/hypercapnic",
"Alpha-1 antitrypsin level if early-onset or family history",
"Sputum culture during exacerbations, FBC, pulse oximetry",
"6-minute walk test / BODE index for prognosis",
],
"management": [
"Smoking cessation - single most effective intervention",
"Bronchodilators: LAMA/LABA; add ICS if frequent exacerbations with eosinophilia",
"Pulmonary rehabilitation, vaccinations (flu, pneumococcal)",
"Long-term O2 if PaO2<55 mmHg",
"Exacerbation: controlled O2 (avoid hyperoxia), nebulized bronchodilators, oral corticosteroids 5 days, antibiotics if purulent sputum",
"NIV for hypercapnic respiratory failure; invasive ventilation if NIV fails",
],
"key_points": [
"Avoid uncontrolled high-flow O2 in hypercapnic patients - risk of worsening CO2 retention",
],
},
{
"name": "Dengue",
"investigations": [
"NS1 antigen - detectable early (day 1-7), highly specific",
"IgM/IgG serology (ELISA) - IgM rises day 3-5; test RNA/NS1 if early IgM negative",
"RT-PCR for dengue RNA - early confirmation/serotyping",
"FBC: thrombocytopenia, rising hematocrit (hemoconcentration = warning sign)",
"Tourniquet test (capillary fragility)",
"LFTs, serial hematocrit/platelet monitoring",
"USG/CXR for pleural effusion or ascites in severe dengue",
],
"management": [
"No specific antiviral - supportive care is mainstay",
"Fluid management guided by hematocrit trend (careful judicious IV fluids for warning-sign/severe cases; oral fluids for uncomplicated)",
"Avoid NSAIDs/aspirin (bleeding risk) - use paracetamol for fever/pain",
"Close monitoring for warning signs: abdominal pain, persistent vomiting, mucosal bleeding, lethargy",
"Severe dengue managed in experienced center with careful fluid resuscitation +/- blood products",
],
"key_points": [
"Critical phase (defervescence, day 3-7) is when plasma leakage/shock risk peaks - highest vigilance period",
],
},
{
"name": "Malaria",
"investigations": [
"Thick & thin blood film (Giemsa) - gold standard; thick=detection, thin=species ID & % parasitemia",
"Rapid diagnostic test (RDT) - antigen-based (HRP-2/pLDH) when microscopy unavailable",
"Repeat films if initial negative but suspicion persists (P. falciparum can be falsely negative early)",
"Parasitemia % (>20% mature forms = poor prognosis), FBC, glucose, renal/liver function, lactate",
],
"management": [
"Uncomplicated P. falciparum: artemisinin-based combination therapy (ACT), e.g. artemether-lumefantrine",
"Uncomplicated non-falciparum: chloroquine (if sensitive) + primaquine/tafenoquine radical cure (check G6PD first)",
"Severe/complicated malaria: IV artesunate first-line - do NOT delay for confirmation",
"Supportive care: correct hypoglycemia, manage seizures, dialysis for renal failure",
"Exchange transfusion considered in extreme hyperparasitemia",
"Chemoprophylaxis and vector control for prevention",
],
"key_points": [
"Severe malaria criteria: impaired consciousness, acidosis, hypoglycemia, severe anemia, renal failure, pulmonary edema, shock, DIC, hyperparasitemia",
],
},
{
"name": "Tuberculosis (TB)",
"investigations": [
"Sputum smear microscopy (acid-fast bacilli / Ziehl-Neelsen) - 3 specimens",
"GeneXpert MTB/RIF (molecular PCR) - rapid detection + rifampin resistance",
"Mycobacterial culture (liquid/solid media) - gold standard + full drug-susceptibility testing",
"CXR (cavitation, upper lobe infiltrates, hilar lymphadenopathy); CT for extrapulmonary/complicated disease",
"TST (Mantoux) or IGRA for latent TB screening",
"HIV testing recommended in all TB patients",
],
"management": [
"Active TB: 6-month regimen - 2 months intensive (Isoniazid, Rifampin, Pyrazinamide, Ethambutol) + 4 months continuation (Isoniazid+Rifampin)",
"Directly observed therapy (DOT) recommended",
"Drug-resistant (MDR/RR-TB): longer regimens with second-line agents (e.g. bedaquiline-based) per WHO",
"Latent TB: isoniazid preventive therapy (6-9 months) or shorter rifapentine-based regimens",
"Contact tracing, airborne isolation for smear-positive pulmonary disease, notify public health",
"Monitor LFTs (hepatotoxicity) and visual acuity (ethambutol)",
],
"key_points": [
"Infectiousness correlates with smear-positive sputum, productive cough, and cavitary disease",
],
},
{
"name": "Leptospirosis",
"investigations": [
"Serology: MAT (microscopic agglutination test) = reference standard; ELISA IgM for rapid screening",
"Note: serology may be falsely negative in first week of illness",
"Blood culture (first week / leptospiremic phase) or urine culture (second week / leptospiruric phase)",
"PCR for early detection",
"FBC, renal function (creatinine - AKI common), LFTs (jaundice in Weil's disease), CK (myositis)",
"CXR if pulmonary hemorrhage suspected",
],
"management": [
"Mild disease: oral doxycycline 100mg twice daily x 1 week (start early)",
"Severe leptospirosis (Weil's disease): IV penicillin as soon as diagnosis considered, or ceftriaxone as alternative",
"Supportive care for complications: dialysis for AKI, transfusion/ventilatory support for pulmonary hemorrhage",
"Careful fluid and electrolyte management",
],
"key_points": [
"Watch for Jarisch-Herxheimer-like reaction after starting antibiotics",
"Weil's disease triad: jaundice, renal failure, hemorrhage",
],
},
{
"name": "Abscess",
"investigations": [
"Clinical exam: fluctuance, erythema, warmth, tenderness +/- systemic sepsis signs",
"Ultrasound - bedside confirmation of fluid collection, guides drainage",
"CT with contrast for deep/visceral abscesses (hepatic, intra-abdominal)",
"Blood cultures if systemic involvement",
"FBC/inflammatory markers (CRP, WBC)",
"Pus culture & sensitivity from aspirate/drainage to guide antibiotics",
],
"management": [
"Core principle = SOURCE CONTROL: incision & drainage or image-guided percutaneous drainage is definitive treatment",
"Antibiotics alone inadequate for most abscesses ≥3-5cm; small (<3cm) may respond to antibiotics alone",
"Broad-spectrum empirical antibiotics pending culture, then narrow per sensitivities",
"Cover anaerobes for intra-abdominal/dental sources; MRSA-active agents for at-risk skin/soft tissue abscesses",
"Identify and treat underlying cause to prevent recurrence (perforation, foreign body, hematogenous seeding)",
"Surgical drainage when percutaneous approach fails or inaccessible (e.g. loculated empyema)",
],
"key_points": [
"Do not rely on antibiotics alone for a drainable collection - delayed source control worsens outcomes",
],
},
]
def build():
doc = SimpleDocTemplate(OUT, pagesize=letter,
topMargin=0.6*inch, bottomMargin=0.6*inch,
leftMargin=0.55*inch, rightMargin=0.55*inch)
story = []
# ---- Cover page ----
story.append(Spacer(1, 1.6*inch))
story.append(Paragraph("Clinical Quick-Reference Guide", title_style))
story.append(Spacer(1, 6))
story.append(Paragraph("Investigation & Management Summary", subtitle_style))
story.append(Spacer(1, 4))
story.append(HRFlowable(width="60%", thickness=1.2, color=colors.HexColor('#0B3D66'), hAlign='CENTER'))
story.append(Spacer(1, 18))
conditions_list = ", ".join(c["name"] for c in CONDITIONS)
story.append(Paragraph(f"<b>Covers:</b> {conditions_list}", ParagraphStyle(
'CoverList', parent=styles['Normal'], fontSize=11.5, alignment=TA_CENTER,
textColor=colors.HexColor('#333333'), leading=16)))
story.append(Spacer(1, 0.9*inch))
story.append(Paragraph(
"For use as a bedside/clinical study aid. Not a substitute for full clinical "
"guidelines, local antimicrobial policy, or specialist advice. Always confirm "
"doses and regimens against current local/national protocols before prescribing.",
disclaimer_style))
story.append(Spacer(1, 30))
story.append(Paragraph("Generated: August 2026", disclaimer_style))
story.append(PageBreak())
# ---- Table of contents ----
story.append(Paragraph("Contents", ParagraphStyle('TOCTitle', parent=styles['Heading1'],
fontSize=18, textColor=colors.HexColor('#0B3D66'))))
story.append(Spacer(1, 8))
for i, c in enumerate(CONDITIONS, start=1):
story.append(Paragraph(f"{i}. {c['name']}", toc_style))
story.append(PageBreak())
# ---- Condition pages (2 per page where possible via KeepTogether groups) ----
for idx, c in enumerate(CONDITIONS):
block = make_condition_table(c["name"], c["investigations"], c["management"],
c.get("key_points"))
story.extend(block)
if idx != len(CONDITIONS) - 1:
story.append(Spacer(1, 16))
story.append(HRFlowable(width="100%", thickness=0.5, color=colors.HexColor('#DDDDDD')))
story.append(Spacer(1, 16))
def add_footer(canvas_obj, doc_obj):
canvas_obj.saveState()
canvas_obj.setFont('Helvetica', 8)
canvas_obj.setFillColor(colors.HexColor('#999999'))
canvas_obj.drawString(0.55*inch, 0.35*inch, "Clinical Quick-Reference Guide - For educational use only")
canvas_obj.drawRightString(letter[0]-0.55*inch, 0.35*inch, f"Page {doc_obj.page}")
canvas_obj.restoreState()
doc.build(story, onFirstPage=add_footer, onLaterPages=add_footer)
print("PDF created at", OUT)
if __name__ == "__main__":
build()
cd /tmp/workspace/medical-quickref && python build_pdf.py
cd /tmp/workspace/medical-quickref/output && python3 -c " from pypdf import PdfReader r = PdfReader('Quick_Reference_Guide_Diagnoses.pdf') print('Pages:', len(r.pages)) " && ls -la
Quick Reference Guide Diagnoses
PDF Document · PDF
the same way for stroke, diabetic neuropathy, heart failure, thallesemia, anaemia , ACS, ascites, CKD , AKI , liver cirrhosis
| Condition | Key Investigations | Management |
|---|---|---|
| Stroke | - Non-contrast CT head (immediate) - exclude hemorrhage before thrombolysis; CT/MR angiography for large vessel occlusion; MRI-DWI for early ischemic changes - NIHSS scoring for severity/eligibility assessment - Harrison's 22E; Tintinalli's - Blood glucose (exclude hypoglycemia mimic), FBC, coagulation profile, U&E, ECG (AF as cause), lipid profile, carotid Doppler/echo for source in ischemic stroke | - Ischemic stroke: IV thrombolysis (alteplase/tenecteplase) within 4.5h of onset if no contraindication; mechanical thrombectomy for large vessel occlusion up to extended windows with favorable imaging - Minor/nondisabling stroke (NIHSS 0-5): aspirin or short-term dual antiplatelet (aspirin + clopidogrel) rather than thrombolysis - Harrison's 22E - Hemorrhagic stroke: BP control, reverse anticoagulation, neurosurgical evacuation if indicated, ICP management - Secondary prevention: antiplatelets/anticoagulation (AF), statin, BP control, carotid revascularization if significant stenosis - Early rehabilitation (physio/speech/OT), swallow assessment before oral intake |
| Diabetic Neuropathy | - Clinical screening: 10g monofilament testing, vibration perception (biothesiometer), ankle reflexes - to detect loss of protective sensation (LOPS) - Harrison's 22E - Nerve conduction studies if diagnosis unclear or atypical pattern - HbA1c, B12 level, TFTs, renal function (exclude alternative/contributing causes) - Comprehensive foot exam for ulceration risk - Miller's Review of Orthopaedics | - Optimize glycemic control (reduces progression) - primary intervention - Neuropathic pain: first-line agents - pregabalin/gabapentin, duloxetine, amitriptyline - Foot care education, protective footwear, regular podiatry review to prevent ulceration - Manage cardiovascular risk factors (BP, lipids) - autonomic neuropathy screening (postural BP, gastroparesis symptoms) - Refer for ulceration/Charcot foot to multidisciplinary diabetic foot team |
| Heart Failure | - BNP / NT-proBNP - key biomarker; markedly elevated in HF, normal-ish (BNP <200 pg/mL) in pure pericardial constriction - Goldman-Cecil Medicine - Echocardiography - assess LVEF, HFrEF vs HFpEF (HFpEF now ~50% of HF population, BNP >35 pg/mL threshold) - Miller's Anesthesia - 12-lead ECG, CXR, U&E/creatinine, glucose, FBC - Swanson's Family Medicine Review - Consider coronary angiography if ischemic etiology suspected | - HFrEF: guideline-directed medical therapy - ACEi/ARB/ARNI + beta-blocker + MRA + SGLT2 inhibitor ("four pillars"); diuretics for congestion - HFpEF: SGLT2 inhibitors, diuretics for symptom control, manage comorbidities (HTN, AF, obesity) - Acute decompensation: IV diuretics, oxygen, vasodilators if hypertensive, inotropes/mechanical support if cardiogenic shock - Device therapy (CRT/ICD) in selected reduced-EF patients; fluid/salt restriction, daily weight monitoring, cardiac rehab |
| Thalassemia | - Hemoglobin electrophoresis / HPLC - confirms globin chain abnormality; raised HbA2 in beta-thalassemia trait - Creasy & Resnik's Maternal-Fetal Medicine - FBC: microcytic hypochromic anemia with disproportionately low MCV for degree of anemia - Iron studies to distinguish from iron deficiency (ferritin normal/high in thalassemia vs low in iron deficiency) - DNA analysis for genotype confirmation, especially in carrier screening - Emery's Elements of Medical Genetics - Family/genetic counseling and antenatal screening in high-prevalence populations | - Thalassemia minor/trait: usually no treatment needed, genetic counseling - Thalassemia major: regular blood transfusions to maintain Hb, plus iron chelation therapy (deferoxamine, deferasirox, deferiprone) to prevent iron overload - Tietz Textbook of Laboratory Medicine - Splenectomy considered for hypersplenism/high transfusion requirement - Folic acid supplementation, monitor for endocrinopathies/cardiac iron overload (T2* MRI) - Curative option: hematopoietic stem cell transplant in eligible patients |
| Anaemia | - FBC with MCV to classify (microcytic/normocytic/macrocytic), reticulocyte count - Iron studies: serum iron, ferritin, TIBC/transferrin saturation - core work-up for iron deficiency - Harrison's 22E - Peripheral blood film, B12/folate levels, LFTs/renal function - Consider anemia of chronic disease/inflammation if ferritin elevated despite low iron - Tietz Textbook of Laboratory Medicine - Investigate underlying cause (GI blood loss - endoscopy/colonoscopy if iron deficient without clear source) | - Treat underlying cause first (e.g., identify and manage GI bleeding source) - Iron deficiency: oral iron supplementation (ferrous sulfate); IV iron if intolerant/malabsorption/ongoing losses - B12/folate deficiency: replacement (IM B12 or oral high-dose, folic acid) - Anemia of chronic disease: treat underlying inflammatory/chronic condition; erythropoiesis-stimulating agents in select CKD patients - Transfusion for severe/symptomatic anemia or hemodynamic instability |
| ACS (Acute Coronary Syndrome) | - 12-lead ECG immediately - identify STEMI vs NSTEMI/UA; serial ECGs if initial non-diagnostic - Murray & Nadel's; Goldman-Cecil Medicine - High-sensitivity cardiac troponin - serial measurement per 0h/1h or 0h/3h protocols; predicts short and long-term risk of MI/death - Goldman-Cecil Medicine - History/exam/ECG alone cannot confirm or exclude ACS - troponin is essential - CXR, echo (wall motion, complications), coronary angiography for definitive anatomy | - STEMI: immediate reperfusion - primary PCI (preferred, door-to-balloon <90 min) or fibrinolysis if PCI unavailable within window - NSTEMI/UA: dual antiplatelet therapy (aspirin + P2Y12 inhibitor), anticoagulation (heparin/enoxaparin), risk-stratify (GRACE score) for early invasive vs conservative strategy - All ACS: beta-blocker, high-intensity statin, ACEi/ARB if LV dysfunction, nitrates/morphine for symptom relief - Cardiac rehabilitation and secondary prevention (lifestyle, risk factor control) post-discharge |
| Ascites | - Diagnostic paracentesis - test of choice for new-onset ascites; provides both diagnosis and symptomatic relief - Yamada's Gastroenterology; Pfenninger & Fowler's Procedures - SAAG (Serum-Ascites Albumin Gradient): ≥1.1 g/dL suggests portal hypertension (cirrhosis, cardiac); <1.1 g/dL suggests other causes (malignancy, TB, pancreatitis) - Harrison's 22E - Ascitic fluid cell count/differential (neutrophils >250/mm3 = SBP), total protein, culture, cytology if malignancy suspected - Cardiac ascites: high ascitic protein (≥2.5 g/dL) despite high SAAG - Sleisenger & Fordtran's | - Treat underlying cause (cirrhosis, heart failure, malignancy, TB) - Cirrhotic ascites: sodium restriction, diuretics (spironolactone +/- furosemide), therapeutic large-volume paracentesis for tense/refractory ascites with albumin replacement - Spontaneous bacterial peritonitis (neutrophils >250): empirical antibiotics (e.g., third-generation cephalosporin) + albumin, prophylactic antibiotics for recurrence prevention - Refractory ascites: consider TIPS or liver transplant evaluation - Avoid NSAIDs (worsen renal function/fluid retention) |
| CKD (Chronic Kidney Disease) | - eGFR (via creatinine-based equations) and urine albumin-to-creatinine ratio (UACR) - both independently predict progression; combined for KDIGO staging (G1-G5, A1-A3) - Comprehensive Clinical Nephrology; National Kidney Foundation Primer - Renal ultrasound (size, obstruction, cystic disease), urinalysis/microscopy - Identify underlying cause (diabetes, hypertension, glomerulonephritis workup if indicated), electrolytes, PTH/calcium/phosphate, Hb (anemia of CKD) | - Treat underlying cause and slow progression: BP control (ACEi/ARB first-line, especially with proteinuria), SGLT2 inhibitors, glycemic control in diabetics - Manage complications: phosphate binders, vitamin D analogs and PTH management (CKD-MBD), erythropoiesis-stimulating agents/iron for anemia, bicarbonate for metabolic acidosis - Avoid nephrotoxins (NSAIDs, contrast when possible), dose-adjust renally cleared drugs - Plan for renal replacement therapy (dialysis/transplant) as eGFR declines toward end-stage; dietary/nutritional counseling |
| AKI (Acute Kidney Injury) | - KDIGO criteria - staging by rise in serum creatinine (≥0.3 mg/dL in 48h, or ≥1.5x baseline in 7 days) and/or urine output <0.5 mL/kg/h for 6h - Brenner & Rector's; Sabiston Textbook of Surgery - Historically RIFLE and AKIN criteria, now merged into KDIGO classification - Comprehensive Clinical Nephrology - Identify pre-renal/intrinsic/post-renal cause: urinalysis, urine electrolytes/FENa, renal ultrasound (obstruction), review of drugs/contrast exposure, volume status assessment | - Identify and treat the cause: optimize volume status (fluid challenge if pre-renal, avoid overload), stop nephrotoxic drugs, relieve obstruction (catheterization/nephrostomy) if post-renal - Monitor U&E, fluid balance, and urine output closely; treat hyperkalemia, acidosis, volume overload as they arise - Renal replacement therapy (dialysis) indications: refractory hyperkalemia, severe acidosis, fluid overload unresponsive to diuretics, uremic complications (encephalopathy, pericarditis) - Most AKI is reversible with prompt correction of the underlying cause; avoid contrast/nephrotoxins during recovery |
| Liver Cirrhosis | - Child-Pugh score and MELD score - both used to grade severity and predict survival/prioritize transplant listing - Current Surgical Therapy - LFTs (may be near-normal in compensated cirrhosis), FBC (thrombocytopenia from hypersplenism), coagulation profile (INR) - Ultrasound/elastography (Fibroscan) for fibrosis staging; liver biopsy if diagnosis uncertain - Screen for complications: endoscopy for varices, AFP + imaging for HCC surveillance, ascites work-up (SAAG/paracentesis) | - Treat underlying cause (antivirals for viral hepatitis, alcohol cessation, weight loss/metabolic control for MASLD) - Manage complications: non-selective beta-blockers or banding for variceal bleeding prophylaxis, diuretics/paracentesis for ascites, lactulose/rifaximin for hepatic encephalopathy - Regular surveillance: 6-monthly ultrasound + AFP for HCC, periodic endoscopy for varices - Vaccinations (hepatitis A/B, pneumococcal, influenza), avoid hepatotoxins/NSAIDs/alcohol - Liver transplant evaluation for decompensated cirrhosis (rising MELD, refractory complications) |
~/medical-quickref/build_pdf_2.py
# -*- coding: utf-8 -*-
from reportlab.lib.pagesizes import letter
from reportlab.lib import colors
from reportlab.lib.units import inch
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
PageBreak, HRFlowable
)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER
OUT = "/tmp/workspace/medical-quickref/output/Quick_Reference_Guide_Diagnoses_Set2.pdf"
styles = getSampleStyleSheet()
title_style = ParagraphStyle('TitleStyle', parent=styles['Title'], fontSize=26,
textColor=colors.HexColor('#0B3D66'), spaceAfter=6, alignment=TA_CENTER)
subtitle_style = ParagraphStyle('SubtitleStyle', parent=styles['Normal'], fontSize=13,
textColor=colors.HexColor('#444444'), alignment=TA_CENTER, spaceAfter=4)
disclaimer_style = ParagraphStyle('Disclaimer', parent=styles['Normal'], fontSize=8.5,
textColor=colors.HexColor('#777777'), alignment=TA_CENTER)
cond_title_style = ParagraphStyle('CondTitle', parent=styles['Heading1'], fontSize=18,
textColor=colors.white, spaceAfter=0, spaceBefore=0,
leftIndent=0)
section_head_style = ParagraphStyle('SectionHead', parent=styles['Heading3'], fontSize=12.5,
textColor=colors.HexColor('#0B3D66'), spaceBefore=8, spaceAfter=4)
body_style = ParagraphStyle('BodyCell', parent=styles['Normal'], fontSize=9.1, leading=12.3)
toc_style = ParagraphStyle('TOCItem', parent=styles['Normal'], fontSize=12, leading=20,
textColor=colors.HexColor('#0B3D66'))
ACCENT = {
"Stroke": "#1B4F72",
"Diabetic Neuropathy": "#8E44AD",
"Heart Failure": "#B03A2E",
"Thalassemia": "#117864",
"Anaemia": "#2C3E50",
"ACS (Acute Coronary Syndrome)": "#C0392B",
"Ascites": "#6C3483",
"CKD (Chronic Kidney Disease)": "#1E8449",
"AKI (Acute Kidney Injury)": "#B9770E",
"Liver Cirrhosis": "#7B241C",
}
def bl(items):
return "<br/>".join(f"• {i}" for i in items)
def make_condition_table(name, investigations, management, key_points=None):
color = colors.HexColor(ACCENT.get(name, "#0B3D66"))
flow = []
header_tbl = Table([[Paragraph(name.upper(), cond_title_style)]], colWidths=[6.9*inch])
header_tbl.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), color),
('TOPPADDING', (0,0), (-1,-1), 10),
('BOTTOMPADDING', (0,0), (-1,-1), 10),
('LEFTPADDING', (0,0), (-1,-1), 12),
]))
flow.append(header_tbl)
flow.append(Spacer(1, 10))
inv_para = Paragraph(bl(investigations), body_style)
mgmt_para = Paragraph(bl(management), body_style)
data = [
[Paragraph("<b>INVESTIGATIONS</b>", section_head_style),
Paragraph("<b>MANAGEMENT</b>", section_head_style)],
[inv_para, mgmt_para]
]
t = Table(data, colWidths=[3.4*inch, 3.5*inch])
t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,0), colors.HexColor('#EAF1F8')),
('BOX', (0,0), (-1,-1), 0.75, colors.HexColor('#B0B0B0')),
('INNERGRID', (0,0), (-1,-1), 0.5, colors.HexColor('#CCCCCC')),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('LEFTPADDING', (0,0), (-1,-1), 8),
('RIGHTPADDING', (0,0), (-1,-1), 8),
('TOPPADDING', (0,0), (-1,-1), 6),
('BOTTOMPADDING', (0,0), (-1,-1), 8),
]))
flow.append(t)
if key_points:
flow.append(Spacer(1, 8))
kp_tbl = Table([[Paragraph("<b>RED FLAGS / KEY POINTS</b><br/>" + bl(key_points), body_style)]],
colWidths=[6.9*inch])
kp_tbl.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), colors.HexColor('#FDF2E9')),
('BOX', (0,0), (-1,-1), 0.75, colors.HexColor('#E5B98C')),
('LEFTPADDING', (0,0), (-1,-1), 10),
('RIGHTPADDING', (0,0), (-1,-1), 10),
('TOPPADDING', (0,0), (-1,-1), 6),
('BOTTOMPADDING', (0,0), (-1,-1), 6),
]))
flow.append(kp_tbl)
return flow
CONDITIONS = [
{
"name": "Stroke",
"investigations": [
"Non-contrast CT head immediately - exclude hemorrhage before thrombolysis",
"CT/MR angiography for large vessel occlusion; MRI-DWI for early ischemic change",
"NIHSS scoring for severity and treatment eligibility",
"Blood glucose (exclude hypoglycemia mimic), FBC, coagulation profile, U&E",
"ECG (screen for AF as cardioembolic source), lipid profile",
"Carotid Doppler / echocardiogram to identify embolic source",
],
"management": [
"Ischemic stroke: IV thrombolysis (alteplase/tenecteplase) within 4.5h of onset if no contraindication",
"Mechanical thrombectomy for large vessel occlusion (extended window with favorable imaging)",
"Minor/nondisabling stroke (NIHSS 0-5): aspirin or short dual antiplatelet therapy rather than thrombolysis",
"Hemorrhagic stroke: BP control, reverse anticoagulation, neurosurgical evacuation/ICP management if indicated",
"Secondary prevention: antiplatelet/anticoagulation (AF), statin, BP control, carotid revascularization if significant stenosis",
"Early rehabilitation (physio/speech/OT), formal swallow assessment before oral intake",
],
"key_points": [
"Time is brain - door-to-needle and door-to-groin times are critical quality metrics",
"Never give thrombolysis until hemorrhage is excluded on CT",
],
},
{
"name": "Diabetic Neuropathy",
"investigations": [
"10g monofilament testing, vibration perception (biothesiometer), ankle reflexes - screen for loss of protective sensation (LOPS)",
"Nerve conduction studies if diagnosis unclear or atypical pattern",
"HbA1c, vitamin B12, TFTs, renal function - exclude/identify contributing causes",
"Comprehensive foot examination for ulceration risk",
],
"management": [
"Optimize glycemic control - primary intervention to slow progression",
"Neuropathic pain: pregabalin/gabapentin, duloxetine, or amitriptyline (first-line agents)",
"Foot care education, protective footwear, regular podiatry review to prevent ulceration",
"Cardiovascular risk factor management (BP, lipids)",
"Screen for autonomic neuropathy (postural BP drop, gastroparesis symptoms)",
"Refer ulceration/Charcot foot to multidisciplinary diabetic foot team",
],
"key_points": [
"Loss of protective sensation is the single biggest risk factor for foot ulceration and amputation",
],
},
{
"name": "Heart Failure",
"investigations": [
"BNP / NT-proBNP - key biomarker; HFpEF threshold BNP >35 pg/mL",
"Echocardiography - assess LVEF, distinguish HFrEF vs HFpEF (HFpEF ~50% of HF population)",
"12-lead ECG, chest X-ray, U&E/creatinine, glucose, FBC",
"Coronary angiography if ischemic etiology suspected",
],
"management": [
"HFrEF: guideline-directed therapy - ACEi/ARB/ARNI + beta-blocker + MRA + SGLT2 inhibitor (\"four pillars\") + diuretics for congestion",
"HFpEF: SGLT2 inhibitors, diuretics for symptoms, manage comorbidities (hypertension, AF, obesity)",
"Acute decompensation: IV diuretics, oxygen, vasodilators if hypertensive, inotropes/mechanical support if cardiogenic shock",
"Device therapy (CRT/ICD) in selected reduced-EF patients",
"Fluid/salt restriction, daily weight monitoring, cardiac rehabilitation",
],
"key_points": [
"BNP is typically only mildly elevated (<200 pg/mL) in isolated pericardial constriction - helps differentiate from HF",
],
},
{
"name": "Thalassemia",
"investigations": [
"Hemoglobin electrophoresis / HPLC - confirms globin chain abnormality; raised HbA2 in beta-thalassemia trait",
"FBC: microcytic hypochromic anemia, MCV disproportionately low for degree of anemia",
"Iron studies to distinguish from iron deficiency (ferritin normal/high in thalassemia)",
"DNA analysis for genotype confirmation, especially carrier screening",
"Family and antenatal genetic counseling in high-prevalence populations",
],
"management": [
"Thalassemia trait/minor: usually no treatment needed; genetic counseling",
"Thalassemia major: regular blood transfusions to maintain Hb + iron chelation therapy (deferoxamine, deferasirox, deferiprone)",
"Splenectomy considered for hypersplenism / high transfusion requirement",
"Folic acid supplementation",
"Monitor for endocrinopathies and cardiac iron overload (T2* MRI)",
"Curative option: hematopoietic stem cell transplant in eligible patients",
],
"key_points": [
"Iron overload from chronic transfusion is the main long-term threat - chelation adherence is critical",
],
},
{
"name": "Anaemia",
"investigations": [
"FBC with MCV to classify (microcytic / normocytic / macrocytic), reticulocyte count",
"Iron studies: serum iron, ferritin, TIBC/transferrin saturation",
"Peripheral blood film, vitamin B12/folate levels, LFTs/renal function",
"Anemia of chronic disease/inflammation suspected if ferritin elevated despite low iron",
"Investigate underlying cause (e.g. endoscopy/colonoscopy for unexplained iron deficiency)",
],
"management": [
"Treat underlying cause first (e.g. identify and manage GI bleeding source)",
"Iron deficiency: oral iron supplementation; IV iron if intolerant/malabsorption/ongoing losses",
"B12/folate deficiency: replacement (IM B12 or high-dose oral, folic acid)",
"Anemia of chronic disease: treat underlying inflammatory/chronic condition; ESAs in select CKD patients",
"Transfusion for severe or symptomatic anemia / hemodynamic instability",
],
"key_points": [
"Unexplained iron-deficiency anemia in an adult warrants GI evaluation to exclude occult malignancy",
],
},
{
"name": "ACS (Acute Coronary Syndrome)",
"investigations": [
"12-lead ECG immediately - distinguish STEMI vs NSTEMI/unstable angina; repeat serial ECGs if non-diagnostic",
"High-sensitivity cardiac troponin - serial measurement (0h/1h or 0h/3h protocols)",
"History, exam, and ECG alone cannot confirm or exclude ACS - troponin is essential",
"Chest X-ray, echocardiogram (wall motion/complications), coronary angiography for definitive anatomy",
],
"management": [
"STEMI: immediate reperfusion - primary PCI preferred (door-to-balloon <90 min) or fibrinolysis if PCI unavailable",
"NSTEMI/UA: dual antiplatelet therapy (aspirin + P2Y12 inhibitor) + anticoagulation; risk-stratify (GRACE score) for early invasive vs conservative strategy",
"All ACS: beta-blocker, high-intensity statin, ACEi/ARB if LV dysfunction, nitrates/morphine for symptom relief",
"Cardiac rehabilitation and secondary prevention (lifestyle, risk factor control) post-discharge",
],
"key_points": [
"Troponin magnitude predicts both short-term (30-day) and long-term (1-year) risk of recurrent MI and death",
],
},
{
"name": "Ascites",
"investigations": [
"Diagnostic paracentesis - test of choice for new-onset ascites; both diagnostic and symptomatically relieving",
"SAAG (Serum-Ascites Albumin Gradient): ≥1.1 g/dL = portal hypertension (cirrhosis, cardiac); <1.1 g/dL = other causes (malignancy, TB, pancreatitis)",
"Ascitic fluid cell count/differential (neutrophils >250/mm3 = SBP), total protein, culture, cytology if malignancy suspected",
"Cardiac ascites: high ascitic protein (≥2.5 g/dL) despite high SAAG",
],
"management": [
"Treat underlying cause (cirrhosis, heart failure, malignancy, TB)",
"Cirrhotic ascites: sodium restriction, diuretics (spironolactone +/- furosemide), large-volume paracentesis with albumin replacement for tense/refractory ascites",
"Spontaneous bacterial peritonitis (neutrophils >250): empirical antibiotics (e.g. 3rd-generation cephalosporin) + albumin; prophylactic antibiotics to prevent recurrence",
"Refractory ascites: consider TIPS or liver transplant evaluation",
"Avoid NSAIDs (worsen renal function/fluid retention)",
],
"key_points": [
"SAAG indicates portal hypertension but does not itself confirm the underlying cause",
],
},
{
"name": "CKD (Chronic Kidney Disease)",
"investigations": [
"eGFR (creatinine-based) and urine albumin-to-creatinine ratio (UACR) - combined for KDIGO staging (G1-G5, A1-A3)",
"Renal ultrasound (size, obstruction, cystic disease), urinalysis/microscopy",
"Identify underlying cause (diabetes, hypertension, glomerulonephritis work-up if indicated)",
"Electrolytes, PTH/calcium/phosphate, hemoglobin (anemia of CKD)",
],
"management": [
"Treat underlying cause and slow progression: BP control (ACEi/ARB first-line, especially with proteinuria), SGLT2 inhibitors, glycemic control in diabetics",
"Manage complications: phosphate binders, vitamin D analogs/PTH management (CKD-MBD), ESAs/iron for anemia, bicarbonate for metabolic acidosis",
"Avoid nephrotoxins (NSAIDs, contrast when possible); dose-adjust renally cleared drugs",
"Plan renal replacement therapy (dialysis/transplant) as eGFR declines toward end-stage",
"Dietary and nutritional counseling",
],
"key_points": [
"eGFR and albuminuria are independent predictors of progression - both are needed for accurate staging",
],
},
{
"name": "AKI (Acute Kidney Injury)",
"investigations": [
"KDIGO criteria: rise in serum creatinine ≥0.3 mg/dL in 48h, or ≥1.5x baseline in 7 days, and/or urine output <0.5 mL/kg/h for 6h",
"Older RIFLE and AKIN criteria now merged into KDIGO classification",
"Identify pre-renal / intrinsic / post-renal cause: urinalysis, urine electrolytes/FENa, renal ultrasound (obstruction)",
"Review drug and contrast exposure, assess volume status",
],
"management": [
"Identify and treat the cause: optimize volume status (fluid challenge if pre-renal, avoid overload), stop nephrotoxic drugs, relieve obstruction (catheterization/nephrostomy) if post-renal",
"Monitor U&E, fluid balance, and urine output closely",
"Treat hyperkalemia, acidosis, and volume overload as they arise",
"Renal replacement therapy indications: refractory hyperkalemia, severe acidosis, fluid overload unresponsive to diuretics, uremic complications",
"Avoid contrast/nephrotoxins during recovery phase",
],
"key_points": [
"Most AKI is reversible with prompt correction of the underlying cause - early recognition is key",
],
},
{
"name": "Liver Cirrhosis",
"investigations": [
"Child-Pugh score and MELD score - grade severity, predict survival, prioritize transplant listing",
"LFTs (may be near-normal in compensated disease), FBC (thrombocytopenia from hypersplenism), coagulation profile (INR)",
"Ultrasound/elastography (Fibroscan) for fibrosis staging; liver biopsy if diagnosis uncertain",
"Screen for complications: endoscopy for varices, AFP + imaging for HCC surveillance, ascites work-up (SAAG/paracentesis)",
],
"management": [
"Treat underlying cause (antivirals for viral hepatitis, alcohol cessation, weight loss/metabolic control for MASLD)",
"Variceal bleeding prophylaxis: non-selective beta-blockers or endoscopic banding",
"Ascites: diuretics/paracentesis; hepatic encephalopathy: lactulose/rifaximin",
"Regular surveillance: 6-monthly ultrasound + AFP for HCC, periodic endoscopy for varices",
"Vaccinations (hepatitis A/B, pneumococcal, influenza); avoid hepatotoxins/NSAIDs/alcohol",
"Liver transplant evaluation for decompensated cirrhosis (rising MELD, refractory complications)",
],
"key_points": [
"Decompensation (ascites, variceal bleed, encephalopathy, jaundice) marks a major prognostic turning point",
],
},
]
def build():
doc = SimpleDocTemplate(OUT, pagesize=letter,
topMargin=0.6*inch, bottomMargin=0.6*inch,
leftMargin=0.55*inch, rightMargin=0.55*inch)
story = []
story.append(Spacer(1, 1.6*inch))
story.append(Paragraph("Clinical Quick-Reference Guide", title_style))
story.append(Spacer(1, 6))
story.append(Paragraph("Investigation & Management Summary - Set 2", subtitle_style))
story.append(Spacer(1, 4))
story.append(HRFlowable(width="60%", thickness=1.2, color=colors.HexColor('#0B3D66'), hAlign='CENTER'))
story.append(Spacer(1, 18))
conditions_list = ", ".join(c["name"] for c in CONDITIONS)
story.append(Paragraph(f"<b>Covers:</b> {conditions_list}", ParagraphStyle(
'CoverList', parent=styles['Normal'], fontSize=11.5, alignment=TA_CENTER,
textColor=colors.HexColor('#333333'), leading=16)))
story.append(Spacer(1, 0.9*inch))
story.append(Paragraph(
"For use as a bedside/clinical study aid. Not a substitute for full clinical "
"guidelines, local protocols, or specialist advice. Always confirm doses and "
"regimens against current local/national protocols before prescribing.",
disclaimer_style))
story.append(Spacer(1, 30))
story.append(Paragraph("Generated: August 2026", disclaimer_style))
story.append(PageBreak())
story.append(Paragraph("Contents", ParagraphStyle('TOCTitle', parent=styles['Heading1'],
fontSize=18, textColor=colors.HexColor('#0B3D66'))))
story.append(Spacer(1, 8))
for i, c in enumerate(CONDITIONS, start=1):
story.append(Paragraph(f"{i}. {c['name']}", toc_style))
story.append(PageBreak())
for idx, c in enumerate(CONDITIONS):
block = make_condition_table(c["name"], c["investigations"], c["management"],
c.get("key_points"))
story.extend(block)
if idx != len(CONDITIONS) - 1:
story.append(Spacer(1, 16))
story.append(HRFlowable(width="100%", thickness=0.5, color=colors.HexColor('#DDDDDD')))
story.append(Spacer(1, 16))
def add_footer(canvas_obj, doc_obj):
canvas_obj.saveState()
canvas_obj.setFont('Helvetica', 8)
canvas_obj.setFillColor(colors.HexColor('#999999'))
canvas_obj.drawString(0.55*inch, 0.35*inch, "Clinical Quick-Reference Guide - For educational use only")
canvas_obj.drawRightString(letter[0]-0.55*inch, 0.35*inch, f"Page {doc_obj.page}")
canvas_obj.restoreState()
doc.build(story, onFirstPage=add_footer, onLaterPages=add_footer)
print("PDF created at", OUT)
if __name__ == "__main__":
build()
cd /tmp/workspace/medical-quickref && python build_pdf_2.py && python3 -c " from pypdf import PdfReader r = PdfReader('output/Quick_Reference_Guide_Diagnoses_Set2.pdf') print('Pages:', len(r.pages)) "
Quick Reference Guide Diagnoses Set2
PDF Document · PDF
Quick Reference Guide Diagnoses
PDF Document · PDF
Quick Reference Guide Diagnoses Set2
PDF Document · PDF
mid diastolic murmur
mitral stenosis mid-diastolic murmur auscultation phonocardiogram diagram
| Cause | Distinguishing Features |
|---|---|
| Mitral stenosis (most common cause) | Low-pitched, rumbling mid-diastolic murmur best heard at the apex in the left lateral position; accompanied by a loud/accentuated S1 and an opening snap. Murmur length correlates with severity - it lengthens as stenosis worsens - Bailey & Love's Short Practice of Surgery; Mulholland & Greenfield's Surgery |
| Tricuspid stenosis | Best heard at the lower left sternal border; increases in intensity with inspiration (increased venous return to right heart); may show a prominent y descent - Harrison's 22E |
| Austin Flint murmur (severe aortic regurgitation) | Low-pitched, mid-to-late diastolic murmur at the apex caused by the AR jet impinging on the anterior mitral leaflet, producing functional/relative mitral stenosis; can be confused with true mitral stenosis - Harrison's 22E; Symptom to Diagnosis |
| Carey-Coombs murmur (acute rheumatic fever) | Short, transient apical mid-diastolic murmur due to flow through an edematous, inflamed mitral valve during active valvulitis; accompanies the murmur of mitral regurgitation - Braunwald's Heart Disease; Rheumatology 2-Volume Set |
| Left/right atrial myxoma | Large myxomas prolapsing across the mitral (or tricuspid) valve can obstruct inflow, mimicking mitral stenosis; classically accompanied by a "tumor plop" (early diastolic sound 80-120ms after S2) and systemic features (fever, weight loss, emboli, syncope) - Fuster & Hurst's The Heart; Frameworks for Internal Medicine |
| High-flow states across a normal valve | e.g., tricuspid regurgitation, ASD, anomalous pulmonary venous return - increased flow volume alone can generate a mid-diastolic murmur without structural stenosis - Harrison's 22E |
| Complete heart block | An unusual cause listed alongside atrial myxoma and rheumatic valvulitis - Harrison's 22E |