"iron deficiency anemia" AND "serum ferritin" diagnosis
| Test | Result | Reference Range | Status | Interpretation |
|---|---|---|---|---|
| Haemoglobin | 9.5 g/dL | 11.5-16.5 | π΄ LOW | Mild-moderate anemia |
| MCH | 21.8 pg | 25.0-35.0 | π΄ LOW | Hypochromic RBCs |
| MCHC | 33.9 g/dL | 31.0-38.0 | β Normal | |
| Total Leucocyte Count | 10.7 Γ 10βΉ/L | 4-11 | β Normal | Upper end of normal |
| Lymphocytes | 4.4 Γ 10βΉ/L | 0.5-5.0 | β Normal | |
| MID | 1.7 Γ 10βΉ/L | 0.1-1.5 | π‘ Slightly high | Minor, not clinically significant |
| Granulocytes | 4.6 Γ 10βΉ/L | 1.2-8.0 | β Normal | |
| RBC | 4.35 Γ 10ΒΉΒ²/L | 3.50-5.50 | β Normal | |
| MCV | 64.3 fL | 75.0-100.0 | π΄ LOW | Significant microcytosis |
| HCT | 28% | 35.0-55.0 | π΄ LOW | Low hematocrit |
| PDW% | 37.8% | 0.1-99.9 | β Normal | |
| RDW% | 14.6% | 11.0-16.0 | π‘ High-normal | Anisocytosis - mixed cell sizes |
| RDWa | 48.9 fL | 30.0-150.0 | β Normal | |
| PLT | 484 Γ 10Β³/ΞΌL | 100-400 | π΄ HIGH | Reactive thrombocytosis |
| MPV | 7.8 fL | 8.0-11.0 | π‘ Slightly low | Small platelets |
| PDW | 9.6 fL | 0.1-99.9 | β Normal | |
| PCT | 0.38% | 0.01-9.99 | β Normal |
| Test | Result | Reference Range (Females) | Status |
|---|---|---|---|
| Serum Ferritin | 23 ng/mL | ~12-150 ng/mL (females) | π‘ Low-normal / borderline low |
Note: The lab printed the male reference range (20-290 ng/mL) on the report - the female reference range is approximately 12-150 ng/mL. For a 19-year-old female, ferritin below 30 ng/mL is strongly suggestive of depleted iron stores, even if technically above the lower limit for women. The Washington Manual states ferritin <10 ng/mL in women "almost always" reflects low iron stores, but values 10-30 ng/mL with this clinical picture remain diagnostically significant.
Disclaimer: This is an educational interpretation for informational purposes. Final clinical decisions should be made by the treating physician.
Generate a quick reference PDF with IDA diagnostic criteria and treatment protocols
ls -la /tmp/workspace/ 2>/dev/null || mkdir -p /tmp/workspace && echo "created"
mkdir -p /tmp/workspace/ida-pdf && cat > /tmp/workspace/ida-pdf/generate_ida_pdf.py << 'PYEOF' from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import mm, cm from reportlab.platypus import ( SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable, KeepTogether ) from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY from reportlab.platypus import Flowable W, H = A4 # ββ colour palette ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ RED = colors.HexColor("#C0392B") DARK_RED = colors.HexColor("#922B21") ORANGE = colors.HexColor("#E67E22") GREEN = colors.HexColor("#1E8449") BLUE = colors.HexColor("#1A5276") TEAL = colors.HexColor("#148F77") LIGHT_BG = colors.HexColor("#FDFEFE") HEADER_BG= colors.HexColor("#1A5276") ALT_ROW = colors.HexColor("#EBF5FB") WARN_BG = colors.HexColor("#FEF9E7") WARN_BORDER = colors.HexColor("#F39C12") SECTION_BG = colors.HexColor("#EAF2FF") # ββ document βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ doc = SimpleDocTemplate( "/tmp/workspace/ida-pdf/IDA_Quick_Reference.pdf", pagesize=A4, leftMargin=18*mm, rightMargin=18*mm, topMargin=15*mm, bottomMargin=15*mm, title="IDA Quick Reference Guide", author="Orris Medical", ) styles = getSampleStyleSheet() def S(name, **kw): return ParagraphStyle(name, parent=styles["Normal"], **kw) # custom styles title_style = S("Title2", fontSize=20, textColor=colors.white, alignment=TA_CENTER, fontName="Helvetica-Bold", spaceAfter=2) sub_style = S("Sub", fontSize=10, textColor=colors.HexColor("#AED6F1"), alignment=TA_CENTER, fontName="Helvetica", spaceAfter=0) h1_style = S("H1", fontSize=12, textColor=colors.white, fontName="Helvetica-Bold", spaceBefore=2, spaceAfter=2, leftIndent=6, leading=16) h2_style = S("H2", fontSize=10, textColor=BLUE, fontName="Helvetica-Bold", spaceBefore=4, spaceAfter=2) body_style = S("Body", fontSize=8.5, leading=12, spaceAfter=2, alignment=TA_JUSTIFY) bullet_style = S("Bullet", fontSize=8.5, leading=12, leftIndent=12, bulletIndent=4, spaceAfter=1) note_style = S("Note", fontSize=7.8, textColor=colors.HexColor("#7D6608"), leading=11, leftIndent=8) footer_style = S("Footer", fontSize=7, textColor=colors.grey, alignment=TA_CENTER) tag_style = S("Tag", fontSize=7.5, textColor=colors.white, fontName="Helvetica-Bold", alignment=TA_CENTER) elems = [] # ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ # HEADER BANNER # ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ header_data = [[ Paragraph("IRON DEFICIENCY ANEMIA", title_style), "", ], [ Paragraph("Quick Reference: Diagnostic Criteria & Treatment Protocols", sub_style), "", ]] header_tbl = Table(header_data, colWidths=[W - 36*mm], rowHeights=[26, 16]) header_tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), HEADER_BG), ("SPAN", (0,0), (-1, 0)), ("SPAN", (0,1), (-1, 1)), ("TOPPADDING", (0,0), (-1,-1), 6), ("BOTTOMPADDING",(0,-1),(-1,-1), 8), ("LEFTPADDING", (0,0), (-1,-1), 10), ("ROUNDEDCORNERS", [6]), ])) elems.append(header_tbl) elems.append(Spacer(1, 5*mm)) # ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ # SECTION HELPER # ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ def section_header(title, color=BLUE): tbl = Table([[Paragraph(f"β {title}", h1_style)]], colWidths=[W - 36*mm]) tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), color), ("ROUNDEDCORNERS", [4]), ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING",(0,0),(-1,-1), 4), ])) return tbl def bullet(text, symbol="β’"): return Paragraph(f"<b>{symbol}</b> {text}", bullet_style) def warn_box(lines, title="β Clinical Note"): content = [Paragraph(f"<b>{title}</b>", S("WH", fontSize=8.5, textColor=WARN_BORDER, fontName="Helvetica-Bold"))] for l in lines: content.append(Paragraph(f" {l}", S("WB", fontSize=8.2, textColor=colors.HexColor("#7D6608"), leading=11))) tbl = Table([[content]], colWidths=[W - 36*mm]) tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), WARN_BG), ("BOX", (0,0), (-1,-1), 1.2, WARN_BORDER), ("ROUNDEDCORNERS", [5]), ("TOPPADDING", (0,0),(-1,-1), 6), ("BOTTOMPADDING",(0,0),(-1,-1), 6), ("LEFTPADDING", (0,0),(-1,-1), 8), ])) return tbl # ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ # SECTION 1 β OVERVIEW # ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ elems.append(section_header("OVERVIEW", DARK_RED)) elems.append(Spacer(1, 2*mm)) elems.append(Paragraph( "Iron Deficiency Anemia (IDA) is the <b>most common nutritional deficiency worldwide</b>, " "characterised by depletion of iron stores leading to impaired haemoglobin synthesis. " "It progresses through three stages: <b>pre-latent</b> (depleted stores, normal Hb), " "<b>latent</b> (low serum iron, raised TIBC), and <b>manifest IDA</b> (microcytic hypochromic anemia).", body_style)) elems.append(Spacer(1, 3*mm)) # ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ # SECTION 2 β DIAGNOSTIC CRITERIA # ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ elems.append(section_header("DIAGNOSTIC CRITERIA", BLUE)) elems.append(Spacer(1, 2*mm)) # lab table diag_header = [ Paragraph("<b>Parameter</b>", S("TH", fontSize=8.5, textColor=colors.white, fontName="Helvetica-Bold", alignment=TA_CENTER)), Paragraph("<b>IDA Finding</b>", S("TH", fontSize=8.5, textColor=colors.white, fontName="Helvetica-Bold", alignment=TA_CENTER)), Paragraph("<b>Normal Range</b>", S("TH", fontSize=8.5, textColor=colors.white, fontName="Helvetica-Bold", alignment=TA_CENTER)), Paragraph("<b>Significance</b>", S("TH", fontSize=8.5, textColor=colors.white, fontName="Helvetica-Bold", alignment=TA_CENTER)), ] diag_rows = [ ["Haemoglobin", "< 12 g/dL (F) / < 13 g/dL (M)", "11.5β16.5 (F)\n13β17.5 (M) g/dL", "Confirms anaemia"], ["MCV", "< 80 fL (often < 70 fL)", "80β100 fL", "Microcytosis β hallmark"], ["MCH", "< 27 pg", "27β33 pg", "Hypochromia"], ["MCHC", "< 32 g/dL", "31.5β35.5 g/dL", "Late finding"], ["RDW", "> 14.5% (elevated)", "11.5β14.5%", "Anisocytosis β early sign"], ["Serum Ferritin", "< 30 ng/mL (diagnostic)\n< 10 ng/mL women (confirmatory)", "20β200 ng/mL (F)\n20β300 ng/mL (M)", "Most specific marker"], ["Serum Iron", "< 50 ΞΌg/dL", "60β170 ΞΌg/dL", "Reduced transport iron"], ["TIBC", "> 400 ΞΌg/dL", "250β370 ΞΌg/dL", "Compensatory rise"], ["Transferrin Sat.", "< 16%", "20β50%", "Key ratio for IDA"], ["Platelet Count", "Often elevated (reactive)\n~450 Γ 10Β³/ΞΌL", "150β400 Γ 10Β³/ΞΌL", "Reactive thrombocytosis"], ["Reticulocyte Hb", "< 25 pg", "28β35 pg", "Earliest indicator"], ] def pstyle(txt, bold=False, center=False): al = TA_CENTER if center else TA_LEFT fn = "Helvetica-Bold" if bold else "Helvetica" return Paragraph(txt, S("C", fontSize=8, leading=10.5, alignment=al, fontName=fn)) diag_data = [diag_header] + [ [pstyle(r[0], bold=True), pstyle(r[1]), pstyle(r[2]), pstyle(r[3])] for r in diag_rows ] col_w = [42*mm, 52*mm, 42*mm, 38*mm] diag_tbl = Table(diag_data, colWidths=col_w) ts = TableStyle([ ("BACKGROUND", (0,0), (-1,0), BLUE), ("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#BFC9CA")), ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING",(0,0),(-1,-1), 4), ("LEFTPADDING", (0,0), (-1,-1), 5), ("RIGHTPADDING",(0,0), (-1,-1), 5), ("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.white, ALT_ROW]), ("ROUNDEDCORNERS", [4]), ("FONTSIZE", (0,0), (-1,-1), 8), ]) diag_tbl.setStyle(ts) elems.append(diag_tbl) elems.append(Spacer(1, 2*mm)) elems.append(warn_box([ "Ferritin is an acute-phase reactant β falsely normal/elevated in infection, inflammation, liver disease.", "Use soluble Transferrin Receptor (sTfR) or sTfR/log ferritin ratio when co-existing inflammation suspected.", "Bone marrow absent iron staining is the gold standard but rarely needed clinically.", ])) elems.append(Spacer(1, 3*mm)) # ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ # SECTION 3 β DIFFERENTIAL DIAGNOSIS # ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ elems.append(section_header("DIFFERENTIAL DIAGNOSIS OF MICROCYTIC ANAEMIA", TEAL)) elems.append(Spacer(1, 2*mm)) diff_hdr = [ Paragraph("<b>Condition</b>", S("TH", fontSize=8.5, textColor=colors.white, fontName="Helvetica-Bold")), Paragraph("<b>Ferritin</b>", S("TH", fontSize=8.5, textColor=colors.white, fontName="Helvetica-Bold", alignment=TA_CENTER)), Paragraph("<b>Serum Iron</b>", S("TH", fontSize=8.5, textColor=colors.white, fontName="Helvetica-Bold", alignment=TA_CENTER)), Paragraph("<b>TIBC</b>", S("TH", fontSize=8.5, textColor=colors.white, fontName="Helvetica-Bold", alignment=TA_CENTER)), Paragraph("<b>RDW</b>", S("TH", fontSize=8.5, textColor=colors.white, fontName="Helvetica-Bold", alignment=TA_CENTER)), Paragraph("<b>Key Distinguishing Feature</b>", S("TH", fontSize=8.5, textColor=colors.white, fontName="Helvetica-Bold")), ] diff_rows = [ ["IDA", "β Low", "β Low", "β High", "β High", "History of blood loss / menorrhagia"], ["Anaemia of Chronic Disease","β/N Normal", "β Low", "β/N Low", "Normal", "CRP elevated; underlying chronic illness"], ["Ξ²-Thalassaemia trait", "Normal/β", "Normal/β", "Normal", "Normal", "Target cells; Hb A2 > 3.5% on HPLC"], ["Ξ±-Thalassaemia trait", "Normal", "Normal", "Normal", "Normal", "Ethnic origin; Hb Barts on NBS; FHx"], ["Sideroblastic anaemia", "β High", "β High", "β Low", "β High", "Ring sideroblasts on bone marrow"], ["Lead poisoning", "Normal", "β Low", "β High", "β High", "Basophilic stippling; elevated blood lead"], ] diff_data = [diff_hdr] + [ [pstyle(r[0], bold=True), pstyle(r[1], center=True), pstyle(r[2], center=True), pstyle(r[3], center=True), pstyle(r[4], center=True), pstyle(r[5])] for r in diff_rows ] diff_tbl = Table(diff_data, colWidths=[35*mm, 23*mm, 23*mm, 20*mm, 20*mm, 53*mm]) diff_tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,0), TEAL), ("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#BFC9CA")), ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING",(0,0), (-1,-1), 4), ("LEFTPADDING", (0,0), (-1,-1), 5), ("ROWBACKGROUNDS",(0,1),(-1,-1), [colors.white, ALT_ROW]), ("ROUNDEDCORNERS",[4]), ])) elems.append(diff_tbl) elems.append(Spacer(1, 3*mm)) # ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ # SECTION 4 β TREATMENT PROTOCOL # ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ elems.append(section_header("TREATMENT PROTOCOL", GREEN)) elems.append(Spacer(1, 2*mm)) # 4A β Oral iron elems.append(Paragraph("<b>A. Oral Iron Therapy</b> (first-line for stable, mild-moderate IDA)", h2_style)) oral_hdr = [ Paragraph("<b>Preparation</b>", S("TH", fontSize=8.5, textColor=colors.white, fontName="Helvetica-Bold")), Paragraph("<b>Dose</b>", S("TH", fontSize=8.5, textColor=colors.white, fontName="Helvetica-Bold", alignment=TA_CENTER)), Paragraph("<b>Elemental Fe</b>", S("TH", fontSize=8.5, textColor=colors.white, fontName="Helvetica-Bold", alignment=TA_CENTER)), Paragraph("<b>Notes</b>", S("TH", fontSize=8.5, textColor=colors.white, fontName="Helvetica-Bold")), ] oral_rows = [ ["Ferrous Sulfate (preferred)", "325 mg onceβthree times daily", "65 mg / dose", "Most cost-effective; commonest GI side-effects"], ["Ferrous Gluconate", "300 mg three times daily", "36 mg / dose", "Better GI tolerance; useful if sulfate not tolerated"], ["Ferrous Fumarate", "100 mg three times daily", "33 mg / dose", "Alternative; palatable for children"], ["Iron Polysaccharide Complex", "150 mg twice daily", "150 mg / dose","Less GI upset; more expensive"], ["Carbonyl Iron", "50 mg twiceβthree times daily", "50 mg / dose", "Slow-release; safest in accidental overdose"], ] oral_data = [oral_hdr] + [ [pstyle(r[0], bold=True), pstyle(r[1], center=True), pstyle(r[2], center=True), pstyle(r[3])] for r in oral_rows ] oral_tbl = Table(oral_data, colWidths=[48*mm, 44*mm, 28*mm, 54*mm]) oral_tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,0), GREEN), ("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#BFC9CA")), ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING", (0,0), (-1,-1), 4), ("LEFTPADDING", (0,0), (-1,-1), 5), ("ROWBACKGROUNDS",(0,1), (-1,-1), [colors.white, colors.HexColor("#EAFAF1")]), ("ROUNDEDCORNERS",[4]), ])) elems.append(oral_tbl) elems.append(Spacer(1, 2*mm)) # oral tips elems.append(Paragraph("<b>Oral Iron β Key Practice Points:</b>", h2_style)) tips = [ "Take on an <b>empty stomach</b> for best absorption (30 min before meals)", "Co-administer with <b>Vitamin C</b> (100β200 mg / orange juice) to enhance absorption", "Avoid concurrent tea, coffee, calcium, antacids β they inhibit absorption", "<b>Every-other-day dosing</b> may be as effective as daily with fewer GI side effects (hepcidin cycling)", "Expected response: <b>Hb rises ~1β2 g/dL per month</b>; reticulocyte peak at 7β10 days", "Continue for <b>3β6 months after Hb normalises</b> to replenish stores", "If Hb does not respond in 4 weeks β consider non-adherence, ongoing blood loss, malabsorption", ] for t in tips: elems.append(bullet(t)) elems.append(Spacer(1, 2*mm)) # 4B β IV iron elems.append(Paragraph("<b>B. Intravenous Iron Therapy</b> (indications below)", h2_style)) iv_indications = [ "Intolerance / non-response to oral iron", "Malabsorption (bariatric surgery, IBD, coeliac disease)", "Severe anaemia requiring rapid repletion (pre-operative, cardiac failure)", "Chronic kidney disease on haemodialysis", "Second / third trimester pregnancy with significant IDA", ] for ind in iv_indications: elems.append(bullet(ind, "β")) elems.append(Spacer(1, 1*mm)) iv_hdr = [ Paragraph("<b>Agent</b>", S("TH", fontSize=8.5, textColor=colors.white, fontName="Helvetica-Bold")), Paragraph("<b>Dose / Schedule</b>", S("TH", fontSize=8.5, textColor=colors.white, fontName="Helvetica-Bold")), Paragraph("<b>Notes</b>", S("TH", fontSize=8.5, textColor=colors.white, fontName="Helvetica-Bold")), ] iv_rows = [ ["Iron Sucrose", "200 mg IV over 15 min; repeat doses", "Safest profile; preferred in pregnancy / CKD"], ["Ferric Carboxymaltose","500β1000 mg IV over 15 min; 1β2 doses", "High single-dose capacity; risk of hypophosphataemia"], ["Low-MW Iron Dextran", "Total dose infusion (TDI) over 4β6 h", "Requires test dose; risk of hypersensitivity"], ["Ferric Derisomaltose", "500β1000 mg IV over 20 min", "Newer; minimal anaphylaxis risk; single high dose"], ] iv_data = [iv_hdr] + [ [pstyle(r[0], bold=True), pstyle(r[1]), pstyle(r[2])] for r in iv_rows ] iv_tbl = Table(iv_data, colWidths=[46*mm, 62*mm, 66*mm]) iv_tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,0), colors.HexColor("#1E8449")), ("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#BFC9CA")), ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING",(0,0), (-1,-1), 4), ("LEFTPADDING", (0,0), (-1,-1), 5), ("ROWBACKGROUNDS",(0,1),(-1,-1), [colors.white, colors.HexColor("#EAFAF1")]), ])) elems.append(iv_tbl) elems.append(Spacer(1, 3*mm)) # ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ # SECTION 5 β SPECIAL POPULATIONS # ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ elems.append(section_header("SPECIAL POPULATIONS", ORANGE)) elems.append(Spacer(1, 2*mm)) sp_hdr = [ Paragraph("<b>Population</b>", S("TH", fontSize=8.5, textColor=colors.white, fontName="Helvetica-Bold")), Paragraph("<b>Threshold / Consideration</b>", S("TH", fontSize=8.5, textColor=colors.white, fontName="Helvetica-Bold")), Paragraph("<b>Preferred Management</b>", S("TH", fontSize=8.5, textColor=colors.white, fontName="Helvetica-Bold")), ] sp_rows = [ ["Premenopausal Women", "Hb < 12 g/dL; ferritin < 30 ng/mL", "Oral iron; treat menorrhagia cause; dietary counselling"], ["Pregnancy", "Hb < 11 (1st/3rd trim), < 10.5 (2nd trim)", "Oral iron 60 mg/day prophylaxis; IV if severe / malabsorption"], ["Children (6 moβ5 yr)", "Hb < 11 g/dL; ferritin < 12 ng/mL", "3β6 mg/kg/day elemental Fe; treat for 3 months post-normalisation"], ["Adolescents", "Growth spurt + menstruation = high risk", "Oral iron + dietary education; screen at-risk groups"], ["Elderly", "IDA often multifactorial; exclude GI source", "Colonoscopy/endoscopy; oral iron; consider IV if oral fails"], ["CKD / Haemodialysis", "Ferritin target 200β500; TSAT > 20%", "IV iron sucrose; ESA only if ferritin-replete"], ["Post-Bariatric Surgery", "Malabsorption of duodenal Fe absorption", "Preventive supplementation; IV iron often needed long-term"], ] sp_data = [sp_hdr] + [ [pstyle(r[0], bold=True), pstyle(r[1]), pstyle(r[2])] for r in sp_rows ] sp_tbl = Table(sp_data, colWidths=[44*mm, 62*mm, 68*mm]) sp_tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,0), ORANGE), ("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#BFC9CA")), ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING", (0,0), (-1,-1), 4), ("LEFTPADDING", (0,0), (-1,-1), 5), ("ROWBACKGROUNDS",(0,1), (-1,-1), [colors.white, colors.HexColor("#FEF9E7")]), ])) elems.append(sp_tbl) elems.append(Spacer(1, 3*mm)) # ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ # SECTION 6 β MONITORING & FOLLOW-UP # ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ elems.append(section_header("MONITORING & FOLLOW-UP", DARK_RED)) elems.append(Spacer(1, 2*mm)) mon_hdr = [ Paragraph("<b>Timepoint</b>", S("TH", fontSize=8.5, textColor=colors.white, fontName="Helvetica-Bold", alignment=TA_CENTER)), Paragraph("<b>Test</b>", S("TH", fontSize=8.5, textColor=colors.white, fontName="Helvetica-Bold")), Paragraph("<b>Expected / Action</b>", S("TH", fontSize=8.5, textColor=colors.white, fontName="Helvetica-Bold")), ] mon_rows = [ ["7β10 days", "Reticulocyte count", "Reticulocytosis confirms response to iron"], ["4 weeks", "CBC (Hb, MCV, RDW)", "Hb β β₯1 g/dL expected; if not β reassess (compliance? bleeding? malabsorption?)"], ["3 months", "CBC + Serum Ferritin", "Hb should normalise; continue iron 3β6 more months to replenish stores"], ["6 months", "CBC + Ferritin", "Ferritin should reach β₯ 50 ng/mL; can discontinue iron if stores replenished"], ["If no response", "Serum iron, TIBC, sTfR, HPLC", "Rule out: thalassaemia, sideroblastic anaemia, ongoing occult blood loss"], ] mon_data = [mon_hdr] + [ [pstyle(r[0], center=True, bold=True), pstyle(r[1]), pstyle(r[2])] for r in mon_rows ] mon_tbl = Table(mon_data, colWidths=[30*mm, 52*mm, 92*mm]) mon_tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,0), DARK_RED), ("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#BFC9CA")), ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING", (0,0), (-1,-1), 4), ("LEFTPADDING", (0,0), (-1,-1), 5), ("ROWBACKGROUNDS",(0,1), (-1,-1), [colors.white, colors.HexColor("#FDEDEC")]), ])) elems.append(mon_tbl) elems.append(Spacer(1, 3*mm)) # ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ # SECTION 7 β RED FLAGS / WHEN TO INVESTIGATE FOR CAUSE # ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ elems.append(section_header("RED FLAGS β INVESTIGATE UNDERLYING CAUSE", RED)) elems.append(Spacer(1, 2*mm)) rf_pairs = [ ("GI blood loss", "Age > 50 with new IDA β colonoscopy + endoscopy mandatory; unexplained IDA in any male"), ("Haematuria", "Renal/bladder malignancy; always dipstick urine in new IDA"), ("Weight loss + IDA", "Screen for GI malignancy, coeliac disease, inflammatory bowel disease"), ("Recurrent IDA despite treatment", "Malabsorption (coeliac serology), H. pylori testing, hereditary haemorrhagic telangiectasia"), ("Pica / Pagophagia", "Pathognomonic of severe iron deficiency; resolves rapidly with iron treatment"), ("Koilonychia / Glossitis / Angular cheilitis", "Signs of chronic severe IDA; Plummer-Vinson syndrome if dysphagia present"), ] rf_data = [ [Paragraph(f"<b>π΄ {r[0]}</b>", S("RF", fontSize=8.5, fontName="Helvetica-Bold", textColor=RED)), Paragraph(r[1], S("RFB", fontSize=8.5, leading=11))] for r in rf_pairs ] rf_tbl = Table(rf_data, colWidths=[48*mm, 126*mm]) rf_tbl.setStyle(TableStyle([ ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#F1948A")), ("TOPPADDING", (0,0), (-1,-1), 5), ("BOTTOMPADDING",(0,0), (-1,-1), 5), ("LEFTPADDING", (0,0), (-1,-1), 6), ("ROWBACKGROUNDS",(0,0),(-1,-1), [colors.white, colors.HexColor("#FDEDEC")]), ])) elems.append(rf_tbl) elems.append(Spacer(1, 3*mm)) # ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ # SECTION 8 β DIETARY SOURCES OF IRON # ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ elems.append(section_header("DIETARY IRON SOURCES & COUNSELLING", TEAL)) elems.append(Spacer(1, 2*mm)) diet_hdr = [ Paragraph("<b>Food Source</b>", S("TH", fontSize=8.5, textColor=colors.white, fontName="Helvetica-Bold")), Paragraph("<b>Iron Content</b>", S("TH", fontSize=8.5, textColor=colors.white, fontName="Helvetica-Bold", alignment=TA_CENTER)), Paragraph("<b>Type</b>", S("TH", fontSize=8.5, textColor=colors.white, fontName="Helvetica-Bold", alignment=TA_CENTER)), Paragraph("<b>Bioavailability</b>", S("TH", fontSize=8.5, textColor=colors.white, fontName="Helvetica-Bold", alignment=TA_CENTER)), ] diet_rows = [ ["Red meat / Organ meats (liver)", "~3β7 mg/100g", "Haem", "15β35% (high)"], ["Poultry / Fish", "~1β3 mg/100g", "Haem", "15β25% (moderate)"], ["Dark leafy greens (spinach, kale)","~2β3 mg/100g", "Non-Haem", "2β8% (low)"], ["Legumes (lentils, beans)", "~3β4 mg/100g", "Non-Haem", "2β8%; enhance with Vit C"], ["Fortified cereals", "~5β18 mg/serving","Non-Haem","Variable; up to 25%"], ["Tofu / Tempeh", "~3 mg/100g", "Non-Haem", "2β8%"], ["Dried fruits (apricot, raisin)", "~2β3 mg/100g", "Non-Haem", "Moderate; pair with Vit C"], ] diet_data = [diet_hdr] + [ [pstyle(r[0], bold=True), pstyle(r[1], center=True), pstyle(r[2], center=True), pstyle(r[3], center=True)] for r in diet_rows ] diet_tbl = Table(diet_data, colWidths=[60*mm, 38*mm, 28*mm, 48*mm]) diet_tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,0), TEAL), ("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#BFC9CA")), ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING", (0,0), (-1,-1), 4), ("LEFTPADDING", (0,0), (-1,-1), 5), ("ROWBACKGROUNDS",(0,1), (-1,-1), [colors.white, ALT_ROW]), ])) elems.append(diet_tbl) elems.append(Spacer(1, 2*mm)) elems.append(Paragraph( "<b>Inhibitors of iron absorption:</b> tea, coffee, phytates (bran), calcium (dairy), " "polyphenols. <b>Enhancers:</b> Vitamin C, meat factor (haem iron), fermented foods.", S("Diet2", fontSize=8, leading=11, textColor=colors.HexColor("#1A5276")) )) elems.append(Spacer(1, 3*mm)) # ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ # FOOTER # ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ elems.append(HRFlowable(width="100%", thickness=0.8, color=BLUE)) elems.append(Spacer(1, 1.5*mm)) elems.append(Paragraph( "Sources: Washington Manual of Medical Therapeutics | Textbook of Family Medicine 9e | " "Goldman-Cecil Medicine | Creasy & Resnik's Maternal-Fetal Medicine | Harriet Lane Handbook 23e " "β Compiled by <b>Orris Medical</b> | August 2026 | For educational use only β not a substitute for clinical judgement.", footer_style )) # ββ BUILD ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ doc.build(elems) print("PDF generated successfully.") PYEOF echo "Script written"
cd /tmp/workspace/ida-pdf && python generate_ida_pdf.py
ls -lh /tmp/workspace/ida-pdf/IDA_Quick_Reference.pdf
IDA Quick Reference
PDF Document Β· PDF