i'll give u one ppt CAN YOU MAKE or add LIKE FOR EXAMPLE IN CARDIAC OEDEMA JUST FOR EXAMPLE WE START WITH RIGHT HEART FAILURE SO WE ALREADY HAVE PATHO PHYSIOLOGY IN CHART FORM U HAVE TO ADD WHICH INVESTIGATION WHY TO ADVISE FINDINGS IN RELATION WITH PATHOPHYSIOLOGY AND WHEN TO ADVISE AND ALSO MENTION IMPORTANT HOMEOPATHIC REMEDIES WHICH ARE GONNA USE IN THAT CONDITION IN RELATION TO PATHOPHYSIOLOGY AND WHERE HOW ITS GONNA ACT AND IMPORTANT SYMPTOMS AND WHY THAT SYMPTOM OCCURS AND COMPARE AND CONTRAST ATLEAST 4-5 REMEDIES FOR EACH IN DETAIL
cd "/tmp/workspace/attachments/ee914391-0d91-4d75-b6ea-3d666e36f909/" && python3 -c " from pptx import Presentation from pptx.util import Emu prs = Presentation('OEDEMA PAYAL PARMAR.pptx') print(f'Total slides: {len(prs.slides)}') for i, slide in enumerate(prs.slides, 1): print(f'\n=== SLIDE {i} (layout: {slide.slide_layout.name}) ===') for shape in slide.shapes: if shape.has_text_frame and shape.text_frame.text.strip(): print(f' [{shape.name}]: {shape.text_frame.text[:300]}') "
homeopathic remedies cardiac oedema right heart failure compare contrast Digitalis Apis Apocynum Convallaria Crataegus
mkdir -p /tmp/workspace/oedema_output && python /tmp/skills/pptx/scripts/office/unpack.py "/tmp/workspace/attachments/ee914391-0d91-4d75-b6ea-3d666e36f909/OEDEMA PAYAL PARMAR.pptx" /tmp/workspace/oedema_unpacked/ 2>&1 | head -30
ls /tmp/workspace/oedema_unpacked/ppt/slides/ | head -40
python3 -c " from pptx import Presentation prs = Presentation('/tmp/workspace/attachments/ee914391-0d91-4d75-b6ea-3d666e36f909/OEDEMA PAYAL PARMAR.pptx') for i, layout in enumerate(prs.slide_layouts): print(i, layout.name) "
~/oedema_output/build_slides.py
"""
Build enhanced OEDEMA presentation with Investigation + Homeopathy slides
inserted after each major condition block.
"""
from pptx import Presentation
from pptx.util import Inches, Pt, Emu
from pptx.dml.color import RGBColor
from pptx.enum.text import PP_ALIGN
from pptx.util import Inches, Pt
import copy
from lxml import etree
SRC = '/tmp/workspace/attachments/ee914391-0d91-4d75-b6ea-3d666e36f909/OEDEMA PAYAL PARMAR.pptx'
OUT = '/tmp/workspace/oedema_output/OEDEMA_ENHANCED.pptx'
# ---- colour palette (matches existing dark slide style) ----
C_DARK_BG = RGBColor(0x0A, 0x0A, 0x2E) # deep navy
C_ACCENT1 = RGBColor(0x00, 0xD4, 0xFF) # cyan
C_ACCENT2 = RGBColor(0xFF, 0xD7, 0x00) # gold
C_ACCENT3 = RGBColor(0xFF, 0x69, 0xB4) # pink / rose
C_WHITE = RGBColor(0xFF, 0xFF, 0xFF)
C_LIGHT_BLU = RGBColor(0xAD, 0xD8, 0xE6)
C_GREEN = RGBColor(0x90, 0xEE, 0x90)
C_ORANGE = RGBColor(0xFF, 0xA5, 0x00)
prs = Presentation(SRC)
BLANK = prs.slide_layouts[6] # Blank layout
DEF = prs.slide_layouts[11] # DEFAULT
W = prs.slide_width
H = prs.slide_height
# ---- helpers ----
def add_blank_slide(prs):
return prs.slides.add_slide(BLANK)
def tb(slide, text, x, y, w, h, size=14, bold=False, color=C_WHITE,
align=PP_ALIGN.LEFT, wrap=True, bg=None):
"""Add a text-box."""
txBox = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h))
tf = txBox.text_frame
tf.word_wrap = wrap
p = tf.paragraphs[0]
p.alignment = align
run = p.add_run()
run.text = text
run.font.size = Pt(size)
run.font.bold = bold
run.font.color.rgb = color
if bg:
fill = txBox.fill
fill.solid()
fill.fore_color.rgb = bg
return txBox
def rect(slide, x, y, w, h, color):
"""Filled rectangle."""
shape = slide.shapes.add_shape(
1, # MSO_SHAPE_TYPE.RECTANGLE
Inches(x), Inches(y), Inches(w), Inches(h)
)
shape.fill.solid()
shape.fill.fore_color.rgb = color
shape.line.fill.background()
return shape
def set_bg(slide, color):
"""Set solid background colour on a slide."""
background = slide.background
fill = background.fill
fill.solid()
fill.fore_color.rgb = color
def section_divider(prs, title, subtitle=""):
"""Section-header slide."""
sl = add_blank_slide(prs)
set_bg(sl, C_DARK_BG)
# accent bar
rect(sl, 0, 2.8, 10, 0.06, C_ACCENT1)
tb(sl, title, 0.4, 2.0, 9.2, 1.0, size=30, bold=True, color=C_ACCENT1, align=PP_ALIGN.CENTER)
if subtitle:
tb(sl, subtitle, 0.4, 3.1, 9.2, 0.6, size=16, color=C_WHITE, align=PP_ALIGN.CENTER)
return sl
# =====================================================================
# SLIDE CONTENT DATA
# =====================================================================
# ---- CARDIAC OEDEMA : RIGHT HEART FAILURE ----
CARDIAC_INV_TITLE = "CARDIAC OEDEMA — INVESTIGATIONS"
CARDIAC_INV_SUB = "Right Heart Failure | Rationale, Timing & Pathophysiological Correlation"
CARDIAC_INV_ROWS = [
# (Investigation, Why Advised, Pathophys Link, Findings, When)
("ECG",
"Detect underlying arrhythmia, LVH, RVH, ischaemia as cause of HF",
"↓ CO triggers neuro-humoral activation; RVH from chronic pressure overload",
"RVH pattern (R>S in V1), P-pulmonale, AF, RBBB, Q waves (ischaemic aetiology)",
"1st line, immediately"),
("Chest X-Ray (PA)",
"Assess cardiomegaly, pulmonary venous congestion, pleural effusion",
"↑ Pulmonary venous/capillary pressure → bat-wing perihilar shadowing; R-HF → bilateral effusion",
"Cardiomegaly (CTR >0.5), bilateral pleural effusion, Kerley B lines, upper-lobe diversion",
"1st line, immediately"),
("Echocardiography",
"Gold standard for cardiac structure/function; EF, valve disease, wall motion",
"Confirms RV dilation/dysfunction; TR from annular dilatation; RAAS-driven volume overload causes chamber dilation",
"↓EF (<40% in HFrEF), RV dilation, TR, pericardial effusion, IVC plethora (↑ RAP)",
"Urgent / within 24–48 h"),
("BNP / NT-proBNP",
"Biomarker of ventricular wall-stress; diagnose & monitor HF severity",
"Secreted by cardiomyocytes in response to ↑ end-diastolic wall stress; counter-regulatory but insufficient to prevent oedema",
"BNP >100 pg/mL or NT-proBNP >300 pg/mL = HF likely; severity correlates with oedema grade",
"At presentation, monitor response to therapy"),
("Serum Electrolytes + Renal Function (U&E/BMP)",
"RAAS/ADH activation causes Na⁺ retention and hypokalaemia; assess pre-renal AKI",
"Ang II → aldosterone → ↑ Na⁺ reabsorption, K⁺ loss; ↓ RBF → ↑ creatinine (cardiorenal syndrome)",
"Hyponatraemia (dilutional), hypokalaemia (RAAS), ↑ creatinine/urea (cardiorenal syndrome)",
"At presentation and with every therapeutic change"),
("LFTs + Serum Albumin",
"Hepatic congestion (↑ hepatic venous pressure); distinguish from hepatic oedema",
"R-HF → ↑ IVC/hepatic venous pressure → hepatomegaly, transaminitis; ↓ albumin if severe/chronic",
"↑ ALP, ALT, bilirubin (congestion); ↓ albumin in severe chronic HF",
"At baseline"),
("Complete Blood Count",
"Anaemia (causes/exacerbates HF); thrombocytopenia in congestive splenomegaly",
"Anaemia → ↑ CO demand worsening HF; chronic disease anaemia common",
"Normocytic anaemia of chronic disease; ↑ WBC if infectious trigger",
"At baseline"),
("Thyroid Function (TSH)",
"Hypo/hyperthyroidism can cause or worsen HF",
"Hypothyroidism → ↓ HR/CO, pericardial effusion; hyperthyroidism → high-output failure",
"↑ TSH (hypothyroid); ↓ TSH (hyperthyroid); treat to normalise",
"At baseline workup"),
("Urinalysis + Spot Protein:Creatinine",
"Cardiorenal syndrome assessment; exclude primary renal cause",
"↓ GFR → oliguria; concurrent renal disease worsens prognosis",
"Oliguria, casts in cardiorenal syndrome; proteinuria if renal involvement",
"At baseline"),
("6-Minute Walk Test / NYHA Assessment",
"Functional severity of HF, guide therapy titration",
"Correlates with cardiac output reserve and exercise tolerance",
"Distance < 300 m = severe; guides therapy escalation",
"After stabilisation, for chronic monitoring"),
]
# ---- CARDIAC HOMEOPATHY ----
CARDIAC_HOMEO_TITLE = "CARDIAC OEDEMA — HOMEOPATHIC REMEDIES"
CARDIAC_HOMEO_SUB = "Right Heart Failure | Remedy Selection, Pathophysiological Action & Compare-Contrast"
CARDIAC_REMEDIES = [
{
"name": "DIGITALIS PURPUREA",
"source": "Foxglove plant",
"pathophys_action": (
"Contains cardiac glycosides → inhibits Na⁺/K⁺-ATPase → ↑ intracellular Ca²⁺ → positive inotropy. "
"Slows AV conduction (vagomimetic). Directly addresses the ↓ CO → RAAS → fluid retention cascade "
"by improving pump function and increasing renal perfusion."
),
"key_symptoms": (
"• Extremely slow, irregular, weak pulse (key-note)\n"
"• Any movement → violent palpitations\n"
"• Oedema: anasarca, dropsy with scanty/suppressed urine\n"
"• Sensation as if heart would stop if patient moves\n"
"• Cyanosis of lips and extremities\n"
"• Liver enlarged and tender (hepatic congestion)\n"
"• Dyspnoea worse lying down; orthopnoea\n"
"• Faintness with slow pulse\n"
"• Jaundice (hepatic venous congestion)\n"
"Why: All symptoms reflect ↓ CO + RAAS-driven fluid overload + venous hypertension"
),
"modalities": "Worse: motion, sitting up, cold. Better: rest, open air.",
"potency": "Mother tincture Q or 3x–6x for cardiac action; 30C–200C for constitutional",
"compare": "Unlike Apocynum (more ascites/vomiting), Digitalis focuses on SLOW pulse + oedema + liver. Unlike Crataegus (trophorestorative/nutrition), Digitalis has clear acute cardiac glycoside effect.",
},
{
"name": "APOCYNUM CANNABINUM",
"source": "Indian Hemp",
"pathophys_action": (
"Powerful hydragogue — acts on serous membranes and kidneys to drain excess fluid. "
"Stimulates diuresis and acts on the right heart and venous circulation. "
"Addresses the downstream effects of ↑ venous pressure → ascites/anasarca/pleural effusion. "
"Also has action on mitral and tricuspid valves (similar to regurgitation picture)."
),
"key_symptoms": (
"• Ascites + anasarca (the DROPSY remedy par excellence)\n"
"• Nausea and vomiting with the cardiac oedema\n"
"• Scanty urine despite massive fluid accumulation\n"
"• Oppression of chest, difficult breathing\n"
"• Palpitations with weak, intermittent pulse\n"
"• Mitral regurgitation / tricuspid regurgitation symptoms\n"
"• Great debility, prostration\n"
"• Abdomen hard, tense; tympanitic ascites\n"
"Why: Targets the mechanical consequences of R-HF: ↑ portal/systemic venous pressure → ascites + pleural effusion"
),
"modalities": "Worse: cold air, uncovering. Better: warmth.",
"potency": "Q (tincture) for acute dropsy cases; 3x–30C",
"compare": "More focused on DROPSY/ASCITES than Digitalis. Overlaps with Arsenicum (restlessness) but Apocynum is less anxious, more prostrated. Compare Crataegus — Apocynum is more acute, Crataegus is more chronic/trophorestorative.",
},
{
"name": "CONVALLARIA MAJALIS",
"source": "Lily of the Valley",
"pathophys_action": (
"Contains cardiac glycosides (convallotoxin, convalloside) — similar mechanism to Digitalis but milder. "
"Specifically indicated in RIGHT HEART FAILURE with VENOUS STASIS. "
"Increases force of cardiac contraction → ↑ CO → ↑ renal perfusion → diuresis → breaks RAAS cycle. "
"Especially suited to hypertrophy/dilatation of right ventricle with venous congestion of extremities."
),
"key_symptoms": (
"• Right-sided cardiac hypertrophy with venous stasis\n"
"• Palpitation from the least exertion\n"
"• Oedema of lower extremities with venous engorgement\n"
"• Extreme dyspnoea (whole chest feels occupied by the heart)\n"
"• Tobacco heart — heart irritability from tobacco use\n"
"• Sensation of the heart occupying the whole chest\n"
"• Paroxysmal tachycardia alternating with bradycardia\n"
"• Anasarca with scanty urine\n"
"Why: Right ventricular hypertrophy from chronic ↑ RV afterload → venous congestion; Convallaria addresses this specifically"
),
"modalities": "Worse: least exertion, warm room. Better: fresh air.",
"potency": "Q or 3x for physiological effect; 30C for constitutional",
"compare": "More RIGHT-sided than Digitalis (which is more left/biventricular). More specific for tobacco-related cardiac irritability. Less dropsical than Apocynum. Milder than Digitalis in acute settings.",
},
{
"name": "CRATAEGUS OXYACANTHA",
"source": "Hawthorn Berry",
"pathophys_action": (
"Contains oligomeric proanthocyanidins and flavonoids → inhibit ACE (similar to ACE inhibitors) → "
"↓ Ang II → ↓ aldosterone → ↓ Na⁺/H₂O retention. "
"Also: positive inotrope (mild), vasodilator of coronary and peripheral vessels, antioxidant. "
"Acts on the compensatory RAAS arm of the pathophysiology — mirroring modern heart failure therapy. "
"Long-term trophorestorative action on myocardium."
),
"key_symptoms": (
"• Chronic heart failure with very FEEBLE, IRREGULAR, weak pulse\n"
"• Extreme weakness; patient can barely walk without dyspnoea\n"
"• Oedema with dyspnoea and weakness\n"
"• Arteriosclerosis + valvular disease\n"
"• Sensation of heart would stop if patient falls asleep\n"
"• Angina pectoris with cardiac weakness\n"
"• Hypertension with weak heart\n"
"• Dizziness, faintness, pallor\n"
"Why: Chronic ↓ CO + arteriosclerosis + secondary hypertension from RAAS — Crataegus acts on both pump weakness and neuro-humoral arm"
),
"modalities": "Worse: warm room, exertion. Better: rest, fresh air.",
"potency": "Q or 1x–3x for trophorestorative use; 30C–200C for constitutional",
"compare": "Unlike Digitalis (acute/subacute), Crataegus is for CHRONIC compensated/decompensated HF. It is SAFER and suitable for long-term use. Does NOT have same acute glycoside effect as Digitalis. Best as adjuvant/preventive.",
},
{
"name": "ARSENICUM ALBUM",
"source": "Arsenic Trioxide",
"pathophys_action": (
"Acts on the SNS/anxiety arm of cardiac pathophysiology. "
"In HF, SNS activation (↑ noradrenaline) → tachycardia, peripheral vasoconstriction, anxiety. "
"Arsenicum addresses: ↑ capillary permeability (in oedematous states), renal involvement (oliguria/anasarca), "
"and the extreme restlessness and fear that accompanies decompensated HF. "
"Also a key remedy when cardiac oedema has significant pulmonary involvement (cardiac asthma)."
),
"key_symptoms": (
"• Extreme restlessness and anxiety with cardiac complaints\n"
"• Oedema worse after midnight (1–3 AM aggravation) — classic keynote\n"
"• Dyspnoea worse lying down (must sit up) — orthopnoea\n"
"• Cold extremities despite restlessness (SNS vasoconstriction)\n"
"• Burning pains paradoxically relieved by heat\n"
"• Cardiac asthma — midnight attacks of dyspnoea and wheezing\n"
"• Anasarca with scanty dark urine\n"
"• Prostration out of proportion to illness\n"
"• Thirst for small sips frequently\n"
"Why: Decompensated HF → ↑ SNS → restlessness/anxiety/vasoconstriction; Arsenicum addresses this neurogenic arm"
),
"modalities": "Worse: midnight–2 AM, cold, wet. Better: warmth, sitting up, company.",
"potency": "30C–1M for acute dyspnoea/anxiety crises",
"compare": "Unlike Digitalis (slow pulse, calm), Arsenicum has RAPID/irregular pulse with extreme anxiety. Unlike Apocynum (prostrated/quiet), Arsenicum is restless. Unlike Crataegus (chronic/mild), Arsenicum is for acute decompensation with anxiety.",
},
]
# ---- RENAL OEDEMA: NEPHROTIC SYNDROME ----
RENAL_NEP_INV_ROWS = [
("24-hour Urinary Protein / Spot PCR",
"Confirm proteinuria ≥ 3.5 g/day; hallmark of nephrotic syndrome",
"GBM damage → loss of charge barrier → albumin leaks → hypoalbuminaemia → ↓ oncotic pressure → oedema",
"≥ 3.5 g/day (nephrotic range); spot PCR > 3.5",
"1st line, at presentation"),
("Serum Albumin",
"Hypoalbuminaemia drives oncotic-pressure-dependent oedema",
"Albumin <2.5 g/dL → plasma oncotic pressure < hydrostatic → transudation into interstitium",
"< 3.0 g/dL (often < 2.5 g/dL in full nephrotic syndrome)",
"At presentation and monitoring"),
("Serum Lipid Profile",
"Hyperlipidaemia is part of nephrotic syndrome triad",
"↓ albumin → ↑ hepatic lipoprotein synthesis (compensation) → hypercholesterolaemia + hypertriglyceridaemia",
"↑ Total cholesterol, LDL; ↑ triglycerides; lipiduria on urine microscopy",
"At baseline"),
("Renal Biopsy",
"Determine specific histological cause (MCD, FSGS, membranous, diabetic nephropathy)",
"Different GBM/podocyte pathologies produce nephrotic syndrome; biopsy guides specific treatment",
"MCD: effacement of foot processes on EM; FSGS: segmental sclerosis; Membranous: spike-and-dome",
"After basic workup in adult non-diabetic or steroid-resistant cases"),
("Complement (C3, C4), ANA, ANCA, Anti-dsDNA",
"Rule out secondary causes: SLE (membranous/FSGS), vasculitis",
"Immune complex deposition in SLE nephritis leads to nephrotic syndrome",
"↓ C3/C4 in SLE/MPGN; +ANA/anti-dsDNA in SLE; +ANCA in vasculitis",
"At baseline in all adult nephrotic syndrome"),
("HbA1c + Fasting Glucose",
"Diabetic nephropathy is most common cause of nephrotic syndrome in adults",
"Glycation of GBM proteins → loss of selective filtration → proteinuria → hypoalbuminaemia",
"HbA1c > 6.5%; nodular glomerulosclerosis (Kimmelstiel-Wilson lesions) on biopsy",
"At baseline"),
("Renal Ultrasound",
"Assess renal size, echogenicity, exclude obstruction; guide biopsy",
"↓ renal perfusion (RAAS activation) may show ↓ renal size in chronic disease",
"Enlarged/normal kidneys in MCD; small echogenic kidneys in chronic nephropathy",
"At baseline"),
]
RENAL_NEP_REMEDIES = [
{
"name": "APIS MELLIFICA",
"source": "Honeybee venom",
"pathophys_action": (
"Acts on the ONCOTIC PRESSURE arm — addresses increased capillary permeability and serous membrane exudation. "
"Especially suited to PERIORBITAL and facial oedema (bag-like swelling). "
"↑ Capillary permeability → protein-poor transudation → Apis addresses this exudative tendency. "
"Key action: promotes diuresis and reduces serous membrane oedema."
),
"key_symptoms": (
"• BAG-LIKE periorbital oedema worse in morning — classic keynote for nephrotic\n"
"• Oedema shiny, transparent, gelatinous — 'waxy'\n"
"• Scanty, dark, albuminous urine (matches proteinuria)\n"
"• Oedema extends to face, lips, hands\n"
"• Stinging, burning pains in kidney region\n"
"• No thirst (key distinguishing feature)\n"
"• Worse from heat, warmth; better from cold applications\n"
"• Restless, fidgety, busy behaviour\n"
"Why: Facial/periorbital oedema from ↓ oncotic pressure matches hypo-oncotic picture of nephrotic syndrome"
),
"modalities": "Worse: heat, warm room, pressure. Better: cold applications, open air.",
"potency": "6C–30C",
"compare": "Unlike Arsenicum (anxious, thirsty, warm-worse-cold), Apis has NO thirst and is better from cold. Unlike Helleborus (sluggish, dark urine), Apis has shiny/transparent oedema.",
},
{
"name": "HELLEBORUS NIGER",
"source": "Christmas Rose",
"pathophys_action": (
"Specific remedy for nephrotic oedema with dark/scanty urine and cerebral involvement. "
"Acts on renal tubules to restore urine output. "
"Also addresses the cerebral sluggishness from uraemia/hypoalbuminaemia."
),
"key_symptoms": (
"• Generalised dropsical oedema — puffiness of whole face\n"
"• Scanty, dark, turbid, coffee-ground urine (albuminuria)\n"
"• Cerebral sluggishness — stupor, automatic movements\n"
"• Suppressed urine with anasarca\n"
"• Muscular twitching, convulsions\n"
"• Pupils dilated\n"
"• Unconscious picking at lips/clothes\n"
"Why: Severe nephrotic + uraemic state (↓ GFR + accumulating waste products) produces this cerebral picture"
),
"modalities": "Worse: suppressed secretions, cold. Better: warmth.",
"potency": "3x–30C",
"compare": "More CEREBRAL/URAEMIC than Apis. Darker, more turbid urine than the clear/albuminous urine of Apis. More suited to ADVANCED nephrotic with CNS involvement.",
},
{
"name": "ARSENICUM ALBUM",
"source": "Arsenic Trioxide",
"pathophys_action": (
"In nephrotic syndrome, addresses the hypoalbuminaemia → ↓ oncotic pressure → interstitial oedema + ascites. "
"Acts on kidneys (renal epithelium) to reduce proteinuria in some cases. "
"Also addresses secondary RAAS activation in nephrotic syndrome."
),
"key_symptoms": (
"• Generalised oedema with great prostration and anxiety\n"
"• Oedema worse after midnight\n"
"• Urine scanty, dark, albuminous, burning on passage\n"
"• Thirst for small sips frequently (unlike Apis)\n"
"• Dyspnoea — pleural effusion / ascites from ↓ oncotic pressure\n"
"• Burning everywhere relieved by heat\n"
"• Waxy pallor of face\n"
"• Ascites + anasarca in severe hypoalbuminaemia\n"
"Why: ↓ Albumin → ↓ oncotic pressure → diffuse exudation; RAAS activation worsens fluid retention"
),
"modalities": "Worse: midnight–2 AM, cold, exertion. Better: warmth, sitting up.",
"potency": "30C–200C",
"compare": "Arsenicum has THIRST (Apis has none); Arsenicum is RESTLESS/ANXIOUS (Helleborus is stuporous). Both have anasarca but the mental picture distinguishes them sharply.",
},
{
"name": "LYCOPODIUM CLAVATUM",
"source": "Club Moss spores",
"pathophys_action": (
"Primary action on LIVER and KIDNEYS. In nephrotic syndrome, addresses secondary hepatic involvement "
"(hypoalbuminaemia strains liver synthetic function). "
"Also covers the hyperlipidaemia component and secondary RAAS activation (right-sided abdominal symptoms)."
),
"key_symptoms": (
"• Oedema more RIGHT-sided\n"
"• Urine cloudy, milky, turbid with deposits; dark urine at night\n"
"• Urine contains ammoniacal sediment (red/brick-dust sediment)\n"
"• Bloating of abdomen after eating (4–8 PM aggravation)\n"
"• Desire for sweets; craving for warm drinks\n"
"• Hyperlipidaemia picture — liver involved\n"
"• Right-sided symptoms predominate\n"
"• Weakness and exhaustion disproportionate\n"
"Why: Lycopodium targets the hepatorenal axis — liver hypoprotein synthesis + renal loss = combined pathology"
),
"modalities": "Worse: right side, 4–8 PM, pressure of clothing. Better: warm drinks, motion.",
"potency": "30C–200C–1M",
"compare": "Unlike Apis (serous/shiny oedema), Lycopodium has liver + kidney dual involvement. Unlike Arsenicum (midnight anxiety), Lycopodium aggravates 4–8 PM. More suited for CHRONIC nephrotic than acute episodes.",
},
{
"name": "PHOSPHORUS",
"source": "Elemental Phosphorus",
"pathophys_action": (
"Acts on glomerular basement membrane (similar to membranous nephropathy pathology). "
"Addresses haemorrhagic/inflammatory renal lesions with proteinuria. "
"Also covers pulmonary oedema secondary to ↓ albumin (pleural effusion in nephrotic)."
),
"key_symptoms": (
"• Urine dark, smoky, turbid with albuminuria and haematuria\n"
"• Pitting oedema of face and lower limbs\n"
"• Tendency to haemorrhage (petechiae, haematuria)\n"
"• Tall, lean constitution; open, affectionate\n"
"• Pleural effusion + ascites from hypoalbuminaemia\n"
"• Desire for cold water, ice cream\n"
"• Burning in kidneys\n"
"• Liver involvement — fatty degeneration picture\n"
"Why: GBM damage → haematuria + proteinuria (Phosphorus targets this inflammatory/haemorrhagic kidney picture)"
),
"modalities": "Worse: cold water, lying on left side, twilight. Better: cold food, sleep.",
"potency": "30C–200C",
"compare": "Unlike Apis (no thirst), Phosphorus craves cold water. Unlike Arsenicum (burning + fear), Phosphorus has haemorrhagic tendency. Key distinguishing: haematuria + albuminuria + tall lean constitution.",
},
]
# ---- HEPATIC OEDEMA ----
HEPATIC_INV_ROWS = [
("Liver Function Tests (ALT, AST, ALP, GGT, Bilirubin)",
"Assess degree of hepatocellular damage and cholestasis",
"Fibrosis → ↓ hepatocyte mass → ↓ albumin synthesis; hepatocyte necrosis → ↑ transaminases",
"↑ ALT/AST (hepatocellular injury); ↑ ALP/GGT (cholestasis); ↑ bilirubin (jaundice)",
"1st line, at presentation"),
("Serum Albumin + PT/INR",
"Markers of hepatic synthetic function — both made in liver",
"Cirrhosis → ↓ hepatocyte synthesis → ↓ albumin (↓ oncotic pressure → oedema/ascites) + ↓ clotting factors (↑ PT)",
"↓ Albumin (<3.0 g/dL); prolonged PT/INR; these drive Child-Pugh/MELD scoring",
"At presentation and serial monitoring"),
("Ascitic Fluid Analysis (Paracentesis)",
"Characterise ascites: exudate vs transudate; exclude SBP",
"Portal hypertension → low-protein transudate (SAAG > 1.1 g/dL); SBP has PMN > 250/mm³",
"SAAG ≥ 1.1 (portal HTN); protein < 25 g/L; PMN count (SBP diagnosis)",
"When ascites confirmed clinically/on USS"),
("Abdominal Ultrasound + Doppler",
"Liver morphology, portal vein patency, spleen size, ascites volume",
"Portal hypertension → hepatopetal → hepatofugal portal flow; splenomegaly from congestive spleen",
"Echogenic nodular liver; portal vein >13 mm; splenomegaly; ascites; reversed portal flow on Doppler",
"1st line imaging"),
("Hepatitis B & C Serology",
"Most common causes of cirrhosis worldwide",
"Chronic viral hepatitis → hepatocyte necrosis → fibrosis → cirrhosis → portal hypertension → oedema",
"HBsAg, anti-HBc, anti-HCV, HCV PCR",
"At baseline"),
("Fibroscan (Transient Elastography)",
"Non-invasive assessment of hepatic fibrosis",
"Fibrosis → ↑ liver stiffness; predicts degree of portal hypertension",
"Stiffness >12 kPa = cirrhosis; correlates with Metavir F-score",
"As non-invasive alternative/adjunct to biopsy"),
("Plasma Aldosterone + Renin",
"Assess RAAS activation (mechanism of Na⁺ retention in hepatic oedema)",
"↓ Effective arterial volume (splanchnic vasodilation) → ↑ renin → ↑ aldosterone → Na⁺/H₂O retention",
"↑ Aldosterone; ↑ renin; aldosterone persists as liver fails to metabolise it",
"In refractory ascites workup"),
("Endoscopy (OGD)",
"Assess oesophageal and gastric varices (complication of portal hypertension)",
"Portal hypertension → portosystemic collaterals → oesophageal varices → risk of variceal haemorrhage",
"Grade varices; red wale signs = high bleed risk; initiate prophylaxis",
"After diagnosis of cirrhosis"),
]
HEPATIC_REMEDIES = [
{
"name": "LYCOPODIUM CLAVATUM",
"source": "Club Moss spores",
"pathophys_action": (
"PRIMARY LIVER REMEDY in homeopathy. Acts on hepatocytes to improve synthetic function, "
"reduces portal congestion and addresses the hypoalbuminaemia → oedema pathway. "
"Also addresses secondary RAAS: liver failure → ↓ aldosterone clearance → hyperaldosteronism → Na⁺ retention."
),
"key_symptoms": (
"• Ascites with marked abdominal bloating (worse 4–8 PM)\n"
"• RIGHT-sided oedema predominantly\n"
"• Jaundice with clay-coloured stools (obstructive component)\n"
"• Great flatulence; distension immediately after small meals\n"
"• Craving for sweets and warm drinks\n"
"• Mental: domineering but cowardly; anticipatory anxiety\n"
"• Urine: dark, turbid (hepatorenal involvement)\n"
"• ↓ Libido; impotence\n"
"Why: Portal hypertension → ascites + right-sided venous congestion; liver failure → ↓ albumin → oedema"
),
"modalities": "Worse: right side, 4–8 PM, cold food. Better: warm drinks, motion.",
"potency": "30C–1M",
"compare": "Most specific for HEPATIC oedema. Less useful in pure cardiac oedema (that's Digitalis). Unlike Cardus Marianus (liver congestion without mental picture), Lycopodium has a rich constitutional picture.",
},
{
"name": "CARDUUS MARIANUS",
"source": "Milk Thistle",
"pathophys_action": (
"Contains silymarin — hepatoprotective, antioxidant, anti-inflammatory. "
"Stabilises hepatocyte membranes → ↓ further fibrosis progression → preserves synthetic function → ↑ albumin → ↓ oedema. "
"Also has direct action on portal circulation and spleen."
),
"key_symptoms": (
"• Hepatic oedema with ascites from cirrhosis\n"
"• LEFT-sided oedema and complaints\n"
"• Liver enlarged and painful; stitching pains in region of liver/spleen\n"
"• Jaundice (catarrhal, cirrhotic)\n"
"• Nausea, vomiting of green bile\n"
"• Splenomegaly with dull aching\n"
"• Haemorrhages (oesophageal varices picture)\n"
"• Varicose veins of lower limbs\n"
"Why: Portal hypertension → splenomegaly + variceal tendency + ascites; Cardus acts on this vascular-portal picture"
),
"modalities": "Worse: motion, lying on left side. Better: rest.",
"potency": "Q (mother tincture) or 3x–30C",
"compare": "More SPECIFIC for liver/portal pathology than Lycopodium (which is more general/constitutional). LEFT-sided vs Lycopodium's RIGHT-sided. Carduus = structural liver damage; Lycopodium = functional/constitutional.",
},
{
"name": "CHELIDONIUM MAJUS",
"source": "Greater Celandine",
"pathophys_action": (
"Specific liver-bile duct remedy. Acts on bile flow and hepatocyte function. "
"Addresses the cholestatic component of hepatic disease (↑ ALP/bilirubin). "
"Also promotes diuresis and addresses secondary renal involvement."
),
"key_symptoms": (
"• Jaundice with clay/grey stools (biliary obstruction)\n"
"• PAIN under right scapula — classic keynote of Chelidonium\n"
"• Liver enlarged, hard; stitching pains\n"
"• Oedema with marked jaundice\n"
"• Tongue yellow, coated; bitter taste\n"
"• Nausea better by eating (paradoxical but classic)\n"
"• Urine golden yellow (bilirubinuria)\n"
"• Worse 4 AM and 4 PM (liver aggravation times)\n"
"Why: Biliary obstruction → cholestasis → bilirubin accumulation → jaundice; liver synthetic failure → ↓ albumin → oedema"
),
"modalities": "Worse: right side, motion, 4 AM/PM. Better: hot milk, eating.",
"potency": "Q or 3x–30C",
"compare": "Unlike Lycopodium (4–8 PM bloating/flatus), Chelidonium has PAIN UNDER RIGHT SCAPULA as keynote. More for BILIARY/CHOLESTATIC pathology, less for pure portal hypertension.",
},
{
"name": "ARSENICUM ALBUM",
"source": "Arsenic Trioxide",
"pathophys_action": (
"In hepatic oedema, acts on the ↓ albumin → ↓ oncotic pressure → ascites/anasarca pathway. "
"Also addresses secondary RAAS: ↓ effective arterial volume → ↑ RAAS → Na⁺ retention → worsening ascites. "
"Key for alcoholic liver disease cases with anxiety, restlessness and great weakness."
),
"key_symptoms": (
"• Ascites with great debility and fear of death\n"
"• Extreme restlessness — moves constantly but too weak\n"
"• Thirst for small sips frequently\n"
"• Oedema worse after midnight\n"
"• Burning in liver region, paradoxically relieved by heat\n"
"• Jaundice with waxy skin\n"
"• Anorexia; cannot bear sight/smell of food\n"
"• Diarrhoea alternating with constipation\n"
"Why: ↓ Albumin → massive ascites + pleural effusion; splanchnic vasodilation → hypotension → Arsenicum's sinking/prostration picture"
),
"modalities": "Worse: midnight, cold. Better: heat, company.",
"potency": "30C–1M",
"compare": "Unlike Lycopodium (comfortable at home, domineering), Arsenicum is ANXIOUS/FEARFUL/RESTLESS. Unlike Carduus (physical congestion), Arsenicum = mental terror + physical sinking.",
},
{
"name": "CHINA OFFICINALIS",
"source": "Peruvian Bark (Cinchona)",
"pathophys_action": (
"Classic remedy for debility from fluid loss. In hepatic oedema, addresses the consequences of "
"repeated paracentesis (periodic drainage) → hypoproteinaemia → rebound fluid accumulation. "
"Also addresses haemorrhagic tendency (oesophageal variceal bleeds) and post-haemorrhagic weakness."
),
"key_symptoms": (
"• Oedema/ascites following repeated loss of vital fluids (haemorrhage, paracentesis)\n"
"• Periodic aggravation (every other day — malaria-like periodicity)\n"
"• Extreme debility, anaemia after fluid loss\n"
"• Abdomen bloated with flatulence; gas does not pass\n"
"• Face earthy, sunken; dark circles under eyes\n"
"• Tinnitus; ↑ sensitivity to touch\n"
"• Haematuria, haemorrhage from various orifices\n"
"Why: Post-paracentesis rebound (↓ protein → ↓ oncotic pressure → rapid reaccumulation of ascites); China restores vital force"
),
"modalities": "Worse: touch, cold, every other day. Better: warmth.",
"potency": "6C–30C",
"compare": "Unlike Arsenicum (constant anxiety), China has PERIODICITY. Unlike Carduus (structural liver), China is for POST-HAEMORRHAGE/POST-DRAINAGE debility. Key: fluid loss as precipitating factor.",
},
]
# ---- LYMPHOEDEMA ----
LYMPH_INV_ROWS = [
("Lymphoscintigraphy (Radionuclide Lymphangiography)",
"Gold standard to confirm lymphatic dysfunction and map drainage patterns",
"Lymphatic obstruction (primary aplasia/hypoplasia or secondary filarial blockage) → stasis of protein-rich lymph",
"Delayed/absent tracer uptake in regional nodes; dermal backflow pattern",
"When clinical diagnosis uncertain or pre-surgery planning"),
("Blood film + Nocturnal Microfilarial count",
"Confirm filarial lymphoedema (most common secondary cause in tropics)",
"W. bancrofti microfilariae show NOCTURNAL PERIODICITY — blood collected 10 PM–2 AM",
"Microfilariae on Giemsa-stained thick blood film; Knott's concentration test",
"When filariasis suspected; nocturnal blood sample essential"),
("ICTB card test / Filarial Ag ELISA",
"Immunochromatographic test — detects circulating filarial antigen",
"Adult worm antigens in blood indicate active W. bancrofti infection",
"Positive = active infection; useful even when microfilaraemia undetectable",
"1st line diagnostic in endemic areas"),
("Duplex Ultrasound of lymphatics",
"Assess venous patency (exclude DVT as co-existing cause); visualise dilated lymphatics",
"DVT can mimic or co-exist with lymphoedema; dilated lymph channels visible in chronic lymphoedema",
"Patent deep veins; dilated lymphatic channels with echogenic fluid",
"At baseline to exclude venous cause"),
("CT / MRI of abdomen-pelvis",
"Exclude secondary causes: malignancy, lymph node metastases, retroperitoneal fibrosis",
"Cancer invasion of lymphatics → secondary lymphoedema; CT identifies nodal enlargement/mass",
"Lymph node enlargement, mass compressing lymphatics; honeycomb pattern of subcutaneous tissues",
"When secondary malignant cause suspected"),
("Kaposi-Stemmer Sign (Clinical)",
"Clinical diagnostic test for lymphoedema at base of 2nd toe",
"Chronic lymphoedema → subcutaneous fibrosis → inability to pinch skin fold",
"POSITIVE: Cannot pinch skin fold = lymphoedema (nearly pathognomonic)",
"At clinical examination"),
]
LYMPH_REMEDIES = [
{
"name": "CALCAREA FLUORICA",
"source": "Calcium Fluoride",
"pathophys_action": (
"Acts on connective tissue and lymphatics — specifically addresses the FIBROSIS and INDURATION "
"that characterises chronic lymphoedema. "
"Calcium fluoride is a component of connective tissue; its deficiency leads to fibroelastic tissue changes. "
"Addresses the progressive fibrosis of lymphatic walls in chronic lymphoedema."
),
"key_symptoms": (
"• NON-PITTING, indurated, woody hard oedema — classic keynote\n"
"• Varicose veins, enlarged hard glands\n"
"• Fibrotic, hard indurations in subcutaneous tissue\n"
"• Elephantiasis-like thickening of skin\n"
"• Hard nodules along lymphatics\n"
"• Cracks in skin over swollen area\n"
"Why: Chronic filarial lymphoedema → fibrosis → indurated non-pitting oedema → Calc Fluor targets fibroelastic pathology"
),
"modalities": "Worse: damp cold, rest. Better: heat, gentle rubbing.",
"potency": "6x (tissue salt) or 30C",
"compare": "Most specific for FIBROTIC non-pitting lymphoedema. Unlike Apis (inflammatory, hot, shiny), Calc Fluor is cold, hard, chronic. Unlike Graphites (oozing, cracked skin), Calc Fluor is predominantly indurated.",
},
{
"name": "APIS MELLIFICA",
"source": "Honeybee venom",
"pathophys_action": (
"Acts on ACUTE inflammatory lymphoedema — increased capillary and lymphatic permeability. "
"In acute filarial lymphangitis: bacterial/filarial inflammatory response → ↑ vascular permeability → "
"protein-rich exudate → Apis addresses this exudative, hot, oedematous phase."
),
"key_symptoms": (
"• SHINY, TRANSPARENT, hot, burning, oedematous swelling\n"
"• Stinging, burning pains (like bee sting)\n"
"• Better from cold applications (pathognomonic of Apis)\n"
"• No thirst despite swelling\n"
"• Acute lymphangitis with fiery red streaking\n"
"• Urticaria, allergic oedema\n"
"• Worse from heat in every form\n"
"Why: Acute filarial attack → acute inflammatory lymphangitis → Apis matches this hot, stinging, exudative picture"
),
"modalities": "Worse: heat, touch, pressure. Better: cold application.",
"potency": "6C–30C in acute phase",
"compare": "Acute vs Calc Fluor (chronic fibrosis). Unlike Rhus Tox (better from motion/warmth), Apis is definitively better from COLD. Most useful in ACUTE attacks of filarial lymphangitis.",
},
{
"name": "GRAPHITES",
"source": "Black Lead (Graphite)",
"pathophys_action": (
"Acts on lymphatics with particular affinity for SKIN and lymphatic glands. "
"Addresses chronic oedema where skin becomes thickened, cracked and leaks sticky fluid. "
"Also acts on the cellulite-like fibrofatty deposition in chronic lymphoedema."
),
"key_symptoms": (
"• Chronic lymphoedema with OOZING, cracked, moist skin\n"
"• Sticky, honey-like discharge from skin cracks\n"
"• Thick, indurated skin with pigmentation changes\n"
"• Tendency to keloid/fibrotic scar formation\n"
"• Obese, chilly, constipated constitution (Graphites type)\n"
"• Swelling of cervical/inguinal lymph nodes\n"
"• Worse in cold, damp; better from warmth\n"
"Why: Chronic lymphoedema → skin fibrosis → breaks → sticky exudate; Graphites addresses this skin-lymphatic axis"
),
"modalities": "Worse: cold, damp, right side. Better: warmth, wrapping.",
"potency": "30C–200C",
"compare": "Unlike Calc Fluor (hard/woody indurated), Graphites has MOIST, STICKY, OOZING skin. Unlike Apis (hot/acute), Graphites is chronic and chilly. Suits OBESE constitution.",
},
{
"name": "RHUS TOXICODENDRON",
"source": "Poison Ivy",
"pathophys_action": (
"Acts on fibrous tissues, fasciae, and periarticular lymphatics. "
"In lymphoedema associated with joint involvement (filariasis attacking periarticular lymphatics, DVT with joint stiffness), "
"Rhus Tox addresses lymphatic oedema with restlessness and stiffness."
),
"key_symptoms": (
"• Oedema with STIFFNESS and RESTLESSNESS — must keep moving\n"
"• Worse on first movement, better on continued motion\n"
"• Hot, swollen, erythematous oedema with vesicular eruptions\n"
"• Acute filarial lymphangitis with fever, aching, restlessness\n"
"• Cellulitis-like picture with swelling\n"
"• Tearing, stitching pains in swollen limb\n"
"• Fever with aching in all bones during acute filarial attack\n"
"Why: Acute filarial attack → fever + lymphangitis + joint/fascial stiffness → Rhus Tox matches this febrile restless lymphangitic picture"
),
"modalities": "Worse: rest, cold, damp. Better: warm applications, motion.",
"potency": "30C–200C",
"compare": "Unlike Apis (better from cold/rest), Rhus Tox is better from MOTION and HEAT. More for ACUTE FEBRILE filarial lymphangitis. Unlike Calc Fluor (cold/fibrotic/chronic), Rhus Tox is warm and restless.",
},
{
"name": "SILICEA (SILICA)",
"source": "Pure Flint",
"pathophys_action": (
"Acts on LYMPH NODES and lymphatic vessels — promotes maturation and resolution of chronic lymphatic induration. "
"Silicea promotes suppuration and expulsion of foreign bodies (filarial worm carcasses in lymphatics). "
"Also addresses progressive fibrosis by improving connective tissue vitality."
),
"key_symptoms": (
"• Chronic lymphoedema with hard, enlarged, fixed lymph nodes\n"
"• Recurrent lymphangitis/lymphadenitis tending to suppurate\n"
"• Weakened immune state — infections heal poorly\n"
"• Fistula formation from chronic lymph node abscess\n"
"• Cold, sweaty hands and feet\n"
"• Timid, yielding constitution; lack of grit\n"
"• Slow healing; scars break open\n"
"Why: Filarial debris in lymphatics acts as foreign body; Silicea promotes its elimination and resolves chronic lymphatic induration"
),
"modalities": "Worse: cold, uncovering, damp. Better: warmth, wrapping.",
"potency": "6x (tissue salt) for chronic; 200C–1M for constitutional",
"compare": "Unlike Graphites (moist/oozing skin), Silicea is for LYMPH NODE induration and abscess-prone states. Unlike Calc Fluor (fibroelastic), Silicea is for IMMUNE/SUPPURATIVE lymphatic pathology.",
},
]
# ================================================================
# BUILD THE SLIDES
# ================================================================
def add_heading_slide(prs, title, subtitle):
sl = add_blank_slide(prs)
set_bg(sl, C_DARK_BG)
rect(sl, 0, 0, 10, 0.08, C_ACCENT1) # top bar
rect(sl, 0, 7.42, 10, 0.08, C_ACCENT1) # bottom bar
tb(sl, title, 0.3, 0.3, 9.4, 0.8, size=24, bold=True, color=C_ACCENT1, align=PP_ALIGN.LEFT)
tb(sl, subtitle, 0.3, 1.2, 9.4, 0.55, size=13, color=C_LIGHT_BLU, align=PP_ALIGN.LEFT)
return sl
def add_investigation_slide(prs, rows, condition_label):
"""Add investigation table slides (2 per batch of 5 rows)."""
batch = 5
for batch_start in range(0, len(rows), batch):
sl = add_blank_slide(prs)
set_bg(sl, C_DARK_BG)
rect(sl, 0, 0, 10, 0.08, C_ACCENT2)
title_text = f"INVESTIGATIONS: {condition_label}"
tb(sl, title_text, 0.2, 0.12, 9.6, 0.5, size=16, bold=True, color=C_ACCENT2)
# Column headers
headers = ["Investigation", "Why Advised", "Pathophys Link", "Expected Findings", "When"]
col_x = [0.15, 1.85, 3.75, 5.75, 8.15]
col_w = [1.65, 1.85, 1.95, 2.35, 1.7]
y_hdr = 0.72
for ci, hdr in enumerate(headers):
tb(sl, hdr, col_x[ci], y_hdr, col_w[ci], 0.35, size=9, bold=True, color=C_ACCENT2)
# Separator
rect(sl, 0.15, 1.08, 9.7, 0.03, C_ACCENT2)
row_height = 1.24
for ri, row in enumerate(rows[batch_start:batch_start+batch]):
y = 1.13 + ri * row_height
bg_col = RGBColor(0x10, 0x10, 0x3A) if ri % 2 == 0 else RGBColor(0x16, 0x16, 0x4A)
rect(sl, 0.15, y, 9.7, row_height - 0.04, bg_col)
row_colors = [C_WHITE, C_LIGHT_BLU, C_GREEN, C_ACCENT1, C_ORANGE]
for ci, cell in enumerate(row):
tb(sl, cell, col_x[ci] + 0.03, y + 0.04, col_w[ci] - 0.06, row_height - 0.1,
size=8, color=row_colors[ci], wrap=True)
def add_remedy_slides(prs, remedies, condition_label):
"""Add one slide per remedy + a compare-contrast summary slide."""
for i, rem in enumerate(remedies):
sl = add_blank_slide(prs)
set_bg(sl, C_DARK_BG)
rect(sl, 0, 0, 10, 0.08, C_ACCENT3)
# Title bar
rect(sl, 0.15, 0.12, 9.7, 0.65, RGBColor(0x20, 0x00, 0x40))
tb(sl, f"HOMEOPATHIC REMEDY {i+1}/{len(remedies)}: {rem['name']}", 0.25, 0.17,
9.4, 0.52, size=17, bold=True, color=C_ACCENT3)
# Source + condition
tb(sl, f"Source: {rem['source']} | Condition: {condition_label}",
0.25, 0.82, 9.4, 0.3, size=10, color=C_LIGHT_BLU)
# Left column: Pathophysiological Action + Key Symptoms
rect(sl, 0.15, 1.15, 4.7, 4.75, RGBColor(0x08, 0x08, 0x28))
tb(sl, "PATHOPHYSIOLOGICAL ACTION", 0.22, 1.18, 4.55, 0.3, size=9, bold=True, color=C_ACCENT2)
tb(sl, rem['pathophys_action'], 0.22, 1.5, 4.55, 1.7, size=8.5, color=C_WHITE, wrap=True)
tb(sl, "KEY SYMPTOMS & WHY THEY OCCUR", 0.22, 3.25, 4.55, 0.3, size=9, bold=True, color=C_ACCENT2)
tb(sl, rem['key_symptoms'], 0.22, 3.58, 4.55, 2.2, size=8, color=C_LIGHT_BLU, wrap=True)
# Right column: Modalities, Potency, Compare
rect(sl, 5.05, 1.15, 4.8, 4.75, RGBColor(0x08, 0x08, 0x28))
tb(sl, "MODALITIES", 5.12, 1.18, 4.65, 0.3, size=9, bold=True, color=C_ORANGE)
tb(sl, rem['modalities'], 5.12, 1.5, 4.65, 0.6, size=9, color=C_WHITE, wrap=True)
tb(sl, "POTENCY / DOSAGE", 5.12, 2.15, 4.65, 0.3, size=9, bold=True, color=C_ORANGE)
tb(sl, rem['potency'], 5.12, 2.47, 4.65, 0.5, size=9, color=C_WHITE, wrap=True)
tb(sl, "COMPARE & CONTRAST WITH OTHER REMEDIES", 5.12, 3.05, 4.65, 0.35, size=9, bold=True, color=C_ACCENT3)
tb(sl, rem['compare'], 5.12, 3.45, 4.65, 2.4, size=8.5, color=C_LIGHT_BLU, wrap=True)
# Bottom bar
rect(sl, 0, 7.42, 10, 0.08, C_ACCENT3)
# Compare-contrast summary slide
sl = add_blank_slide(prs)
set_bg(sl, C_DARK_BG)
rect(sl, 0, 0, 10, 0.08, C_ACCENT2)
tb(sl, f"REMEDY COMPARISON TABLE — {condition_label}", 0.2, 0.12, 9.6, 0.5,
size=17, bold=True, color=C_ACCENT2)
# Table headers
col_names = ["Remedy", "Key Symptom", "Pulse/Urine", "Modalities", "Best For"]
col_x2 = [0.1, 2.1, 4.2, 6.2, 8.0]
col_w2 = [1.95, 2.05, 2.0, 1.75, 1.9]
y2 = 0.72
for ci, h in enumerate(col_names):
tb(sl, h, col_x2[ci], y2, col_w2[ci], 0.32, size=9, bold=True, color=C_ACCENT2)
rect(sl, 0.1, 1.06, 9.8, 0.03, C_ACCENT2)
rh2 = (7.42 - 1.1) / len(remedies)
for ri, rem in enumerate(remedies):
y3 = 1.12 + ri * rh2
bg2 = RGBColor(0x0E, 0x0E, 0x36) if ri % 2 == 0 else RGBColor(0x14, 0x14, 0x44)
rect(sl, 0.1, y3, 9.8, rh2 - 0.04, bg2)
# Extract first key symptom bullet
ksym_lines = rem['key_symptoms'].split('\n')
first_sym = ksym_lines[0].strip('• ').strip() if ksym_lines else ""
# Rough pulse/urine extraction from key symptoms
pulse_info = ""
for line in ksym_lines:
if any(w in line.lower() for w in ['pulse', 'urine', 'urination', 'oliguria', 'albuminuria']):
pulse_info = line.strip('• ').strip()
break
row_data = [
rem['name'],
first_sym[:60] if len(first_sym) > 60 else first_sym,
pulse_info[:55] if len(pulse_info) > 55 else pulse_info,
rem['modalities'][:60] if len(rem['modalities']) > 60 else rem['modalities'],
rem['compare'].split('.')[0][:65] if rem['compare'] else "",
]
rc2 = [C_ACCENT3, C_WHITE, C_LIGHT_BLU, C_ORANGE, C_GREEN]
for ci, cell in enumerate(row_data):
tb(sl, cell, col_x2[ci] + 0.03, y3 + 0.04, col_w2[ci] - 0.06, rh2 - 0.1,
size=8, color=rc2[ci], wrap=True)
rect(sl, 0, 7.42, 10, 0.08, C_ACCENT2)
# ================================================================
# ASSEMBLE: insert new slides AFTER existing ones
# (We add them at the end; then we'll reorder using slide XML manipulation)
# For simplicity: insert after slide 11 (cardiac pathophys),
# after slide 12 (renal), after slide 13 (hepatic), after slide 18 (filariasis)
#
# Actually, python-pptx doesn't support insert-at-position directly.
# We will add all new slides at end, then reorder.
# ================================================================
# Record original slide count
orig_count = len(prs.slides)
print(f"Original slide count: {orig_count}")
# --- CARDIAC OEDEMA (after slide 11, index 10) ---
add_heading_slide(prs, CARDIAC_INV_TITLE, CARDIAC_INV_SUB)
add_investigation_slide(prs, CARDIAC_INV_ROWS, "RIGHT HEART FAILURE")
add_heading_slide(prs, CARDIAC_HOMEO_TITLE, CARDIAC_HOMEO_SUB)
add_remedy_slides(prs, CARDIAC_REMEDIES, "CARDIAC OEDEMA (R-HF)")
# --- RENAL OEDEMA - NEPHROTIC ---
add_heading_slide(prs, "RENAL OEDEMA — INVESTIGATIONS", "Nephrotic Syndrome | Rationale, Timing & Pathophysiological Correlation")
add_investigation_slide(prs, RENAL_NEP_INV_ROWS, "NEPHROTIC SYNDROME")
add_heading_slide(prs, "RENAL OEDEMA — HOMEOPATHIC REMEDIES", "Nephrotic Syndrome | Remedy Selection, Action & Compare-Contrast")
add_remedy_slides(prs, RENAL_NEP_REMEDIES, "RENAL OEDEMA (NEPHROTIC)")
# --- HEPATIC OEDEMA ---
add_heading_slide(prs, "HEPATIC OEDEMA — INVESTIGATIONS", "Liver Cirrhosis / Portal Hypertension | Rationale, Timing & Pathophysiological Correlation")
add_investigation_slide(prs, HEPATIC_INV_ROWS, "HEPATIC OEDEMA (CIRRHOSIS)")
add_heading_slide(prs, "HEPATIC OEDEMA — HOMEOPATHIC REMEDIES", "Cirrhosis / Portal Hypertension | Remedy Selection, Action & Compare-Contrast")
add_remedy_slides(prs, HEPATIC_REMEDIES, "HEPATIC OEDEMA")
# --- LYMPHOEDEMA ---
add_heading_slide(prs, "LYMPHOEDEMA — INVESTIGATIONS", "Primary / Filarial Lymphoedema | Rationale, Timing & Pathophysiological Correlation")
add_investigation_slide(prs, LYMPH_INV_ROWS, "LYMPHOEDEMA")
add_heading_slide(prs, "LYMPHOEDEMA — HOMEOPATHIC REMEDIES", "Primary / Filarial Lymphoedema | Remedy Selection, Action & Compare-Contrast")
add_remedy_slides(prs, LYMPH_REMEDIES, "LYMPHOEDEMA")
new_total = len(prs.slides)
print(f"New total slides (before reorder): {new_total}")
print(f"New slides added: {new_total - orig_count}")
# ================================================================
# REORDER: Move new slides to their correct positions
# python-pptx slide reordering via XML manipulation
# ================================================================
from pptx.oxml.ns import qn
def move_slide(prs, old_index, new_index):
"""Move slide from old_index to new_index."""
xml_slides = prs.slides._sldIdLst
slides = list(xml_slides)
to_move = slides[old_index]
xml_slides.remove(to_move)
slides = list(xml_slides)
if new_index >= len(slides):
xml_slides.append(to_move)
else:
xml_slides.insert(new_index, to_move)
# Slides after cardiac pathophys (slide 11 = index 10):
# insert 10 new cardiac slides after index 10 → they should be at indices 11-20
# Currently they are at the END: indices orig_count to orig_count+9
# After insertion, subsequent positions shift. We do this in reverse order
# to maintain correct relative positions.
# Count new slides per section
cardiac_new = 2 + 2 + 5 + 1 # heading + 2 inv + heading + 5 remedy + compare = 10
renal_new = 2 + 2 + 5 + 1 # 10
hepatic_new = 2 + 2 + 5 + 1 # 10
lymph_new = 2 + 2 + 5 + 1 # 10
# Re-check actual new count
actual_new = new_total - orig_count
print(f"Actual new slides: {actual_new}")
# Cardiac new slides were appended first, starting at index orig_count (35)
# We want them after index 10 (slide 11 = cardiac pathophys)
# Insert target positions (where each block should go):
# Cardiac block → after current slide index 10 (= after slide 11)
# After inserting cardiac, renal block should go after what was slide 12 (index 11, now 11+cardiac_new)
# etc.
total_cardiac = actual_new - (renal_new + hepatic_new + lymph_new) # should be ~10
total_renal = renal_new
total_hepatic = hepatic_new
total_lymph = lymph_new
print(f"Cardiac slides to move: {total_cardiac}")
current_len = len(prs.slides)
# Move lymph slides (last added) to after hepatic section (slide 13 = index 12,
# but after cardiac+renal+hepatic insertions that's index 12+cardiac+renal+hepatic_new)
#
# Strategy: move in REVERSE block order so indices stay predictable.
# Lymph block: currently at indices [current_len-lymph_new .. current_len-1]
# Target: after slide 13+cardiac+renal = index 12 + total_cardiac + total_renal + total_hepatic
# Simpler: move each block one at a time, from LAST to FIRST
def move_block(prs, src_start, count, dest_after_index):
"""Move 'count' slides starting at src_start to after dest_after_index."""
insert_at = dest_after_index + 1
for i in range(count):
# Each time we move one slide; src_start may shift
current_src = src_start # first slide of remaining block
move_slide(prs, current_src, insert_at + i)
# Move lymph block: currently at [35+cardiac+renal+hepatic .. 35+all-1]
lymph_src_start = orig_count + total_cardiac + total_renal + total_hepatic
# target: after slide 13 = index 12, but we haven't moved others yet
# We move BACKWARDS: lymph first (deepest), then hepatic, renal, cardiac
# Current state: [0..34 original][cardiac_new][renal_new][hepatic_new][lymph_new]
# Desired: [0..10][cardiac_new][11..11][renal_new][12..12][hepatic_new][13..34][lymph_new AFTER filarial]
# Filariasis = slide 18 = index 17 (after no inserts)
# After cardiac insert at 11: filarial becomes 17+cardiac_new = 17+10 = 27
# After renal insert at 12+10=22: filarial becomes 27+10=37
# After hepatic insert at 13+20=33: filarial becomes 37+10=47... too complex
# Simpler: just move all 4 blocks sequentially in order (cardiac first)
# 1. Move cardiac block to after index 10
# 2. Move renal block to after index 11+cardiac_new (which is slide 12, now shifted)
# 3. Move hepatic block to after the new slide 12 position + renal block
# 4. Move lymph block to after slide 18 position + all previous insertions
# After step 1: cardiac block is at indices 11..11+total_cardiac-1
# The original slides 11+ are now shifted right by total_cardiac
# Start fresh logic:
# Original slides: 0..34 (35 slides)
# New slides appended: 35..35+actual_new-1
# STEP 1: Move cardiac block (src: orig_count=35, count=total_cardiac) to dest after 10
cardiac_src = orig_count # 35
cardiac_dest = 10 # insert after slide index 10
for i in range(total_cardiac):
move_slide(prs, cardiac_src, cardiac_dest + 1 + i)
# After first move: slide 35 → 11, shifting existing 11..34 to 12..35
# After second move: slide 35 → 12, shifting 12..35 → 13..36
# etc. But actually cardiac_src must account for shifts.
# After moving slide from 35 to 11: the remaining slides 36,37,... become 35,36,...
# No wait: we inserted at 11, so slides 11..34 are now 12..35, and the moved slide is at 11
# Next: we want to move the NEXT cardiac slide which was at 36 (orig), now at 35 after shift?
# Actually no: when we move from 35 to 12, then 35 no longer points to right slide.
# This gets complex. Use a cleaner approach:
# Reset and do clean approach: move entire block at once
# Each move_slide call: remove from old pos, insert at new pos
# For moving a contiguous block to a new location, move each individually
print("Starting slide reorder...")
# After step1, let's recalculate
# Before any moves: indices 0-34 = original, 35-44 = cardiac, 45-54 = renal, 55-64 = hepatic, 65-74 = lymph
# Move cardiac (35-44) to after index 10:
# We move one at a time. Moving slide at 35 to position 11:
# - old 35 removed → slides compress: what was 36 is now 35
# - inserted at 11 → slides 11..34 shift to 12..35
# - New state: 0..10, cardiac[0] at 11, old[11..34] at 12..35, cardiac[1..9] at 36..44, renal at 45..54...
# Moving next cardiac: it's now at 36. We want it at 12.
# → move from 36 to 12 → etc.
# So: for block starting at src, moving count slides to dest_after+1, dest_after+2...
# Each time we pick the slide at position: src + (delta from previous shifts)
# After moving i slides: the remaining block has shifted left by i (because each removal compresses)
# But insertions push things right... tricky.
#
# Cleanest: move block by moving the FIRST slide of the remaining block each time,
# targeting dest_after+1, then dest_after+2, etc.
def move_block_clean(prs, src_start_initial, count, dest_after_index):
"""
Move 'count' slides (originally at src_start_initial..src_start_initial+count-1)
to positions dest_after_index+1 .. dest_after_index+count.
After each move, the src position shifts because of removal+insertion.
"""
current_src = src_start_initial
for i in range(count):
target = dest_after_index + 1 + i
# current_src is where the NEXT slide to move currently lives
# After previous iteration: we moved slide from current_src-1 to target-1,
# which inserts at target-1, shifting slides.
# Since target < current_src after first move (we inserted at lower index),
# current_src shifts by +1 each time? Let's track:
# i=0: move from src to dest+1. If src > dest+1, src is not affected by insertion (lower index).
# After removal from src, src+1..end shift left by 1. After insertion at dest+1, dest+1..end shift right.
# Net: slides originally at dest+2..src-1 shift +1 (insertion) -0 = +1 net... wait no.
# Actually: removal from src → slides src+1..N-1 shift to src..N-2
# Then insertion at dest+1 → slides dest+1..N-2 shift to dest+2..N-1
# Net effect on slide that was at src+1 (now at src after removal, then dest+1<src so it goes to src+1 again... complex)
# Simple rule: if src > target: after removal src shifts to src-1 (if removal is before it),
# then insertion at target shifts it +1 → net 0 change for the remaining block's first element
# ONLY if the remaining block is entirely above target.
# Since dest_after_index < src_start_initial, all moves are: take from above, put below.
# After moving slide from current_src to target:
# - Removal at current_src → slides current_src+1.. shift left by 1
# - Insertion at target (target < current_src) → slides target.. shift right by 1
# - The next slide (originally at current_src+1, now at current_src after removal,
# then +1 due to insertion = current_src+1... wait that means it stayed?)
# Actually: removal from current_src makes current_src+1 → current_src
# Then insertion at target (< current_src): makes current_src → current_src+1
# Net: the next slide stays at current_src+1? No: it went from current_src+1 → current_src (removal) → current_src+1 (insertion at lower index).
# So current_src remains SAME for each iteration! Great.
move_slide(prs, current_src, target)
# current_src stays the same (proven above when target < current_src)
# Verify counts
print(f"Cardiac block size: {total_cardiac}, Renal: {total_renal}, Hepatic: {total_hepatic}, Lymph: {total_lymph}")
# STEP 1: Move cardiac block to after slide index 10
move_block_clean(prs, 35, total_cardiac, 10)
# Now slides: 0..10, cardiac(10 slides)=11..20, original11..34 → 21..44, renal=45..54, hepatic=55..64, lymph=65..74
# STEP 2: Move renal block to after original slide 12 (= "Renal Oedema" slide)
# Original slide 12 (0-indexed) is now at index 12 + 10 (cardiac insert) = 22?
# Wait: original slides 0..10 = intact. Original 11..34 shifted to 21..44. So original slide 12 = now at 22.
renal_src = 45 # same position (moves above it shifted things but 45 is after all of them)
# Actually: after step1, the slides appended after position 35 (renal, hepatic, lymph) are still at 45, 55, 65
# because the cardiac block (10 slides) was moved from 35..44 to 11..20,
# and the remaining (renal=45..54, hepatic=55..64, lymph=65..74) shifted left by 10:
# they're now at 35..44, 45..54, 55..64
# Let me recount: before step1: 75 slides total (35 orig + 10 cardiac + 10 renal + 10 hepatic + 10 lymph)
# After step1 (moving 10 slides from 35..44 to 11..20): total still 75
# The renal block was at 45..54 → after moving 10 slides from 35 to 11..20:
# Each move shifts slides above target: renal slides (45..54) are above insertion points (11..20)
# but also their src positions are above removal points (35..44).
# After each removal from 35, slides 36..74 shift left by 1.
# After each insertion at 11..20, slides 11..74 shift right by 1.
# Net effect on renal block (originally 45..54):
# After 10 moves: 10 removals from 35..44 → slides 45..54 shift left by 10 → now at 35..44
# 10 insertions at 11..20 → slides 11..34 shift right by 10, slides 35..44 shift right by 10
# Hmm, insertions at 11, 12... 20 affect slides 11..N, so renal block (originally 45) after 10 removals is at 35,
# then 10 insertions at 11..20 shift it to 45 again. Net: renal is back at 45..54. OK!
# Actually total count stays 75. Positions: 0..10 original, 11..20 cardiac_new, 21..44 original 11..34 shifted,
# 45..54 renal, 55..64 hepatic, 65..74 lymph. Correct.
# Original "Renal Oedema" slide = slide index 11 (0-indexed). After step1, it's at 21.
# STEP 2: Move renal block (at 45..54) to after index 21 (Renal Oedema slide)
move_block_clean(prs, 45, total_renal, 21)
# After step2: 0..10, 11..20 cardiac, 21 renaledema, 22..31 renal_new, 32..44 original12..34, 45..54 hepatic, 55..64 lymph
# Wait: original slides 12..34 were at 22..44, now after insertion of 10 at 22..31, they shift to 32..44.
# But hepatic (was 45..54) and lymph (65..74) — after 10 removals from 45..54 and 10 insertions at 22..31:
# removals: 45..54 shift left by 10 → 35..44? No: removals from 45 shift slides 46.. left.
# This is getting complex. Let me just trust the math:
# Total = 75. After each block_clean call the total stays 75. Only positions change.
# STEP 3: Move hepatic block to after original "Hepatic Oedema" slide = original index 12 (Slide 13).
# After steps 1&2: original slide 12 = at index 12 + 10 (cardiac) + 10 (renal) + 1 (renal oedema slide itself offset)
# Hmm. Let me count carefully.
# Original slides 0..34. After step1: orig 0..10 at 0..10, orig 11..34 at 21..44 (shifted right by 10).
# Orig slide 12 = at index 22 (21 + 1 = 22, since orig11=21, orig12=22).
# After step2: we inserted 10 renal slides at 22..31. Orig 12 was at 22, gets pushed to 32.
# So orig slide 12 (Hepatic Oedema) is now at index 32.
# After step2, hepatic block: was at 45..54 before step2.
# Step2: 10 removals from 45..54, 10 insertions at 22..31.
# Removals from 45 shift slides 46..74 left by 1. So hepatic block slides shift: first removal sends 45→44, then next removal sends 45→44...
# Actually: each removal of a slide from 45 makes it disappear, so remaining hepatic slides (46..54) shift to 45..53.
# After 10 removals from the 45-position block: that whole block is gone from 45..54.
# After 10 insertions at 22..31: slides at 22..44 (before insertions) shift right by 10. But hepatic was already removed.
# So hepatic is now at the NEW positions 22..31. Wait no, those are the renal slides!
# I'm confusing myself. Let me just directly check after saving.
# Let's take a different, cleaner approach: build position map BEFORE any moves.
# Then do a single comprehensive reorder at the end.
# CLEAN APPROACH: Use single reorder based on desired final order
# Desired order:
# Original slides 1-11 (indices 0-10)
# Cardiac new block (10 slides)
# Original slide 12 (index 11) [Renal Oedema]
# Renal new block (10 slides)
# Original slide 13 (index 12) [Hepatic Oedema]
# Hepatic new block (10 slides)
# Original slides 14-18 (indices 13-17) [Other/Filariasis up to Filariasis]
# Lymph new block (10 slides)
# Original slides 19-35 (indices 18-34) [Rest of presentation]
desired_order = (
list(range(11)) + # orig 0-10
list(range(35, 35 + total_cardiac)) + # cardiac new
[11] + # orig 11 (Renal Oedema slide)
list(range(35 + total_cardiac, 35 + total_cardiac + total_renal)) + # renal new
[12] + # orig 12 (Hepatic Oedema)
list(range(35 + total_cardiac + total_renal, 35 + total_cardiac + total_renal + total_hepatic)) + # hepatic new
list(range(13, 19)) + # orig 13-18 (filariasis etc)
list(range(35 + total_cardiac + total_renal + total_hepatic, 35 + actual_new)) + # lymph new
list(range(19, 35)) # orig 19-34
)
print(f"Desired order length: {len(desired_order)}, Total slides: {len(prs.slides)}")
assert len(desired_order) == len(prs.slides), f"Mismatch! {len(desired_order)} vs {len(prs.slides)}"
assert sorted(desired_order) == list(range(len(prs.slides))), "Not a valid permutation!"
# WAIT — we already called move_block_clean above which changed positions.
# We need to undo that. Let me save and reload.
prs.save('/tmp/workspace/oedema_output/TEMP_before_reorder.pptx')
print("Saved temp before reorder (already partially reordered by move_block_clean calls above — will fix)")
where is my enhanced ppt?
ls /tmp/workspace/oedema_output/ 2>/dev/null && echo "---" && ls /tmp/workspace/oedema_unpacked/ppt/slides/ 2>/dev/null | head -5
~/oedema_output/build_enhanced.py
"""
Enhanced OEDEMA PPT builder
Adds Investigation + Homeopathy slides after each major section.
"""
from pptx import Presentation
from pptx.util import Inches, Pt
from pptx.dml.color import RGBColor
from pptx.enum.text import PP_ALIGN
SRC = '/tmp/workspace/attachments/ee914391-0d91-4d75-b6ea-3d666e36f909/OEDEMA PAYAL PARMAR.pptx'
OUT = '/tmp/workspace/oedema_output/OEDEMA_ENHANCED.pptx'
C_BG = RGBColor(0x08, 0x08, 0x28)
C_CYAN = RGBColor(0x00, 0xD4, 0xFF)
C_GOLD = RGBColor(0xFF, 0xD7, 0x00)
C_PINK = RGBColor(0xFF, 0x69, 0xB4)
C_WHITE = RGBColor(0xFF, 0xFF, 0xFF)
C_LBLUE = RGBColor(0xAD, 0xD8, 0xE6)
C_GREEN = RGBColor(0x90, 0xEE, 0x90)
C_ORANGE = RGBColor(0xFF, 0xA5, 0x00)
C_NAVY2 = RGBColor(0x10, 0x10, 0x3C)
C_NAVY3 = RGBColor(0x18, 0x18, 0x48)
C_PURPLE = RGBColor(0x1E, 0x00, 0x3E)
prs = Presentation(SRC)
BLANK = prs.slide_layouts[6]
def set_bg(sl, col):
b = sl.background; f = b.fill; f.solid(); f.fore_color.rgb = col
def rect(sl, x, y, w, h, col):
s = sl.shapes.add_shape(1, Inches(x), Inches(y), Inches(w), Inches(h))
s.fill.solid(); s.fill.fore_color.rgb = col; s.line.fill.background()
def tb(sl, text, x, y, w, h, size=10, bold=False, col=C_WHITE, align=PP_ALIGN.LEFT):
t = sl.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h))
tf = t.text_frame; tf.word_wrap = True
p = tf.paragraphs[0]; p.alignment = align
r = p.add_run(); r.text = text
r.font.size = Pt(size); r.font.bold = bold; r.font.color.rgb = col
def new_slide():
sl = prs.slides.add_slide(BLANK); set_bg(sl, C_BG); return sl
def move_slide(prs, from_i, to_i):
lst = prs.slides._sldIdLst
items = list(lst)
item = items[from_i]
lst.remove(item)
items2 = list(lst)
if to_i >= len(items2): lst.append(item)
else: lst.insert(to_i, item)
# ─── SECTION DIVIDER ───────────────────────────────────────────────────────────
def section_slide(title, sub):
sl = new_slide()
rect(sl, 0, 0, 10, 0.1, C_CYAN)
rect(sl, 0, 7.4, 10, 0.1, C_CYAN)
rect(sl, 0, 2.9, 10, 0.07, C_GOLD)
tb(sl, title, 0.4, 1.7, 9.2, 1.0, size=26, bold=True, col=C_CYAN, align=PP_ALIGN.CENTER)
if sub: tb(sl, sub, 0.4, 3.1, 9.2, 0.7, size=13, col=C_GOLD, align=PP_ALIGN.CENTER)
# ─── INVESTIGATIONS (2-row table, up to 5 rows per slide) ─────────────────────
def inv_slides(label, rows):
cols_x = [0.12, 1.92, 3.85, 5.85, 8.1]
cols_w = [1.75, 1.88, 1.95, 2.2, 1.75]
hdrs = ["Investigation","Why Advised","Pathophys Link","Findings","When"]
per = 5
for start in range(0, len(rows), per):
sl = new_slide()
rect(sl, 0, 0, 10, 0.1, C_GOLD)
tb(sl, f"INVESTIGATIONS — {label}", 0.15, 0.12, 9.7, 0.45, size=15, bold=True, col=C_GOLD)
for ci,(h,cw,cx) in enumerate(zip(hdrs,cols_w,cols_x)):
tb(sl, h, cx, 0.62, cw, 0.28, size=8, bold=True, col=C_GOLD)
rect(sl, 0.1, 0.93, 9.8, 0.03, C_GOLD)
rh = 1.26
hcols = [C_WHITE, C_LBLUE, C_GREEN, C_CYAN, C_ORANGE]
for ri, row in enumerate(rows[start:start+per]):
y = 0.98 + ri*rh
bg = C_NAVY2 if ri%2==0 else C_NAVY3
rect(sl, 0.1, y, 9.8, rh-0.04, bg)
for ci, cell in enumerate(row):
tb(sl, cell, cols_x[ci]+0.03, y+0.04, cols_w[ci]-0.06, rh-0.12,
size=7.5, col=hcols[ci])
# ─── REMEDY SLIDES ─────────────────────────────────────────────────────────────
def remedy_slides(label, remedies):
for i, R in enumerate(remedies):
sl = new_slide()
rect(sl, 0, 0, 10, 0.1, C_PINK)
rect(sl, 0.1, 0.13, 9.8, 0.65, C_PURPLE)
tb(sl, f"REMEDY {i+1}/{len(remedies)}: {R['name']}", 0.2, 0.17, 9.6, 0.52,
size=16, bold=True, col=C_PINK)
tb(sl, f"Source: {R['src']} | {label}", 0.2, 0.82, 9.6, 0.28, size=9, col=C_LBLUE)
# LEFT box
rect(sl, 0.1, 1.15, 4.75, 5.9, C_NAVY2)
tb(sl, "PATHOPHYSIOLOGICAL ACTION", 0.17, 1.18, 4.6, 0.28, size=8, bold=True, col=C_GOLD)
tb(sl, R['action'], 0.17, 1.48, 4.6, 1.85, size=7.8, col=C_WHITE)
tb(sl, "KEY SYMPTOMS & WHY THEY OCCUR", 0.17, 3.38, 4.6, 0.28, size=8, bold=True, col=C_GOLD)
tb(sl, R['symptoms'], 0.17, 3.68, 4.6, 3.25, size=7.5, col=C_LBLUE)
# RIGHT box
rect(sl, 5.05, 1.15, 4.8, 5.9, C_NAVY2)
tb(sl, "MODALITIES", 5.12, 1.18, 4.65, 0.28, size=8, bold=True, col=C_ORANGE)
tb(sl, R['mod'], 5.12, 1.48, 4.65, 0.7, size=8, col=C_WHITE)
tb(sl, "POTENCY / DOSAGE", 5.12, 2.23, 4.65, 0.28, size=8, bold=True, col=C_ORANGE)
tb(sl, R['potency'], 5.12, 2.53, 4.65, 0.55, size=8, col=C_WHITE)
tb(sl, "COMPARE & CONTRAST", 5.12, 3.13, 4.65, 0.28, size=8, bold=True, col=C_PINK)
tb(sl, R['compare'], 5.12, 3.45, 4.65, 3.5, size=7.8, col=C_LBLUE)
rect(sl, 0, 7.4, 10, 0.1, C_PINK)
# Compare table
sl = new_slide()
rect(sl, 0, 0, 10, 0.1, C_CYAN)
tb(sl, f"REMEDY COMPARISON — {label}", 0.15, 0.13, 9.7, 0.44, size=15, bold=True, col=C_CYAN)
cx2 = [0.1, 2.2, 4.3, 6.35, 8.2]
cw2 = [2.05, 2.05, 2.0, 1.8, 1.75]
hd2 = ["Remedy","Keynote Symptom","Pulse / Urine","Modalities","Best For"]
for ci,(h,cw,cx) in enumerate(zip(hd2,cw2,cx2)):
tb(sl, h, cx, 0.63, cw, 0.28, size=8, bold=True, col=C_CYAN)
rect(sl, 0.08, 0.95, 9.84, 0.03, C_CYAN)
rh2 = 1.3
for ri, R in enumerate(remedies):
y = 1.0 + ri*rh2
bg = C_NAVY2 if ri%2==0 else C_NAVY3
rect(sl, 0.08, y, 9.84, rh2-0.04, bg)
sym0 = R['symptoms'].split('\n')[0].lstrip('• ').strip()[:65]
pu = next((l.lstrip('• ').strip()[:55] for l in R['symptoms'].split('\n')
if any(w in l.lower() for w in ['pulse','urine','oliguria','albumin'])), "—")
row = [R['name'], sym0, pu, R['mod'][:55], R['compare'].split('.')[0][:65]]
rc2 = [C_PINK, C_WHITE, C_LBLUE, C_ORANGE, C_GREEN]
for ci, cell in enumerate(row):
tb(sl, cell, cx2[ci]+0.03, y+0.05, cw2[ci]-0.06, rh2-0.12, size=7.5, col=rc2[ci])
rect(sl, 0, 7.4, 10, 0.1, C_CYAN)
# ══════════════════════════════════════════════════════════════════════════════
# CONTENT DATA
# ══════════════════════════════════════════════════════════════════════════════
# ──────────── CARDIAC OEDEMA ─────────────────────────────────────────────────
CARDIAC_INV = [
("ECG","Detect arrhythmia / RVH / ischaemia as HF cause",
"↓ CO → RVH from chronic pressure overload; AF precipitates decompensation",
"RVH (R>S in V1), P-pulmonale, AF, RBBB, ischaemic Q waves","1st line — immediately"),
("Chest X-Ray (PA)","Assess cardiomegaly, pulmonary congestion, pleural effusion",
"↑ Pulm. venous pressure → bat-wing shadowing; R-HF → bilateral effusion",
"CTR >0.5, bilateral effusion, Kerley B lines, upper-lobe diversion","1st line — immediately"),
("Echocardiography","Gold standard: EF, valve disease, RV/LV function",
"RV dilation from ↑ afterload; TR from annular dilatation; IVC plethora = ↑ RAP",
"↓ EF (<40% HFrEF), RV dilation, TR, pericardial effusion, IVC plethora","Urgent — 24–48 h"),
("BNP / NT-proBNP","Biomarker of ventricular wall-stress; diagnose & monitor HF",
"Secreted by cardiomyocytes in response to ↑ end-diastolic wall stress",
"BNP >100 pg/mL or NT-proBNP >300 pg/mL confirms HF; correlates with severity",
"At presentation; monitor therapy response"),
("Serum Electrolytes + Renal Function","RAAS/ADH activation → Na retention + AKI",
"Ang II → aldosterone → ↑ Na⁺ / K⁺ loss; ↓ RBF → cardiorenal syndrome",
"Hyponatraemia (dilutional), hypokalaemia, ↑ creatinine/urea (CRS)","At presentation & with every Rx change"),
("LFTs + Serum Albumin","Hepatic congestion; ↑ hepatic venous pressure in R-HF",
"R-HF → ↑ IVC/hepatic venous pressure → hepatomegaly, transaminitis",
"↑ ALP, ALT, bilirubin (congestion); ↓ albumin in severe chronic HF","Baseline"),
("CBC","Anaemia exacerbates HF; infective triggers",
"Anaemia → ↑ CO demand worsening HF; chronic disease anaemia common",
"Normocytic anaemia of chronic disease; ↑ WBC if infectious trigger","Baseline"),
("Thyroid Function (TSH)","Hypo/hyperthyroidism cause or worsen HF",
"Hypothyroid → ↓ HR/CO + pericardial effusion; Hyperthyroid → high-output failure",
"↑ TSH (hypothyroid); ↓ TSH (hyperthyroid)","Baseline workup"),
("Urinalysis + Spot PCR","Cardiorenal syndrome; exclude primary renal cause",
"↓ GFR → oliguria; concurrent renal disease worsens prognosis",
"Oliguria, casts; proteinuria if renal involvement","Baseline"),
("6-Minute Walk / NYHA class","Functional severity; guide therapy titration",
"Correlates with CO reserve and exercise tolerance",
"<300 m = severe HF; guides escalation / cardiac rehab","After stabilisation"),
]
CARDIAC_REM = [
{"name":"DIGITALIS PURPUREA","src":"Foxglove plant",
"action":"Contains cardiac glycosides → inhibits Na⁺/K⁺-ATPase → ↑ intracellular Ca²⁺ → positive inotropy. Slows AV conduction (vagomimetic). Directly addresses the ↓ CO → RAAS → fluid retention cascade by improving pump function and increasing renal perfusion → breaks RAAS loop.",
"symptoms":"• Extremely SLOW, irregular, weak pulse (keynote)\n• Any movement → violent palpitations\n• Oedema: anasarca, dropsy + scanty/suppressed urine\n• Sensation heart will stop if patient moves\n• Cyanosis of lips and extremities\n• Liver enlarged and tender (hepatic congestion)\n• Dyspnoea — orthopnoea; worse lying down\n• Faintness WITH slow pulse\n• Jaundice (hepatic venous congestion)\nWHY: Reflects ↓ CO + RAAS-driven fluid overload + venous hypertension",
"mod":"Worse: motion, sitting up, cold. Better: rest, open air.",
"potency":"Mother tincture Q / 3x–6x for cardiac action; 30C–200C constitutional",
"compare":"Unlike Apocynum (ascites/vomiting dominant), Digitalis centres on SLOW PULSE + oedema + liver. Unlike Crataegus (chronic/trophorestorative), Digitalis has acute glycoside action. Unlike Arsenicum (restless/rapid pulse), Digitalis is slow + calm."},
{"name":"APOCYNUM CANNABINUM","src":"Indian Hemp",
"action":"Powerful hydragogue — acts on serous membranes and kidneys. Stimulates diuresis + acts on right heart and venous circulation. Addresses mechanical consequences of R-HF: ↑ portal/systemic venous pressure → ascites/anasarca/pleural effusion. Also indicated in mitral + tricuspid regurgitation.",
"symptoms":"• Ascites + anasarca — the DROPSY remedy par excellence\n• Nausea + vomiting with cardiac oedema\n• Scanty urine despite massive fluid accumulation\n• Oppression of chest; difficult breathing\n• Palpitations with weak, intermittent pulse\n• Mitral / tricuspid regurgitation symptoms\n• Great debility + prostration\n• Abdomen hard, tense; tympanitic ascites\nWHY: Targets ↑ venous pressure → ascites + bilateral pleural effusion of R-HF",
"mod":"Worse: cold air, uncovering. Better: warmth.",
"potency":"Q (tincture) for acute dropsy; 3x–30C",
"compare":"More DROPSY/ASCITES focused than Digitalis. Overlaps with Arsenicum (restlessness) but Apocynum is prostrated, not anxious. Unlike Crataegus (chronic), Apocynum is more acute."},
{"name":"CONVALLARIA MAJALIS","src":"Lily of the Valley",
"action":"Contains cardiac glycosides (convallotoxin) — milder than Digitalis. Specifically for RIGHT HEART FAILURE + venous stasis. Increases contractile force → ↑ CO → ↑ renal perfusion → diuresis → breaks RAAS cycle. Best for RV hypertrophy/dilatation with venous congestion of extremities.",
"symptoms":"• RIGHT-sided cardiac hypertrophy with venous stasis\n• Palpitation from least exertion\n• Oedema of lower limbs with venous engorgement\n• Whole chest feels occupied by heart (extreme dyspnoea)\n• Tobacco heart — cardiac irritability from tobacco\n• Paroxysmal tachycardia alternating with bradycardia\n• Anasarca with scanty urine\nWHY: RV hypertrophy from chronic ↑ afterload → venous congestion — Convallaria addresses specifically",
"mod":"Worse: least exertion, warm room. Better: fresh air.",
"potency":"Q / 3x physiological; 30C constitutional",
"compare":"More RIGHT-sided than Digitalis (biventricular). Specific for tobacco-related cardiac irritability. Less dropsical than Apocynum. Milder and safer than Digitalis in acute settings."},
{"name":"CRATAEGUS OXYACANTHA","src":"Hawthorn Berry",
"action":"Flavonoids + OPCs → ACE inhibition (↓ Ang II → ↓ aldosterone → ↓ Na/H₂O retention). Also mild positive inotrope, coronary/peripheral vasodilator, antioxidant. Acts on the RAAS compensatory arm — mirrors modern HF therapy. Long-term trophorestorative action on myocardium.",
"symptoms":"• Chronic HF — very FEEBLE, IRREGULAR, weak pulse\n• Extreme weakness; dyspnoea on minimal exertion\n• Arteriosclerosis + valvular disease\n• Sensation heart will stop if patient falls asleep\n• Angina with cardiac weakness\n• Hypertension with weak heart\n• Oedema, dizziness, faintness, pallor\nWHY: Chronic ↓ CO + arteriosclerosis + RAAS-driven secondary hypertension — acts on both pump weakness and neurohormonal arm",
"mod":"Worse: warm room, exertion. Better: rest, fresh air.",
"potency":"Q / 1x–3x trophorestorative; 30C–200C constitutional",
"compare":"Unlike Digitalis (acute/subacute), Crataegus is for CHRONIC HF. SAFER for long-term use. No acute glycoside effect like Digitalis. Best as adjuvant/preventive alongside conventional therapy."},
{"name":"ARSENICUM ALBUM","src":"Arsenic Trioxide",
"action":"Acts on SNS/anxiety arm of cardiac pathophysiology. In HF, SNS activation → tachycardia, vasoconstriction, anxiety. Arsenicum addresses: ↑ capillary permeability, renal involvement (oliguria/anasarca), and the extreme restlessness that accompanies decompensated HF. Key for cardiac asthma.",
"symptoms":"• Extreme RESTLESSNESS + ANXIETY with cardiac complaints\n• Oedema WORSE AFTER MIDNIGHT (1–3 AM) — classic keynote\n• Dyspnoea worse lying down — orthopnoea\n• Cold extremities despite restlessness (SNS vasoconstriction)\n• Burning pains paradoxically relieved by heat\n• Cardiac asthma — midnight attacks of dyspnoea\n• Anasarca with scanty dark urine\n• Thirst for small sips frequently\nWHY: Decompensated HF → ↑ SNS → restlessness/vasoconstriction; Arsenicum addresses this neurogenic arm",
"mod":"Worse: midnight–2 AM, cold, wet. Better: warmth, sitting up, company.",
"potency":"30C–1M for acute dyspnoea/anxiety crises",
"compare":"Unlike Digitalis (slow pulse, calm), Arsenicum has RAPID pulse + extreme anxiety. Unlike Apocynum (prostrated/quiet), Arsenicum is restless. Unlike Crataegus (chronic/mild), Arsenicum suits acute decompensation."},
]
# ──────────── RENAL OEDEMA — NEPHROTIC ───────────────────────────────────────
RENAL_INV = [
("24-hr Urine Protein / Spot PCR","Confirm proteinuria ≥3.5 g/day — hallmark of nephrotic",
"GBM damage → charge barrier loss → albumin leaks → hypoalbuminaemia → ↓ oncotic pressure → oedema",
"≥3.5 g/day; spot PCR >3.5","1st line at presentation"),
("Serum Albumin","Hypoalbuminaemia drives oncotic-pressure-dependent oedema",
"Albumin <2.5 g/dL → plasma oncotic < hydrostatic → transudation into interstitium",
"<3.0 g/dL (often <2.5 g/dL in full nephrotic syndrome)","Presentation + monitoring"),
("Lipid Profile","Hyperlipidaemia — part of nephrotic triad",
"↓ Albumin → ↑ hepatic lipoprotein synthesis (compensation) → hypercholesterolaemia + hypertriglyceridaemia",
"↑ Total cholesterol, LDL, triglycerides; lipiduria on microscopy","Baseline"),
("Renal Biopsy","Identify histological cause (MCD, FSGS, membranous, diabetic nephropathy)",
"Different GBM/podocyte pathologies produce nephrotic; biopsy guides specific treatment",
"MCD: EM foot-process effacement; FSGS: segmental sclerosis; Membranous: spike-and-dome",
"Adults, non-diabetic, or steroid-resistant"),
("Complement C3/C4, ANA, ANCA, Anti-dsDNA","Rule out secondary causes: SLE, vasculitis",
"Immune complex deposition in SLE nephritis → nephrotic syndrome",
"↓ C3/C4 in SLE/MPGN; +ANA/anti-dsDNA in SLE; +ANCA in vasculitis","Baseline all adults"),
("HbA1c + Fasting Glucose","Diabetic nephropathy — most common adult nephrotic cause",
"Glycation of GBM → loss of selective filtration → proteinuria → hypoalbuminaemia",
"HbA1c >6.5%; Kimmelstiel-Wilson nodules on biopsy","Baseline"),
("Renal Ultrasound","Renal size, echogenicity, guide biopsy",
"↓ Renal perfusion (RAAS) may show ↓ renal size in chronic disease",
"Enlarged/normal in MCD; small echogenic kidneys in chronic nephropathy","Baseline"),
]
RENAL_REM = [
{"name":"APIS MELLIFICA","src":"Honeybee venom",
"action":"Acts on ONCOTIC PRESSURE arm — addresses ↑ capillary permeability + serous exudation. Suited to PERIORBITAL/facial oedema. ↑ Capillary permeability → transudation; Apis promotes diuresis + reduces serous oedema. Classic keynote matches morning periorbital puffiness of nephrotic syndrome.",
"symptoms":"• BAG-LIKE periorbital oedema worse in morning — classic nephrotic keynote\n• Oedema shiny, transparent, gelatinous — 'waxy'\n• Scanty, dark, albuminous urine (matches proteinuria)\n• Stinging, burning pains in kidney region\n• NO THIRST — key distinguishing feature\n• Worse from heat; better from cold applications\n• Restless, fidgety behaviour\nWHY: Facial oedema from ↓ oncotic pressure → matches hypo-oncotic picture of nephrotic",
"mod":"Worse: heat, warm room, pressure. Better: cold applications, open air.",
"potency":"6C–30C",
"compare":"Unlike Arsenicum (anxious, thirsty, warm-better-cold), Apis has NO thirst + better from COLD. Unlike Helleborus (stuporous, dark turbid urine), Apis has shiny transparent oedema."},
{"name":"HELLEBORUS NIGER","src":"Christmas Rose",
"action":"Specific for nephrotic oedema with dark/scanty urine + cerebral involvement. Acts on renal tubules to restore urine output. Addresses cerebral sluggishness from uraemia/hypoalbuminaemia. Suited to advanced/severe nephrotic cases.",
"symptoms":"• Generalised dropsical oedema — puffiness of whole face\n• Scanty, DARK, turbid, coffee-ground urine (albuminuria)\n• Cerebral sluggishness — stupor, automatic movements\n• Suppressed urine + anasarca\n• Muscular twitching, convulsions\n• Dilated pupils; unconscious picking at lips\nWHY: Severe nephrotic + uraemic state (↓ GFR + accumulating waste products) produces this cerebral picture",
"mod":"Worse: suppressed secretions, cold. Better: warmth.",
"potency":"3x–30C",
"compare":"More CEREBRAL/URAEMIC than Apis. Darker more turbid urine than Apis' clear albuminous urine. Best for advanced nephrotic + CNS involvement."},
{"name":"ARSENICUM ALBUM","src":"Arsenic Trioxide",
"action":"In nephrotic: addresses hypoalbuminaemia → ↓ oncotic pressure → interstitial oedema + ascites. Acts on renal epithelium to reduce proteinuria in some cases. Covers secondary RAAS activation in nephrotic syndrome + pulmonary involvement (pleural effusion).",
"symptoms":"• Generalised oedema + great prostration + anxiety\n• Oedema worse AFTER MIDNIGHT\n• Urine scanty, dark, albuminous, burning on passage\n• THIRST for small sips frequently (unlike Apis)\n• Dyspnoea — pleural effusion / ascites from ↓ oncotic\n• Burning relieved by heat\n• Waxy pallor of face; anasarca\nWHY: ↓ Albumin → diffuse exudation; RAAS activation worsens fluid retention",
"mod":"Worse: midnight–2 AM, cold, exertion. Better: warmth, sitting up.",
"potency":"30C–200C",
"compare":"Arsenicum has THIRST (Apis has none); Arsenicum is RESTLESS/ANXIOUS (Helleborus is stuporous). Both have anasarca but mental picture distinguishes sharply."},
{"name":"LYCOPODIUM CLAVATUM","src":"Club Moss spores",
"action":"Primary action on LIVER + KIDNEYS. In nephrotic: addresses secondary hepatic involvement (hypoalbuminaemia strains liver synthetic function) and covers hyperlipidaemia component (hepatic overproduction). Also covers secondary RAAS activation (right-sided abdominal symptoms).",
"symptoms":"• Oedema more RIGHT-sided\n• Urine cloudy, milky, turbid with deposits; dark at night\n• Urine with brick-dust (red/ammoniacal) sediment\n• Bloating of abdomen after eating (4–8 PM aggravation)\n• Desire for sweets; craving warm drinks\n• Weakness disproportionate to illness\nWHY: Lycopodium targets hepatorenal axis — liver ↓ synthesis + renal protein loss = combined pathology",
"mod":"Worse: right side, 4–8 PM, pressure of clothing. Better: warm drinks, motion.",
"potency":"30C–200C–1M",
"compare":"Unlike Apis (serous/shiny oedema), Lycopodium has liver + kidney dual involvement. Unlike Arsenicum (midnight), Lycopodium aggravates 4–8 PM. More suited to CHRONIC nephrotic."},
{"name":"PHOSPHORUS","src":"Elemental Phosphorus",
"action":"Acts on glomerular basement membrane (membranous nephropathy picture). Addresses haemorrhagic/inflammatory renal lesions with proteinuria + haematuria. Also covers pulmonary oedema from ↓ albumin (pleural effusion). Tall lean constitutionally sensitive patients.",
"symptoms":"• Urine dark, smoky, turbid + ALBUMINURIA + HAEMATURIA\n• Pitting oedema of face + lower limbs\n• Tendency to haemorrhage (petechiae, haematuria)\n• Pleural effusion + ascites from hypoalbuminaemia\n• Desire for cold water, ice cream\n• Burning in kidneys; liver fatty degeneration picture\nWHY: GBM damage → haematuria + proteinuria — Phosphorus targets this inflammatory/haemorrhagic picture",
"mod":"Worse: cold water, lying on left, twilight. Better: cold food, sleep.",
"potency":"30C–200C",
"compare":"Unlike Apis (no thirst), Phosphorus CRAVES cold water. Unlike Arsenicum (burning fear), Phosphorus has haemorrhagic tendency. Key: haematuria + albuminuria + tall lean constitution."},
]
# ──────────── HEPATIC OEDEMA ──────────────────────────────────────────────────
HEPATIC_INV = [
("LFTs (ALT, AST, ALP, GGT, Bilirubin)","Degree of hepatocellular damage + cholestasis",
"Fibrosis → ↓ hepatocyte mass → ↓ albumin synthesis; hepatocyte necrosis → ↑ transaminases",
"↑ ALT/AST (hepatocellular); ↑ ALP/GGT (cholestasis); ↑ bilirubin","1st line at presentation"),
("Serum Albumin + PT/INR","Hepatic synthetic function markers — both made in liver",
"Cirrhosis → ↓ hepatocyte synthesis → ↓ albumin (↓ oncotic → oedema) + ↓ clotting (↑ PT)",
"↓ Albumin <3.0 g/dL; prolonged PT/INR; drives Child-Pugh / MELD scoring","Baseline + serial monitoring"),
("Ascitic Fluid Analysis (Paracentesis)","Characterise ascites; exclude SBP",
"Portal HTN → low-protein transudate (SAAG >1.1 g/dL); SBP has PMN >250/mm³",
"SAAG ≥1.1 (portal HTN); protein <25 g/L; PMN count (SBP diagnosis)","When ascites confirmed"),
("Abdominal USS + Doppler","Liver morphology, portal vein patency, spleen, ascites volume",
"Portal HTN → hepatopetal→hepatofugal portal flow; splenomegaly from congestive spleen",
"Nodular echogenic liver; portal vein >13 mm; splenomegaly; reversed portal flow","1st line imaging"),
("Hepatitis B & C Serology","Most common causes of cirrhosis worldwide",
"Chronic viral hepatitis → necrosis → fibrosis → cirrhosis → portal HTN → oedema",
"HBsAg, anti-HBc, anti-HCV, HCV PCR","Baseline"),
("Fibroscan (Transient Elastography)","Non-invasive hepatic fibrosis staging",
"Fibrosis → ↑ liver stiffness; predicts degree of portal hypertension",
"Stiffness >12 kPa = cirrhosis; correlates with Metavir F-score","As non-invasive alternative to biopsy"),
("Plasma Aldosterone + Renin","Assess RAAS activation — mechanism of Na⁺ retention",
"↓ Effective arterial volume (splanchnic vasodilation) → ↑ renin → ↑ aldosterone → Na/H₂O retention",
"↑ Aldosterone; ↑ renin; liver fails to metabolise aldosterone → sustained action","Refractory ascites workup"),
("OGD (Endoscopy)","Assess oesophageal/gastric varices",
"Portal HTN → portosystemic collaterals → oesophageal varices → variceal haemorrhage risk",
"Grade varices; red wale signs = high bleed risk; initiate prophylaxis","After diagnosis of cirrhosis"),
]
HEPATIC_REM = [
{"name":"LYCOPODIUM CLAVATUM","src":"Club Moss spores",
"action":"PRIMARY LIVER REMEDY in homeopathy. Acts on hepatocytes to improve synthetic function, reduces portal congestion, addresses hypoalbuminaemia → oedema. Also addresses secondary RAAS (liver fails to metabolise aldosterone → hyperaldosteronism → Na⁺ retention → ascites).",
"symptoms":"• Ascites + abdominal bloating WORSE 4–8 PM\n• RIGHT-sided oedema predominantly\n• Jaundice with clay-coloured stools (obstructive component)\n• Great flatulence immediately after small meals\n• Craving sweets + warm drinks\n• Mental: domineering but cowardly; anticipatory anxiety\n• Dark turbid urine (hepatorenal)\nWHY: Portal HTN → ascites + right-sided congestion; ↓ albumin → oedema; ↑ aldosterone → Na retention",
"mod":"Worse: right side, 4–8 PM, cold food. Better: warm drinks, motion.",
"potency":"30C–1M",
"compare":"Most specific for HEPATIC oedema. Unlike Cardus Marianus (structural/physical), Lycopodium has rich constitutional picture. Unlike Chelidonium (biliary), Lycopodium covers overall hepatic failure."},
{"name":"CARDUUS MARIANUS","src":"Milk Thistle",
"action":"Contains silymarin — hepatoprotective, antioxidant, anti-inflammatory. Stabilises hepatocyte membranes → ↓ further fibrosis → preserves synthetic function → ↑ albumin → ↓ oedema. Direct action on portal circulation + spleen. Addresses venous congestion.",
"symptoms":"• Hepatic oedema + ascites from cirrhosis\n• LEFT-sided oedema + complaints\n• Liver enlarged + painful; stitching pains in liver/spleen\n• Jaundice (catarrhal / cirrhotic)\n• Nausea, vomiting of green bile\n• Splenomegaly with dull aching\n• Varicose veins / haemorrhages (variceal picture)\nWHY: Portal HTN → splenomegaly + variceal tendency + ascites; Cardus acts on vascular-portal picture",
"mod":"Worse: motion, lying on left side. Better: rest.",
"potency":"Q (mother tincture) or 3x–30C",
"compare":"More SPECIFIC structural liver remedy than Lycopodium. LEFT-sided (vs Lycopodium RIGHT). Carduus = structural damage; Lycopodium = functional/constitutional."},
{"name":"CHELIDONIUM MAJUS","src":"Greater Celandine",
"action":"Specific liver-bile duct remedy. Acts on bile flow + hepatocyte function. Addresses cholestatic component (↑ ALP/bilirubin). Promotes diuresis and addresses secondary renal involvement. Pain referred to right scapula is the hallmark.",
"symptoms":"• Jaundice with clay/grey stools (biliary obstruction)\n• PAIN UNDER RIGHT SCAPULA — classic keynote\n• Liver enlarged, hard; stitching pains\n• Tongue yellow, coated; bitter taste\n• Nausea better by eating (paradoxical classic)\n• Urine golden yellow (bilirubinuria)\n• Worse 4 AM and 4 PM (liver aggravation times)\nWHY: Biliary obstruction → cholestasis → jaundice; liver failure → ↓ albumin → oedema",
"mod":"Worse: right side, motion, 4 AM/PM. Better: hot milk, eating.",
"potency":"Q or 3x–30C",
"compare":"Unlike Lycopodium (4–8 PM bloating), Chelidonium has PAIN UNDER RIGHT SCAPULA. More for BILIARY/CHOLESTATIC pathology, less for pure portal hypertension."},
{"name":"ARSENICUM ALBUM","src":"Arsenic Trioxide",
"action":"In hepatic oedema: addresses ↓ albumin → ↓ oncotic → ascites/anasarca. Also addresses secondary RAAS: ↓ effective arterial volume → ↑ RAAS → Na retention. Key for alcoholic liver disease with anxiety, restlessness, great weakness.",
"symptoms":"• Ascites + great debility + FEAR OF DEATH\n• Extreme restlessness — moves but too weak\n• Thirst for small sips frequently\n• Oedema worse after midnight\n• Burning in liver region relieved by heat\n• Jaundice with waxy skin\n• Anorexia — cannot bear sight/smell of food\nWHY: ↓ Albumin → ascites + pleural effusion; splanchnic vasodilation → hypotension → sinking/prostration",
"mod":"Worse: midnight, cold. Better: heat, company.",
"potency":"30C–1M",
"compare":"Unlike Lycopodium (comfortable/domineering), Arsenicum is ANXIOUS/FEARFUL/RESTLESS. Unlike Carduus (physical congestion), Arsenicum = mental terror + physical sinking."},
{"name":"CHINA OFFICINALIS","src":"Peruvian Bark (Cinchona)",
"action":"Remedy for debility from repeated FLUID LOSS. In hepatic oedema, addresses post-paracentesis consequences (periodic drainage → hypoproteinaemia → rebound fluid). Also covers haemorrhagic tendency (oesophageal variceal bleeds) and post-haemorrhagic weakness.",
"symptoms":"• Oedema/ascites following repeated fluid loss (haemorrhage / paracentesis)\n• PERIODIC aggravation (every other day)\n• Extreme debility, anaemia after fluid loss\n• Abdomen bloated with flatulence; gas does not pass\n• Face earthy/sunken; dark circles under eyes\n• Tinnitus; ↑ sensitivity to touch\n• Haematuria; haemorrhage from various orifices\nWHY: Post-paracentesis rebound (↓ protein → ↓ oncotic → rapid reaccumulation of ascites)",
"mod":"Worse: touch, cold, every other day. Better: warmth.",
"potency":"6C–30C",
"compare":"Unlike Arsenicum (constant anxiety), China has PERIODICITY. Unlike Carduus (structural liver), China is for POST-HAEMORRHAGE/POST-DRAINAGE debility. Key: fluid loss as precipitating factor."},
]
# ──────────── LYMPHOEDEMA ─────────────────────────────────────────────────────
LYMPH_INV = [
("Lymphoscintigraphy","Gold standard — confirm lymphatic dysfunction + map drainage",
"Lymphatic obstruction (aplasia/hypoplasia or filarial) → stasis of protein-rich lymph",
"Delayed/absent tracer uptake; dermal backflow pattern","When diagnosis uncertain / pre-surgery"),
("Blood film + Nocturnal Microfilarial count","Confirm filarial lymphoedema",
"W. bancrofti microfilariae show NOCTURNAL PERIODICITY — blood at 10 PM–2 AM",
"Microfilariae on Giemsa thick film; Knott's concentration test","Nocturnal blood sample essential"),
("ICT Card Test / Filarial Ag ELISA","Detects circulating filarial antigen (W. bancrofti)",
"Adult worm antigens in blood = active infection even without microfilaraemia",
"Positive = active infection; useful even when microfilaraemia undetectable","1st line in endemic areas"),
("Duplex Ultrasound","Venous patency (exclude DVT); visualise dilated lymphatics",
"DVT can co-exist; dilated lymph channels visible in chronic lymphoedema",
"Patent deep veins; dilated lymphatic channels with echogenic fluid","Baseline — exclude venous cause"),
("CT / MRI Abdomen-Pelvis","Exclude malignancy, nodal mets, retroperitoneal fibrosis",
"Cancer invasion of lymphatics → secondary lymphoedema; CT identifies nodal enlargement",
"Lymph node enlargement; honeycomb subcutaneous pattern","When secondary malignant cause suspected"),
("Kaposi-Stemmer Sign (Clinical)","Clinical test for lymphoedema at base of 2nd toe",
"Chronic lymphoedema → subcutaneous fibrosis → inability to pinch skin fold",
"POSITIVE: Cannot pinch skin fold = lymphoedema (nearly pathognomonic)","At clinical examination"),
]
LYMPH_REM = [
{"name":"CALCAREA FLUORICA","src":"Calcium Fluoride",
"action":"Acts on connective tissue + lymphatics. Addresses FIBROSIS and INDURATION of chronic lymphoedema. Calcium fluoride is a component of fibroelastic tissue; its deficiency leads to fibroelastic changes. Reverses progressive fibrosis of lymphatic walls in chronic filarial lymphoedema.",
"symptoms":"• NON-PITTING, indurated, WOODY HARD oedema — classic keynote\n• Varicose veins, enlarged hard glands\n• Fibrotic hard indurations in subcutaneous tissue\n• Elephantiasis-like thickening of skin\n• Hard nodules along lymphatics\n• Cracks in skin over swollen area\nWHY: Filarial lymphoedema → fibrosis → indurated non-pitting oedema → Calc Fluor targets fibroelastic pathology",
"mod":"Worse: damp cold, rest. Better: heat, gentle rubbing.",
"potency":"6x (tissue salt) or 30C",
"compare":"Most specific for FIBROTIC non-pitting lymphoedema. Unlike Apis (hot/shiny/acute), Calc Fluor is cold, hard, chronic. Unlike Graphites (moist/oozing), Calc Fluor is predominantly indurated."},
{"name":"APIS MELLIFICA","src":"Honeybee venom",
"action":"Acts on ACUTE inflammatory lymphoedema — ↑ capillary + lymphatic permeability. In acute filarial lymphangitis: inflammatory response → ↑ vascular permeability → protein-rich exudate. Apis addresses this hot, exudative, stinging phase of acute filarial attack.",
"symptoms":"• SHINY, TRANSPARENT, HOT, burning oedema\n• Stinging burning pains (like bee sting)\n• BETTER from cold applications — pathognomonic\n• No thirst despite swelling\n• Acute lymphangitis with fiery red linear streaking\n• Urticaria, allergic oedema\n• Worse from heat in every form\nWHY: Acute filarial attack → inflammatory lymphangitis → Apis matches hot, stinging, exudative picture",
"mod":"Worse: heat, touch, pressure. Better: cold application.",
"potency":"6C–30C in acute phase",
"compare":"Acute vs Calc Fluor (chronic fibrosis). Unlike Rhus Tox (better from motion/warmth), Apis definitively BETTER FROM COLD. Most useful in ACUTE filarial lymphangitis attacks."},
{"name":"GRAPHITES","src":"Black Lead (Graphite)",
"action":"Affinity for lymphatics + skin. Addresses chronic oedema with thickened, cracked, leaking skin. Acts on the cellulite-like fibrofatty deposition in chronic lymphoedema. Key for skin-lymphatic axis in long-standing cases.",
"symptoms":"• Chronic lymphoedema with OOZING, CRACKED, MOIST skin\n• Sticky, honey-like discharge from skin cracks\n• Thick, indurated skin with pigmentation changes\n• Tendency to keloid/fibrotic scar formation\n• Obese, chilly, constipated constitution\n• Swelling of cervical/inguinal lymph nodes\nWHY: Chronic lymphoedema → skin fibrosis → breaks → sticky exudate; Graphites addresses skin-lymphatic axis",
"mod":"Worse: cold, damp, right side. Better: warmth, wrapping.",
"potency":"30C–200C",
"compare":"Unlike Calc Fluor (hard/woody), Graphites has MOIST, STICKY, OOZING skin. Unlike Apis (hot/acute), Graphites is chronic + chilly. Suits OBESE constitution."},
{"name":"RHUS TOXICODENDRON","src":"Poison Ivy",
"action":"Acts on fibrous tissues, fasciae, periarticular lymphatics. In lymphoedema with joint stiffness (filariasis, DVT with fascial stiffness), Rhus Tox addresses lymphatic oedema with characteristic restlessness and worse-on-first-movement pattern.",
"symptoms":"• Oedema with STIFFNESS + RESTLESSNESS — must keep moving\n• WORSE on first movement; BETTER on continued motion\n• Hot, swollen, erythematous oedema with vesicular eruptions\n• Acute filarial lymphangitis with fever + aching + restlessness\n• Tearing, stitching pains in swollen limb\n• Fever with bone-aching during acute filarial attack\nWHY: Acute filarial attack → fever + lymphangitis + fascial stiffness → Rhus Tox matches febrile restless picture",
"mod":"Worse: rest, cold, damp. Better: warm applications, motion.",
"potency":"30C–200C",
"compare":"Unlike Apis (better from cold/rest), Rhus Tox BETTER FROM MOTION + HEAT. More for ACUTE FEBRILE filarial lymphangitis. Unlike Calc Fluor (cold/fibrotic), Rhus Tox is warm + restless."},
{"name":"SILICEA (SILICA)","src":"Pure Flint",
"action":"Acts on LYMPH NODES + lymphatic vessels — promotes maturation and resolution of chronic lymphatic induration. Silicea promotes suppuration and expulsion of foreign bodies (filarial debris). Improves connective tissue vitality. Key for immune-compromised lymphatic states.",
"symptoms":"• Chronic lymphoedema + hard, enlarged, FIXED lymph nodes\n• Recurrent lymphangitis/lymphadenitis → tends to suppurate\n• Fistula formation from chronic lymph node abscess\n• Cold, sweaty hands and feet\n• Timid, yielding constitution; slow healing\n• Scars break open; wounds heal poorly\nWHY: Filarial debris in lymphatics = foreign body; Silicea promotes its elimination + resolves chronic induration",
"mod":"Worse: cold, uncovering, damp. Better: warmth, wrapping.",
"potency":"6x (tissue salt) chronic; 200C–1M constitutional",
"compare":"Unlike Graphites (oozing skin), Silicea is for LYMPH NODE induration + abscess-prone. Unlike Calc Fluor (fibroelastic), Silicea is for IMMUNE/SUPPURATIVE lymphatic pathology."},
]
# ══════════════════════════════════════════════════════════════════════════════
# RECORD positions BEFORE adding new slides
# ══════════════════════════════════════════════════════════════════════════════
orig_count = len(prs.slides) # 35
print(f"Original slides: {orig_count}")
# ── ADD ALL NEW SLIDES (appended at end) ────────────────────────────────────
# BLOCK A: Cardiac (after slide 11 = index 10)
section_slide("CARDIAC OEDEMA — INVESTIGATIONS",
"Right Heart Failure | Rationale, Timing & Pathophysiological Correlation")
inv_slides("RIGHT HEART FAILURE", CARDIAC_INV)
section_slide("CARDIAC OEDEMA — HOMEOPATHIC REMEDIES",
"Right Heart Failure | Remedy Selection, Pathophysiological Action & Compare-Contrast")
remedy_slides("CARDIAC OEDEMA (R-HF)", CARDIAC_REM)
# BLOCK B: Renal (after slide 12 = index 11)
section_slide("RENAL OEDEMA — INVESTIGATIONS",
"Nephrotic Syndrome | Rationale, Timing & Pathophysiological Correlation")
inv_slides("NEPHROTIC SYNDROME", RENAL_INV)
section_slide("RENAL OEDEMA — HOMEOPATHIC REMEDIES",
"Nephrotic Syndrome | Remedy Selection, Pathophysiological Action & Compare-Contrast")
remedy_slides("RENAL OEDEMA (NEPHROTIC)", RENAL_REM)
# BLOCK C: Hepatic (after slide 13 = index 12)
section_slide("HEPATIC OEDEMA — INVESTIGATIONS",
"Liver Cirrhosis / Portal Hypertension | Rationale, Timing & Pathophysiological Correlation")
inv_slides("HEPATIC OEDEMA (CIRRHOSIS)", HEPATIC_INV)
section_slide("HEPATIC OEDEMA — HOMEOPATHIC REMEDIES",
"Liver Cirrhosis | Remedy Selection, Pathophysiological Action & Compare-Contrast")
remedy_slides("HEPATIC OEDEMA", HEPATIC_REM)
# BLOCK D: Lymphoedema (after slide 18 = index 17, filariasis)
section_slide("LYMPHOEDEMA — INVESTIGATIONS",
"Primary / Filarial Lymphoedema | Rationale, Timing & Pathophysiological Correlation")
inv_slides("LYMPHOEDEMA", LYMPH_INV)
section_slide("LYMPHOEDEMA — HOMEOPATHIC REMEDIES",
"Primary / Filarial Lymphoedema | Remedy Selection, Pathophysiological Action & Compare-Contrast")
remedy_slides("LYMPHOEDEMA", LYMPH_REM)
new_total = len(prs.slides)
added = new_total - orig_count
print(f"Added {added} slides. Total now: {new_total}")
# ── REORDER: build desired permutation ────────────────────────────────────────
# Count slides per block
# BLOCK A: 1 + ceil(10/5) + 1 + 5+1 = 1+2+1+6 = 10
# BLOCK B: 1 + ceil(7/5) + 1 + 5+1 = 1+2+1+6 = 10
# BLOCK C: 1 + ceil(8/5) + 1 + 5+1 = 1+2+1+6 = 10
# BLOCK D: 1 + ceil(6/5) + 1 + 5+1 = 1+2+1+6 = 10
# Let's compute exactly
def block_size(inv_rows, rem_list):
inv_slides_count = -(-len(inv_rows) // 5) # ceiling div
return 1 + inv_slides_count + 1 + len(rem_list) + 1 # section + inv + section + remedy slides + compare
sA = block_size(CARDIAC_INV, CARDIAC_REM)
sB = block_size(RENAL_INV, RENAL_REM)
sC = block_size(HEPATIC_INV, HEPATIC_REM)
sD = block_size(LYMPH_INV, LYMPH_REM)
print(f"Block sizes: A={sA}, B={sB}, C={sC}, D={sD}, total={sA+sB+sC+sD}")
assert sA+sB+sC+sD == added, f"Mismatch: {sA+sB+sC+sD} vs {added}"
# Start indices of each block (currently appended at end)
bA_start = orig_count
bB_start = orig_count + sA
bC_start = orig_count + sA + sB
bD_start = orig_count + sA + sB + sC
# Desired final order:
# orig 0..10, BLOCK_A, orig 11, BLOCK_B, orig 12, BLOCK_C, orig 13..17, BLOCK_D, orig 18..34
desired = (
list(range(0, 11)) + # orig slides 0-10
list(range(bA_start, bA_start + sA)) + # BLOCK A
[11] + # orig slide 11 (Renal Oedema)
list(range(bB_start, bB_start + sB)) + # BLOCK B
[12] + # orig slide 12 (Hepatic Oedema)
list(range(bC_start, bC_start + sC)) + # BLOCK C
list(range(13, 18)) + # orig slides 13-17 (Other/Filariasis)
list(range(bD_start, bD_start + sD)) + # BLOCK D
list(range(18, 35)) # orig slides 18-34
)
print(f"Desired order length: {len(desired)}, Total slides: {new_total}")
assert len(desired) == new_total, "Length mismatch!"
assert sorted(desired) == list(range(new_total)), "Not a valid permutation!"
# Apply reorder using XML manipulation
xml_slides = prs.slides._sldIdLst
slide_ids = list(xml_slides) # current order of <p:sldId> elements
# Build new order list
new_order = [slide_ids[i] for i in desired]
# Remove all and re-append in desired order
for s in slide_ids:
xml_slides.remove(s)
for s in new_order:
xml_slides.append(s)
print(f"Reordered. Final slide count: {len(prs.slides)}")
# Save
prs.save(OUT)
print(f"Saved: {OUT}")
cd /tmp/workspace/oedema_output && python3 build_enhanced.py 2>&1
python3 -c " from pptx import Presentation prs = Presentation('/tmp/workspace/oedema_output/OEDEMA_ENHANCED.pptx') print(f'Total slides: {len(prs.slides)}') for i, slide in enumerate(prs.slides, 1): texts = [s.text_frame.text.strip()[:60] for s in slide.shapes if s.has_text_frame and s.text_frame.text.strip()] label = texts[0] if texts else '(empty)' print(f' {i:2d}. {label}') " 2>&1
i had just gave u example od RHF but hve to do same for each and every disease mentioned in ppt ask me if u have any question regarding it
wait
ask the 2nd ques again i did not read it
yes but if possible add investigation in drug induced also with homeopath
where is my enhanced ppt?
where is my enhanced ppt?
where is my enhanced ppt? what are u doing my credit will be used up like this!!!
?
what r u doing since half and hour !!!!!
do it fast
?
?
i had just gave u example od RHF but hve to do same for each and every disease mentioned in ppt ask me if u have any question regarding it
?