Fill this practical
In simple language and less line in pdf
ls /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or not found"
mkdir -p /home/daytona/workspace/practical-c71 && cat > /home/daytona/workspace/practical-c71/generate.py << 'PYEOF' from reportlab.lib.pagesizes import A4 from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import cm from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle from reportlab.lib import colors from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY doc = SimpleDocTemplate( "/home/daytona/workspace/practical-c71/Practical_C7_1_Anemia.pdf", pagesize=A4, rightMargin=2*cm, leftMargin=2*cm, topMargin=1.5*cm, bottomMargin=1.5*cm ) styles = getSampleStyleSheet() title_style = ParagraphStyle('Title', fontSize=13, fontName='Helvetica-Bold', alignment=TA_CENTER, spaceAfter=4) heading_style = ParagraphStyle('Heading', fontSize=11, fontName='Helvetica-Bold', spaceAfter=3, spaceBefore=6) subheading_style = ParagraphStyle('Subheading', fontSize=10, fontName='Helvetica-Bold', spaceAfter=2, spaceBefore=4) body_style = ParagraphStyle('Body', fontSize=9.5, fontName='Helvetica', spaceAfter=2, leading=13) bullet_style = ParagraphStyle('Bullet', fontSize=9.5, fontName='Helvetica', leftIndent=14, spaceAfter=1, leading=12) story = [] # Header story.append(Paragraph("ROGA NIDAN EVAM VIKRITI VIGYAN ACTIVITY BOOK", title_style)) story.append(Paragraph("Serial No: 7 Clinical No: C 7.1", ParagraphStyle('sub', fontSize=10, fontName='Helvetica-Bold', spaceAfter=6))) story.append(Spacer(1, 0.2*cm)) # ─── SECTION 1: CBC ─── story.append(Paragraph("1. Complete Blood Count (CBC)", heading_style)) story.append(Paragraph("<b>Parameters:</b> RBCs, Hemoglobin, Hematocrit, MCV, MCH, MCHC, RDW", body_style)) story.append(Spacer(1, 0.1*cm)) story.append(Paragraph("<b>Patient Preparation:</b>", subheading_style)) story.append(Paragraph("• No specific fasting required (fasting 4–6 hrs preferred to avoid lipemia).", bullet_style)) story.append(Paragraph("• Avoid strenuous exercise before the test.", bullet_style)) story.append(Paragraph("• Inform the doctor about any medications (e.g., anticoagulants, iron supplements).", bullet_style)) story.append(Paragraph("• Patient should be calm and relaxed before blood draw.", bullet_style)) story.append(Paragraph("<b>Sample Collection:</b>", subheading_style)) story.append(Paragraph("• Sample: Venous blood (3–5 mL) from antecubital vein.", bullet_style)) story.append(Paragraph("• Container: EDTA (purple/lavender top) vacutainer — EDTA prevents clotting by chelating calcium.", bullet_style)) story.append(Paragraph("• Mix gently by inverting the tube 8–10 times.", bullet_style)) story.append(Paragraph("• Process within 4–6 hours of collection. Avoid hemolysis.", bullet_style)) story.append(Paragraph("<b>Type of Investigation:</b>", subheading_style)) story.append(Paragraph("Quantitative hematological test — performed by automated hematology analyzer (e.g., Sysmex, Coulter); uses electrical impedance and light scattering (flow cytometry principle).", body_style)) story.append(Paragraph("<b>Indication:</b>", subheading_style)) story.append(Paragraph("• Evaluation of fatigue, weakness, pallor, and shortness of breath (as in this case — ABC, 45 yrs).", bullet_style)) story.append(Paragraph("• Diagnosis and classification of anemia.", bullet_style)) story.append(Paragraph("• Monitoring of chronic diseases, infections, nutritional deficiencies.", bullet_style)) story.append(Paragraph("• Pre-operative assessment.", bullet_style)) story.append(Paragraph("<b>Interpretation of CBC Parameters (Excluding Platelets):</b>", subheading_style)) cbc_data = [ ["Parameter", "Normal Value", "Low (↓)", "High (↑)"], ["RBC count", "M: 4.5–5.5 × 10⁶/µL\nF: 4.0–5.0 × 10⁶/µL", "Anemia, hemorrhage,\nB12/folate deficiency", "Polycythemia, dehydration"], ["Hemoglobin", "M: 13.5–17.5 g/dL\nF: 12.0–15.5 g/dL", "Anemia (any type)", "Polycythemia vera,\nhigh altitude"], ["Hematocrit (PCV)", "M: 41–53%\nF: 36–46%", "Anemia, overhydration", "Dehydration, polycythemia"], ["MCV", "80–100 fL", "Microcytic anemia\n(IDA, thalassemia)", "Macrocytic anemia\n(B12/folate deficiency)"], ["MCH", "27–33 pg", "Hypochromic anemia\n(IDA)", "Macrocytic anemia"], ["MCHC", "32–36 g/dL", "Hypochromic anemia,\nIDA, thalassemia", "Hereditary\nspherocytosis"], ["RDW", "11.5–14.5%", "Uniform cell size\n(thalassemia trait)", "Mixed deficiency,\nearly IDA, hemolysis"], ] table = Table(cbc_data, colWidths=[3.2*cm, 4.2*cm, 4.5*cm, 4.5*cm]) table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#2c5f8a')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8.5), ('ALIGN', (0,0), (-1,-1), 'LEFT'), ('VALIGN', (0,0), (-1,-1), 'TOP'), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#f0f4f8'), colors.white]), ('GRID', (0,0), (-1,-1), 0.4, colors.grey), ('TOPPADDING', (0,0), (-1,-1), 3), ('BOTTOMPADDING', (0,0), (-1,-1), 3), ('LEFTPADDING', (0,0), (-1,-1), 4), ])) story.append(table) story.append(Spacer(1, 0.3*cm)) # CBC Interpretation for this case story.append(Paragraph("<b>Interpretation for this case (ABC, 45 yrs):</b>", subheading_style)) story.append(Paragraph( "Expected findings: Low Hb, low RBC, low MCV, low MCH, low MCHC with high RDW → suggests Iron Deficiency Anemia (IDA) given the symptoms of fatigue, pallor, and exertional dyspnea.", body_style)) story.append(Spacer(1, 0.4*cm)) # ─── SECTION 2: PBS ─── story.append(Paragraph("2. Peripheral Blood Smear (PBS)", heading_style)) story.append(Spacer(1, 0.05*cm)) story.append(Paragraph("<b>Patient Preparation:</b>", subheading_style)) story.append(Paragraph("• No special preparation needed.", bullet_style)) story.append(Paragraph("• Fresh blood preferred — best results within 1–2 hours of collection.", bullet_style)) story.append(Paragraph("• Inform about medications that may affect cell morphology.", bullet_style)) story.append(Paragraph("<b>Sample Collection:</b>", subheading_style)) story.append(Paragraph("• Sample: Peripheral venous blood or fingertip capillary blood (fresh finger-prick).", bullet_style)) story.append(Paragraph("• Container: EDTA tube (purple top) — same as CBC, or direct smear from finger-prick.", bullet_style)) story.append(Paragraph("• Smear made immediately (from fresh blood) or within 2 hrs of collection.", bullet_style)) story.append(Paragraph("• Stain: Leishman stain or Wright-Giemsa stain — differentiates cell types by color.", bullet_style)) story.append(Paragraph("<b>Type of Investigation:</b>", subheading_style)) story.append(Paragraph("Morphological / microscopic examination — manual examination under light microscope. Qualitative and semi-quantitative assessment of blood cell morphology.", body_style)) story.append(Paragraph("<b>Indication:</b>", subheading_style)) story.append(Paragraph("• Classify and confirm type of anemia (e.g., microcytic hypochromic in IDA).", bullet_style)) story.append(Paragraph("• Detect abnormal cell shapes: target cells, sickle cells, schistocytes, spherocytes.", bullet_style)) story.append(Paragraph("• Identify parasites (malaria, filaria) in blood.", bullet_style)) story.append(Paragraph("• Evaluate WBC morphology — blast cells in leukemia.", bullet_style)) story.append(Paragraph("• Diagnose platelet disorders, assess reticulocytes.", bullet_style)) story.append(Paragraph("<b>Interpretation:</b>", subheading_style)) pbs_data = [ ["Finding on PBS", "Significance"], ["Microcytic hypochromic RBCs\n(small, pale cells)", "Iron deficiency anemia (IDA)\nThalassemia"], ["Macrocytic / oval macrocytes", "B12 / Folate deficiency (megaloblastic anemia)"], ["Pencil / cigar-shaped cells\n(elliptocytes)", "Iron deficiency anemia"], ["Target cells (codocytes)", "IDA, thalassemia, liver disease"], ["Spherocytes", "Hereditary spherocytosis, autoimmune hemolytic anemia"], ["Schistocytes (fragmented cells)", "Microangiopathic hemolytic anemia (DIC, TTP)"], ["Hypersegmented neutrophils\n(>5 lobes)", "Megaloblastic anemia (B12/folate deficiency)"], ["Polychromasia (bluish RBCs)", "Reticulocytosis — active erythropoiesis (hemolysis, blood loss)"], ["Anisocytosis + Poikilocytosis", "Mixed deficiency or severe anemia"], ] pbs_table = Table(pbs_data, colWidths=[7.5*cm, 9*cm]) pbs_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#2c5f8a')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8.5), ('ALIGN', (0,0), (-1,-1), 'LEFT'), ('VALIGN', (0,0), (-1,-1), 'TOP'), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#f0f4f8'), colors.white]), ('GRID', (0,0), (-1,-1), 0.4, colors.grey), ('TOPPADDING', (0,0), (-1,-1), 3), ('BOTTOMPADDING', (0,0), (-1,-1), 3), ('LEFTPADDING', (0,0), (-1,-1), 4), ])) story.append(pbs_table) story.append(Spacer(1, 0.2*cm)) story.append(Paragraph( "<b>Interpretation for this case:</b> PBS likely shows microcytic hypochromic RBCs with pencil cells, anisocytosis, and poikilocytosis — consistent with Iron Deficiency Anemia.", body_style)) story.append(Spacer(1, 0.5*cm)) story.append(Paragraph("Teacher's Signature: ___________________________", ParagraphStyle('sig', fontSize=10, fontName='Helvetica', alignment=TA_LEFT))) doc.build(story) print("PDF created successfully.") PYEOF python3 /home/daytona/workspace/practical-c71/generate.py
Practical C7 1 Anemia
PDF Document · PDF
Generate a comparison poster: Iron Deficiency vs Megaloblastic Anemia
Medical comparison poster: Iron Deficiency Anemia vs Megaloblastic Anemia. Two-column layout side by side. Left column in red/orange theme for Iron Deficiency Anemia, right column in blue/purple theme for Megaloblastic Anemia. Bold title at top: "Anemia Comparison: Iron Deficiency vs Megaloblastic". Each column has clearly labeled sections: Cause, Symptoms, Blood Film (PBS) findings, CBC findings, Treatment. Include small icons or visual cues. Clean professional medical education poster style with white background, colored header bars for each column, organized rows for each category. Footer note: "Roga Nidan Evam Vikriti Vigyan"

| Feature | Iron Deficiency Anemia | Megaloblastic Anemia |
|---|---|---|
| Cause | Low iron (poor diet, blood loss, malabsorption) | Low B12 or Folate |
| MCV | Low (microcytic) | High (macrocytic) |
| RBC shape on PBS | Microcytic, hypochromic, pencil cells | Oval macrocytes, hypersegmented neutrophils |
| MCH / MCHC | Both low | Normal or high |
| RDW | High | High |
| Serum Iron | Low | Normal |
| Ferritin | Low | Normal |
| B12 / Folate | Normal | Low |
| Symptoms | Fatigue, pallor, koilonychia, pica | Fatigue, pallor, glossitis, neurological signs (B12) |
| Treatment | Oral iron (ferrous sulphate) | B12 injection / oral folate |