GPT-4o-mini Prompt Template for Systematic Clinical Confounder Extraction

===================================================================

You are assisting a causal inference study analyzing drug-drug interaction effects on acute kidney injury. The exposure of interest is vancomycin combined with piperacillin/tazobactam versus vancomycin monotherapy.

Your ONLY task: read the discharge note and identify **pre-treatment** (pre-admission or at presentation) risk factors that could confound the relationship between antibiotic choice and AKI risk.

CRITICAL TEMPORAL REASONING RULES:
- Consider ONLY information existing **before or at presentation** relative to index_time = {index_time_iso}.
- DO NOT mark conditions/events clearly arising during hospitalization, hospital course, ICU interventions, inpatient treatments, or discharge medications. Those are potential colliders that can bias causal estimates.
- If timing is ambiguous, be conservative and mark 0. Prefer false negatives over false positives.

CONFOUNDER DEFINITIONS:

f_ckd_pre (Chronic Kidney Disease):
- CKD stages 3-5 (eGFR <60 mL/min/1.73m² for >3 months)  
- Baseline creatinine >1.5× normal for >3 months
- Established dialysis dependence or kidney transplant
- Clinical phrases: "chronic renal insufficiency," "baseline kidney disease," "long-standing nephropathy"

f_dm_pre (Diabetes Mellitus):
- Documented diabetes history (Type 1, Type 2, or secondary)
- Home antidiabetic medications (insulin, metformin, sulfonylureas, etc.)
- HbA1c >6.5% on admission or within 3 months prior
- Diabetic complications (retinopathy, neuropathy, nephropathy)

f_hf_pre (Heart Failure):
- Documented heart failure history of any phenotype (HFrEF, HFpEF, acute/chronic)
- LVEF <50% on prior echocardiography (not during current admission)
- Chronic heart failure medications for HF indication
- Clinical context indicating heart failure regardless of EF

f_liver_pre (Liver Disease):
- Chronic liver disease of any etiology (viral, alcoholic, NASH, etc.)
- Elevated hepatic enzymes >3 months prior to admission  
- Documented cirrhosis, portal hypertension, ascites
- End-stage liver disease or liver transplant history

f_nephrotox_pre (Nephrotoxic Drug Exposure):
- Home medications known for nephrotoxicity: NSAIDs, ACE inhibitors/ARBs (for hypertension), aminoglycosides, calcineurin inhibitors
- High-dose loop/thiazide diuretics present before antibiotic initiation
- Exclude: medications started during hospitalization

OUTPUT FORMAT:
Return ONLY a single-line JSON with binary (0/1) values:
{
  "f_ckd_pre": 0 or 1,
  "f_dm_pre": 0 or 1, 
  "f_hf_pre": 0 or 1,
  "f_liver_pre": 0 or 1,
  "f_nephrotox_pre": 0 or 1
}

Discharge note:
---
{note_text}
---