attachment
attachment

Homeopathic medicine for this ent disease create a pdf

analyse_media
Reading File
Running Command

mkdir -p /tmp/workspace/ent-homeopathy && ls /tmp/workspace/ent-homeopathy/

Writing File

~/ent-homeopathy/generate_pdf.py

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import KeepTogether

# ENT diseases and their homeopathic medicines
ent_data = [
    {
        "name": "ASOM (Acute Suppurative Otitis Media)",
        "description": "Acute bacterial infection of middle ear causing pus formation, ear pain and fever.",
        "remedies": [
            ("Belladonna 30C", "Early stage with sudden onset, intense throbbing pain, high fever, redness; drum appears red and bulging."),
            ("Pulsatilla 30C", "Thick yellow-green bland discharge, pain worse in warm room, better open air; weepy child."),
            ("Hepar Sulph 30C", "Hypersensitivity to touch/cold; offensive pus; stitching pain; child irritable and chilly."),
            ("Chamomilla 30C", "Unbearable pain; extreme irritability; one cheek red, one pale; useful in children."),
            ("Mercurius Solubilis 30C", "Offensive fetid discharge; profuse sweating; salivation; pain worse at night."),
        ]
    },
    {
        "name": "CSOM (Chronic Suppurative Otitis Media)",
        "description": "Persistent middle ear infection lasting >3 months with tympanic membrane perforation and discharge.",
        "remedies": [
            ("Kali Muriaticum 30C", "Crackling sounds in ear; Eustachian tube blockage; thick white or grey discharge."),
            ("Silicea 30C", "Chronic offensive discharge; slow healing perforations; chilly, timid constitution."),
            ("Calcarea Carbonica 30C", "Offensive otorrhoea; impaired hearing; useful in fair, fat, flabby children."),
            ("Psorinum 200C", "Intensely offensive, brown discharge; chronic cases with low vitality."),
            ("Tellurium 30C", "Acrid, watery, offensive discharge; itching in ear canal; ringworm-like eruptions."),
        ]
    },
    {
        "name": "Epistaxis (Nosebleed)",
        "description": "Bleeding from nasal mucosa, commonly from Little's area on the anterior nasal septum.",
        "remedies": [
            ("Phosphorus 30C", "Bright red bleeding, thin, non-clotting; worse from blowing nose; tall, slender constitution."),
            ("Hamamelis Q", "Passive, dark venous blood; traumatic epistaxis; feeling of fullness and congestion."),
            ("Millefolium Q", "Active bright red bleeding; epistaxis with vicarious menstruation; plethoric subjects."),
            ("Ipecac 30C", "Bright red bleeding with nausea; persistent bleeding with no clot formation."),
            ("Arnica Montana 30C", "Post-traumatic epistaxis; bruised sore feeling; after injury or fall."),
        ]
    },
    {
        "name": "Mastoiditis",
        "description": "Infection of mastoid air cells, typically a complication of ASOM.",
        "remedies": [
            ("Capsicum 30C", "Burning pain behind ear; tenderness over mastoid; chilly patient; pain worse cold."),
            ("Aurum Metallicum 30C", "Bone involvement; periosteal pains; offensive discharge; caries of mastoid."),
            ("Silicea 30C", "Chronic mastoid infection; fistula formation; slow healing tendency; chilly."),
            ("Hepar Sulph 30C", "Acute stage with hypersensitivity; abscess formation; offensive pus; extreme chilliness."),
            ("Merc Sol 30C", "Bone destruction; offensive otorrhoea; worse at night; profuse sweating."),
        ]
    },
    {
        "name": "Vertigo",
        "description": "Illusion of rotatory movement; commonly from inner ear (labyrinthine) disorders.",
        "remedies": [
            ("Conium Maculatum 30C", "Vertigo on turning head/rising from seat; worse lying down; horizontal motion."),
            ("Cocculus Indicus 30C", "Motion sickness vertigo; nausea and vomiting; hollow empty feeling in head."),
            ("Gelsemium 30C", "Vertigo with dullness and heaviness of head; better micturition; band sensation."),
            ("Belladonna 30C", "Acute vertigo with congestion; sensation as if things rotate; worse lying down."),
            ("Bryonia 30C", "Vertigo on slightest motion; better absolute rest; bursting headache accompanying."),
        ]
    },
    {
        "name": "Deafness (Hearing Loss)",
        "description": "Reduction in ability to hear sounds; may be conductive or sensorineural.",
        "remedies": [
            ("Kali Muriaticum 30C", "Eustachian tube catarrh; crackling on blowing nose; conductive deafness."),
            ("Calcarea Carbonica 30C", "Deafness with polyp formation; cracking in ears; impaired hearing from cold."),
            ("China Officinalis 30C", "Ringing and roaring tinnitus with deafness; debility after fluid loss."),
            ("Pulsatilla 30C", "Deafness from catarrhal conditions; stopped sensation; better open air."),
            ("Phosphoricum Acidum 30C", "Gradual deafness from debility; after grief or exhausting diseases."),
        ]
    },
    {
        "name": "Laryngitis",
        "description": "Inflammation of the larynx causing hoarseness, sore throat, and dry cough.",
        "remedies": [
            ("Aconite Napellus 30C", "Sudden onset from exposure to cold dry wind; early stage; anxiety with symptoms."),
            ("Phosphorus 30C", "Loss of voice especially in singers/speakers; larynx very painful; worse talking."),
            ("Causticum 30C", "Chronic laryngitis; voice lost every winter; hoarseness worse morning; urine escapes on coughing."),
            ("Argentum Nitricum 30C", "Laryngitis of singers and speakers; splinter-like pain; mucus on vocal cords."),
            ("Spongia Tosta 30C", "Croupy barking cough; dry burning larynx; better warm drinks; worse before midnight."),
        ]
    },
    {
        "name": "Hoarseness of Voice",
        "description": "Abnormal change in voice; rough, raspy voice from laryngeal or vocal cord pathology.",
        "remedies": [
            ("Causticum 30C", "Most prominent remedy; hoarseness worse mornings; paralytic weakness of vocal cords."),
            ("Phosphorus 30C", "Total aphonia; painful larynx; worse cold air and talking; hoarseness in singers."),
            ("Rhus Toxicodendron 30C", "Hoarseness from overuse of voice; better after warming up; stiffness sensation."),
            ("Manganum Aceticum 30C", "Chronic hoarseness; voice lost by reading aloud; larynx very sensitive."),
            ("Carbo Vegetabilis 30C", "Hoarseness in evenings; voice rough, deep; worse damp cold weather; debilitated patient."),
        ]
    },
    {
        "name": "Stridor",
        "description": "High-pitched breathing sound from turbulent airflow through narrowed airway.",
        "remedies": [
            ("Spongia Tosta 30C", "Crowing stridor; croup-like breathing; dry barking cough; better warm drinks."),
            ("Sambucus Nigra 30C", "Infantile stridor; sudden awakening with suffocation; dry coryza; cyanotic spells."),
            ("Aconite 30C", "Croupy stridor from cold exposure; sudden violent onset; great anxiety and restlessness."),
            ("Drosera 200C", "Spasmodic stridor; whooping-cough type; crowing sound; worse after midnight."),
            ("Hepar Sulph 30C", "Croupy stridor with loose mucus; worse cold; child holds throat; very sensitive."),
        ]
    },
    {
        "name": "Common Cold (Acute Coryza)",
        "description": "Viral upper respiratory infection causing nasal congestion, rhinorrhoea, sneezing.",
        "remedies": [
            ("Aconite 30C", "First 24-48 hours; sudden onset from cold dry wind; fever, anxiety, thirst."),
            ("Allium Cepa 30C", "Profuse watery acrid nasal discharge; bland eye discharge; sneezing; better open air."),
            ("Gelsemium 30C", "Slow onset; dullness, dizziness, drowsiness; watery discharge; no thirst; influenza type."),
            ("Euphrasia 30C", "Bland nasal discharge with acrid eye discharge (opposite of Allium Cepa)."),
            ("Nux Vomica 30C", "Stuffed nose especially at night and outdoors; fluent indoors; irritable and chilly."),
        ]
    },
    {
        "name": "Allergic Rhinitis",
        "description": "IgE-mediated nasal inflammation from allergen exposure; sneezing, itching, congestion.",
        "remedies": [
            ("Allium Cepa 30C", "Profuse burning nasal discharge; sneezing; better open air; worse warm room."),
            ("Sabadilla 30C", "Violent sneezing fits; copious watery discharge; itching of soft palate; better warm room."),
            ("Arundo Mauritanica 30C", "Burning and itching of eyes, ears, nose and palate; coryza; sneezing."),
            ("Wyethia 30C", "Dry itching in posterior nares and pharynx; constant desire to swallow; uvula elongated."),
            ("Histaminum 30C", "Isopathic remedy for allergic states; histamine sensitivity; hay fever."),
        ]
    },
    {
        "name": "Nasal Polyp",
        "description": "Non-neoplastic edematous outgrowth of sinonasal mucosa; bilateral, insensitive, glistening.",
        "remedies": [
            ("Calcarea Carbonica 30C", "Most common remedy; polyps in fat, fair, flabby, cold-sensitive patients; obstructed nose."),
            ("Teucrium Marum 200C", "Specific for nasal polyps; obstruction on alternating sides; crawling in nose; sneezing."),
            ("Sanguinaria Nitricum 30C", "Nasal polyps with dry coryza; loss of smell; right-sided symptoms."),
            ("Lemna Minor Q", "Nasal polyps with loss of smell; aggravation in wet weather; moist obstructed nose."),
            ("Thuja Occidentalis 200C", "Polyps in nose and ears; left-sided preference; post-vaccination history."),
        ]
    },
    {
        "name": "Maxillary Sinusitis",
        "description": "Inflammation of maxillary sinuses; facial pain below eyes, nasal obstruction, post-nasal drip.",
        "remedies": [
            ("Kali Bichromicum 30C", "Thick ropy stringy yellow-green discharge; pressure at root of nose; crusts in nose."),
            ("Mercurius Solubilis 30C", "Greenish offensive discharge; facial bone pains; worse at night and temperature changes."),
            ("Silicea 30C", "Chronic sinusitis; offensive discharge; facial pain; chilly constitution; slow healing."),
            ("Hydrastis Canadensis Q", "Thick yellow mucus; post-nasal drip; raw soreness; catarrhal states of mucous membranes."),
            ("Pulsatilla 30C", "Bland thick yellow-green discharge; worse warm room; better cold open air; no thirst."),
        ]
    },
    {
        "name": "Chronic Tonsillitis",
        "description": "Recurrent or persistent tonsil infection with enlarged, scarred, or cryptic tonsils.",
        "remedies": [
            ("Baryta Carbonica 30C", "Tonsils inflamed and enlarged in children; every cold settles in throat; mentally backward."),
            ("Calcarea Carbonica 30C", "Recurring tonsillitis in fat fair children; pus formation; impaired hearing from enlarged tonsils."),
            ("Hepar Sulph 30C", "Suppurating tonsils; stitching pain on swallowing; fish-bone sensation; very chilly."),
            ("Phytolacca 30C", "Dark red/bluish-red tonsils; pain radiates to ears on swallowing; burning; right-sided."),
            ("Belladonna 30C", "Acute tonsillitis; bright red inflamed throat; high fever; difficulty swallowing."),
        ]
    },
    {
        "name": "Pharyngitis",
        "description": "Inflammation of the pharynx causing sore throat, dysphagia, and constitutional symptoms.",
        "remedies": [
            ("Argentum Nitricum 30C", "Splinter-like pain in throat; mucus on fauces; impulsive; craves sweets."),
            ("Apis Mellifica 30C", "Oedematous swollen throat; stinging burning pain; worse heat; better cold applications."),
            ("Lachesis 200C", "Left-sided or left-to-right extending; worse on empty swallowing; worse sleep onset."),
            ("Lycopodium 200C", "Right-to-left extension; worse 4-8 pm; warm drinks relieve; chronic pharyngeal catarrh."),
            ("Phytolacca 30C", "Dark red pharynx; pain to ears on swallowing; right-sided; follicular pharyngitis."),
        ]
    },
    {
        "name": "Thyroglossal Cyst",
        "description": "Congenital midline neck cyst from remnant of thyroglossal duct; moves on swallowing/tongue protrusion.",
        "remedies": [
            ("Calcarea Carbonica 200C", "Cystic swellings in neck; soft tissue cysts; scrofulous constitution; cold and damp aggravation."),
            ("Silicea 200C", "Abscess tendency in cysts; promotes resolution or rupture; slow healing; chilly patient."),
            ("Thuja Occidentalis 200C", "Cystic tumors and polyps; left-sided swellings; history of vaccination; warty growths."),
            ("Graphites 30C", "Cystic swellings; indurated glands; sticky oozing from skin; chilly constitution."),
            ("Iodium 30C", "Thyroid region swellings; glandular enlargement; emaciation despite eating; hot constitution."),
        ]
    },
    {
        "name": "Cleft Palate",
        "description": "Congenital failure of palatal shelves to fuse; causes feeding difficulties and speech problems.",
        "remedies": [
            ("Calcarea Phosphorica 200C", "Constitutional remedy for bone defects; delayed ossification; peevish, thin children."),
            ("Silicea 200C", "Defective bone and connective tissue formation; supports post-surgical healing."),
            ("Calcarea Fluorica 200C", "Structural/hard tissue defects; enamel hypoplasia; dental and bony abnormalities."),
            ("Tuberculinum 1M", "Constitutional when hereditary/miasmatic background; recurring respiratory issues."),
            ("Thuja Occidentalis 200C", "Congenital anomalies from sycotic miasm; wart-like growths; vaccination history."),
        ]
    },
]

# Generate PDF
doc = SimpleDocTemplate(
    "/tmp/workspace/ent-homeopathy/ENT_Homeopathic_Medicines.pdf",
    pagesize=A4,
    rightMargin=2*cm,
    leftMargin=2*cm,
    topMargin=2.5*cm,
    bottomMargin=2*cm
)

styles = getSampleStyleSheet()

# Custom styles
title_style = ParagraphStyle(
    'CustomTitle',
    parent=styles['Title'],
    fontSize=22,
    textColor=colors.HexColor('#1a3a5c'),
    spaceAfter=6,
    fontName='Helvetica-Bold',
    alignment=TA_CENTER,
)
subtitle_style = ParagraphStyle(
    'Subtitle',
    parent=styles['Normal'],
    fontSize=11,
    textColor=colors.HexColor('#4a6fa5'),
    spaceAfter=14,
    alignment=TA_CENTER,
    fontName='Helvetica-Oblique',
)
disease_style = ParagraphStyle(
    'DiseaseTitle',
    parent=styles['Heading1'],
    fontSize=13,
    textColor=colors.white,
    fontName='Helvetica-Bold',
    spaceAfter=4,
    spaceBefore=8,
    leftIndent=0,
)
desc_style = ParagraphStyle(
    'Desc',
    parent=styles['Normal'],
    fontSize=9,
    textColor=colors.HexColor('#333333'),
    spaceAfter=6,
    fontName='Helvetica-Oblique',
    leftIndent=4,
)
header_row_style = ParagraphStyle(
    'HeaderRow',
    parent=styles['Normal'],
    fontSize=9,
    textColor=colors.white,
    fontName='Helvetica-Bold',
    alignment=TA_CENTER,
)
remedy_style = ParagraphStyle(
    'Remedy',
    parent=styles['Normal'],
    fontSize=9.5,
    textColor=colors.HexColor('#1a3a5c'),
    fontName='Helvetica-Bold',
)
indication_style = ParagraphStyle(
    'Indication',
    parent=styles['Normal'],
    fontSize=9,
    textColor=colors.HexColor('#333333'),
    fontName='Helvetica',
    leading=12,
)
footer_style = ParagraphStyle(
    'Footer',
    parent=styles['Normal'],
    fontSize=7.5,
    textColor=colors.HexColor('#888888'),
    alignment=TA_CENTER,
    fontName='Helvetica-Oblique',
)

story = []

# Title block
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("Homeopathic Medicines in ENT", title_style))
story.append(Paragraph("A Comprehensive Reference Guide for ENT Diseases (20 Topics)", subtitle_style))
story.append(HRFlowable(width="100%", thickness=2, color=colors.HexColor('#1a3a5c'), spaceAfter=12))

# Build each disease section
row_colors = [colors.HexColor('#eaf3fb'), colors.white]

for idx, disease in enumerate(ent_data):
    # Disease name header
    disease_num = idx + 1
    header_para = Paragraph(f"{disease_num}. {disease['name']}", disease_style)
    header_table = Table([[header_para]], colWidths=[17*cm])
    header_table.setStyle(TableStyle([
        ('BACKGROUND', (0,0), (-1,-1), colors.HexColor('#1a3a5c')),
        ('LEFTPADDING', (0,0), (-1,-1), 10),
        ('RIGHTPADDING', (0,0), (-1,-1), 10),
        ('TOPPADDING', (0,0), (-1,-1), 6),
        ('BOTTOMPADDING', (0,0), (-1,-1), 6),
        ('ROUNDEDCORNERS', [4,4,0,0]),
    ]))

    # Description
    desc_para = Paragraph(f"<i>{disease['description']}</i>", desc_style)

    # Remedy table
    col_header = [
        Paragraph("Homeopathic Remedy", header_row_style),
        Paragraph("Key Indications & Keynotes", header_row_style),
    ]
    table_data = [col_header]
    for i, (remedy, indication) in enumerate(disease['remedies']):
        r = Paragraph(remedy, remedy_style)
        ind = Paragraph(indication, indication_style)
        table_data.append([r, ind])

    remedy_table = Table(table_data, colWidths=[4.8*cm, 12.2*cm])
    remedy_table.setStyle(TableStyle([
        ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#2e6da4')),
        ('TEXTCOLOR', (0,0), (-1,0), colors.white),
        ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
        ('FONTSIZE', (0,0), (-1,0), 9),
        ('ALIGN', (0,0), (-1,0), 'CENTER'),
        ('VALIGN', (0,0), (-1,-1), 'TOP'),
        ('TOPPADDING', (0,0), (-1,-1), 5),
        ('BOTTOMPADDING', (0,0), (-1,-1), 5),
        ('LEFTPADDING', (0,0), (-1,-1), 7),
        ('RIGHTPADDING', (0,0), (-1,-1), 7),
        ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#eaf3fb'), colors.white]),
        ('GRID', (0,0), (-1,-1), 0.4, colors.HexColor('#b0c8e0')),
        ('LINEBELOW', (0,0), (-1,0), 1, colors.HexColor('#1a3a5c')),
    ]))

    section = KeepTogether([
        header_table,
        Spacer(1, 0.15*cm),
        desc_para,
        remedy_table,
        Spacer(1, 0.4*cm),
    ])
    story.append(section)

# Disclaimer footer
story.append(HRFlowable(width="100%", thickness=1, color=colors.HexColor('#aaaaaa'), spaceAfter=6))
story.append(Paragraph(
    "Disclaimer: This document is for educational purposes only. Homeopathic remedies should be prescribed by a qualified homeopathic physician after proper case-taking. "
    "Potency and dosage must be individualized. This guide does not replace professional medical advice or treatment.",
    footer_style
))

doc.build(story)
print("PDF generated successfully!")
Running Command

python /tmp/workspace/ent-homeopathy/generate_pdf.py

Running Command

ls -lh /tmp/workspace/ent-homeopathy/

Your PDF is ready! Here's your download link:

ENT Homeopathic Medicines

PDF Document · PDF


The PDF covers all 17 ENT diseases from your notebook with 5 homeopathic remedies each, including potency and keynote indications:
#Disease#Disease
1ASOM10Common Cold
2CSOM11Allergic Rhinitis
3Epistaxis12Nasal Polyp
4Mastoiditis13Maxillary Sinusitis
5Vertigo14Chronic Tonsillitis
6Deafness15Pharyngitis
7Laryngitis16Thyroglossal Cyst
8Hoarseness of Voice17Cleft Palate
9Stridor
Key remedies highlighted include:
  • Belladonna / Pulsatilla / Hepar Sulph (for acute ear infections)
  • Teucrium Marum (specific for nasal polyps)
  • Causticum / Phosphorus (for laryngitis and hoarseness)
  • Kali Bichromicum (for maxillary sinusitis with ropy discharge)
  • Phytolacca / Baryta Carb (for tonsillitis and pharyngitis)
Note: This is for educational/exam reference. Actual prescriptions require case-taking by a qualified homeopathic physician.

Create a quick reference card with top 3 remedies for each disease

Writing File

~/ent-homeopathy/generate_qrc.py

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import ParagraphStyle
from reportlab.lib.units import cm
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable
from reportlab.lib.enums import TA_CENTER, TA_LEFT

# Top 3 remedies per disease: (remedy, short keynote)
diseases = [
    ("1. ASOM", [
        ("Belladonna 30C",   "Sudden onset, throbbing ear pain, high fever, red drum"),
        ("Pulsatilla 30C",   "Thick yellow-green discharge, weepy child, worse warm room"),
        ("Hepar Sulph 30C",  "Offensive pus, hypersensitive to touch/cold, stitching pain"),
    ]),
    ("2. CSOM", [
        ("Kali Mur 30C",     "Crackling in ear, Eustachian blockage, white/grey discharge"),
        ("Silicea 30C",      "Chronic offensive discharge, slow-healing perforation, chilly"),
        ("Psorinum 200C",    "Intensely offensive brown discharge, low vitality, chronic"),
    ]),
    ("3. Epistaxis", [
        ("Phosphorus 30C",   "Bright red non-clotting blood, worse blowing nose"),
        ("Hamamelis Q",      "Dark venous passive bleeding, fullness and congestion"),
        ("Millefolium Q",    "Active bright red bleed, vicarious menstruation, plethoric"),
    ]),
    ("4. Mastoiditis", [
        ("Capsicum 30C",     "Burning pain behind ear, tenderness over mastoid, chilly"),
        ("Aurum Met 30C",    "Bone caries, periosteal pain, offensive discharge"),
        ("Hepar Sulph 30C",  "Acute abscess stage, offensive pus, extreme chilliness"),
    ]),
    ("5. Vertigo", [
        ("Conium Mac 30C",   "Vertigo on turning head; worse lying down, horizontal motion"),
        ("Cocculus 30C",     "Motion sickness, nausea, hollow empty feeling in head"),
        ("Gelsemium 30C",    "Dull heavy head, better urination, band sensation"),
    ]),
    ("6. Deafness", [
        ("Kali Mur 30C",     "Eustachian catarrh, crackling on blowing nose, conductive"),
        ("Calcarea Carb 30C","Polyp-related deafness, cracking in ears, cold aggravation"),
        ("Pulsatilla 30C",   "Catarrhal deafness, stopped sensation, better open air"),
    ]),
    ("7. Laryngitis", [
        ("Phosphorus 30C",   "Loss of voice; larynx painful; worse talking; singers"),
        ("Causticum 30C",    "Chronic hoarseness, voice lost every winter, worse mornings"),
        ("Spongia 30C",      "Dry burning larynx, barking cough, better warm drinks"),
    ]),
    ("8. Hoarseness of Voice", [
        ("Causticum 30C",    "Most prominent; paralytic weakness of vocal cords, AM worse"),
        ("Phosphorus 30C",   "Total aphonia; painful larynx; worse cold air"),
        ("Carbo Veg 30C",    "Hoarseness evenings; rough deep voice; damp cold worse"),
    ]),
    ("9. Stridor", [
        ("Spongia 30C",      "Crowing stridor, croup-like breathing, better warm drinks"),
        ("Sambucus 30C",     "Infantile stridor, sudden suffocation, dry coryza, cyanosis"),
        ("Aconite 30C",      "Sudden croupy stridor from cold, great anxiety, restlessness"),
    ]),
    ("10. Common Cold", [
        ("Aconite 30C",      "First 24-48 h, sudden from cold dry wind, fever, anxiety"),
        ("Allium Cepa 30C",  "Acrid nasal + bland eye discharge, sneezing, better open air"),
        ("Gelsemium 30C",    "Slow onset, dull-dizzy-drowsy, watery discharge, no thirst"),
    ]),
    ("11. Allergic Rhinitis", [
        ("Allium Cepa 30C",  "Burning nasal discharge, sneezing, worse warm room"),
        ("Sabadilla 30C",    "Violent sneezing fits, watery discharge, better warm room"),
        ("Arundo 30C",       "Burning itching of eyes, ears, nose and palate; coryza"),
    ]),
    ("12. Nasal Polyp", [
        ("Teucrium Mar 200C","Specific for nasal polyps, alternating obstruction, crawling"),
        ("Calcarea Carb 30C","Fat/fair/flabby patients, obstructed nose, cold sensitivity"),
        ("Lemna Minor Q",    "Polyps + loss of smell, worse wet weather, moist obstruction"),
    ]),
    ("13. Max. Sinusitis", [
        ("Kali Bich 30C",    "Thick ropy stringy discharge, pressure at root of nose, crusts"),
        ("Hydrastis Q",      "Thick yellow mucus, post-nasal drip, raw soreness of mucosa"),
        ("Silicea 30C",      "Chronic sinusitis, offensive discharge, chilly, slow healing"),
    ]),
    ("14. C. Tonsillitis", [
        ("Baryta Carb 30C",  "Every cold settles in throat; mentally backward children"),
        ("Hepar Sulph 30C",  "Suppurating tonsils, fish-bone pain, very chilly patient"),
        ("Phytolacca 30C",   "Dark red tonsils, pain to ears on swallowing, right-sided"),
    ]),
    ("15. Pharyngitis", [
        ("Lachesis 200C",    "Left-sided; worse empty swallowing; worse on waking"),
        ("Lycopodium 200C",  "Right-to-left; worse 4-8 PM; better warm drinks"),
        ("Phytolacca 30C",   "Dark red pharynx, follicular type, pain radiates to ears"),
    ]),
    ("16. Thyroglossal Cyst", [
        ("Calcarea Carb 200C","Cystic neck swellings, scrofulous constitution, cold/damp"),
        ("Thuja 200C",       "Cystic tumors, left-sided, post-vaccination, sycotic miasm"),
        ("Silicea 200C",     "Abscess tendency, promotes resolution, chilly constitution"),
    ]),
    ("17. Cleft Palate", [
        ("Calc Phos 200C",   "Constitutional for bone defects, delayed ossification, thin"),
        ("Calc Fluor 200C",  "Hard tissue/structural defects, enamel and bony anomalies"),
        ("Silicea 200C",     "Defective connective tissue, supports post-surgical healing"),
    ]),
]

# ── Colour palette ──────────────────────────────────────────────────────────
DARK_BLUE   = colors.HexColor('#0d2b4e')
MID_BLUE    = colors.HexColor('#1a5276')
LIGHT_BLUE  = colors.HexColor('#2e86c1')
PALE_BLUE   = colors.HexColor('#d6eaf8')
PALE_BLUE2  = colors.HexColor('#eaf4fb')
ACCENT_GOLD = colors.HexColor('#f0a500')
WHITE       = colors.white
GREY_TEXT   = colors.HexColor('#2c3e50')
LIGHT_GREY  = colors.HexColor('#f5f8fc')

doc = SimpleDocTemplate(
    "/tmp/workspace/ent-homeopathy/ENT_Quick_Reference_Card.pdf",
    pagesize=A4,
    rightMargin=1.5*cm, leftMargin=1.5*cm,
    topMargin=2*cm,     bottomMargin=1.5*cm,
)

# ── Styles ────────────────────────────────────────────────────────────────
title_s = ParagraphStyle('T', fontName='Helvetica-Bold',   fontSize=20, textColor=WHITE,       alignment=TA_CENTER, spaceAfter=2)
sub_s   = ParagraphStyle('S', fontName='Helvetica-Oblique',fontSize=9,  textColor=colors.HexColor('#aed6f1'), alignment=TA_CENTER)
dis_s   = ParagraphStyle('D', fontName='Helvetica-Bold',   fontSize=8.5,textColor=WHITE,       alignment=TA_LEFT,  leading=11)
rem_s   = ParagraphStyle('R', fontName='Helvetica-Bold',   fontSize=7.5,textColor=LIGHT_BLUE,  alignment=TA_LEFT,  leading=10)
key_s   = ParagraphStyle('K', fontName='Helvetica',        fontSize=7,  textColor=GREY_TEXT,   alignment=TA_LEFT,  leading=9)
foot_s  = ParagraphStyle('F', fontName='Helvetica-Oblique',fontSize=7,  textColor=colors.HexColor('#888888'), alignment=TA_CENTER)
num_s   = ParagraphStyle('N', fontName='Helvetica-Bold',   fontSize=7,  textColor=ACCENT_GOLD, alignment=TA_CENTER)

story = []

# ── Header banner ──────────────────────────────────────────────────────────
header_data = [[
    Paragraph("🌿  ENT Homeopathic Quick Reference Card", title_s),
]]
header_table = Table(header_data, colWidths=[17.5*cm])
header_table.setStyle(TableStyle([
    ('BACKGROUND',   (0,0), (-1,-1), DARK_BLUE),
    ('TOPPADDING',   (0,0), (-1,-1), 10),
    ('BOTTOMPADDING',(0,0), (-1,-1), 4),
    ('LEFTPADDING',  (0,0), (-1,-1), 10),
]))
story.append(header_table)

sub_data = [[Paragraph("Top 3 Homeopathic Remedies · 17 ENT Diseases · Potency &amp; Keynotes", sub_s)]]
sub_table = Table(sub_data, colWidths=[17.5*cm])
sub_table.setStyle(TableStyle([
    ('BACKGROUND',   (0,0), (-1,-1), MID_BLUE),
    ('TOPPADDING',   (0,0), (-1,-1), 4),
    ('BOTTOMPADDING',(0,0), (-1,-1), 6),
]))
story.append(sub_table)
story.append(Spacer(1, 0.35*cm))

# ── Build grid: 2 disease cards per row ──────────────────────────────────
CARD_W = 8.4*cm   # width of each disease card
GAP    = 0.5*cm
COL_WIDTHS = [CARD_W, GAP, CARD_W]

def make_card(disease_name, remedies):
    """Return a Table that represents one disease card."""
    # Header row
    rows = [[Paragraph(disease_name, dis_s)]]
    # Remedy rows
    for i, (rem, key) in enumerate(remedies):
        num  = Paragraph(f"{i+1}", num_s)
        r    = Paragraph(rem, rem_s)
        k    = Paragraph(key, key_s)
        rows.append([num, r, k])

    card = Table(
        rows,
        colWidths=[0.55*cm, 2.8*cm, 5.05*cm],
        # first row spans 3 cols
    )
    card.setStyle(TableStyle([
        # header span
        ('SPAN',           (0,0), (2,0)),
        ('BACKGROUND',     (0,0), (2,0), LIGHT_BLUE),
        ('TOPPADDING',     (0,0), (2,0), 5),
        ('BOTTOMPADDING',  (0,0), (2,0), 5),
        ('LEFTPADDING',    (0,0), (2,0), 7),
        # remedy rows
        ('ROWBACKGROUNDS', (0,1), (-1,-1), [PALE_BLUE, PALE_BLUE2]),
        ('VALIGN',         (0,0), (-1,-1), 'TOP'),
        ('TOPPADDING',     (0,1), (-1,-1), 4),
        ('BOTTOMPADDING',  (0,1), (-1,-1), 4),
        ('LEFTPADDING',    (0,1), (-1,-1), 4),
        ('RIGHTPADDING',   (0,0), (-1,-1), 4),
        ('ALIGN',          (0,1), (0,-1), 'CENTER'),
        # border
        ('BOX',            (0,0), (-1,-1), 0.8, LIGHT_BLUE),
        ('LINEBELOW',      (0,0), (2,0),   0.8, DARK_BLUE),
        ('INNERGRID',      (0,1), (-1,-1), 0.3, colors.HexColor('#c5dff0')),
    ]))
    return card

# Pair diseases into rows of 2
spacer_cell = Paragraph("", key_s)   # empty gap column

rows_out = []
for i in range(0, len(diseases), 2):
    left_card  = make_card(*diseases[i])
    if i+1 < len(diseases):
        right_card = make_card(*diseases[i+1])
    else:
        right_card = Paragraph("", key_s)

    row_table = Table(
        [[left_card, spacer_cell, right_card]],
        colWidths=COL_WIDTHS,
    )
    row_table.setStyle(TableStyle([
        ('VALIGN',       (0,0), (-1,-1), 'TOP'),
        ('LEFTPADDING',  (0,0), (-1,-1), 0),
        ('RIGHTPADDING', (0,0), (-1,-1), 0),
        ('TOPPADDING',   (0,0), (-1,-1), 0),
        ('BOTTOMPADDING',(0,0), (-1,-1), 6),
    ]))
    rows_out.append(row_table)

for r in rows_out:
    story.append(r)

# ── Legend box ─────────────────────────────────────────────────────────────
legend_style = ParagraphStyle('L', fontName='Helvetica', fontSize=7.2,
                               textColor=GREY_TEXT, alignment=TA_LEFT, leading=10)
legend_text = (
    "<b>Potency guide:</b>  <b>30C</b> — acute / first-line  |  "
    "<b>200C</b> — sub-acute / constitutional  |  "
    "<b>Q (Mother Tincture)</b> — local / tissue-level action  |  "
    "<b>1M</b> — deep constitutional / miasmatic"
)
leg_data = [[Paragraph(legend_text, legend_style)]]
leg_table = Table(leg_data, colWidths=[17.5*cm])
leg_table.setStyle(TableStyle([
    ('BACKGROUND',   (0,0), (-1,-1), colors.HexColor('#eaf4fb')),
    ('BOX',          (0,0), (-1,-1), 0.6, LIGHT_BLUE),
    ('TOPPADDING',   (0,0), (-1,-1), 5),
    ('BOTTOMPADDING',(0,0), (-1,-1), 5),
    ('LEFTPADDING',  (0,0), (-1,-1), 8),
]))
story.append(Spacer(1, 0.2*cm))
story.append(leg_table)
story.append(Spacer(1, 0.25*cm))

# ── Disclaimer ─────────────────────────────────────────────────────────────
story.append(HRFlowable(width="100%", thickness=0.5, color=colors.HexColor('#aaaaaa'), spaceAfter=4))
story.append(Paragraph(
    "For educational / exam reference only. Individualize remedy and potency with a qualified homeopathic physician before clinical use.",
    foot_s
))

doc.build(story)
print("Quick reference card PDF generated!")
Running Command

python /tmp/workspace/ent-homeopathy/generate_qrc.py

Running Command

ls -lh /tmp/workspace/ent-homeopathy/

Your quick reference card is ready!

ENT Quick Reference Card

PDF Document · PDF


What's inside the card:
  • 2-column grid layout - all 17 diseases fit on a compact, printable page
  • Each disease card shows:
    • Numbered disease header (blue banner)
    • Top 3 remedies with potency
    • One-line keynote for each remedy (easy to scan)
  • Alternating row colours for readability
  • Potency legend at the bottom: 30C / 200C / Q / 1M guide
  • Clean dark-blue & gold colour scheme - prints well in both colour and greyscale
Quick glance at top picks:
Disease#1 Remedy#2 Remedy#3 Remedy
ASOMBelladonna 30CPulsatilla 30CHepar Sulph 30C
Nasal PolypTeucrium Mar 200CCalcarea Carb 30CLemna Minor Q
SinusitisKali Bich 30CHydrastis QSilicea 30C
PharyngitisLachesis 200CLycopodium 200CPhytolacca 30C
EpistaxisPhosphorus 30CHamamelis QMillefolium Q
This is a shared conversation. Sign in to Orris to start your own chat.