GIVE ME DDX FOR THIS DOG REPEORT/HISTORY-VOMITION/LOSS BODY WEIGHT/ACTIVE
python3 -c " import pdfplumber with pdfplumber.open('/tmp/workspace/attachments/a6722bb0-6bd3-48cc-a07a-8be55b25d484/MAX_CBC_.pdf') as pdf: for i, page in enumerate(pdf.pages): print(f'=== PAGE {i+1} ===') text = page.extract_text() print(text) tables = page.extract_tables() for j, table in enumerate(tables): print(f'--- TABLE {j+1} ---') for row in table: print(row) "
canine vomiting weight loss differential diagnosis lymphocytosis high hemoglobin monocytosis low granulocytes dog
| Parameter | Value | Reference | Interpretation |
|---|---|---|---|
| Lym% | 40.2% H | 10-28% | Lymphocytosis |
| Mon% | 2.8% H | 0.3-0.9% | Monocytosis |
| Gran% | 53.0% L | 60-85% | Relative Neutropenia/Granulopenia |
| HGB | 20.8 g/dL H | 12-18 g/dL | Polycythemia / Hemoconcentration |
| MCH | 28.2 pg H | 12.5-24.5 pg | Increased MCH |
| MCHC | 41.0 g/dL H | 30-36.9 g/dL | Hyperchromia (possible hemolysis or lipemia artifact) |
| RDW-SD | 35.0% L | 37-54% | Low RBC size variation |
| WBC | 6.6 (normal) | 5-14.1 | Total WBC normal |
| PLT | 320 (normal) | 211-621 | Platelets normal |
| Priority | Test | Targets |
|---|---|---|
| 1st | 4Dx SNAP test (or Ehrlichia/Anaplasma serology/PCR) | Tick-borne disease |
| 1st | Serum electrolytes (Na, K, Na:K ratio) | Hypoadrenocorticism |
| 1st | Blood smear review | Atypical lymphocytes, morulae, RBC morphology |
| 2nd | Fecal float + Giardia SNAP | GI parasites |
| 2nd | Serum biochemistry (ALT, ALP, BUN, creatinine, protein/albumin) | Hepatic, renal, PLE |
| 2nd | Abdominal ultrasound | Lymph nodes, GI wall, liver, spleen |
| 3rd | ACTH stimulation test | Addison's (if electrolytes abnormal or suspicion persists) |
| 3rd | GI panel (TLI, B12, folate) | EPI, IBD, chronic enteropathy |
Note: The high MCHC of 41.0 g/dL may also warrant a blood smear to rule out hemolysis artifact or lipemia. MCHC >37 g/dL is frequently flagged for smear review.
Generate a clinical reasoning chart mapping CBC findings to differential diagnoses
ls -la /tmp/workspace/ 2>/dev/null || mkdir -p /tmp/workspace && ls -la /tmp/workspace/
mkdir -p /tmp/workspace/max-ddx && python3 << 'PYEOF' import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import matplotlib.patches as mpatches from matplotlib.patches import FancyArrowPatch, FancyBboxPatch import matplotlib.patheffects as pe import numpy as np fig = plt.figure(figsize=(22, 16), facecolor='#0d1117') ax = fig.add_axes([0, 0, 1, 1]) ax.set_xlim(0, 22) ax.set_ylim(0, 16) ax.axis('off') ax.set_facecolor('#0d1117') # ─── helper functions ──────────────────────────────────────────────────────── def fancy_box(ax, x, y, w, h, fc, ec, text, fontsize=9, bold=False, text_color='white', radius=0.3, alpha=1.0): box = FancyBboxPatch((x - w/2, y - h/2), w, h, boxstyle=f"round,pad=0.05,rounding_size={radius}", facecolor=fc, edgecolor=ec, linewidth=1.8, alpha=alpha, zorder=3) ax.add_patch(box) weight = 'bold' if bold else 'normal' ax.text(x, y, text, ha='center', va='center', fontsize=fontsize, color=text_color, fontweight=weight, zorder=4, wrap=True, multialignment='center') def arrow(ax, x1, y1, x2, y2, color='#aaaaaa', lw=1.5, style='->', alpha=0.7): ax.annotate('', xy=(x2, y2), xytext=(x1, y1), arrowprops=dict(arrowstyle=style, color=color, lw=lw, alpha=alpha), zorder=2) def line(ax, x1, y1, x2, y2, color='#444466', lw=1.2, alpha=0.6, ls='-'): ax.plot([x1, x2], [y1, y2], color=color, lw=lw, alpha=alpha, ls=ls, zorder=2) # ─── TITLE ─────────────────────────────────────────────────────────────────── ax.text(11, 15.4, 'MAX — Clinical Reasoning Chart', ha='center', va='center', fontsize=18, fontweight='bold', color='#ffffff', zorder=5) ax.text(11, 14.9, 'Dog | 1yr | Male • CBC → Differential Diagnosis Mapping • Signs: Vomiting • Weight Loss • Active', ha='center', va='center', fontsize=10, color='#aaaacc', zorder=5) # horizontal rule line(ax, 0.5, 14.6, 21.5, 14.6, color='#3344aa', lw=1.5, alpha=1.0) # ─── CBC FINDINGS COLUMN (left) ────────────────────────────────────────────── ax.text(2.8, 14.1, 'CBC ABNORMALITIES', ha='center', va='center', fontsize=11, fontweight='bold', color='#ffdd44', zorder=5) findings = [ # (label, y, flag color, flag text) ('↑ Lymphocyte %\n40.2% [10–28%]', 13.1, '#ff6b6b', 'HIGH'), ('↑ Monocyte %\n2.8% [0.3–0.9%]', 11.7, '#ff6b6b', 'HIGH'), ('↓ Granulocyte %\n53.0% [60–85%]', 10.3, '#5bc4f5', 'LOW'), ('↑ Hemoglobin\n20.8 g/dL [12–18]', 8.9, '#ff6b6b', 'HIGH'), ('↑ MCHC\n41.0 g/dL [30–36.9]', 7.5, '#ff6b6b', 'HIGH'), ('↑ MCH\n28.2 pg [12.5–24.5]', 6.1, '#ff6b6b', 'HIGH'), ('↓ RDW-SD\n35.0% [37–54%]', 4.7, '#5bc4f5', 'LOW'), ('PLT Normal\n320 K/uL [211–621]', 3.3, '#44cc88', 'NRML'), ('WBC Normal\n6.6 ×10³/uL [5–14.1]', 1.9, '#44cc88', 'NRML'), ] for label, fy, fc, flag in findings: fancy_box(ax, 2.8, fy, 4.2, 0.95, '#1a1f2e', fc, label, fontsize=8.5, text_color='#e0e0ff') # flag badge badge = FancyBboxPatch((4.75, fy - 0.22), 0.72, 0.44, boxstyle="round,pad=0.05,rounding_size=0.1", facecolor=fc, edgecolor='none', alpha=0.9, zorder=4) ax.add_patch(badge) ax.text(5.11, fy, flag, ha='center', va='center', fontsize=7, fontweight='bold', color='white', zorder=5) # ─── PATTERN NODES (middle) ────────────────────────────────────────────────── ax.text(11.0, 14.1, 'CBC PATTERNS', ha='center', va='center', fontsize=11, fontweight='bold', color='#ffdd44', zorder=5) patterns = [ # (label, y, color) ('Lymphocytosis\n+ Monocytosis\n+ ↓ Gran%', 12.1, '#7b5ea7'), ('Hemoconcentration\n(↑HGB + ↑MCHC)', 9.5, '#c05a2a'), ('↑MCH + ↑MCHC\n(Hyperchromia)', 7.3, '#c05a2a'), ('↓RDW-SD\n(Uniform RBC size)', 5.3, '#2a7a9a'), ('Normal WBC count\nNormal Platelets', 3.1, '#2a7a9a'), ] for label, py, pc in patterns: fancy_box(ax, 11.0, py, 3.6, 1.1, '#1e1030', pc, label, fontsize=8.5, text_color='#f0eaff', bold=False) # arrows: findings → patterns # Lym % → Pattern 1 arrow(ax, 5.2, 13.1, 9.2, 12.1, color='#ff6b6b') # Mon % → Pattern 1 arrow(ax, 5.2, 11.7, 9.2, 12.1, color='#ff6b6b') # Gran % → Pattern 1 arrow(ax, 5.2, 10.3, 9.2, 12.1, color='#5bc4f5') # HGB → Pattern 2 arrow(ax, 5.2, 8.9, 9.2, 9.5, color='#ff6b6b') # MCHC → Pattern 2 arrow(ax, 5.2, 7.5, 9.2, 9.5, color='#ff6b6b') # MCH → Pattern 3 arrow(ax, 5.2, 6.1, 9.2, 7.3, color='#ff9944') # MCHC → Pattern 3 arrow(ax, 5.2, 7.5, 9.2, 7.3, color='#ff9944') # RDW-SD → Pattern 4 arrow(ax, 5.2, 4.7, 9.2, 5.3, color='#5bc4f5') # PLT/WBC → Pattern 5 arrow(ax, 5.2, 3.3, 9.2, 3.1, color='#44cc88') arrow(ax, 5.2, 1.9, 9.2, 3.1, color='#44cc88') # ─── DIFFERENTIAL DIAGNOSES (right) ───────────────────────────────────────── ax.text(17.8, 14.1, 'DIFFERENTIAL DIAGNOSES', ha='center', va='center', fontsize=11, fontweight='bold', color='#ffdd44', zorder=5) ddx = [ # (rank, label, y, priority_color, badge) ('①', 'Ehrlichiosis\n(Tick-Borne — E. canis)', 13.2, '#e84040', '★★★'), ('②', 'Hypoadrenocorticism\n(Addison\'s Disease)', 11.5, '#e84040', '★★★'), ('③', 'Anaplasmosis\n(Tick-Borne — A. platys)', 10.0, '#f07020', '★★☆'), ('④', 'GI Parasitism\n(Toxocara, Giardia, etc.)', 8.5, '#f07020', '★★☆'), ('⑤', 'Chronic GI Disease\n(IBD / PLE)', 7.0, '#d4aa00', '★★☆'), ('⑥', 'Hepatic Disease\n(Hepatitis / PSS)', 5.5, '#d4aa00', '★☆☆'), ('⑦', 'Low-Grade Lymphoma\n(Intestinal)', 4.0, '#888888', '★☆☆'), ('⑧', 'Dehydration\n(Secondary — chronic vomiting)', 2.6,'#3399cc', 'SEC'), ] for rank, label, dy, dc, badge in ddx: fancy_box(ax, 17.8, dy, 4.6, 1.05, '#1a1e2e', dc, f'{rank} {label}', fontsize=8.5, text_color='#f0f0ff') # priority badge top-right bx = FancyBboxPatch((19.9, dy - 0.22), 0.8, 0.44, boxstyle="round,pad=0.05,rounding_size=0.1", facecolor=dc, edgecolor='none', alpha=0.85, zorder=4) ax.add_patch(bx) ax.text(20.30, dy, badge, ha='center', va='center', fontsize=7, color='white', fontweight='bold', zorder=5) # ─── PATTERN → DDX arrows ──────────────────────────────────────────────────── # Pattern 1 (Lym+Mon+↓Gran) → Ehrlichia, Addison, Anaplasmosis, Parasitism, Lymphoma arrow(ax, 12.8, 12.1, 15.5, 13.2, color='#9977cc', lw=1.8) arrow(ax, 12.8, 12.1, 15.5, 11.5, color='#9977cc', lw=1.8) arrow(ax, 12.8, 12.1, 15.5, 10.0, color='#9977cc', lw=1.3) arrow(ax, 12.8, 12.1, 15.5, 8.5, color='#9977cc', lw=1.1, alpha=0.5) arrow(ax, 12.8, 12.1, 15.5, 4.0, color='#9977cc', lw=1.0, alpha=0.4) # Pattern 2 (Hemoconcentration) → Dehydration (secondary), Addison arrow(ax, 12.8, 9.5, 15.5, 11.5, color='#d06030', lw=1.3) arrow(ax, 12.8, 9.5, 15.5, 2.6, color='#d06030', lw=1.8) # Pattern 3 (Hyperchromia) → Hemolysis note on Addison, Dehydration arrow(ax, 12.8, 7.3, 15.5, 11.5, color='#cc8833', lw=1.0, alpha=0.6) arrow(ax, 12.8, 7.3, 15.5, 2.6, color='#cc8833', lw=1.0, alpha=0.5) # Pattern 4 (↓RDW-SD) → IBD/PLE, Hepatic arrow(ax, 12.8, 5.3, 15.5, 7.0, color='#3399cc', lw=1.2) arrow(ax, 12.8, 5.3, 15.5, 5.5, color='#3399cc', lw=1.0, alpha=0.6) # Pattern 5 (Normal WBC/PLT) → helps rule out sepsis/DIC (note) arrow(ax, 12.8, 3.1, 15.5, 4.0, color='#44cc88', lw=1.0, alpha=0.5) # ─── LEGEND ────────────────────────────────────────────────────────────────── legend_x = 0.4 legend_y = 0.85 ax.text(legend_x, legend_y, 'Priority:', fontsize=8, color='#aaaaaa', va='center') for i, (col, txt) in enumerate([('#e84040','HIGH'),('#f07020','MODERATE'), ('#d4aa00','CONSIDER'),('#888888','RULE OUT'), ('#3399cc','SECONDARY')]): bx = FancyBboxPatch((legend_x + 0.7 + i*2.2, legend_y - 0.18), 1.1, 0.36, boxstyle="round,pad=0.04,rounding_size=0.08", facecolor=col, edgecolor='none', zorder=4) ax.add_patch(bx) ax.text(legend_x + 1.25 + i*2.2, legend_y, txt, ha='center', va='center', fontsize=7.5, color='white', fontweight='bold', zorder=5) # bottom note ax.text(11, 0.35, 'Note: Blood smear review mandatory. Recommended next tests: 4Dx SNAP (tick-borne), Electrolytes + ACTH stim (Addison\'s), Fecal float (parasites)', ha='center', va='center', fontsize=8, color='#aaccff', style='italic', zorder=5) line(ax, 0.5, 0.6, 21.5, 0.6, color='#3344aa', lw=1.0, alpha=0.6) plt.savefig('/tmp/workspace/max-ddx/clinical_reasoning_chart.png', dpi=150, bbox_inches='tight', facecolor='#0d1117') print('Chart saved successfully.') PYEOF
clinical reasoning chart
Image · PNG