Ciprofloxacine dosage

Reading File
Finding Sources
Searching the Web

ciprofloxacin dosage adults indications 2025

Reading File
Finding Sources
Reading File
Finding Sources
Reading File
Reading File
Here is a complete ciprofloxacin dosage reference:

Ciprofloxacin (Cipro) Dosage

Class: Fluoroquinolone antibiotic Available forms: Tablets (100, 250, 500, 750 mg), oral suspension (250 mg/5 mL or 500 mg/5 mL), IV (200 mg/100 mL or 400 mg/200 mL in D5W), ophthalmic 0.3%, otic preparations

Adults (Systemic)

Oral - Immediate Release

Severity / IndicationDoseFrequency
Mild/Moderate infections250-500 mgEvery 12 hours
Severe/Complicated infections750 mgEvery 12 hours
Uncomplicated UTI/Cystitis (XR)500 mgOnce daily
Complicated UTI/Pyelonephritis (XR)1000 mgOnce daily

Intravenous

SeverityDoseFrequency
Moderate infections400 mgEvery 12 hours
Severe/Complicated infections400 mgEvery 8 hours
Maximum dose: 1.5 g/day oral; bioavailability ~70%, so oral and IV are NOT equivalent by mg.

Anthrax (adults)

  • Inhalational/systemic: Start 400 mg IV Q12h; convert to 500 mg PO Q12h when improving. Total duration: 60 days.
  • Post-exposure prophylaxis: 500 mg PO Q12h x 60 days.

Pediatric (Systemic)

IndicationOralIV
Mild/Moderate20 mg/kg/day divided Q12h (max 1 g/day)-
Severe30-40 mg/kg/day divided Q12h (max 1.5 g/day)10 mg/kg/dose Q8-12h (max 400 mg/dose)
Complicated UTI/Pyelonephritis20-40 mg/kg/day ÷ Q12h (max 1.5 g/day)18-30 mg/kg/day ÷ Q8h (max 1.2 g/day)
Anthrax (inhalational)20-30 mg/kg/day ÷ Q12h (max 1 g/day)20-30 mg/kg/day ÷ Q12h (max 800 mg/day)
Neonates: 10-15 mg/kg/dose IV Q12h (weight-based)

Topical Formulations

RouteIndicationDose
Ophthalmic solution (0.3%)Bacterial conjunctivitis1-2 drops Q2h x 2 days, then Q4h x 5 days
Ophthalmic ointment (0.3%)Bacterial conjunctivitis (≥2 yr)0.5-inch ribbon TID x 2 days, then BID x 5 days
Otic (Cetraxal)Otitis externa (≥1 yr)0.25 mL BID x 7 days
Ciprodex oticOtitis media/externa (≥6 mo)4 drops BID x 7 days
Cipro HC OticOtitis externa (>1 yr)3 drops BID x 7 days

Renal Dose Adjustment

Ciprofloxacin is renally excreted. Dose must be reduced when CrCl is impaired:
CrCl (mL/min)Oral doseIV dose
>50No changeNo change
30-50250-500 mg Q12h200-400 mg Q12h
5-29250-500 mg Q18h200-400 mg Q18-24h
Hemodialysis250-500 mg Q24h (after dialysis)200-400 mg Q24h

Key Pharmacokinetics

  • Oral bioavailability: ~70%
  • Elimination half-life: ~5 hours (normal renal function)
  • Dosing: Twice daily for IR; once daily for XR

Important Warnings

  • Do not take antacids, iron, zinc, or dairy products within 2-4 hours of an oral dose (reduces absorption).
  • Do not use oral suspension via feeding tubes (adheres to tube).
  • Risk of tendon rupture - especially with concomitant corticosteroids; use with caution in patients <18 years.
  • Can cause peripheral neuropathy, CNS effects (seizures, psychosis), and QTc prolongation.
  • Inhibits CYP1A2 - increases levels of theophylline, warfarin, caffeine, tizanidine, cyclosporine, and methotrexate.
  • For obese patients, use adjusted body weight (ABW) for dosing: ABW = IBW + 0.45 × (TBW - IBW).

Sources: The Harriet Lane Handbook (23rd ed.); Goodman & Gilman's Pharmacological Basis of Therapeutics
Clinical note: Always confirm the specific duration of therapy by indication. Common durations range from 3 days (uncomplicated cystitis) to 4-6 weeks (bone/joint infections) to 60 days (anthrax).

Doxycycline use in different conditions with dose guild lines

Finding Sources
Searching the Web

doxycycline dosage guidelines indications 2024 2025

Reading File
Finding Sources
Reading File
Finding Sources
Finding Sources
Reading File
Finding Sources
Finding Sources
Finding Sources
I now have comprehensive data from multiple authoritative textbooks. Here is the full doxycycline dosage guide:

Doxycycline - Dosage Guide by Condition

Class: Tetracycline-derivative antibiotic Available forms: Caps (50, 75, 100, 150 mg), Tabs (20, 50, 75, 100, 150 mg), Delayed-release caps (Oracea 40 mg), Delayed-release tabs (Doryx: 50-200 mg), Oral suspension (25 mg/5 mL), Syrup (50 mg/5 mL), IV injection (100 mg), Brands: Vibramycin, Doryx, Acticlate, Monodox, Oracea

ADULTS

1. General Infections / Skin & Soft Tissue

SeverityDoseFrequencyDuration
Mild/Moderate100 mgEvery 12 hours (PO or IV)Per condition
Severe100 mgEvery 12 hoursPer condition

2. Sexually Transmitted Infections (STIs)

ConditionDoseDurationNotes
Chlamydia (uncomplicated)100 mg BID PO7 daysFirst-line
Pelvic Inflammatory Disease (PID) - Outpatient100 mg BID PO14 days totalWith ceftriaxone IM + metronidazole
PID - Inpatient100 mg IV Q12hUntil improved, then PO to complete 14 daysWith cefotetan or cefoxitin, or ceftriaxone + metronidazole
Non-gonococcal urethritis100 mg BID PO7 days
Lymphogranuloma venereum100 mg BID PO21 days
Granuloma inguinale100 mg BID POMin. 3 weeksUntil lesions heal
DoxyPEP (STI post-exposure prophylaxis)200 mg single dose POWithin 72 hours of condomless sexCDC 2024 guideline for MSM/TGW at high risk

3. Respiratory Tract Infections

ConditionDoseFrequencyDuration
Atypical pneumonia (Mycoplasma, Chlamydophila, Legionella)100 mgBID PO7-14 days
Community-acquired pneumonia (mild-moderate)100 mgBID PO5-7 days
Acute exacerbation of chronic bronchitis100 mgBID PO5-7 days
Q fever (Coxiella burnetti)100 mgBID PO14 days (uncomplicated)
Note: Ciprofloxacin has borderline pneumococcal activity; doxycycline is preferred for atypical CAP when fluoroquinolones are avoided.

4. Tick-Borne & Rickettsial Diseases

ConditionDoseFrequencyDurationNotes
Rocky Mountain Spotted Fever (RMSF)100 mgBID PO/IVUntil afebrile + clinically improved for ≥3 days (min. 5-7 days)Drug of choice
Ehrlichiosis / Anaplasmosis100 mgBID PO/IV10-14 daysDrug of choice
Lyme disease (early localized)100 mgBID PO10-14 days
Lyme disease (early disseminated)100 mgBID PO21 days
Lyme neuroborreliosis (mild)100 mgBID PO21-28 days
Scrub typhus / Murine typhus100 mgBID PO7-14 days
Q fever (chronic/endocarditis)100 mgBID PO18+ monthsCombined with hydroxychloroquine
Doxycycline is lifesaving in rickettsial infections including RMSF, epidemic typhus (Brill disease), murine typhus, scrub typhus, rickettsialpox, ehrlichiosis, and anaplasmosis. (Goodman & Gilman's)

5. Malaria

IndicationDoseFrequencyDuration
Prophylaxis100 mgOnce dailyStart 1-2 days before travel; continue 4 weeks after leaving endemic area (max 4 months)
Treatment (adjunct with quinine)100 mgBID PO7 days

6. Anthrax (Bacillus anthracis)

PhaseDoseRouteDuration
Inhalational/systemic/cutaneous - Initial100 mg Q12hIV (then convert to PO)Combined IV + PO = 60 days total
Post-exposure prophylaxis100 mg Q12hPO60 days
Used in combination with one or two other antimicrobials. If meningitis is suspected, use an alternative agent due to poor CNS penetration.

7. Skin / Dermatological Conditions

ConditionDoseFrequencyDuration
Moderate-to-severe acne100 mgBID PO3-6 months
Mild acne (adolescent)50 mgBID PO3-6 months
Rosacea40 mg (Oracea, delayed-release)Once dailyOngoing (sub-antimicrobial dose)

8. Other Indications

ConditionDoseDurationNotes
Periodontitis20 mg BID POUp to 9 monthsSub-antimicrobial; Periostat formulation
Brucellosis100 mg BID PO6 weeksCombined with rifampin or streptomycin
Tularemia100 mg BID PO14-21 days
Plague100 mg BID PO10-14 days
Whipple's disease100 mg BID POLong-term (1+ year)
MRSA skin/soft tissue infections (CA-MRSA)100 mg BID PO5-14 days depending on severity
Nocardia / Actinomyces100 mg BID POMonthsCombination therapy

PEDIATRIC DOSING

Doxycycline is generally avoided in children <8 years due to tooth enamel discoloration. Exception: The AAP Red Book recommends doxycycline as the drug of choice for rickettsial disease (e.g., RMSF) at any age, including short courses (≤21 days) in children <8 years.
Age / WeightDoseFrequencyNotes
≤45 kg2.2 mg/kg/dose BID PO/IVEvery 12 hoursMax 200 mg/24 hr
>45 kg100 mg/dose BID PO/IVEvery 12 hoursAdult dosing
Malaria prophylaxis (≥8 yr)2.2 mg/kg/24 hr once dailyDailyMax 100 mg/day; max 4 months
Acne (≥8 yr / adolescent)50-100 mg BID or 150 mg once dailyPer schedule

Renal & Hepatic Adjustment

  • Renal impairment: Unlike other tetracyclines, doxycycline is primarily excreted in the feces (not the kidney), so NO dose adjustment is needed in renal failure - making it the preferred tetracycline in renal disease. (Goodman & Gilman's)
  • Hepatic impairment: Use with caution; specific adjustments are not standardized but lower doses may be considered in severe hepatic failure.
  • IV infusion: Infuse over 1-4 hours.

Key Safety Points

IssueDetail
PhotosensitivityAvoid prolonged sun exposure; use sunscreen
GI effectsTake with food or water; sit upright for 30 min after to prevent esophageal ulceration
Antacids / dairyTake at least 2 hours apart from calcium, iron, zinc, antacids, milk
PregnancyAvoid - causes fetal bone-growth abnormalities
Children <8 yrAvoid unless benefit outweighs risk (teeth/bone effects); exception for rickettsial disease
Pseudotumor cerebriIncreased intracranial pressure reported
Drug interactionsRifampin, phenytoin, barbiturates, carbamazepine reduce doxycycline levels; doxycycline enhances warfarin effect
Periodontitis dosingTake tablets at least 1 hour before or 2 hours after meals

Sources: The Harriet Lane Handbook (23rd ed.); Harrison's Principles of Internal Medicine 22E (2025); Goodman & Gilman's Pharmacological Basis of Therapeutics; CDC DoxyPEP Guidelines 2024
Clinical note (2024 update): The CDC now recommends DoxyPEP (200 mg single dose within 72 hours) as post-exposure prophylaxis for bacterial STIs (chlamydia, syphilis, gonorrhea) in MSM and transgender women at high risk - a significant new indication not in older references.

Can you make prescription for general opd for treatment with symptomatic conditions ideally with different symptoms with prescriptions without signs and lab diagnosis

Asking for Preferences
Reading File
Finding Sources
Finding Sources
Finding Sources
Running Command

mkdir -p /home/daytona/workspace/opd-prescriptions && ls /home/daytona/workspace/

Writing File

~/opd-prescriptions/generate_prescriptions.py

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm, cm
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, PageBreak
)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_RIGHT
from reportlab.platypus import KeepTogether
import datetime

OUTPUT = "/home/daytona/workspace/opd-prescriptions/OPD_Prescriptions_Adult.pdf"

# ── Styles ──────────────────────────────────────────────────────────────
styles = getSampleStyleSheet()

clinic_name_style = ParagraphStyle(
    "ClinicName", fontSize=16, fontName="Helvetica-Bold",
    textColor=colors.HexColor("#1a3c6e"), alignment=TA_CENTER, spaceAfter=2
)
clinic_sub_style = ParagraphStyle(
    "ClinicSub", fontSize=9, fontName="Helvetica",
    textColor=colors.HexColor("#555555"), alignment=TA_CENTER, spaceAfter=2
)
section_title_style = ParagraphStyle(
    "SectionTitle", fontSize=13, fontName="Helvetica-Bold",
    textColor=colors.white, alignment=TA_CENTER,
    spaceAfter=4, spaceBefore=4,
    backColor=colors.HexColor("#1a3c6e"),
    leftIndent=0, rightIndent=0
)
complaint_style = ParagraphStyle(
    "Complaint", fontSize=10, fontName="Helvetica-Bold",
    textColor=colors.HexColor("#1a3c6e"), spaceAfter=2
)
normal_style = ParagraphStyle(
    "Normal2", fontSize=9.5, fontName="Helvetica",
    textColor=colors.black, spaceAfter=3, leading=14
)
rx_header_style = ParagraphStyle(
    "RxHeader", fontSize=20, fontName="Helvetica-BoldOblique",
    textColor=colors.HexColor("#1a3c6e"), spaceAfter=4
)
drug_style = ParagraphStyle(
    "Drug", fontSize=10, fontName="Helvetica-Bold",
    textColor=colors.HexColor("#1a3c6e"), spaceAfter=1
)
sig_style = ParagraphStyle(
    "Sig", fontSize=9.5, fontName="Helvetica",
    textColor=colors.HexColor("#333333"), leftIndent=12, spaceAfter=4, leading=13
)
advice_style = ParagraphStyle(
    "Advice", fontSize=9, fontName="Helvetica-Oblique",
    textColor=colors.HexColor("#444444"), leftIndent=10, spaceAfter=3, leading=13
)
footer_style = ParagraphStyle(
    "Footer", fontSize=8, fontName="Helvetica",
    textColor=colors.HexColor("#888888"), alignment=TA_CENTER
)
label_style = ParagraphStyle(
    "Label", fontSize=9, fontName="Helvetica-Bold",
    textColor=colors.HexColor("#555555"), spaceAfter=1
)

# ── Prescriptions Data ───────────────────────────────────────────────────
today = datetime.date.today().strftime("%d %B %Y")

prescriptions = [
    {
        "condition": "Common Cold / Upper Respiratory Tract Infection (URTI)",
        "symptoms": "Runny nose, nasal congestion, sneezing, sore throat, mild fever, watery eyes",
        "diagnosis": "Acute URTI (Symptomatic)",
        "drugs": [
            {
                "name": "1.  Paracetamol (Acetaminophen) 500 mg Tablet",
                "sig": "1-2 tablets every 6-8 hours as needed for fever or discomfort\nMax: 4 g/day  |  Duration: 3-5 days"
            },
            {
                "name": "2.  Cetirizine 10 mg Tablet (Antihistamine)",
                "sig": "1 tablet once daily at bedtime\nDuration: 5 days"
            },
            {
                "name": "3.  Pseudoephedrine 60 mg + Triprolidine 2.5 mg (Actifed or equivalent)",
                "sig": "1 tablet every 8 hours\nDuration: 3-5 days  |  Avoid in hypertensive patients"
            },
            {
                "name": "4.  Saline Nasal Spray (0.9% NaCl)",
                "sig": "2 sprays each nostril 3-4 times daily as needed for congestion"
            },
            {
                "name": "5.  Throat Lozenges (Benzocaine / Menthol based)",
                "sig": "1 lozenge every 3-4 hours as needed for throat pain\nMax: 8 lozenges/day  |  Duration: 5 days"
            },
        ],
        "advice": [
            "Rest adequately; increase fluid intake (warm water, soups, herbal teas)",
            "Avoid cold drinks and exposure to dust/smoke",
            "Steam inhalation 2x/day may relieve congestion",
            "Return if fever >38.5°C persists beyond 3 days or symptoms worsen",
            "Antibiotics are NOT required for viral URTI",
        ],
        "followup": "Review after 5 days if not improved"
    },
    {
        "condition": "Fever / Influenza (Flu-like Illness)",
        "symptoms": "High-grade fever, body aches, myalgia, headache, chills, fatigue, loss of appetite",
        "diagnosis": "Pyrexia of Probable Viral Origin / Influenza-like Illness",
        "drugs": [
            {
                "name": "1.  Paracetamol 500 mg Tablet",
                "sig": "2 tablets every 6 hours while fever persists\nMax: 4 g/day  |  Duration: 5 days"
            },
            {
                "name": "2.  Ibuprofen 400 mg Tablet (Antipyretic / Anti-inflammatory)",
                "sig": "1 tablet every 8 hours WITH FOOD\nDuration: 3-5 days  |  Avoid in peptic ulcer, renal disease, asthma"
            },
            {
                "name": "3.  Diclofenac Sodium 50 mg Tablet (for severe myalgia/body aches)",
                "sig": "1 tablet every 8-12 hours with food\nDuration: 3 days"
            },
            {
                "name": "4.  Oral Rehydration Salts (ORS) Sachets",
                "sig": "1 sachet dissolved in 1 litre of clean water; sip throughout the day\nUse as long as fever persists"
            },
            {
                "name": "5.  Vitamin C 500 mg + Zinc 10 mg Tablet",
                "sig": "1 tablet once daily with meals\nDuration: 7-10 days"
            },
        ],
        "advice": [
            "Strict bed rest; drink at least 2-3 litres of fluids daily",
            "Tepid sponging for very high fever (>39°C)",
            "Light easily digestible diet; avoid fatty/spicy food",
            "Return immediately if fever >40°C, convulsions, extreme weakness, or breathlessness",
            "Do NOT give Aspirin for fever in adults with flu (risk of Reye's syndrome interaction)",
        ],
        "followup": "Review after 3 days or earlier if condition deteriorates"
    },
    {
        "condition": "Acute Gastroenteritis / Diarrhea",
        "symptoms": "Loose watery stools (3+ times/day), nausea, vomiting, abdominal cramps, low-grade fever",
        "diagnosis": "Acute Gastroenteritis (Non-dysenteric, Symptomatic)",
        "drugs": [
            {
                "name": "1.  Oral Rehydration Salts (ORS) Sachets",
                "sig": "1 sachet in 1 litre of water; drink 200-400 mL after each loose stool\nContinue until diarrhea stops"
            },
            {
                "name": "2.  Loperamide HCl 2 mg Capsule (Anti-motility)",
                "sig": "2 capsules (4 mg) initially, then 1 capsule after each loose stool\nMax: 8 mg/day  |  Duration: 2 days  |  Avoid if fever or bloody stool"
            },
            {
                "name": "3.  Metoclopramide 10 mg Tablet (Anti-emetic)",
                "sig": "1 tablet 30 minutes before meals, 3 times daily\nDuration: 3 days  |  Avoid in children < 15 yrs"
            },
            {
                "name": "4.  Omeprazole 20 mg Capsule (Gastric protection)",
                "sig": "1 capsule once daily before breakfast\nDuration: 5 days"
            },
            {
                "name": "5.  Ciprofloxacin 500 mg Tablet (if bacterial cause suspected: watery + cramping)",
                "sig": "1 tablet every 12 hours\nDuration: 3-5 days  |  Prescribe only when indicated"
            },
            {
                "name": "6.  Zinc Sulfate 20 mg Tablet",
                "sig": "1 tablet once daily\nDuration: 10-14 days (WHO recommended adjunct)"
            },
        ],
        "advice": [
            "Drink plenty of clear fluids (ORS, clear soups, coconut water)",
            "Eat bland foods: rice, banana, toast, plain boiled potato (BRAT diet)",
            "Avoid dairy, fatty, spicy, and fried foods until fully recovered",
            "Strict hand hygiene especially before meals and after toilet",
            "Return if vomiting is persistent, blood in stool, or signs of severe dehydration",
        ],
        "followup": "Review in 2-3 days; IV fluids if unable to tolerate oral intake"
    },
    {
        "condition": "Cough / Acute Bronchitis",
        "symptoms": "Persistent dry or productive cough, chest tightness, mild dyspnea, possible low-grade fever, sputum",
        "diagnosis": "Acute Bronchitis / Productive Cough (Symptomatic)",
        "drugs": [
            {
                "name": "1.  Ambroxol HCl 30 mg Syrup / Tablet (Expectorant / Mucolytic)",
                "sig": "1 tablet (or 10 mL syrup) 3 times daily after meals\nDuration: 5-7 days"
            },
            {
                "name": "2.  Salbutamol 2 mg Tablet (Bronchodilator - if wheezing present)",
                "sig": "1 tablet 3 times daily\nDuration: 5 days  |  Use MDI (100 mcg/puff, 2 puffs TDS) if available"
            },
            {
                "name": "3.  Dextromethorphan 15 mg Tablet (for dry, non-productive cough)",
                "sig": "1 tablet every 6-8 hours as needed\nDuration: 3-5 days  |  Do NOT use with productive cough"
            },
            {
                "name": "4.  Prednisolone 5 mg Tablet (short course - for severe bronchospasm)",
                "sig": "4 tablets (20 mg) once daily in the morning with food\nDuration: 5 days then stop (no taper needed for short course)"
            },
            {
                "name": "5.  Azithromycin 500 mg Tablet (if atypical/bacterial cause suspected)",
                "sig": "1 tablet once daily\nDuration: 3-5 days  |  Take on empty stomach or with food"
            },
        ],
        "advice": [
            "Warm fluids and steam inhalation 3x/day to loosen mucus",
            "Avoid smoking and exposure to dust, fumes, and cold air",
            "Honey and warm lemon water may soothe the throat and reduce cough",
            "Elevate head while sleeping for comfort",
            "Return if cough persists > 3 weeks, hemoptysis, or high fever develops",
        ],
        "followup": "Review in 7 days; chest X-ray if no improvement"
    },
    {
        "condition": "Headache / Tension-Type Headache",
        "symptoms": "Bilateral dull/pressing headache, neck stiffness, eye strain, stress, mild nausea, no aura",
        "diagnosis": "Tension-Type Headache (Episodic, Symptomatic)",
        "drugs": [
            {
                "name": "1.  Paracetamol 500 mg + Caffeine 65 mg Tablet (Panadol Extra or equivalent)",
                "sig": "1-2 tablets every 6 hours as needed for headache\nMax: 8 tablets/day  |  Do not use daily for > 10 days (medication overuse headache)"
            },
            {
                "name": "2.  Ibuprofen 400 mg Tablet",
                "sig": "1 tablet every 8 hours WITH FOOD\nDuration: 3 days maximum per episode"
            },
            {
                "name": "3.  Metoclopramide 10 mg Tablet (for associated nausea)",
                "sig": "1 tablet 3 times daily as needed for nausea\nDuration: 2-3 days"
            },
            {
                "name": "4.  Amitriptyline 10 mg Tablet (for frequent/recurrent tension headache - prophylaxis)",
                "sig": "1 tablet at bedtime\nDuration: 6-8 weeks (review before continuation)"
            },
        ],
        "advice": [
            "Identify and avoid triggers: stress, poor posture, eye strain, dehydration, irregular meals",
            "Adequate sleep (7-8 hrs/night) and regular meal schedule",
            "Relaxation techniques, warm compress to neck/shoulders",
            "Limit screen time and ensure proper lighting while working",
            "Return immediately if sudden severe headache ('thunderclap'), vision changes, or neurological symptoms",
        ],
        "followup": "Review in 2 weeks if headache is recurrent or worsening"
    },
    {
        "condition": "Skin Infection / Infected Wound (Mild-Moderate)",
        "symptoms": "Localized skin redness, warmth, swelling, purulent discharge, pain, tenderness at wound site",
        "diagnosis": "Cellulitis / Superficial Skin Infection / Infected Wound (Symptomatic)",
        "drugs": [
            {
                "name": "1.  Amoxicillin-Clavulanate (Co-amoxiclav) 625 mg Tablet",
                "sig": "1 tablet every 8 hours with food\nDuration: 5-7 days"
            },
            {
                "name": "2.  Flucloxacillin 500 mg Capsule (if staphylococcal infection suspected)",
                "sig": "1 capsule every 6 hours on empty stomach (30 min before meals)\nDuration: 5-7 days"
            },
            {
                "name": "3.  Cetirizine 10 mg Tablet (for associated itch/urticaria)",
                "sig": "1 tablet once daily at bedtime\nDuration: 5 days"
            },
            {
                "name": "4.  Ibuprofen 400 mg Tablet (for pain and inflammation)",
                "sig": "1 tablet every 8 hours WITH FOOD\nDuration: 3-5 days"
            },
            {
                "name": "5.  Mupirocin 2% Ointment (Topical antibiotic)",
                "sig": "Apply thin layer to affected area 3 times daily after cleaning wound\nDuration: 7-10 days  |  Cover with sterile dressing"
            },
            {
                "name": "6.  Povidone-Iodine Solution (Betadine 10%)",
                "sig": "Clean wound with diluted solution (1:10 in water) twice daily before dressing"
            },
        ],
        "advice": [
            "Keep wound clean and dry; change dressing daily or when soiled",
            "Elevate affected limb to reduce swelling",
            "Complete the full antibiotic course even if the wound appears healed",
            "Do NOT squeeze or puncture boils or abscesses at home",
            "Return if spreading redness, high fever, pus discharge increasing, or red streaks appear",
        ],
        "followup": "Wound review in 3-5 days; surgical drainage if abscess not improving"
    },
    {
        "condition": "Urinary Tract Infection (UTI) - Symptoms Only",
        "symptoms": "Burning/painful urination (dysuria), increased urinary frequency, urgency, cloudy or foul-smelling urine, lower abdominal discomfort",
        "diagnosis": "Symptomatic Lower Urinary Tract Infection (Uncomplicated Cystitis - Adult Female)",
        "drugs": [
            {
                "name": "1.  Nitrofurantoin 100 mg (Modified-release) Capsule - First Line",
                "sig": "1 capsule twice daily WITH FOOD\nDuration: 5 days"
            },
            {
                "name": "2.  Trimethoprim 200 mg Tablet (Alternative first-line)",
                "sig": "1 tablet twice daily\nDuration: 7 days"
            },
            {
                "name": "3.  Ciprofloxacin 500 mg Tablet (if above not tolerated / suspected resistance)",
                "sig": "1 tablet every 12 hours\nDuration: 3 days for uncomplicated UTI"
            },
            {
                "name": "4.  Phenazopyridine 200 mg Tablet (Urinary analgesic - symptomatic relief)",
                "sig": "1 tablet 3 times daily AFTER MEALS\nDuration: 2 days only  |  Will turn urine orange - this is normal"
            },
            {
                "name": "5.  Ibuprofen 400 mg Tablet (for pelvic/lower abdominal pain)",
                "sig": "1 tablet every 8 hours WITH FOOD\nDuration: 2-3 days"
            },
        ],
        "advice": [
            "Increase fluid intake to at least 2-3 litres of water per day",
            "Void completely after each urination and always after sexual intercourse",
            "Wipe front to back after using the toilet",
            "Avoid caffeine, alcohol, and spicy food until symptoms resolve",
            "Return immediately if fever, back/flank pain, rigors develop (may indicate pyelonephritis)",
        ],
        "followup": "Review in 5-7 days; urine culture if symptoms recur or persist"
    },
]

# ── PDF Generation ───────────────────────────────────────────────────────
def build_prescription_header():
    """Returns clinic header elements."""
    elements = []
    elements.append(Spacer(1, 4*mm))
    elements.append(Paragraph("CITY GENERAL HOSPITAL", clinic_name_style))
    elements.append(Paragraph("Department of General Medicine – Outpatient Department (OPD)", clinic_sub_style))
    elements.append(Paragraph("General OPD  |  Tel: +XX-XXXX-XXXXXX  |  www.citygeneralhospital.example", clinic_sub_style))
    elements.append(HRFlowable(width="100%", thickness=2, color=colors.HexColor("#1a3c6e"), spaceAfter=4))
    return elements

def build_patient_info_table():
    """Returns patient info table."""
    data = [
        [Paragraph("<b>Patient Name:</b> ________________________", normal_style),
         Paragraph("<b>Age/Sex:</b> _______ / _______", normal_style),
         Paragraph("<b>Date:</b> " + today, normal_style)],
        [Paragraph("<b>Address:</b> ________________________", normal_style),
         Paragraph("<b>Weight:</b> __________ kg", normal_style),
         Paragraph("<b>OPD No:</b> __________", normal_style)],
    ]
    table = Table(data, colWidths=[75*mm, 55*mm, 50*mm])
    table.setStyle(TableStyle([
        ("FONTSIZE", (0, 0), (-1, -1), 9),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 4),
        ("TOPPADDING", (0, 0), (-1, -1), 4),
        ("GRID", (0, 0), (-1, -1), 0.3, colors.HexColor("#cccccc")),
        ("BACKGROUND", (0, 0), (-1, -1), colors.HexColor("#f4f8ff")),
    ]))
    return table

def build_prescription_page(rx):
    elements = []
    # Header
    elements.extend(build_prescription_header())

    # Condition Banner
    elements.append(Spacer(1, 2*mm))
    banner_data = [[Paragraph(f"  Rx  —  {rx['condition']}", section_title_style)]]
    banner_table = Table(banner_data, colWidths=[180*mm])
    banner_table.setStyle(TableStyle([
        ("BACKGROUND", (0, 0), (-1, -1), colors.HexColor("#1a3c6e")),
        ("TOPPADDING", (0, 0), (-1, -1), 5),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 5),
        ("LEFTPADDING", (0, 0), (-1, -1), 8),
    ]))
    elements.append(banner_table)
    elements.append(Spacer(1, 3*mm))

    # Patient Info
    elements.append(build_patient_info_table())
    elements.append(Spacer(1, 3*mm))

    # Presenting Symptoms
    sym_data = [[
        Paragraph("<b>Presenting Symptoms:</b>", label_style),
        Paragraph(rx["symptoms"], normal_style)
    ]]
    sym_table = Table(sym_data, colWidths=[42*mm, 138*mm])
    sym_table.setStyle(TableStyle([
        ("BACKGROUND", (0, 0), (-1, -1), colors.HexColor("#eef4ff")),
        ("TOPPADDING", (0, 0), (-1, -1), 4),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 4),
        ("LEFTPADDING", (0, 0), (-1, -1), 6),
        ("BOX", (0, 0), (-1, -1), 0.5, colors.HexColor("#aac4ee")),
    ]))
    elements.append(sym_table)
    elements.append(Spacer(1, 2*mm))

    # Working Diagnosis
    diag_data = [[
        Paragraph("<b>Working Diagnosis:</b>", label_style),
        Paragraph(rx["diagnosis"], complaint_style)
    ]]
    diag_table = Table(diag_data, colWidths=[42*mm, 138*mm])
    diag_table.setStyle(TableStyle([
        ("BACKGROUND", (0, 0), (-1, -1), colors.HexColor("#fff8e1")),
        ("TOPPADDING", (0, 0), (-1, -1), 4),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 4),
        ("LEFTPADDING", (0, 0), (-1, -1), 6),
        ("BOX", (0, 0), (-1, -1), 0.5, colors.HexColor("#f0c040")),
    ]))
    elements.append(diag_table)
    elements.append(Spacer(1, 4*mm))

    # Rx symbol
    elements.append(Paragraph("℞", rx_header_style))

    # Drugs table
    drug_rows = []
    for drug in rx["drugs"]:
        drug_rows.append([
            Paragraph(drug["name"], drug_style),
            Paragraph(drug["sig"].replace("\n", "<br/>"), sig_style)
        ])
    drug_table = Table(drug_rows, colWidths=[78*mm, 102*mm])
    drug_table.setStyle(TableStyle([
        ("VALIGN", (0, 0), (-1, -1), "TOP"),
        ("TOPPADDING", (0, 0), (-1, -1), 5),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 5),
        ("LEFTPADDING", (0, 0), (-1, -1), 6),
        ("RIGHTPADDING", (0, 0), (-1, -1), 6),
        ("ROWBACKGROUNDS", (0, 0), (-1, -1), [colors.HexColor("#f0f6ff"), colors.white]),
        ("LINEBELOW", (0, 0), (-1, -2), 0.3, colors.HexColor("#d0d8e8")),
        ("BOX", (0, 0), (-1, -1), 0.7, colors.HexColor("#1a3c6e")),
    ]))
    elements.append(drug_table)
    elements.append(Spacer(1, 4*mm))

    # Advice Section
    elements.append(Paragraph("General Advice &amp; Instructions:", complaint_style))
    for i, adv in enumerate(rx["advice"], 1):
        elements.append(Paragraph(f"  {i}.  {adv}", advice_style))
    elements.append(Spacer(1, 3*mm))

    # Follow-up
    fu_data = [[
        Paragraph("<b>Follow-up / Review:</b>", label_style),
        Paragraph(rx["followup"], normal_style)
    ]]
    fu_table = Table(fu_data, colWidths=[42*mm, 138*mm])
    fu_table.setStyle(TableStyle([
        ("BACKGROUND", (0, 0), (-1, -1), colors.HexColor("#e8f5e9")),
        ("TOPPADDING", (0, 0), (-1, -1), 4),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 4),
        ("LEFTPADDING", (0, 0), (-1, -1), 6),
        ("BOX", (0, 0), (-1, -1), 0.5, colors.HexColor("#66bb6a")),
    ]))
    elements.append(fu_table)
    elements.append(Spacer(1, 4*mm))

    # Signature line
    sig_data = [[
        Paragraph("Doctor's Signature: _____________________", normal_style),
        Paragraph("Designation: _____________________", normal_style),
        Paragraph("Stamp:", normal_style),
    ]]
    sig_table = Table(sig_data, colWidths=[65*mm, 65*mm, 50*mm])
    sig_table.setStyle(TableStyle([
        ("TOPPADDING", (0, 0), (-1, -1), 12),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 8),
        ("LINEABOVE", (0, 0), (-1, 0), 0.5, colors.HexColor("#999999")),
    ]))
    elements.append(sig_table)

    # Footer
    elements.append(HRFlowable(width="100%", thickness=0.5, color=colors.HexColor("#cccccc"), spaceBefore=4))
    elements.append(Paragraph(
        "This prescription is issued for symptomatic treatment only. Lab investigations may be required if symptoms persist or worsen. "
        "All medications should be taken as directed. Do not share prescriptions. | City General Hospital OPD",
        footer_style
    ))

    return elements


# ── Build PDF ────────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    rightMargin=15*mm,
    leftMargin=15*mm,
    topMargin=10*mm,
    bottomMargin=12*mm
)

story = []
for i, rx in enumerate(prescriptions):
    story.extend(build_prescription_page(rx))
    if i < len(prescriptions) - 1:
        story.append(PageBreak())

doc.build(story)
print(f"PDF generated: {OUTPUT}")
You've run out of free credits. Sign up for a free account to continue using Orris.
This is a shared conversation. Sign in to Orris to start your own chat.