Total leucocyte count principle an indication and procedure
Total Leucocyte Count principle indication procedure hemocytometer WBC diluting fluid
Create a quick reference PDF guide for TLC procedure steps
mkdir -p /tmp/workspace/tlc-guide && ls -la /tmp/workspace/
~/tlc-guide/generate_pdf.py
"""
Generate a quick-reference PDF guide for the Total Leucocyte Count (TLC) procedure.
"""
from reportlab.lib.pagesizes import A4
from reportlab.lib.units import mm
from reportlab.lib import colors
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
ListFlowable, ListItem, HRFlowable, KeepTogether
)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT
# ---------- Colors ----------
NAVY = colors.HexColor("#1b3a5c")
TEAL = colors.HexColor("#0f7d8c")
LIGHT_BG = colors.HexColor("#eef4f7")
GREY = colors.HexColor("#4a4a4a")
RED = colors.HexColor("#a3271f")
styles = getSampleStyleSheet()
title_style = ParagraphStyle(
"TitleStyle", parent=styles["Title"], fontSize=20, textColor=colors.white,
alignment=TA_CENTER, spaceAfter=2, leading=24
)
subtitle_style = ParagraphStyle(
"SubtitleStyle", parent=styles["Normal"], fontSize=10.5, textColor=colors.white,
alignment=TA_CENTER, spaceAfter=0, leading=13
)
section_head = ParagraphStyle(
"SectionHead", parent=styles["Heading2"], fontSize=13, textColor=colors.white,
backColor=NAVY, leading=16, spaceBefore=0, spaceAfter=0,
leftIndent=6, borderPadding=(4, 6, 4, 6)
)
body = ParagraphStyle(
"Body", parent=styles["Normal"], fontSize=9.7, leading=13.5, textColor=GREY,
spaceAfter=4
)
body_bold = ParagraphStyle(
"BodyBold", parent=body, fontName="Helvetica-Bold", textColor=NAVY
)
step_title = ParagraphStyle(
"StepTitle", parent=styles["Normal"], fontSize=10.3, fontName="Helvetica-Bold",
textColor=NAVY, leading=13
)
step_body = ParagraphStyle(
"StepBody", parent=styles["Normal"], fontSize=9.5, leading=12.8, textColor=GREY
)
formula_style = ParagraphStyle(
"Formula", parent=styles["Normal"], fontSize=10.5, leading=14, textColor=NAVY,
alignment=TA_CENTER, fontName="Helvetica-Bold"
)
small_note = ParagraphStyle(
"SmallNote", parent=styles["Normal"], fontSize=8.3, leading=11, textColor=colors.HexColor("#666666")
)
footer_style = ParagraphStyle(
"Footer", parent=styles["Normal"], fontSize=7.5, textColor=colors.HexColor("#888888"),
alignment=TA_CENTER
)
def section_header_flowable(text, bg=NAVY):
t = Table([[Paragraph(text, section_head)]], colWidths=[170*mm])
t.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, -1), bg),
("TOPPADDING", (0, 0), (-1, -1), 6),
("BOTTOMPADDING", (0, 0), (-1, -1), 6),
("LEFTPADDING", (0, 0), (-1, -1), 8),
]))
return t
def numbered_step(num, title_text, desc_text, extra=None):
rows = [
Table(
[[Paragraph(str(num), ParagraphStyle("num", parent=step_title, textColor=colors.white,
alignment=TA_CENTER)),
Paragraph(f"<b>{title_text}</b><br/>{desc_text}" + (f"<br/><i>{extra}</i>" if extra else ""),
step_body)]],
colWidths=[9*mm, 161*mm],
rowHeights=None,
)
]
tbl = rows[0]
tbl.setStyle(TableStyle([
("BACKGROUND", (0, 0), (0, 0), TEAL),
("VALIGN", (0, 0), (-1, -1), "TOP"),
("ROUNDEDCORNERS", [4, 4, 4, 4]) if hasattr(TableStyle, "ROUNDEDCORNERS") else ("LEFTPADDING", (0,0),(0,0),0),
("TOPPADDING", (0, 0), (-1, -1), 4),
("BOTTOMPADDING", (0, 0), (-1, -1), 6),
("LEFTPADDING", (1, 0), (1, 0), 8),
("LINEBELOW", (0, 0), (-1, -1), 0.4, colors.HexColor("#dddddd")),
]))
return tbl
doc = SimpleDocTemplate(
"/tmp/workspace/tlc-guide/TLC_Quick_Reference_Guide.pdf",
pagesize=A4,
topMargin=14*mm, bottomMargin=14*mm, leftMargin=20*mm, rightMargin=20*mm,
title="Total Leucocyte Count (TLC) - Quick Reference Guide",
author="Medical Reference Library",
)
elements = []
# ---------- Header banner ----------
header_table = Table(
[[Paragraph("TOTAL LEUCOCYTE COUNT (TLC)", title_style)],
[Paragraph("Quick Reference Guide — Manual Hemocytometer Method", subtitle_style)]],
colWidths=[170*mm]
)
header_table.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, -1), NAVY),
("TOPPADDING", (0, 0), (-1, 0), 10),
("BOTTOMPADDING", (0, -1), (-1, -1), 10),
("TOPPADDING", (0, 1), (-1, 1), 0),
]))
elements.append(header_table)
elements.append(Spacer(1, 8))
# ---------- Principle ----------
elements.append(section_header_flowable("PRINCIPLE"))
elements.append(Spacer(1, 4))
elements.append(Paragraph(
"Whole blood is diluted in a <b>WBC diluting fluid</b> (e.g. Turk's fluid / dilute acetic acid with a dye) which "
"<b>lyses red blood cells</b> so they do not obscure leucocytes, and faintly stains leucocyte nuclei. "
"The diluted sample is loaded onto a <b>Neubauer counting chamber (hemocytometer)</b> of known ruled area and depth. "
"Leucocytes are counted microscopically in defined squares, and the count per unit volume of blood is calculated "
"using the dilution factor and chamber volume.", body))
elements.append(Spacer(1, 10))
# ---------- Indications ----------
elements.append(section_header_flowable("INDICATIONS", bg=TEAL))
elements.append(Spacer(1, 4))
indications = [
"Suspected bacterial/viral infection or sepsis",
"Assessment of inflammation, trauma, burns, or post-surgical status",
"Diagnosis and monitoring of leukemias and other hematologic malignancies",
"Monitoring bone marrow suppression from chemotherapy / myelosuppressive drugs",
"Detecting leukopenia (drug toxicity, marrow failure, severe viral illness, autoimmune disease)",
"Routine complete blood count (CBC) screening",
"Body fluid analysis (CSF, pleural, peritoneal/ascitic fluid) e.g. distinguishing cirrhotic ascites from spontaneous bacterial peritonitis",
]
bullet_items = [ListItem(Paragraph(i, body), bulletColor=TEAL) for i in indications]
elements.append(ListFlowable(bullet_items, bulletType="bullet", start="circle",
leftIndent=12, bulletFontSize=6, spaceBefore=0))
elements.append(Spacer(1, 10))
# ---------- Requirements ----------
elements.append(section_header_flowable("SAMPLE & EQUIPMENT REQUIRED", bg=NAVY))
elements.append(Spacer(1, 4))
req_table = Table(
[
[Paragraph("<b>Sample</b>", body_bold), Paragraph("Well-mixed venous blood in EDTA anticoagulant (heparin is unsuitable)", body)],
[Paragraph("<b>Equipment</b>", body_bold), Paragraph("Neubauer hemocytometer chamber & coverslip, WBC pipette, microscope", body)],
[Paragraph("<b>Reagent</b>", body_bold), Paragraph("WBC diluting fluid (lyses RBCs, e.g. Turk's fluid); refrigerated and filtered before use", body)],
],
colWidths=[32*mm, 138*mm]
)
req_table.setStyle(TableStyle([
("BACKGROUND", (0, 0), (0, -1), LIGHT_BG),
("VALIGN", (0, 0), (-1, -1), "TOP"),
("TOPPADDING", (0, 0), (-1, -1), 5),
("BOTTOMPADDING", (0, 0), (-1, -1), 5),
("LEFTPADDING", (0, 0), (-1, -1), 6),
("GRID", (0, 0), (-1, -1), 0.5, colors.HexColor("#cccccc")),
]))
elements.append(req_table)
elements.append(Spacer(1, 10))
# ---------- Procedure Steps ----------
elements.append(section_header_flowable("PROCEDURE - STEP BY STEP", bg=RED))
elements.append(Spacer(1, 5))
steps = [
("Dilute the sample",
"Draw well-mixed EDTA blood and diluting fluid into the WBC pipette to achieve a <b>1:20 dilution</b>. "
"Rotate/mix the vial for about 5 minutes to ensure complete RBC lysis.",
"Use 1:10 dilution if leukopenic (count <2500); use 1:100-1:200 if marked leukocytosis is suspected."),
("Load the counting chamber",
"Charge the Neubauer hemocytometer with just enough diluted fluid to fill the space beneath the coverslip "
"by capillary action — avoid overfilling or underfilling."),
("Allow cells to settle",
"Let the chamber stand for several minutes so cells settle in a single plane."),
("Verify distribution",
"Scan the chamber under the low-power (10x) objective to confirm cells are evenly and randomly distributed. "
"Reload if clumped or streaked."),
("Count the leucocytes",
"Partially close the microscope condenser diaphragm to make leucocytes stand out. Count leucocytes in the "
"<b>4 large corner squares (A, B, C, D)</b> on each side of the chamber — 8 large squares in total across both sides."),
("Calculate the result",
"Apply the counting formula (see below) using the total cells counted, number of squares counted, and the dilution factor used."),
]
for i, (t, d, *extra) in enumerate(steps, start=1):
ex = extra[0] if extra else None
elements.append(KeepTogether(numbered_step(i, t, d, ex)))
elements.append(Spacer(1, 3))
elements.append(Spacer(1, 6))
# ---------- Formula ----------
elements.append(section_header_flowable("CALCULATION FORMULA", bg=TEAL))
elements.append(Spacer(1, 6))
formula_box = Table(
[[Paragraph(
"Leucocyte count (cells/mm³) = (Total cells counted ÷ No. of large squares counted) × Dilution factor × 10",
formula_style)]],
colWidths=[170*mm]
)
formula_box.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, -1), LIGHT_BG),
("BOX", (0, 0), (-1, -1), 1, TEAL),
("TOPPADDING", (0, 0), (-1, -1), 10),
("BOTTOMPADDING", (0, 0), (-1, -1), 10),
]))
elements.append(formula_box)
elements.append(Spacer(1, 5))
elements.append(Paragraph(
"Each large corner square = 1/10 mm³ volume (depth 0.1 mm x area 1 mm²); the factor of 10 converts this "
"to a per-mm³ value. <i>d</i> = dilution factor (e.g. 20 for a 1:20 dilution).", small_note))
elements.append(Spacer(1, 10))
# ---------- Normal Value ----------
elements.append(section_header_flowable("NORMAL REFERENCE RANGE", bg=NAVY))
elements.append(Spacer(1, 4))
elements.append(Paragraph(
"<b>Adults: 4,000 - 11,000 cells/mm³ (4-11 × 10&sup9;/L)</b> — verify against local laboratory reference range.",
body))
elements.append(Spacer(1, 10))
# ---------- Sources of error ----------
elements.append(section_header_flowable("COMMON SOURCES OF ERROR", bg=RED))
elements.append(Spacer(1, 4))
errors = [
"Partial clotting of the blood sample",
"Inadequate/delayed mixing before dilution",
"Faulty pipetting or chamber loading technique",
"Uncalibrated pipettes or hemocytometer",
"Uneven cell distribution (\"field error\") — minimized by counting more squares",
"Leukemic cytoplasmic fragments falsely elevating the count",
]
err_items = [ListItem(Paragraph(i, body), bulletColor=RED) for i in errors]
elements.append(ListFlowable(err_items, bulletType="bullet", start="circle",
leftIndent=12, bulletFontSize=6, spaceBefore=0))
elements.append(Spacer(1, 8))
elements.append(HRFlowable(width="100%", thickness=0.6, color=colors.HexColor("#cccccc")))
elements.append(Spacer(1, 4))
elements.append(Paragraph(
"Note: Manual hemocytometer counts show a CV of ~6.5% (normal/elevated) and up to ~15% (leukopenic blood), vs. "
"~1-3% CV for automated hematology analyzers. The manual method is now reserved mainly for calibration checks, "
"severe leukopenia/thrombocytopenia, platelet-interference cases, and CSF cell counts.",
small_note))
elements.append(Spacer(1, 10))
elements.append(Paragraph(
"Reference: Henry's Clinical Diagnosis and Management by Laboratory Methods | Quick Compendium of Clinical Pathology, 5th ed. "
"— For educational quick-reference use only; always follow institutional SOPs.",
footer_style))
doc.build(elements)
print("PDF generated successfully.")
cd /tmp/workspace/tlc-guide && python3 generate_pdf.py
cd /tmp/workspace/tlc-guide && python3 -c " import pdfplumber with pdfplumber.open('TLC_Quick_Reference_Guide.pdf') as pdf: print('Pages:', len(pdf.pages)) for i,p in enumerate(pdf.pages): print(f'--- page {i+1} size:', p.width, p.height) " && ls -la
TLC Quick Reference Guide
PDF Document · PDF