The patient is 16 years old and have chief complaints of facial swelling and bl lower limb swelling and diagnosis is nephrotic syndrome,based on this assess the rationality of medication by elobrating safety efficacy cost
nephrotic syndrome pediatric adolescent treatment guidelines
nephrotic syndrome pediatric treatment torsemide spironolactone albumin methylprednisolone rationality 2024 2025
| S.No | Drug Name | Generic Name | Dose |
|---|---|---|---|
| 1 | Inj. Pan 40mg | Pantoprazole | 40mg 1-0-0 (OD) |
| 2 | Inj. Emeset | Ondansetron | 4mg 1-1-1 (TDS) |
| 3 | Tab. Metoz | Metolazone | 5mg 1-1-1 (TDS) |
| 4 | Tab. Aldactone | Spironolactone | 100mg 1-1-1 (TDS) |
| 5 | Inj. Lasix | Furosemide | 100mg 1-1-1 (TDS) |
| 6 | Inj. Dytor (Torsemide) | Torsemide | 100mg 1-1-1 (TDS) |
| 7 | Tab. Dolo | Paracetamol | 650mg 1-1-1 (TDS) |
| 8 | Inj. Human Albumin | Albumin 20% | 100mL |
| 9 | Methylprednisolone | Methylprednisolone | 500mg in 100mL NS |
| 10 | Tab. Omaroxtil | ? (possibly Amoxicillin/Clavulanate or antibiotic) | 30mg 1-0-0 |
| Drug | Rational? | Key Issue |
|---|---|---|
| Pantoprazole 40mg IV OD | ✅ Rational | Appropriate gastroprotection with steroids |
| Ondansetron 4mg TDS | ⚠️ Conditional | TDS may be excessive; PRN preferred |
| Metolazone 5mg TDS | ❌ Irrational | 4th diuretic; dangerous combination + excessive dose |
| Spironolactone 100mg TDS | ❌ Irrational dose | 300mg/day excessive; max 100-150mg/day for this age |
| Furosemide 100mg TDS IV | ❌ Irrational combination | Cannot use with torsemide (duplicate loop diuretic) |
| Torsemide 100mg TDS IV | ❌ Irrational combination | Duplicate loop diuretic; choose one only |
| Paracetamol 650mg TDS | ✅ Rational | Correct choice (avoids nephrotoxic NSAIDs) |
| Albumin 20% 100mL IV | ✅ Rational | Appropriate for hypoalbuminemia-related refractory edema |
| Methylprednisolone 500mg IV | ✅ Rational | Appropriate pulse therapy |
| Omaroxtil 30mg OD | ⚠️ Unclear | Drug identity needs confirmation |
| Category | Affordable | Expensive |
|---|---|---|
| Pantoprazole | ✅ Low cost | |
| Ondansetron | ✅ Low cost | |
| Furosemide | ✅ Cheapest diuretic | |
| Spironolactone | ✅ Low cost | |
| Metolazone | ✅ Low cost | |
| Paracetamol | ✅ Cheapest analgesic | |
| Torsemide (Dytor) | ❌ More expensive than furosemide; redundant | |
| Human Albumin 20% | ❌ High cost; justified only if albumin critically low | |
| Methylprednisolone IV | Moderate cost; clinically justified |
Assess based on this chart
Days 15-16: Furosemide alone (no torsemide yet) - Rational start
Day 17: Torsemide ADDED alongside furosemide - First irrational point
Day 18: Furosemide withheld; Albumin given; Paracetamol started - Clinical deterioration/fever episode
Days 19-26: BOTH furosemide + torsemide resumed - Dual loop diuretic period (10 days)
Day 25: Single IV methylprednisolone pulse - Steroid escalation
Days 1-2: Oral prednisolone started; spironolactone stopped on Day 2 - Transition to oral therapy
| Drug | Rational? | Dose | Duration/Pattern | Safety | Cost |
|---|---|---|---|---|---|
| Pantoprazole 40mg OD | ✅ | Appropriate | 14 days - justified | Safe | Low |
| Ondansetron 4mg TDS | ⚠️ | Appropriate | 14 days standing - excessive | QTc risk with hypokalemia | Low but wasteful |
| Metolazone 5mg TDS | ❌ | Excessive (15mg/day) | 14 days - too long | High risk | Low (but harmful) |
| Spironolactone 100mg TDS | ❌ | Excessive (300mg/day) | 13 days | Hyperkalemia risk | Low |
| Furosemide 100mg TDS | ❌ | Excessive | Dual loop Day 17+ | Ototoxicity, AKI | Low |
| Torsemide 100mg TDS | ❌ | Excessive | Duplicate loop diuretic | Severe electrolyte risk | Higher cost, no added benefit |
| Paracetamol 650mg TDS | ✅ | Appropriate | 2 days only - excellent | Safe | Low |
| Albumin 20% 100mL | ✅ | Appropriate | Single targeted dose | Safe with monitoring | High but justified |
| Methylprednisolone 500mg | ✅ | Standard | Single pulse (incomplete?) | Requires monitoring | Moderate |
| Prednisolone 30mg OD | ✅ | Appropriate | Discharge transition | Safe + PPI co-prescribed | Very low |
Furosemide is only prescribed for first 3 days
| Step | Drug | Duration | Assessment |
|---|---|---|---|
| Initiation | Furosemide 100mg TDS | Days 1-3 | ✅ Rational short-term |
| Transition | Switch to Torsemide | Day 3 onward | ✅ Rational decision |
| Ongoing | Torsemide 100mg TDS | 12 days | ⚠️ Dose too high, no titration |
| Add-on | Spironolactone 100mg TDS | Throughout | ❌ Overdose (300mg/day) |
| Add-on | Metolazone 5mg TDS | Throughout | ❌ Excessive dose + duration |
Give a brief note on overall rationality
| Domain | Rating |
|---|---|
| Drug selection | ✅ Largely appropriate |
| Dosing | ⚠️ Issues with 3 drugs |
| Duration of therapy | ❌ Metolazone + ondansetron too prolonged |
| Monitoring (electrolytes, BP, glucose) | ❓ Not documented in chart |
| Cost-effectiveness | ⚠️ Torsemide + spironolactone at high doses increase cost without proportional benefit |
Give a brief note on use, safety, efficacy and cost considering the patient characteristics ( 16 year old female, chief complaint of facial edema and lower limb edema) for above medications
| Drug | Appropriate for 16F? | Key Patient-Specific Concern |
|---|---|---|
| Pantoprazole | ✅ Yes | None |
| Ondansetron | ⚠️ With caution | QTc risk with concurrent hypokalemia |
| Metolazone | ❌ Excess dose/duration | AKI risk, no pediatric dosing data |
| Spironolactone | ⚠️ Dose too high | Hormonal/menstrual effects in adolescent female |
| Furosemide | ✅ Short-term | Reduced efficacy due to hypoalbuminemia |
| Torsemide | ✅ Better choice | Dose needs titration downward |
| Paracetamol | ✅ Ideal | Avoids nephrotoxic NSAIDs correctly |
| Albumin 20% | ✅ Targeted use | Expensive but single-use justified |
| Methylprednisolone | ✅ Appropriate | Bone health, menstrual effects, incomplete course |
| Prednisolone | ✅ Essential | Bone density + Ca/Vit D supplement needed |
Generate a medication optimization chart with dose adjustments for this 16-year-old female
ls /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or does not exist"
mkdir -p /home/daytona/workspace/nephrotic-optimization && echo "done"
~/nephrotic-optimization/build_chart.py
import openpyxl
from openpyxl.styles import (
Font, PatternFill, Alignment, Border, Side, GradientFill
)
from openpyxl.utils import get_column_letter
wb = openpyxl.Workbook()
ws = wb.active
ws.title = "Medication Optimization Chart"
# ── Colour palette ──────────────────────────────────────────────────────────
DARK_BLUE = "1F3864" # header bg
MED_BLUE = "2E75B6" # sub-header bg
LIGHT_BLUE = "D6E4F0" # alternating row
WHITE = "FFFFFF"
RED_BG = "FFE0E0" # irrational / concern
YELLOW_BG = "FFF9C4" # conditional
GREEN_BG = "E2EFDA" # rational / optimized
ORANGE_BG = "FCE4D6" # dose change flag
PURPLE_BG = "EAD1DC" # patient-specific note
HEADER_FONT_COLOR = "FFFFFF"
DARK_TEXT = "1A1A1A"
def hdr_font(sz=11, bold=True, color=HEADER_FONT_COLOR):
return Font(name="Arial", size=sz, bold=bold, color=color)
def body_font(sz=10, bold=False, color=DARK_TEXT):
return Font(name="Arial", size=sz, bold=bold, color=color)
def fill(hex_color):
return PatternFill("solid", fgColor=hex_color)
def border():
s = Side(style="thin", color="BFBFBF")
return Border(left=s, right=s, top=s, bottom=s)
def thick_border():
s = Side(style="medium", color="1F3864")
return Border(left=s, right=s, top=s, bottom=s)
def wrap_center(bold=False, sz=10, color=DARK_TEXT):
return dict(font=Font(name="Arial", size=sz, bold=bold, color=color),
alignment=Alignment(wrap_text=True, vertical="center",
horizontal="center"),
border=border())
def wrap_left(bold=False, sz=10, color=DARK_TEXT):
return dict(font=Font(name="Arial", size=sz, bold=bold, color=color),
alignment=Alignment(wrap_text=True, vertical="center",
horizontal="left"),
border=border())
def apply(cell, style_dict, bg=None):
for attr, val in style_dict.items():
setattr(cell, attr, val)
if bg:
cell.fill = fill(bg)
# ── Column widths ────────────────────────────────────────────────────────────
col_widths = [4, 22, 18, 22, 22, 26, 26, 24, 24, 28]
for i, w in enumerate(col_widths, 1):
ws.column_dimensions[get_column_letter(i)].width = w
# ── TITLE (row 1) ────────────────────────────────────────────────────────────
ws.merge_cells("A1:J1")
c = ws["A1"]
c.value = "MEDICATION OPTIMIZATION CHART"
c.font = Font(name="Arial", size=16, bold=True, color=HEADER_FONT_COLOR)
c.fill = fill(DARK_BLUE)
c.alignment = Alignment(horizontal="center", vertical="center")
ws.row_dimensions[1].height = 32
# ── PATIENT INFO (row 2) ─────────────────────────────────────────────────────
ws.merge_cells("A2:J2")
c = ws["A2"]
c.value = ("Patient: 16-Year-Old Female | Diagnosis: Nephrotic Syndrome | "
"Chief Complaints: Facial Edema & Bilateral Lower Limb Edema | "
"Setting: Inpatient | Assumed Weight: ~50 kg")
c.font = Font(name="Arial", size=10, bold=False, color=HEADER_FONT_COLOR)
c.fill = fill(MED_BLUE)
c.alignment = Alignment(horizontal="center", vertical="center", wrap_text=True)
ws.row_dimensions[2].height = 22
# ── LEGEND (row 3) ───────────────────────────────────────────────────────────
ws.merge_cells("A3:J3")
c = ws["A3"]
c.value = ("Legend: ✅ Rational (Green) ⚠️ Conditional / Dose Concern (Yellow) "
"❌ Irrational / High Risk (Red) 🔶 Dose Adjusted (Orange) "
"💜 Female-Specific Note (Purple)")
c.font = Font(name="Arial", size=9, bold=False, color="1A1A1A")
c.fill = fill("F2F2F2")
c.alignment = Alignment(horizontal="left", vertical="center", wrap_text=True)
ws.row_dimensions[3].height = 18
# ── COLUMN HEADERS (row 4) ───────────────────────────────────────────────────
headers = [
"S.No", "Drug Name\n(Brand / Generic)", "Route &\nFrequency",
"Prescribed\nDose", "Optimized\nDose",
"Dose Adjustment\nRationale",
"Efficacy in\nNephrotic Syndrome",
"Safety Profile\n(16F Specific)",
"Cost (India)\nApprox.",
"Overall\nRationality"
]
ws.row_dimensions[4].height = 42
for col, h in enumerate(headers, 1):
c = ws.cell(row=4, column=col, value=h)
c.font = hdr_font(sz=10)
c.fill = fill(MED_BLUE)
c.alignment = Alignment(wrap_text=True, vertical="center",
horizontal="center")
c.border = thick_border()
# ── DATA ─────────────────────────────────────────────────────────────────────
# Each row: (sno, brand/generic, route+freq, prescribed, optimized,
# rationale, efficacy, safety, cost, rationality_label, row_bg, rationality_bg)
rows = [
(
"1",
"Inj. Pan\n(Pantoprazole)",
"IV\nOD (1-0-0)",
"40 mg OD",
"40 mg OD\n(No change)",
"Standard dose for gastroprotection during systemic steroid therapy. Appropriate for entire duration of corticosteroid course.",
"Highly effective acid suppression. Prevents steroid-induced peptic ulceration and GI bleed throughout 14-day admission.",
"Safe in adolescents. Risk: prolonged use (>8 wks) may reduce Mg2+ and B12. 14-day course is acceptable with no adjustment needed.",
"~INR 15-30/inj\n(Generic)\nLOW COST",
"✅ RATIONAL",
WHITE, GREEN_BG
),
(
"2",
"Inj. Emeset\n(Ondansetron)",
"IV\nTDS (1-1-1)",
"4 mg TDS\n(14 days\nstanding)",
"4 mg PRN\n(Max BD)\nStep down\nafter Day 3",
"TDS standing for 14 days is excessive. Convert to PRN (as needed) after Day 2-3. If persistent vomiting, max BD. Oral route when tolerating oral intake.",
"Effective 5-HT3 anti-emetic for steroid-induced nausea. 4 mg is appropriate adolescent dose. Efficacy not improved by standing TDS vs PRN.",
"⚠️ KEY RISK: Hypokalemia from diuretics + ondansetron = additive QTc prolongation → risk of Torsades de Pointes. Monitor ECG and K+ closely. Avoid standing TDS in electrolyte-depleted state.",
"~INR 10-20/inj\n(Generic)\nLOW COST\n(42 injections over 14d unnecessary)",
"⚠️ CONDITIONAL\n(Drug OK;\nFrequency excess)",
LIGHT_BLUE, YELLOW_BG
),
(
"3",
"Tab. Metoz\n(Metolazone)",
"Oral\nTDS (1-1-1)",
"5 mg TDS\n= 15 mg/day\n(14 days)",
"2.5-5 mg OD\n(Max 3 days\nonly as burst)\nThen STOP",
"Standard adult dose is 2.5-5 mg OD. TDS is 3x the recommended frequency. Use only as a short burst (1-3 days) when loop diuretic response is inadequate, then discontinue. No pediatric dosing evidence for prolonged use.",
"Effective add-on to loop diuretics for refractory edema by sequential nephron blockade. NOT indicated as a standing 14-day drug. Once loop diuretic achieves response, metolazone should stop.",
"❌ HIGH RISK: Severe K+/Na+/Mg2+ wasting. Over-diuresis in nephrotic syndrome causes hypovolemia despite peripheral edema (low oncotic pressure → AKI risk). No validated pediatric dosing. Prolonged use unjustified.",
"~INR 3-6/tab\n(Generic)\nVERY LOW COST\n(Risk >> Cost concern)",
"❌ IRRATIONAL\n(Dose & Duration)",
RED_BG, RED_BG
),
(
"4",
"Tab. Aldactone\n(Spironolactone)",
"Oral\nTDS (1-1-1)",
"100 mg TDS\n= 300 mg/day",
"25-50 mg BD\n= 50-100 mg/day\n(1-2 mg/kg/day\nfor 50 kg patient)",
"Recommended dose: 1-3 mg/kg/day. For ~50 kg patient: 50-150 mg/day maximum. 300 mg/day is 2-6x the recommended ceiling. Reduce to 50-100 mg/day. Onset is slow (2-3 days); high doses do not accelerate effect.",
"Rational choice for nephrotic syndrome - counters secondary hyperaldosteronism (RAAS activation from low oncotic pressure). Potassium-sparing action complements loop diuretics. Efficacy plateaus above 100 mg/day.",
"⚠️ At 300 mg/day: Anti-androgenic effects in 16F → menstrual irregularities, breast tenderness, hormonal disruption during adolescent development. Hyperkalemia risk especially if AKI develops. Reduce dose to safe range.",
"~INR 5-10/tab\n(Generic)\nLOW COST\n(High dose = no extra benefit + more toxicity)",
"⚠️ CONDITIONAL\n(Drug rational;\nDose irrational)",
YELLOW_BG, ORANGE_BG
),
(
"5",
"Inj. Lasix\n(Furosemide)",
"IV\nTDS (1-1-1)",
"100 mg TDS\n(Days 1-3 only)",
"40-80 mg BD-TDS\n(1-2 mg/kg/dose)\nDays 1-3 then\nswitch to Torsemide",
"Short 3-day initiation is clinically appropriate. Dose 100 mg TDS (~2 mg/kg/dose for 50 kg) is at upper limit but acceptable for acute severe edema. Transition to torsemide from Day 3 is rational given superior bioavailability in hypoalbuminemia.",
"First-line loop diuretic. Efficacy reduced in nephrotic syndrome due to protein binding - hypoalbuminemia means less free drug at tubular lumen. Higher doses or torsemide switch are justified responses.",
"Acceptable for 3-day use. Risks: ototoxicity (IV bolus - infuse slowly over 1-2 min), hypokalemia, hypovolemia. Short duration limits cumulative toxicity. Avoid rapid bolus injection.",
"~INR 5-10/inj\n(Generic)\nCHEAPEST loop diuretic. Cost-effective for short-term use.",
"✅ RATIONAL\n(Short-term\ninitiation only)",
GREEN_BG, GREEN_BG
),
(
"6",
"Inj. Dytor\n(Torsemide)",
"IV/Oral\nTDS (1-1-1)",
"100 mg TDS\n= 300 mg/day\n(12 days)",
"20-40 mg BD\n= 40-80 mg/day\nTitrate DOWN\nas edema resolves\nSwitch to oral\nwhen tolerating",
"Switch from furosemide is rational. However, 300 mg/day with no titration over 12 days is excessive. Recommended maintenance dose for edema: 10-20 mg OD-BD. Should be stepped down every 2-3 days as clinical response occurs. Transition to oral as gut edema improves.",
"Superior to furosemide in nephrotic syndrome: 80-90% bioavailability (vs 50%), longer duration (6-8h), less albumin-dependent tubular delivery. Rational substitution. Dose-response curve flattens above 40-80 mg/day.",
"Same class toxicity as furosemide. At 300 mg/day for 12 days: cumulative risk of ototoxicity, hypovolemia, AKI. In 16F with low oncotic pressure, aggressive diuresis can collapse circulating volume while peripheral edema persists. Dose titration is mandatory.",
"~INR 25-50/inj\n(Branded Dytor)\nMODERATE COST\n(5-10x more than furosemide; justified by pharmacokinetics)",
"⚠️ CONDITIONAL\n(Drug switch rational;\nDose needs titration)",
LIGHT_BLUE, ORANGE_BG
),
(
"7",
"Tab. Dolo\n(Paracetamol)",
"Oral\nTDS (1-1-1)",
"650 mg TDS\n(2 days only\nfor fever)",
"650 mg TDS PRN\n(2-3 days max)\nNo change needed",
"Prescribed and used optimally - 2 days for fever then stopped. 650 mg TDS is standard adolescent dose. No modification required. This is the best-managed drug in the prescription.",
"Effective antipyretic/analgesic. Critical point: NSAIDs are CONTRAINDICATED in nephrotic syndrome (reduce GFR, worsen proteinuria, increase edema via prostaglandin inhibition). Correct drug selection demonstrates clinical awareness.",
"Best safety profile in entire chart for this patient. Safe at this dose for 2-day use. Hepatotoxicity risk only with overdose or prolonged use - neither applies here. No renal, hormonal, or cardiac concerns.",
"~INR 1-2/tab\n(Brand Dolo)\nCHEAPEST drug\nin prescription.\nUsed optimally.",
"✅ RATIONAL\n(Best-managed\ndrug in chart)",
GREEN_BG, GREEN_BG
),
(
"8",
"Inj. H. Albumin\n20% 100 mL\n(Human Albumin)",
"IV Infusion\nSingle dose\n(Day 18)",
"20% albumin\n100 mL\n(single infusion)",
"20% albumin\n0.5-1 g/kg\n(25-50 g)\nFollowed by\nloop diuretic\nSingle targeted use",
"Single targeted infusion on Day 18 (acute deterioration with fever) is appropriate and evidence-based. Albumin followed by loop diuretic is the guideline-recommended approach for refractory edema in severe hypoalbuminemia (serum albumin <20 g/L).",
"Provides temporary oncotic pressure rise to pull interstitial fluid back intravascularly, enabling diuretic action. Effect lasts 12-24 hours only - albumin lost in urine. Not a long-term solution; correct use as a one-time bridge.",
"Safe as single infusion with monitoring. Note: furosemide was withheld on Day 18 - standard practice is albumin FOLLOWED by loop diuretic to prevent fluid redistribution. Confirm this sequence was maintained clinically. Infection transmission risk minimal with modern pasteurized albumin.",
"~INR 3,000-6,000\nper 100 mL vial\nHIGH COST\n(Justified for\nsingle targeted use;\nnot for repeated use)",
"✅ RATIONAL\n(Single targeted\nuse justified)",
GREEN_BG, GREEN_BG
),
(
"9",
"Inj. Methylpred-\nnisolone\n(Solumedrol)",
"IV Infusion\nSingle pulse\n(Day 25)",
"500 mg in\n100 mL NS\n(1 pulse only)",
"500 mg IV OD\nx 3 consecutive\ndays (KDIGO 2025)\nThen oral\nprednisolone",
"500 mg is the correct pulse dose. However, only 1 pulse documented; KDIGO 2025 recommends 3 consecutive daily pulses for partial responders. The course appears incomplete. If 3 pulses were intended but only 1 given, this reduces efficacy without proportionally reducing toxicity risk.",
"High-dose pulse achieves superior tissue drug levels vs oral. Suppresses podocyte injury and glomerular inflammation. Evidence supports pulse therapy in steroid-resistant or partially-responding nephrotic syndrome. Full 3-pulse course is more effective than a single pulse.",
"⚠️ 16F-SPECIFIC: Acute BP spike during infusion (monitor), hyperglycemia (monitor blood glucose), menstrual axis suppression (HPO axis), mood/behavioral effects. ONE-TIME bone impact low, but cumulative steroid burden across admission must include Ca2+/Vit D supplementation.",
"~INR 200-500\nper 500 mg vial\n(Generic)\nMODERATE COST\n(Justified;\ncomplete 3-pulse course for full benefit)",
"✅ RATIONAL\n(Dose OK;\ncourse may be\nincomplete)",
GREEN_BG, YELLOW_BG
),
(
"10",
"Tab. Omacortil\n(Prednisolone)",
"Oral\nOD (1-0-0)",
"30 mg OD\n(Days 1-2\nof discharge)",
"1-2 mg/kg/day\n(max 60 mg/day)\nFor 50 kg: 50-60 mg OD\nx 4-6 weeks\nthen taper\nover 6-8 weeks",
"30 mg OD may be underdosed for a 50 kg patient (standard is 1-2 mg/kg/day = 50-60 mg). Confirm actual weight. If weight ~30 kg, 30 mg is appropriate (1 mg/kg). Taper plan must be documented. Do NOT stop abruptly (adrenal suppression risk).",
"Mainstay treatment for nephrotic syndrome. Induces remission in 80-90% of children (mostly minimal change disease). Most important drug in the entire prescription for disease modification. Standard 4-6 week full dose followed by 6-8 week taper is evidence-based.",
"⚠️ CRITICAL 16F-SPECIFIC CONCERNS:\n1. Bone density: Peak mineral accrual age - steroids impair Ca2+ absorption → MUST add Ca2+ 500mg + Vit D 400-800 IU daily (NOT in current prescription - significant omission)\n2. Growth: Less critical at 16 but monitor\n3. Menstrual irregularities: Common, counsel patient\n4. Cushingoid features: Weight gain, striae - psychological impact on teenage girl\n5. Adrenal suppression: Never stop abruptly\n6. Infection: Check pneumococcal & varicella vaccination",
"~INR 2-5/tab\n(Omacortil brand)\nCHEAPEST &\nMOST ESSENTIAL\ndrug. Highly\ncost-effective.",
"✅ RATIONAL\n(Confirm dose\nper actual weight)",
GREEN_BG, YELLOW_BG
),
(
"★ ADD",
"Tab. Calcium 500mg\n+ Vit D 400 IU\n(Calcirol / Shelcal)",
"Oral\nOD",
"NOT\nPRESCRIBED\n(Omission)",
"Calcium 500 mg\n+ Vit D 400-800 IU\nOD throughout\nsteroid course",
"MISSING FROM PRESCRIPTION. All patients receiving systemic corticosteroids should receive calcium + vitamin D supplementation. Critically important for a 16-year-old female at peak bone mineral accrual. Risk of steroid-induced osteoporosis and fracture increases without supplementation.",
"Prevents steroid-induced bone loss. Calcium and Vit D supplementation is included in all standard nephrotic syndrome management protocols (KDIGO 2025, Ashford St. Peter's 2024). This is not optional in a growing adolescent.",
"Essential for 16F: Adolescent females have peak bone mineral density accrual between ages 11-18. Corticosteroids reduce calcium absorption, increase bone resorption → significant long-term fracture risk if unsupplemented. Recommend DXA scan if prolonged steroid course anticipated.",
"~INR 3-8/tab\n(Generic brands)\nVERY LOW COST\nHigh clinical\nimportance",
"⚠️ RECOMMENDED\nADDITION\n(Currently absent\n- significant gap)",
PURPLE_BG, PURPLE_BG
),
]
# ── Write data rows ───────────────────────────────────────────────────────────
start_row = 5
for r_idx, row_data in enumerate(rows):
row_num = start_row + r_idx
ws.row_dimensions[row_num].height = 120
(sno, drug, route, prescribed, optimized,
rationale, efficacy, safety, cost, rationality,
row_bg, rat_bg) = row_data
values = [sno, drug, route, prescribed, optimized,
rationale, efficacy, safety, cost, rationality]
for col_idx, val in enumerate(values, 1):
c = ws.cell(row=row_num, column=col_idx, value=val)
is_rat_col = (col_idx == 10)
bg = rat_bg if is_rat_col else row_bg
# Alternating subtle shade for non-flagged rows
if row_bg == WHITE and r_idx % 2 == 1:
bg = "F7F9FB" if not is_rat_col else rat_bg
c.fill = fill(bg)
c.border = border()
c.font = body_font(sz=9, bold=(col_idx in (1, 2, 10)))
if col_idx == 1:
c.alignment = Alignment(horizontal="center", vertical="center",
wrap_text=True)
elif col_idx == 10:
c.alignment = Alignment(horizontal="center", vertical="center",
wrap_text=True)
else:
c.alignment = Alignment(horizontal="left", vertical="center",
wrap_text=True)
# ── FOOTER ────────────────────────────────────────────────────────────────────
footer_row = start_row + len(rows)
ws.merge_cells(f"A{footer_row}:J{footer_row}")
ws.row_dimensions[footer_row].height = 40
c = ws.cell(row=footer_row, column=1)
c.value = ("References: KDIGO 2025 Clinical Practice Guideline for Nephrotic Syndrome in Children | "
"Tintinalli's Emergency Medicine | Brenner & Rector's The Kidney | "
"Goodman & Gilman's Pharmacological Basis of Therapeutics | "
"Ashford St. Peter's Paediatric Nephrotic Syndrome Guideline (May 2024) | "
"Chart prepared for clinical pharmacology review - not a substitute for individualized clinical judgment.")
c.font = Font(name="Arial", size=8, italic=True, color="555555")
c.fill = fill("F2F2F2")
c.alignment = Alignment(horizontal="left", vertical="center", wrap_text=True)
# ── Print / page setup ────────────────────────────────────────────────────────
ws.page_setup.orientation = "landscape"
ws.page_setup.fitToPage = True
ws.page_setup.fitToWidth = 1
ws.page_setup.fitToHeight = 0
ws.freeze_panes = "A5"
# ── Save ──────────────────────────────────────────────────────────────────────
out_path = "/home/daytona/workspace/nephrotic-optimization/Medication_Optimization_Chart_NephroticSyndrome_16F.xlsx"
wb.save(out_path)
print(f"Saved: {out_path}")
cd /home/daytona/workspace/nephrotic-optimization && python build_chart.py
python3 -c " import openpyxl, os, tempfile wb = openpyxl.Workbook() ws = wb.active ws['A1'] = 'test' # Save to tmp first tmp = '/tmp/test_wb.xlsx' wb.save(tmp) print('tmp save ok:', os.path.exists(tmp)) import shutil dest = '/home/daytona/workspace/nephrotic-optimization/test.xlsx' shutil.copy(tmp, dest) print('copy ok:', os.path.exists(dest)) "
python3 -c " import shutil, os tmp = '/tmp/test_wb.xlsx' dest = '/home/daytona/workspace/nephrotic-optimization/test.xlsx' # Try copyfile only (no permissions copy) shutil.copyfile(tmp, dest) print('ok:', os.path.exists(dest)) "
/tmp first then copyfile to workspace. Let me update the script:~/nephrotic-optimization/build_chart.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/nephrotic-optimization/build_chart.py'
cd /home/daytona/workspace/nephrotic-optimization && python build_chart.py
Medication Optimization Chart NephroticSyndrome 16F
Spreadsheet · XLSX
| Column | Content |
|---|---|
| S.No | Drug number |
| Drug Name | Brand + Generic |
| Route & Frequency | As prescribed |
| Prescribed Dose | Actual dose from chart |
| Optimized Dose | Evidence-based adjusted dose |
| Dose Adjustment Rationale | Why the change is needed |
| Efficacy | Specific to nephrotic syndrome |
| Safety Profile | 16-year-old female-specific risks |
| Cost (India) | Approximate INR per unit |
| Overall Rationality | Color-coded verdict |