I want to revise a drug per day. So, let's start with antibiotics. As, I am General practitioner, I want to revise and get updates on each drugs . What do u say?

Asking for Preferences

Which antibiotic class or specific drug would you like to start with today? ยท How detailed should the revision be?

Great choice to start with Penicillins - the backbone of antibiotic therapy. Let me pull in textbook content and recent literature simultaneously.
Searching sources...
Reading File
Finding Sources
Searching PubMed

penicillin amoxicillin clinical use resistance

Searching the Web

penicillin antibiotic 2025 2026 clinical updates resistance GP prescribing

Now let me pull the actual textbook content from Goodman & Gilman and Katzung - the two most relevant pharmacology references.
Reading File
Reading File
Finding Sources
Finding Sources
Reading File
Reading File
I now have comprehensive information. Let me compile the full deep-dive revision.
Searching Images

penicillin beta-lactam mechanism of action bacterial cell wall

A medical pathophysiology diagram illustrating the mechanism of action of Catharanthus roseus root ethanolic extract (EECRR) in sensitizing multiple antibiotic-resistant Staphylococcus aureus (MAR-SA) to ampicillin. The flowchart transitions from left to right, starting with a bacterial colony of MAR-SA and a test tube representing the extract. It branches into two treatment pathways: 'Ampicillin + 1/2 MIC EECRR', which results in decreased cell viability, and 'Ampicillin + MIC EECRR', which leads to cell death (indicated by a red cross). The right side of the diagram provides a molecular level illustration of a MAR-SA cell. It demonstrates that the EECRR treatment inhibits penicillin-binding protein 2a (PBP2a), which normally blocks ampicillin. By suppressing PBP2a expression and causing plasmid DNA damage, the extract allows ampicillin to bind to PBP2, disrupting the bacterial cell wall integrity. Key labels include PBP2a, PBP2, ampicillin, plasmid, and DNA damage. This visual summarizes an antimicrobial research study on overcoming antibiotic resistance using botanical extracts.

A medical pathophysiology diagram illustrating the mechanism of action of Catharanthus roseus root ethanolic extract (EECRR) in sensitizing multiple antibiotic-resistant Staphylococcus aureus (MAR-SA) to ampicillin. The flowchart transitions from left to right, starting with a bacterial colony of MAR-SA and a test tube representing the extract. It branches into two treatment pathways: 'Ampicillin + 1/2 MIC EECRR', which results in decreased cell viability, and 'Ampicillin + MIC EECRR', which leads to cell death (indicated by a red cross). The right side of the diagram provides a molecular level illustration of a MAR-SA cell. It demonstrates that the EECRR treatment inhibits penicillin-binding protein 2a (PBP2a), which normally blocks ampicillin. By suppressing PBP2a expression and causing plasmid DNA damage, the extract allows ampicillin to bind to PBP2, disrupting the bacterial cell wall integrity. Key labels include PBP2a, PBP2, ampicillin, plasmid, and DNA damage. This visual summarizes an antimicrobial research study on overcoming antibiotic resistance using botanical extracts.

A diagnostic biochemical image displaying a SDS-PAGE gel fluorescence scan from a Bocillin competition assay. The visual demonstrates the inhibition of Pseudomonas aeruginosa Penicillin-Binding Protein 3 (PBP3) by the cyclic boronate inhibitor, vaborbactam. The gel shows a series of horizontal protein bands representing PBP3 labeled with a fluorescent Bocillin reporter. From right to left, the lanes correspond to increasing concentrations of vaborbactam (0, 0.05, 0.1, 0.25, 0.5, 1.0, 1.25, 1.5, and 1.75 mM). A clear, concentration-dependent decrease in band intensity is visible; the highest fluorescence intensity is at 0 mM (absence of inhibitor), while the lowest intensity is observed at 1.75 mM. This trend illustrates competitive binding between vaborbactam and the fluorescent reporter for the PBP3 active site. The educational focus is on the biochemical validation of non-beta-lactam antibiotic inhibitors against bacterial cell wall synthesis targets.

A diagnostic biochemical image displaying a SDS-PAGE gel fluorescence scan from a Bocillin competition assay. The visual demonstrates the inhibition of Pseudomonas aeruginosa Penicillin-Binding Protein 3 (PBP3) by the cyclic boronate inhibitor, vaborbactam. The gel shows a series of horizontal protein bands representing PBP3 labeled with a fluorescent Bocillin reporter. From right to left, the lanes correspond to increasing concentrations of vaborbactam (0, 0.05, 0.1, 0.25, 0.5, 1.0, 1.25, 1.5, and 1.75 mM). A clear, concentration-dependent decrease in band intensity is visible; the highest fluorescence intensity is at 0 mM (absence of inhibitor), while the lowest intensity is observed at 1.75 mM. This trend illustrates competitive binding between vaborbactam and the fluorescent reporter for the PBP3 active site. The educational focus is on the biochemical validation of non-beta-lactam antibiotic inhibitors against bacterial cell wall synthesis targets.

This composite educational graphic presents a microbiology analysis of bacterial cell wall synthesis using autoradiography and grain distribution profiling. It consists of three panels (a, b, and c), each featuring an electron micrograph of Escherichia coli alongside a corresponding quantitative graph.

Panels (a) and (b) demonstrate filamentous bacteria exhibiting abnormal cell morphology with multiple visible constrictions. The associated line graphs, which plot 'Grains / ยตm cell length' against 'Normalized cell length', show two distinct peaks labeled 'PIPS' (Penicillin-Insensitive Peptidoglycan Synthesis). These peaks correlate spatially with the cellular constrictions, indicating localized peptidoglycan incorporation sites when Penicillin-Binding Protein 3 (PBP3) is inhibited or non-functional.

Panel (c) displays normally dividing bacterial cells with shorter, rod-shaped morphology. The corresponding graph shows a single, sharp central peak at a normalized cell length of 0.5, representing focused peptidoglycan synthesis at the standard mid-cell division site. This comparison highlights the topography of cell envelope growth and the distinction between normal septal synthesis and penicillin-insensitive mechanisms in cell division mutants.

This composite educational graphic presents a microbiology analysis of bacterial cell wall synthesis using autoradiography and grain distribution profiling. It consists of three panels (a, b, and c), each featuring an electron micrograph of Escherichia coli alongside a corresponding quantitative graph. Panels (a) and (b) demonstrate filamentous bacteria exhibiting abnormal cell morphology with multiple visible constrictions. The associated line graphs, which plot 'Grains / ยตm cell length' against 'Normalized cell length', show two distinct peaks labeled 'PIPS' (Penicillin-Insensitive Peptidoglycan Synthesis). These peaks correlate spatially with the cellular constrictions, indicating localized peptidoglycan incorporation sites when Penicillin-Binding Protein 3 (PBP3) is inhibited or non-functional. Panel (c) displays normally dividing bacterial cells with shorter, rod-shaped morphology. The corresponding graph shows a single, sharp central peak at a normalized cell length of 0.5, representing focused peptidoglycan synthesis at the standard mid-cell division site. This comparison highlights the topography of cell envelope growth and the distinction between normal septal synthesis and penicillin-insensitive mechanisms in cell division mutants.

Here is your full GP-level deep dive on Penicillins - Day 1 of your antibiotic revision series.

๐Ÿ’Š Day 1 - Penicillins: The Complete GP Revision

Sources: Goodman & Gilman's Pharmacological Basis of Therapeutics | Katzung's Basic & Clinical Pharmacology 16e | CDC Antibiotic Stewardship Report 2025 | IDSA AMR Guidance 2026

1. CLASSIFICATION AT A GLANCE

ClassKey DrugsSpectrum
Natural penicillinsPenicillin G (IV), Penicillin V (oral), Benzathine Pen G (IM)Narrow - Gram+, spirochetes
AntistaphylococcalOxacillin, Nafcillin, DicloxacillinNarrow - MSSA only
AminopenicillinsAmpicillin, AmoxicillinBroader - some Gram- added
+ ฮฒ-lactamase inhibitorAmoxicillin-Clavulanate (Co-amoxiclav), Ampicillin-SulbactamBroad - overcomes resistance
AntipseudomonalPiperacillin-Tazobactam (Pip-Taz)Extended Gram- + Pseudomonas

2. MECHANISM OF ACTION

Penicillins are ฮฒ-lactam antibiotics - they are bactericidal and work by:
  1. Irreversibly binding to Penicillin-Binding Proteins (PBPs) on the bacterial cell membrane
  2. PBPs are transpeptidase enzymes responsible for the final cross-linking step of peptidoglycan (the structural backbone of the bacterial cell wall)
  3. Inhibiting PBPs leads to accumulation of defective cell wall precursors โ†’ the bacteria cannot maintain osmotic integrity โ†’ cell lysis and death
Key point: They are time-dependent killers. Efficacy depends on maintaining drug concentration above the MIC for >40-50% of the dosing interval (not on peak concentration).

3. PHARMACOKINETICS - DEEP DIVE

ParameterDetails
AbsorptionAmoxicillin - good oral bioavailability (~80%), can be taken with food. Ampicillin and Pen V - 30-55%, must be given on empty stomach (1-2 hrs before or after meals)
DistributionWidely distributed into tissues, joint/pleural/pericardial fluid, bile. Poor penetration into: CSF (normal meninges <1% of plasma), prostate, phagocytic cells, intraocular fluid. CSF penetration improves to ~5% with meningeal inflammation
Protein bindingVariable. Nafcillin/Dicloxacillin - highly protein-bound. Amoxicillin/Ampicillin - lower binding
MetabolismMinimal hepatic metabolism. Nafcillin is the exception - primarily biliary excretion
EliminationPredominantly renal - glomerular filtration AND tubular secretion. Short half-life: 30-90 minutes for most penicillins
Dose adjustmentReduce dose in significant renal impairment (except Nafcillin)
Probenecid interactionBlocks renal tubular secretion of penicillins โ†’ prolongs half-life and raises drug levels. Still used occasionally for gonorrhoea or syphilis regimens
  • Goodman & Gilman's, p.1170

4. SPECTRUM OF ACTIVITY

Natural Penicillins (Pen G, Pen V, Benzathine Pen G)

  • Gram-positive: Most streptococci (S. pyogenes, viridans group), penicillin-susceptible S. pneumoniae, non-ฮฒ-lactamase staphylococci
  • Gram-negative: Neisseria meningitidis (still very sensitive), some anaerobes (Clostridium spp., Actinomyces)
  • Spirochetes: T. pallidum (syphilis), Borrelia, Leptospira - remain highly sensitive
  • โš ๏ธ >90% of S. aureus is now resistant to natural penicillins due to ฮฒ-lactamase production
  • โš ๏ธ Penicillin-resistant S. pneumoniae is common in paediatric populations

Aminopenicillins (Amoxicillin, Ampicillin)

  • All of the above, PLUS:
  • H. influenzae (non-ฮฒ-lactamase strains), E. coli, Proteus mirabilis, Salmonella, Enterococcus faecalis
  • Amoxicillin is the most active oral ฮฒ-lactam against S. pneumoniae with elevated MICs - use higher doses (80-90 mg/kg/day) for AOM in children
  • โš ๏ธ Ampicillin-resistant H. influenzae widespread - use Co-amoxiclav instead
  • โš ๏ธ No activity against Klebsiella, Enterobacter, Pseudomonas, Serratia, Citrobacter (intrinsic ฮฒ-lactamases)

Amoxicillin-Clavulanate (Co-amoxiclav)

  • Adds coverage for ฮฒ-lactamase-producing H. influenzae, Moraxella catarrhalis, E. coli, Klebsiella, S. aureus (MSSA)
  • Does NOT cover MRSA, Pseudomonas, Enterobacter

Piperacillin-Tazobactam

  • Extended Gram-negative coverage including Pseudomonas aeruginosa, most Enterobacterales (including some ESBL-producers), anaerobes
  • A hospital-level drug; not for GP outpatient prescribing typically
  • Katzung 16e, p.1244-1245

5. GP-RELEVANT CLINICAL INDICATIONS + DOSES

Amoxicillin

IndicationAdult DoseDurationNotes
Streptococcal pharyngitis500 mg TDS or 1g BD5-7 daysStill first-line; penicillin V is an option
Community-acquired pneumonia (mild, low-risk)1g TDS5 daysFor suspected pneumococcal; use with azithromycin if atypicals suspected
Acute otitis media500 mg TDS5-7 daysHigh-dose 80-90 mg/kg/day in children
Acute sinusitis (bacterial)500 mg TDS5 daysOnly for bacterial, not viral
H. pylori eradicationAs part of triple/quadruple therapy10-14 daysSee regimens below

Amoxicillin-Clavulanate (Co-amoxiclav)

IndicationAdult DoseDuration
Otitis media (treatment failure/severe)625 mg TDS or 1g BD5-7 days
Exacerbation of chronic bronchitis625 mg TDS5 days
Sinusitis (with ฮฒ-lactamase risk)625 mg BD/TDS5 days
UTI (Co-amoxiclav, second-line)625 mg TDS7 days
Animal bites625 mg TDS5-7 days
Cellulitis (mild, community-acquired)625 mg TDS5-7 days
2025-2026 Update (Wales/UK): National guidance now targets โ‰ฅ75% of amoxicillin prescriptions to be 5-day courses rather than 7 days. Evidence shows equivalent clinical outcomes with reduced antibiotic exposure and AMR risk. (GOV.Wales AMR 2025-2027)

Benzathine Penicillin G (IM)

IndicationDoseSchedule
Streptococcal pharyngitis1.2 million units IMSingle dose
Syphilis (primary/secondary/latent early <1yr)2.4 million units IMSingle dose
Syphilis (late latent/>1yr)2.4 million units IMWeekly x 3 weeks
Rheumatic fever prophylaxis1.2 million units IMEvery 3-4 weeks

H. pylori Eradication (Amoxicillin component)

Standard first-line Bismuth Quadruple Therapy:
  • PPI + Bismuth + Tetracycline + Metronidazole x 14 days
  • If bismuth unavailable, Non-bismuth concomitant therapy (PPI + Amoxicillin + Clarithromycin + Metronidazole x 14 days) - recent 2026 meta-analysis (PMID: 41498306) confirms high eradication rates with this regimen.

6. RESISTANCE MECHANISMS - THE "BIG 3"

MechanismDetailsClinical Example
ฮฒ-lactamase productionMost common. Enzyme cleaves the ฮฒ-lactam ringS. aureus, H. influenzae, E. coli. Overcome with clavulanate/sulbactam/tazobactam
Altered PBPsPBP mutations reduce penicillin binding affinityMRSA (PBP2a - mecA gene); Penicillin-resistant S. pneumoniae. ฮฒ-lactamase inhibitors do NOT help here
Efflux pumps / Reduced permeabilityDrug pumped out or can't enter the cellGram-negative bacteria (P. aeruginosa); combined with ฮฒ-lactamase
2026 IDSA AMR Guidance note: ESBLs (Extended-Spectrum ฮฒ-Lactamases) inactivate most penicillins, cephalosporins, and aztreonam. ESBL-producing Enterobacterales generally remain susceptible to carbapenems. (IDSA AMR Guidance 2026)

7. ADVERSE EFFECTS

EffectFrequencyDetails
Hypersensitivity reactionsMost importantRanges from maculopapular rash (~5%) to urticaria, serum sickness, to life-threatening anaphylaxis (<0.05%)
GI disturbanceCommon with Co-amoxiclavNausea, diarrhoea - especially clavulanate component. Take with food for Co-amoxiclav
C. difficileLess common than clindamycin/FQStill a risk, especially in elderly/hospitalized
Neurotoxicity (rare)High-dose IVSeizures with very high doses (e.g., >20 MU/day penicillin G), especially in renal impairment
HaematologicalRareHaemolytic anaemia, neutropaenia, thrombocytopaenia with prolonged use
Electrolyte disturbanceIV formulationsHigh-dose IV piperacillin can cause hypokalaemia

8. PENICILLIN ALLERGY - THE UPDATED PICTURE โญ (Critical GP Pearl)

This is one of the most clinically important and commonly mismanaged issues:
  • ~10% of patients self-report penicillin allergy
  • <1% are truly allergic (CDC 2025)
  • Most "allergies" are:
    • Maculopapular rash from amoxicillin during EBV infection (misattributed allergy)
    • Childhood GI side effects
    • Family history
Cross-reactivity with Cephalosporins:
  • Overall cross-reactivity: ~2-7% (likely an overestimate based on older data)
  • True cross-reactivity is R-group side chain dependent, not just ring structure
  • Patients with penicillin allergy + cephalosporin with different R-group: cross-reactivity <2%
  • Patients with history of anaphylaxis to penicillin: cross-reactivity up to 50% - skin test or use alternative
  • Penicillin vs. carbapenem: <1%
  • Penicillin vs. monobactam (aztreonam): 0% (except aztreonam-ceftazidime share R-group)
GP action: When you see "penicillin allergy" on a patient's record - clarify the reaction. Encourage de-labelling of patients with low-risk reactions. An inaccurate penicillin allergy label forces use of broader-spectrum antibiotics, driving resistance.
  • Washington Manual of Medical Therapeutics

9. KEY DRUG INTERACTIONS

DrugInteractionClinical Significance
ProbenecidBlocks tubular secretion โ†’ raises penicillin levelsUsed intentionally for syphilis/gonorrhoea regimens
Warfarin / AnticoagulantsBroad-spectrum penicillins alter gut flora โ†’ reduce Vit K โ†’ potentiate anticoagulationMonitor INR
Oral contraceptivesTheoretical reduction in efficacy (old data, largely dismissed)Advise per local guidance
MethotrexatePenicillins reduce renal MTX excretion โ†’ toxicity riskAvoid combination or monitor MTX levels closely
AllopurinolIncreases incidence of ampicillin rashRash rate rises from 5% to ~20%

10. PRESCRIBING PEARLS FOR GPS ๐Ÿฉบ

  1. Amoxicillin with food - always fine. All other oral penicillins - empty stomach
  2. Amoxicillin for CAP: 1g TDS is now recommended over 500mg TDS due to rising pneumococcal MICs
  3. Co-amoxiclav for bites - ALWAYS the first choice for human/animal bites
  4. Benzathine penicillin for syphilis - never substitute with oral penicillin (incomplete absorption)
  5. Don't use ampicillin empirically for UTI or typhoid - resistance rates too high
  6. Shorter courses work: 5-day amoxicillin is as effective as 7 days for most community infections (2025-2026 guideline shift)
  7. Penicillin allergy de-labelling is a stewardship priority - most self-reported allergies are not true allergies
  8. MRSA coverage: No penicillin covers MRSA. If MRSA suspected, escalate
  9. Enterococcal endocarditis: Ampicillin + Ceftriaxone (preferred over Ampicillin + Gentamicin - same efficacy, less nephrotoxicity)
  10. Renal dose adjustment: Required for most penicillins except Nafcillin (biliary excretion)

11. MEMORY AID

PENICILLINS = "BLAST the Cell Wall"
B - Bactericidal (cell wall synthesis inhibitor)
L - ฮฒ-Lactam ring is the pharmacophore
A - Allergy is the #1 concern (anaphylaxis possible)
S - Spectrum varies by subclass (narrow โ†’ broad)
T - Time-dependent killing (T > MIC is key PK/PD)

Quick Recall Card

Natural PenAminopenicillinsCo-amoxiclavAntistaphylococcal
MRSA?NoNoNoNo (only MSSA)
Pseudomonas?NoNoNoNo
H. influenzae?NoSome strainsYesNo
S. aureus (MSSA)?No (resist)NoYesYes (DOC)
Streptococci?Yes (DOC)YesYesYes
Spirochetes?Yes (DOC)YesYesNo

That's Day 1 - Penicillins - fully covered from mechanism to GP pearls with 2025-2026 updates.
Tomorrow's suggestion: Cephalosporins (natural progression from penicillins, building on ฮฒ-lactam knowledge) - or tell me which class you'd prefer next! ๐ŸŽฏ

Time-dependent killing (T > MIC is key PK/PD)- what does this mean?

Great question - this is a fundamental concept in antibiotic prescribing that directly affects how you dose drugs in practice.
Searching sources...
Finding Sources
Searching Images

antibiotic pharmacodynamics time-dependent concentration-dependent killing MIC graph

Reading File
Reading File
Excellent - Harrison's 22e and Fishman's Pulmonary have exactly what we need. Here's the full explanation:

โฑ๏ธ Time-Dependent Killing (T > MIC) - Explained

First, what is MIC?

MIC = Minimum Inhibitory Concentration
  • The lowest drug concentration that stops a bacterium from growing under lab conditions
  • Think of it as the "floor" the drug must stay above to be effective
  • Every bacterium has its own MIC for every antibiotic
  • Example: S. pneumoniae may have an MIC of 0.06 mg/L for amoxicillin

The 3 PK/PD Models of Antibiotic Killing

Antibiotics don't all kill bacteria in the same way. There are 3 patterns:
ModelWhat drives killingKey parameterExamples
Time-dependentHow long drug stays above MICT > MICPenicillins, Cephalosporins, Carbapenems, Macrolides, Linezolid
Concentration-dependentHow high the peak goes vs. MICCmax : MICAminoglycosides, Fluoroquinolones
AUC-dependentTotal drug exposure over time vs. MICAUC : MICVancomycin, Daptomycin, Fluoroquinolones
  • Harrison's Principles of Internal Medicine 22e, p.1211 | Fishman's Pulmonary Diseases, p.2680

Time-Dependent Killing - The Core Concept

For penicillins (and all ฮฒ-lactams), killing rate does NOT increase with higher doses beyond a ceiling.
Imagine two scenarios:
Scenario A: Give a HUGE dose once
Drug level: โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘  (high peak, then drops below MIC)
                              โ†‘ MIC threshold
Effect: Kills bacteria during the high phase... then bacteria REGROW when drug drops

Scenario B: Give smaller doses MORE frequently (or spread out the same dose)
Drug level: โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘
                              โ†‘ MIC threshold
Effect: Drug stays above MIC for longer โ†’ sustained bacterial killing โœ…
The key insight: Once drug concentration reaches ~4x the MIC, killing is maximal and saturated - going higher does NOTHING extra. What matters is keeping it above the MIC for enough time.

The Target: How long above MIC is "enough"?

ฮฒ-Lactam GroupTarget (fT > MIC)Meaning
Penicillins40-50% of dosing intervalDrug must be above MIC for โ‰ฅ40-50% of the time between doses
Cephalosporins60-70% of dosing interval
Carbapenemsโ‰ฅ40% of dosing interval
"f" stands for the free (unbound) fraction - only drug not bound to protein is active.
  • Fishman's Pulmonary Diseases, p.2680

A Practical Example (Amoxicillin 500mg TDS)

Dose at 8am โ†’ 2pm โ†’ 8pm (every 8 hours = 480 min dosing interval)

Drug concentration over 8 hours:
         โ†‘ Peak
         |  \
         |   \
- - - - -|- - --------  โ† MIC
         |         \
         |          \___  (falls below MIC near end of interval)

Time above MIC = ~4 hours out of 8 = 50% โœ… (just hits target for penicillins)
This is why amoxicillin is given 3x/day (TDS) and not once daily - unlike, say, azithromycin which has a long half-life and tissue accumulation.

Why Does This Matter for Your Prescribing?

1. Frequency matters more than dose size (for ฮฒ-lactams)

  • Doubling the amoxicillin dose from 500mg to 1g does NOT double the bacterial kill if you're already above 4x MIC
  • But increasing frequency (BD โ†’ TDS) or extending infusion time does improve efficacy

2. It explains why compliance matters so much

  • Missing doses of amoxicillin/penicillin โ†’ drug level drops below MIC โ†’ bacteria regrow
  • With concentration-dependent drugs (e.g., gentamicin), one big dose a day is fine - but not with penicillins

3. Extended/continuous IV infusions for severe infections

  • In ICU settings, piperacillin-tazobactam is sometimes given as a 3-4 hour extended infusion (rather than a 30-min bolus) to maximize T > MIC - especially against organisms with higher MICs
  • This is called pharmacodynamic optimisation

4. Rising MICs = shrinking T > MIC window

  • As bacteria develop resistance โ†’ MIC rises โ†’ the same dose stays above MIC for a shorter fraction of the interval โ†’ treatment may fail even with the "right" antibiotic
  • This is why high-dose amoxicillin (80-90 mg/kg/day) is used for AOM in children - to overcome modestly elevated pneumococcal MICs

Contrast with Concentration-Dependent (e.g., Gentamicin)

For gentamicin - the HIGHER the peak above MIC, the MORE it kills. So you give it once daily in a big dose to maximize Cmax:MIC, and the low trough between doses actually reduces nephrotoxicity. Completely opposite logic to penicillins.

Summary - One-Line Memory Peg

๐Ÿ”‘ Penicillins: "Keep it dripping, not spiking" - it's the time spent above the MIC that kills bacteria, not how high the peak goes.
ฮฒ-Lactams (Pen, Ceph)Aminoglycosides (Gentamicin)Vancomycin
Key parameterT > MICCmax : MICAUC : MIC
StrategyDose frequentlyDose high, once dailyMonitor trough/AUC
AnalogySlow sustained rainOne heavy downpourTotal rainfall over 24h

This concept directly underpins why we prescribe penicillins TDS/QDS, why extended infusions help in severe infections, and why missing doses is harmful - all things you'll use in GP practice every day.
Ready for tomorrow's drug? ๐ŸŽฏ

Explain me the next two methods concentration and AUC dependent also like above.

Searching sources...
Finding Sources
Finding Sources
Reading File
Reading File
Finding Sources
There's even a textbook figure for this - let me fetch it.
Loading Image
This is the actual Harrison's 22e PK/PD diagram. Let's build the full explanation around it.

๐Ÿ“ˆ Concentration-Dependent & AUC-Dependent Killing - Explained

First, look at this official textbook diagram - it shows all three parameters on a single drug concentration-time curve:
PK/PD Model - Harrison's 22e
The red dashed line = MIC. The blue curve = drug concentration over time after one dose.
  • Peak (Cmax/MIC) = how HIGH the peak goes above the MIC
  • T > MIC = the window of time the drug stays above the MIC (what we covered last time)
  • AUC/MIC = the entire shaded area under the curve, divided by the MIC
Now let's go through the next two in depth.
  • Harrison's Principles of Internal Medicine 22e, p.1211

๐Ÿ”บ Method 2 - Concentration-Dependent Killing (Cmax : MIC)

The Core Concept

For these drugs, the HIGHER the peak concentration relative to the MIC, the FASTER and MORE COMPLETELY bacteria are killed. There is NO ceiling effect - doubling the peak genuinely doubles the kill rate.
Low peak dose (e.g. 3mg/kg):
         โ†‘ Cmax (3x MIC)
         | \
- - - - -|- --------  โ† MIC
         |       \___
Effect: Some killing, bacteria may survive and regrow โŒ

High peak dose (e.g. 7mg/kg):
              โ†‘ Cmax (10x MIC)
              |  \
              |   \
- - - - - - - - - --------  โ† MIC
                        \___
Effect: Rapid, massive bacterial kill โœ…
The higher you drive the peak, the better. The long drug-free trough between doses? That's actually fine - and even beneficial (see PAE below).

Key Parameter

Cmax : MIC ratio - target is typically โ‰ฅ8-12x
For example, if bacterial MIC for gentamicin = 1 mg/L, you want your Cmax to be at least 8-12 mg/L.

Why the Drug-Free Trough Helps

This is where the brilliant concept of the Post-Antibiotic Effect (PAE) comes in:
PAE = Even after drug concentration drops BELOW the MIC, bacteria remain stunned and suppressed for 1-4 hours before they start regrowing.
Think of it like a boxer who's been knocked down - even after you stop hitting, they don't immediately jump back up.
For aminoglycosides, PAE against Gram-negatives lasts 1-4 hours. This gap also allows the kidney tubular cells time to "flush out" drug and recover - which is why:
Once-daily gentamicin: HIGH peak (kill) โ†’ long trough (kidney recovery + PAE still working)
                                                         โ†“
                                        LESS nephrotoxicity + BETTER killing โœ…

Three-times-daily gentamicin (old approach): lower peaks + sustained drug in kidney
                                                         โ†“
                                        MORE nephrotoxicity + LESS killing โŒ
This is completely opposite to penicillins. Frequent dosing of aminoglycosides = worse outcome.

Examples of Concentration-Dependent Drugs

DrugTarget Cmax:MICDosing Strategy
Gentamicinโ‰ฅ8-10xOnce daily (5-7 mg/kg)
Amikacinโ‰ฅ8-10xOnce daily
Tobramycinโ‰ฅ8-10xOnce daily
MetronidazoleHigh CmaxStandard dosing
Fluoroquinolones (ciprofloxacin, levofloxacin) are a hybrid - they have both Cmax/MIC AND AUC/MIC dependency (covered below).

Prescribing Implication

Gentamicin dose calculation:
  • Dose = 5-7 mg/kg once daily (not 1.7 mg/kg TDS as in old regimens)
  • Monitor trough level (drawn just before next dose) - must be <1 mg/L (ensures adequate drug-free interval = kidney recovery)
  • Monitor peak level if needed - drawn 1 hour after infusion
  • Fishman's Pulmonary Diseases, p.2684-2686

๐Ÿ“Š Method 3 - AUC-Dependent Killing (AUC : MIC)

What is AUC?

AUC = Area Under the Curve
Look at the graph again - it's literally the total area of the blue shaded region under the concentration-time curve. It represents total drug exposure over the full dosing interval - combining both how high it went AND how long it stayed.
Drug concentration
         โ†‘
         |โ–ˆโ–ˆโ–ˆโ–ˆ
         |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
         |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
- - - - -|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ- - -  โ† MIC
         |          โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
         |_____________________________โ†’ Time

The AUC = the ENTIRE shaded area (โ–ˆ) above AND below the MIC line
AUC/MIC = this total area รท the MIC value

The Core Concept

These drugs are a hybrid - they are influenced by BOTH how high the peak goes AND how long the drug is around. Neither alone is sufficient. It's the total exposure that predicts killing.
Think of it like paying for a gym membership by total hours used - it doesn't matter if you went for one intense 5-hour session or five 1-hour sessions. Total hours = total benefit.

Key Targets

DrugOrganismAUC/MIC Target
VancomycinMRSA, S. aureusAUCโ‚‚โ‚„ 400-600 mgยทh/L
FluoroquinolonesS. pneumoniaeAUC/MIC >30
FluoroquinolonesGram-negative bacteriaAUC/MIC >125

Vancomycin - The Classic Example

Vancomycin monitoring has recently shifted away from trough-only monitoring to AUC-guided dosing:
Old approach (trough monitoring):
  • Just check trough level before next dose โ†’ target 15-20 mg/L
  • Problem: High trough doesn't guarantee adequate AUC, and risks nephrotoxicity
New approach (AUC/MIC monitoring):
  • Target AUCโ‚‚โ‚„ of 400-600 mgยทh/L (with MIC typically = 1 mg/L โ†’ AUC/MIC of 400-600)
  • Achieved by calculating dose using 2-point PK sampling or Bayesian software
  • Lower risk of nephrotoxicity while ensuring efficacy
"Recent evidence strongly suggests moving away from serum trough vancomycin monitoring to a PK/PD target of AUC to MIC ratio. An AUCโ‚‚โ‚„ of 400-600 mgยทh/L is associated with clinical efficacy."
  • Harriet Lane Handbook 23e

Fluoroquinolones - The True Hybrid

Fluoroquinolones (ciprofloxacin, levofloxacin, moxifloxacin) actually sit across BOTH concentration-dependent AND AUC-dependent models:
  • Against S. pneumoniae: AUC/MIC >30 is the target
  • Against Gram-negatives: AUC/MIC >125 is the target
  • A Cmax/MIC of โ‰ฅ12 for pneumococcus is also associated with optimal killing
This is why levofloxacin 500mg once daily works well - one big dose achieves both a good peak AND a sufficient 24-hour AUC, rather than splitting it into smaller doses.

Examples of AUC-Dependent Drugs

DrugPrimary targetMonitoring
VancomycinAUCโ‚‚โ‚„/MIC 400-600Trough OR AUC-guided (preferred now)
LevofloxacinAUC/MIC >30 (GPC), >125 (GNR)Clinical response
CiprofloxacinAUC/MIC >125 (GNR)Clinical response
MoxifloxacinAUC/MICClinical response
DaptomycinAUC/MICClinical response
TigecyclineAUC/MICClinical response
  • Harrison's 22e, p.1211 | Fishman's Pulmonary Diseases, p.2680 | Harriet Lane 23e

๐Ÿง  All Three Methods - Side-by-Side Master Summary

Time-DependentConcentration-DependentAUC-Dependent
What drives killingDuration above MICHeight of peak vs. MICTotal exposure (peak + duration)
Key parameterT > MICCmax : MICAUC : MIC
Ceiling effect?YES - killing saturates at 4x MICNO - higher peak = more killNO - more exposure = more kill
Optimal dosingFrequent small doses / extended infusionInfrequent large dosesOnce or twice daily
Drug-free trough?Dangerous (bacteria regrow)Fine - PAE covers the gapFine to have trough periods
PAE?Minimal (ฮฒ-lactams)Long (aminoglycosides)Moderate
ExamplesPenicillins, Cephalosporins, CarbapenemsGentamicin, AmikacinVancomycin, Fluoroquinolones, Daptomycin
AnalogySteady drip irrigationOne powerful floodTotal rainfall measurement

๐ŸŽฏ The "Why Does Any of This Matter to a GP?" Summary

ScenarioPK/PD Lesson
Patient missed 2 doses of amoxicillinDangerous - T > MIC drops, bacteria regrow. Stress compliance
Prescribing ciprofloxacin for UTIOnce daily 500mg fine - AUC/MIC model means one big dose works
Gentamicin in hospitalOnce-daily dosing is BETTER than TDS - higher kill, less toxicity
Patient on vancomycin for MRSAAsk for AUC monitoring, not just trough levels (current 2025 standard)
Levofloxacin 500mg OD vs 250mg BDSame total dose - but OD achieves higher Cmax/MIC AND similar AUC - OD preferred

Memory Peg - All 3 Together

๐Ÿ…ฃ Time > MIC       = ฮฒ-Lactams  โ†’ "Keep it STEADY" (drip, drip, drip)
๐Ÿ…’ Cmax/MIC         = Aminoglycosides โ†’ "Hit it HARD once" (one big punch)
๐Ÿ… AUC/MIC          = Vancomycin/FQ โ†’ "Total EXPOSURE matters" (count all hours)
You now have the complete PK/PD framework that underpins how every antibiotic class is dosed. Everything in antibiotic therapy - dosing frequency, monitoring parameters, dose adjustments in renal failure - flows from these three principles. ๐Ÿ’ก

Create a quick reference PDF comparing all 3 PK/PD models with dosing strategies

Reading File
Good - I'll use ReportLab to create a well-designed PDF. Let me build it now.
Running Command

ls -la /tmp/workspace/ 2>/dev/null || mkdir -p /tmp/workspace && echo "workspace ready"

Running Command

mkdir -p /tmp/workspace/pkpd-reference && cat > /tmp/workspace/pkpd-reference/generate_pdf.py << 'PYEOF' from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.lib.units import cm, mm from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY from reportlab.platypus import ( SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable, KeepTogether ) from reportlab.graphics.shapes import Drawing, Rect, Line, String, Polygon, Circle from reportlab.graphics import renderPDF from reportlab.graphics.charts.lineplots import LinePlot from reportlab.graphics.widgets.markers import makeMarker import math # โ”€โ”€ Colour palette โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ C_NAVY = colors.HexColor('#1B2A4A') C_TEAL = colors.HexColor('#0F7C8A') C_AMBER = colors.HexColor('#E07B2A') C_GREEN = colors.HexColor('#2A7A3B') C_LRED = colors.HexColor('#C0392B') C_LTBLUE = colors.HexColor('#D6EAF8') C_LTAMBER = colors.HexColor('#FEF9E7') C_LTGREEN = colors.HexColor('#EAFAF1') C_LTYELL = colors.HexColor('#FDFEFE') C_GREY = colors.HexColor('#7F8C8D') C_LGREY = colors.HexColor('#F2F3F4') C_WHITE = colors.white C_BLACK = colors.HexColor('#1C1C1C') C_MICRED = colors.HexColor('#E74C3C') W, H = A4 # 595.27 x 841.89 pts # โ”€โ”€ Document โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ doc = SimpleDocTemplate( '/tmp/workspace/pkpd-reference/PKPD_Antibiotic_Reference.pdf', pagesize=A4, leftMargin=1.5*cm, rightMargin=1.5*cm, topMargin=1.5*cm, bottomMargin=1.8*cm, title='Antibiotic PK/PD Models โ€“ Quick Reference', author='Orris Medical AI', subject='Pharmacokinetics / Pharmacodynamics' ) styles = getSampleStyleSheet() def sty(name, **kw): s = ParagraphStyle(name, **kw) return s S_TITLE = sty('Title2', fontName='Helvetica-Bold', fontSize=20, textColor=C_WHITE, alignment=TA_CENTER, spaceAfter=2) S_SUBTITLE = sty('Sub', fontName='Helvetica', fontSize=10, textColor=C_WHITE, alignment=TA_CENTER, spaceAfter=0) S_SECHEAD = sty('SecHead', fontName='Helvetica-Bold', fontSize=12, textColor=C_WHITE, alignment=TA_CENTER, spaceAfter=4) S_BODY = sty('Body2', fontName='Helvetica', fontSize=8.5, textColor=C_BLACK, leading=12, spaceAfter=3) S_BOLD = sty('Bold2', fontName='Helvetica-Bold', fontSize=8.5, textColor=C_BLACK, leading=12) S_SMALL = sty('Small', fontName='Helvetica', fontSize=7.5, textColor=C_GREY, leading=10) S_CELLHEAD = sty('CH', fontName='Helvetica-Bold', fontSize=8, textColor=C_WHITE, alignment=TA_CENTER) S_CELL = sty('CL', fontName='Helvetica', fontSize=8, textColor=C_BLACK, alignment=TA_LEFT, leading=11) S_CELLC = sty('CC', fontName='Helvetica', fontSize=8, textColor=C_BLACK, alignment=TA_CENTER, leading=11) S_PEARLS = sty('Pearl', fontName='Helvetica', fontSize=8, textColor=C_BLACK, leading=12, leftIndent=6) # โ”€โ”€ Curve drawing helper โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ def make_curve_drawing(model, w=160, h=90): """Draw a mini PK curve for each model.""" d = Drawing(w, h) pad_l, pad_b, pad_r, pad_t = 18, 14, 8, 8 gw = w - pad_l - pad_r gh = h - pad_b - pad_t mic_y = pad_b + gh * 0.28 # MIC line position def tx(t): return pad_l + t * gw # t in [0,1] def cy(c): return pad_b + c * gh # c in [0,1] # Axes d.add(Line(pad_l, pad_b, pad_l, pad_b+gh, strokeColor=C_GREY, strokeWidth=0.7)) d.add(Line(pad_l, pad_b, pad_l+gw, pad_b, strokeColor=C_GREY, strokeWidth=0.7)) # Axis labels d.add(String(2, pad_b+gh//2, 'Conc.', fontSize=5.5, fillColor=C_GREY, textAnchor='middle')) d.add(String(pad_l+gw//2, 1, 'Time', fontSize=5.5, fillColor=C_GREY, textAnchor='middle')) # MIC dashed line seg = 4 x = pad_l while x < pad_l + gw: d.add(Line(x, mic_y, min(x+seg, pad_l+gw), mic_y, strokeColor=C_MICRED, strokeWidth=0.9, strokeDashArray=[3,2])) x += seg*2 d.add(String(pad_l+gw+1, mic_y-2, 'MIC', fontSize=5, fillColor=C_MICRED, textAnchor='start')) if model == 'time': # Two doses showing T>MIC windows for offset in [0, 0.47]: pts = [] for i in range(60): t = i/59 raw = math.exp(-6*(t-0.08)**2) if t > 0.04 else 0 c = 0.55 * raw pts.append((tx(t*0.44 + offset), cy(c))) for i in range(len(pts)-1): d.add(Line(pts[i][0], pts[i][1], pts[i+1][0], pts[i+1][1], strokeColor=C_TEAL, strokeWidth=1.4)) # T>MIC bracket x1, x2 = tx(0.07), tx(0.38) d.add(Line(x1, mic_y+2, x2, mic_y+2, strokeColor=C_TEAL, strokeWidth=1.2, strokeDashArray=[2,1])) d.add(String((x1+x2)/2, mic_y+4, 'T > MIC', fontSize=5.5, fillColor=C_TEAL, textAnchor='middle')) elif model == 'conc': # Single high spike pts = [] for i in range(80): t = i/79 if t < 0.05: c = t/0.05 * 0.92 else: c = 0.92 * math.exp(-5*(t-0.05)) pts.append((tx(t), cy(c))) for i in range(len(pts)-1): d.add(Line(pts[i][0], pts[i][1], pts[i+1][0], pts[i+1][1], strokeColor=C_AMBER, strokeWidth=1.4)) # Cmax arrow peak_x = tx(0.05) peak_y = cy(0.92) d.add(Line(peak_x+2, peak_y, peak_x+2, mic_y, strokeColor=C_AMBER, strokeWidth=1, strokeDashArray=[2,2])) d.add(String(peak_x+4, (peak_y+mic_y)/2, 'Cmax/MIC', fontSize=5.5, fillColor=C_AMBER, textAnchor='start')) # PAE bracket # find where curve drops below MIC pae_start = tx(0.42) pae_end = tx(0.62) d.add(Line(pae_start, mic_y-5, pae_end, mic_y-5, strokeColor=C_GREEN, strokeWidth=1)) d.add(Line(pae_start, mic_y-3, pae_start, mic_y-7, strokeColor=C_GREEN, strokeWidth=0.8)) d.add(Line(pae_end, mic_y-3, pae_end, mic_y-7, strokeColor=C_GREEN, strokeWidth=0.8)) d.add(String((pae_start+pae_end)/2, mic_y-12, 'PAE', fontSize=5.5, fillColor=C_GREEN, textAnchor='middle')) elif model == 'auc': # Moderate curve, shade AUC pts = [] for i in range(80): t = i/79 if t < 0.07: c = t/0.07 * 0.72 else: c = 0.72 * math.exp(-3.5*(t-0.07)) pts.append((tx(t), cy(c))) # Fill AUC area (simplified - draw polygon) poly_pts = [(pad_l, pad_b)] for p in pts: poly_pts.append(p) poly_pts.append((tx(1), pad_b)) poly_flat = [] for p in poly_pts: poly_flat.extend(p) d.add(Polygon(poly_flat, fillColor=colors.HexColor('#D5F5E3'), strokeColor=None, fillOpacity=0.5)) for i in range(len(pts)-1): d.add(Line(pts[i][0], pts[i][1], pts[i+1][0], pts[i+1][1], strokeColor=C_GREEN, strokeWidth=1.4)) # AUC label inside shaded region d.add(String(tx(0.35), cy(0.18), 'AUC/MIC', fontSize=5.5, fillColor=C_GREEN, textAnchor='middle')) return d # โ”€โ”€ PAGE BACKGROUND helper (via canvas) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ def header_footer(canvas, doc): canvas.saveState() # Top header bar canvas.setFillColor(C_NAVY) canvas.rect(0, H-2.6*cm, W, 2.6*cm, fill=1, stroke=0) # Title canvas.setFillColor(C_WHITE) canvas.setFont('Helvetica-Bold', 18) canvas.drawCentredString(W/2, H-1.5*cm, 'Antibiotic PK/PD Models โ€“ Quick Reference') canvas.setFont('Helvetica', 9) canvas.drawCentredString(W/2, H-2.1*cm, 'For General Practitioners | Time-Dependent ยท Concentration-Dependent ยท AUC-Dependent') # Bottom bar canvas.setFillColor(C_NAVY) canvas.rect(0, 0, W, 1.2*cm, fill=1, stroke=0) canvas.setFillColor(C_WHITE) canvas.setFont('Helvetica', 7.5) canvas.drawString(1.5*cm, 0.45*cm, 'Sources: Harrison\'s Principles 22e ยท Goodman & Gilman ยท Fishman\'s Pulmonary Diseases ยท Harriet Lane 23e') canvas.drawRightString(W-1.5*cm, 0.45*cm, 'Orris Medical AI | August 2026') canvas.restoreState() # โ”€โ”€ Build content โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ story = [] story.append(Spacer(1, 2.8*cm)) # space below header bar # โ”€โ”€ INTRO ROW โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ intro_text = ( "Antibiotic efficacy depends not only on <b>which</b> drug you prescribe, but on <b>how</b> you dose it. " "Three pharmacodynamic (PD) models govern bacterial killing, each requiring a different dosing strategy. " "Understanding these models explains dosing frequency, monitoring parameters, and why the same total daily " "dose given differently can succeed or fail." ) intro_style = ParagraphStyle('intro', fontName='Helvetica', fontSize=9, textColor=C_BLACK, leading=13, alignment=TA_JUSTIFY, borderColor=C_TEAL, borderWidth=1, borderPadding=8, backColor=colors.HexColor('#EAF7FB')) story.append(Paragraph(intro_text, intro_style)) story.append(Spacer(1, 0.35*cm)) # โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• # SECTION CARDS โ€“ one per model # โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• models = [ { 'color': C_TEAL, 'light': colors.HexColor('#EAF7FB'), 'emoji': 'โฑ', 'title': 'Model 1 โ€“ Time-Dependent Killing', 'param': 'T > MIC', 'param_full': 'Time drug concentration stays above MIC', 'what': 'Killing rate saturates once concentration reaches ~4ร— MIC. Going higher adds nothing. Only staying ABOVE the MIC longer increases effect.', 'target': 'Penicillins: 40โ€“50% ยท Cephalosporins: 60โ€“70% ยท Carbapenems: โ‰ฅ40% of dosing interval above MIC', 'drugs': [ ('Amoxicillin / Pen V', 'TDS or QDS', 'Must maintain T>MIC; TDS > BD'), ('Benzylpenicillin (IV)', 'q4โ€“6h or CI', 'Short tยฝ; continuous infusion in ICU'), ('Cephalexin', 'QDS', 'Higher freq than cefixime (longer tยฝ)'), ('Ceftriaxone', 'ODโ€“BD', 'Long tยฝ 6โ€“9h allows once daily'), ('Meropenem (IV)', 'q8h or ext. infusion', 'Extended 3โ€“4h infusion maximises T>MIC'), ('Piperacillin-Tazobactam', 'q6โ€“8h or CI', 'Extended infusion for resistant organisms'), ], 'strategy': 'Dose FREQUENTLY or use extended/continuous IV infusions to keep drug above MIC.', 'trap': 'Doubling the dose without increasing frequency does NOT improve killing. Missing doses causes bacterial regrowth.', 'pae': 'Minimal PAE against Gram-negatives โ†’ cannot rely on drug-free interval.', 'monitoring': 'Clinical response; ensure compliance; extend infusion time for high-MIC organisms.', 'analogy': '๐Ÿšฟ Steady drip irrigation โ€“ constant water supply, not one big flood', 'curve': 'time', }, { 'color': C_AMBER, 'light': colors.HexColor('#FEF5E7'), 'emoji': '๐Ÿ”บ', 'title': 'Model 2 โ€“ Concentration-Dependent Killing', 'param': 'Cmax : MIC', 'param_full': 'Peak drug concentration relative to MIC', 'what': 'The HIGHER the peak above MIC, the faster and more completely bacteria are killed. No ceiling โ€“ higher peak = better kill. Drug-free trough is safe (even beneficial).', 'target': 'Cmax/MIC โ‰ฅ 8โ€“12ร— for aminoglycosides ยท Once-daily dosing achieves optimal peak', 'drugs': [ ('Gentamicin', '5โ€“7 mg/kg OD (IV)', 'OD > TDS โ€“ higher peak, less nephrotoxicity'), ('Amikacin', '15โ€“20 mg/kg OD (IV)', 'Monitor trough <5 mg/L; peak 56โ€“64 mg/L'), ('Tobramycin', '5โ€“7 mg/kg OD (IV)', 'Similar to gentamicin'), ('Metronidazole', 'Standard dosing', 'Some concentration-dependent features'), ], 'strategy': 'Give INFREQUENT but LARGE doses to maximise peak (Cmax). Once-daily > multiple small doses.', 'trap': 'Old TDS aminoglycoside dosing = lower peaks (less killing) + sustained trough (more nephrotoxicity). Avoid.', 'pae': 'Prolonged PAE 1โ€“4h against Gram-negatives โ†’ drug-free trough is SAFE and reduces kidney exposure.', 'monitoring': 'Trough level before next dose: target <1 mg/L (gentamicin). Peak 1h post-infusion if needed.', 'analogy': '๐ŸฅŠ One powerful knockout punch โ€“ intensity matters, not duration', 'curve': 'conc', }, { 'color': C_GREEN, 'light': colors.HexColor('#EAFAF1'), 'emoji': '๐Ÿ“Š', 'title': 'Model 3 โ€“ AUC-Dependent Killing', 'param': 'AUC : MIC', 'param_full': 'Total drug exposure (area under curve) relative to MIC', 'what': 'Total drug exposure over 24h drives killing โ€“ accounts for BOTH peak height AND duration. Neither alone is sufficient; the integrated area under the concentration-time curve predicts efficacy.', 'target': 'Vancomycin: AUCโ‚‚โ‚„/MIC 400โ€“600 ยท Fluoroquinolones vs S. pneumoniae: >30 ยท vs Gram-negatives: >125', 'drugs': [ ('Vancomycin (IV)', 'Individualised dosing', 'AUC-guided monitoring now preferred over trough'), ('Levofloxacin', '500 mg OD', 'OD better than BD โ€“ higher AUC/MIC & Cmax/MIC'), ('Ciprofloxacin', '500โ€“750 mg BD', 'AUC/MIC >125 for Gram-negatives'), ('Moxifloxacin', '400 mg OD', 'Superior tissue penetration; AUC-driven'), ('Daptomycin (IV)', '4โ€“6 mg/kg OD', 'AUC/MIC + Cmax/MIC; OD dosing'), ('Tigecycline (IV)', '50 mg BD after LD', 'AUC-dependent; broad spectrum'), ], 'strategy': 'Optimise TOTAL EXPOSURE. OD or BD dosing achieves adequate AUC while maintaining practical schedule.', 'trap': 'Vancomycin: old trough-only monitoring (target 15โ€“20 mg/L) is now replaced by AUC/MIC-guided dosing to balance efficacy and reduce nephrotoxicity.', 'pae': 'Moderate PAE; the drug-free interval is tolerated due to residual post-antibiotic suppression.', 'monitoring': 'Vancomycin: AUCโ‚‚โ‚„ target 400โ€“600 mgยทh/L (2-point sampling or Bayesian). Fluoroquinolones: clinical response.', 'analogy': '๐ŸŒง Total rainfall over 24h โ€“ both the downpour and the drizzle count', 'curve': 'auc', }, ] for m in models: col = m['color'] bg = m['light'] items = [] # โ”€โ”€ Section header bar โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ hdr_data = [[Paragraph(f"<b>{m['title']}</b>", S_SECHEAD)]] hdr_tbl = Table(hdr_data, colWidths=[doc.width]) hdr_tbl.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,-1), col), ('ROWBACKGROUNDS', (0,0), (-1,-1), [col]), ('TOPPADDING', (0,0), (-1,-1), 6), ('BOTTOMPADDING', (0,0), (-1,-1), 6), ('LEFTPADDING', (0,0), (-1,-1), 8), ('ROUNDEDCORNERS', [4,4,0,0]), ])) items.append(hdr_tbl) # โ”€โ”€ Two-column layout: curve + key facts โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ curve_d = make_curve_drawing(m['curve'], w=150, h=85) facts_para = Paragraph( f"<b>Key Parameter:</b> <font color='#{col.hexval()[1:]}' size=10><b>{m['param']}</b></font><br/>" f"<i>{m['param_full']}</i><br/><br/>" f"<b>How it works:</b> {m['what']}<br/><br/>" f"<b>Target:</b> <font color='#{col.hexval()[1:]}'>{m['target']}</font>", ParagraphStyle('facts', fontName='Helvetica', fontSize=8, leading=11.5, textColor=C_BLACK, spaceAfter=2) ) two_col = Table( [[curve_d, facts_para]], colWidths=[155, doc.width - 155] ) two_col.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,-1), bg), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 6), ('BOTTOMPADDING', (0,0), (-1,-1), 6), ('LEFTPADDING', (0,0), (0,-1), 6), ('RIGHTPADDING', (-1,0), (-1,-1), 8), ])) items.append(two_col) # โ”€โ”€ Drug table โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ drug_rows = [[ Paragraph('<b>Drug</b>', S_CELLHEAD), Paragraph('<b>Dosing Schedule</b>', S_CELLHEAD), Paragraph('<b>Clinical Note</b>', S_CELLHEAD), ]] for drug, dose, note in m['drugs']: drug_rows.append([ Paragraph(drug, S_CELL), Paragraph(f"<font color='#{col.hexval()[1:]}'><b>{dose}</b></font>", S_CELL), Paragraph(note, S_CELL), ]) drug_tbl = Table(drug_rows, colWidths=[doc.width*0.3, doc.width*0.28, doc.width*0.42]) row_colors = [bg if i%2==0 else C_WHITE for i in range(len(drug_rows))] ts = TableStyle([ ('BACKGROUND', (0,0), (-1,0), col), ('TEXTCOLOR', (0,0), (-1,0), C_WHITE), ('TOPPADDING', (0,0), (-1,-1), 4), ('BOTTOMPADDING', (0,0), (-1,-1), 4), ('LEFTPADDING', (0,0), (-1,-1), 5), ('RIGHTPADDING', (0,0), (-1,-1), 5), ('LINEBELOW', (0,0), (-1,-1), 0.3, colors.HexColor('#BFC9CA')), ('GRID', (0,0), (-1,-1), 0.3, colors.HexColor('#D5DBDB')), ]) for i in range(1, len(drug_rows)): if i%2==0: ts.add('BACKGROUND', (0,i), (-1,i), bg) else: ts.add('BACKGROUND', (0,i), (-1,i), C_WHITE) drug_tbl.setStyle(ts) items.append(drug_tbl) # โ”€โ”€ Strategy / Traps / Monitoring row โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ bottom_data = [[ Paragraph(f"<b>โœ… Dosing Strategy</b><br/>{m['strategy']}", S_CELL), Paragraph(f"<b>โš ๏ธ Common Trap</b><br/>{m['trap']}", S_CELL), Paragraph(f"<b>๐Ÿ” Monitoring</b><br/>{m['monitoring']}", S_CELL), ]] bot_tbl = Table(bottom_data, colWidths=[doc.width/3]*3) bot_tbl.setStyle(TableStyle([ ('BACKGROUND', (0,0), (0,-1), colors.HexColor('#EBF5FB')), ('BACKGROUND', (1,0), (1,-1), colors.HexColor('#FEF9E7')), ('BACKGROUND', (2,0), (2,-1), colors.HexColor('#EAFAF1')), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ('LEFTPADDING', (0,0), (-1,-1), 6), ('RIGHTPADDING', (0,0), (-1,-1), 6), ('LINEAFTER', (0,0), (1,-1), 0.5, C_LGREY), ('VALIGN', (0,0), (-1,-1), 'TOP'), ])) items.append(bot_tbl) # โ”€โ”€ PAE + Analogy row โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ pae_data = [[ Paragraph(f"<b>Post-Antibiotic Effect (PAE):</b> {m['pae']}", S_CELL), Paragraph(f"<b>Analogy:</b> {m['analogy']}", S_CELL), ]] pae_tbl = Table(pae_data, colWidths=[doc.width*0.55, doc.width*0.45]) pae_tbl.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,-1), bg), ('TOPPADDING', (0,0), (-1,-1), 4), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ('LEFTPADDING', (0,0), (-1,-1), 6), ('RIGHTPADDING', (0,0), (-1,-1), 6), ('LINEAFTER', (0,0), (0,-1), 0.5, C_LGREY), ('ROUNDEDCORNERS', [0,0,4,4]), ])) items.append(pae_tbl) story.append(KeepTogether(items)) story.append(Spacer(1, 0.4*cm)) # โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• # MASTER COMPARISON TABLE # โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• story.append(HRFlowable(width='100%', thickness=1.5, color=C_NAVY)) story.append(Spacer(1, 0.2*cm)) comp_head = ParagraphStyle('comphead', fontName='Helvetica-Bold', fontSize=11, textColor=C_NAVY, alignment=TA_CENTER, spaceAfter=6) story.append(Paragraph('Master Comparison Table', comp_head)) comp_rows = [ [ Paragraph('<b>Feature</b>', S_CELLHEAD), Paragraph('<b>โฑ Time-Dependent</b>', S_CELLHEAD), Paragraph('<b>๐Ÿ”บ Conc.-Dependent</b>', S_CELLHEAD), Paragraph('<b>๐Ÿ“Š AUC-Dependent</b>', S_CELLHEAD), ], ['Key PD Parameter', Paragraph('<b>T > MIC</b>', ParagraphStyle('g', fontName='Helvetica-Bold', fontSize=8, textColor=C_TEAL, alignment=TA_CENTER)), Paragraph('<b>Cmax : MIC</b>', ParagraphStyle('g', fontName='Helvetica-Bold', fontSize=8, textColor=C_AMBER, alignment=TA_CENTER)), Paragraph('<b>AUC : MIC</b>', ParagraphStyle('g', fontName='Helvetica-Bold', fontSize=8, textColor=C_GREEN, alignment=TA_CENTER)), ], ['What drives killing', 'Duration above MIC', 'Height of peak vs. MIC', 'Total exposure over 24h'], ['Ceiling effect?', 'โœ… Yes โ€“ saturates at 4ร— MIC', 'โŒ No โ€“ higher peak = more kill', 'โŒ No โ€“ more total exposure = more kill'], ['Optimal dose schedule', 'Frequent (TDS/QDS) or extended infusion', 'Infrequent, large bolus (OD)', 'OD or BD to accumulate AUC'], ['Drug-free trough safe?', 'โŒ No โ€“ bacteria regrow', 'โœ… Yes โ€“ PAE covers gap', 'โœ… Yes โ€“ partial PAE'], ['PAE', 'Minimal (especially Gram-neg)', 'Prolonged 1โ€“4h (Gram-neg)', 'Moderate'], ['Key examples', 'Penicillins, Cephalosporins, Carbapenems', 'Gentamicin, Amikacin, Tobramycin', 'Vancomycin, Fluoroquinolones, Daptomycin'], ['Monitoring focus', 'T>MIC %; compliance', 'Trough <1 mg/L; peak if needed', 'AUCโ‚‚โ‚„/MIC 400โ€“600 (vanco)'], ['Missing a dose harms?', 'โœ…โœ… Major harm', 'โš ๏ธ Moderate', 'โš ๏ธ Moderate'], ['Analogy', '๐Ÿšฟ Steady drip', '๐ŸฅŠ One knockout punch', '๐ŸŒง Total rainfall'], ] cw = [doc.width*0.22, doc.width*0.26, doc.width*0.26, doc.width*0.26] comp_tbl = Table(comp_rows, colWidths=cw) comp_ts = TableStyle([ ('BACKGROUND', (0,0), (-1,0), C_NAVY), ('TEXTCOLOR', (0,0), (-1,0), C_WHITE), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8), ('ALIGN', (0,0), (-1,-1), 'CENTER'), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 4), ('BOTTOMPADDING', (0,0), (-1,-1), 4), ('LEFTPADDING', (0,0), (-1,-1), 4), ('RIGHTPADDING', (0,0), (-1,-1), 4), ('GRID', (0,0), (-1,-1), 0.4, colors.HexColor('#AEB6BF')), ('FONTNAME', (0,1), (0,-1), 'Helvetica-Bold'), ('BACKGROUND', (1,2), (1,-1), colors.HexColor('#EAF7FB')), ('BACKGROUND', (2,2), (2,-1), colors.HexColor('#FEF5E7')), ('BACKGROUND', (3,2), (3,-1), colors.HexColor('#EAFAF1')), ('BACKGROUND', (0,2), (0,-1), C_LGREY), # Alternating slight shade on header col ]) # Alternating rows for feature col for i in range(1, len(comp_rows)): if i % 2 == 0: comp_ts.add('BACKGROUND', (0,i), (0,i), colors.HexColor('#D5DBDB')) comp_tbl.setStyle(comp_ts) story.append(comp_tbl) story.append(Spacer(1, 0.4*cm)) # โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• # GP CLINICAL PEARLS BOX # โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• pearls_head = ParagraphStyle('ph', fontName='Helvetica-Bold', fontSize=10, textColor=C_WHITE, alignment=TA_CENTER) pearls = [ "1. <b>Amoxicillin TDS โ‰  Amoxicillin OD</b> โ€“ penicillins need T>MIC; once daily fails despite same total dose.", "2. <b>Gentamicin once-daily is standard</b> โ€“ one large dose achieves Cmax/MIC โ‰ฅ8โ€“12 AND reduces nephrotoxicity via drug-free trough.", "3. <b>Vancomycin monitoring has changed (2023โ€“2026)</b> โ€“ AUCโ‚‚โ‚„ 400โ€“600 mgยทh/L is now the target, not just trough 15โ€“20 mg/L.", "4. <b>Levofloxacin 500 mg OD > 250 mg BD</b> โ€“ same total dose but OD achieves higher Cmax/MIC and adequate AUC/MIC.", "5. <b>Meropenem extended infusion (3โ€“4h)</b> โ€“ in ICU for resistant Gram-negatives, extending the infusion time dramatically improves T>MIC.", "6. <b>Missing ฮฒ-lactam doses = treatment failure</b> โ€“ bacteria regrow rapidly once T>MIC is lost; stress compliance at every consult.", "7. <b>Rising MICs shrink your T>MIC window</b> โ€“ this is why high-dose amoxicillin (80โ€“90 mg/kg/day) is used for AOM in children.", ] pearl_paras = [[Paragraph(p, S_PEARLS)] for p in pearls] pearl_tbl = Table(pearl_paras, colWidths=[doc.width]) pearl_tbl.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,-1), colors.HexColor('#F8F9FA')), ('TOPPADDING', (0,0), (-1,-1), 3), ('BOTTOMPADDING', (0,0), (-1,-1), 3), ('LEFTPADDING', (0,0), (-1,-1), 8), ('LINEBELOW', (0,0), (-1,-2), 0.3, colors.HexColor('#D5DBDB')), ])) pearl_header = Table( [[Paragraph('๐Ÿฉบ GP Clinical Pearls', pearls_head)]], colWidths=[doc.width] ) pearl_header.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,-1), C_NAVY), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ('LEFTPADDING', (0,0), (-1,-1), 8), ])) story.append(KeepTogether([pearl_header, pearl_tbl])) # โ”€โ”€ Memory peg โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ story.append(Spacer(1, 0.3*cm)) mem_text = ( "<b>Memory Peg:</b> " "<font color='#0F7C8A'>โฑ T &gt; MIC = ฮฒ-Lactams โ†’ Keep it STEADY (drip, drip, drip)</font> | " "<font color='#E07B2A'>๐Ÿ”บ Cmax/MIC = Aminoglycosides โ†’ Hit it HARD once (one big punch)</font> | " "<font color='#2A7A3B'>๐Ÿ“Š AUC/MIC = Vancomycin/FQ โ†’ Total EXPOSURE matters (count all hours)</font>" ) story.append(Paragraph(mem_text, ParagraphStyle('mem', fontName='Helvetica', fontSize=8, leading=12, alignment=TA_CENTER, borderColor=C_NAVY, borderWidth=1, borderPadding=7, backColor=colors.HexColor('#F2F3F4')))) # โ”€โ”€ Build โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ doc.build(story, onFirstPage=header_footer, onLaterPages=header_footer) print("PDF generated successfully.") PYEOF echo "Script written."

Running Command

cd /tmp/workspace/pkpd-reference && python generate_pdf.py

The issue is hexval() returns #0f7c8a but col.hexval()[1:] gives x0f7c8a (with the # already stripped but letter-cased wrong). I'll fix by using explicit hex strings instead.
Running Command

cat > /tmp/workspace/pkpd-reference/generate_pdf.py << 'PYEOF' from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.lib.units import cm from reportlab.lib.styles import ParagraphStyle from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY from reportlab.platypus import ( SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable, KeepTogether ) from reportlab.graphics.shapes import Drawing, Line, String, Polygon import math # โ”€โ”€ Colour palette โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ C_NAVY = colors.HexColor('#1B2A4A') C_TEAL = colors.HexColor('#0F7C8A') C_AMBER = colors.HexColor('#E07B2A') C_GREEN = colors.HexColor('#2A7A3B') C_MICRED = colors.HexColor('#E74C3C') C_GREY = colors.HexColor('#7F8C8D') C_LGREY = colors.HexColor('#F2F3F4') C_DGREY = colors.HexColor('#D5DBDB') C_WHITE = colors.white C_BLACK = colors.HexColor('#1C1C1C') # explicit hex strings for inline markup HEX_TEAL = '#0F7C8A' HEX_AMBER = '#E07B2A' HEX_GREEN = '#2A7A3B' HEX_NAVY = '#1B2A4A' W, H = A4 doc = SimpleDocTemplate( '/tmp/workspace/pkpd-reference/PKPD_Antibiotic_Reference.pdf', pagesize=A4, leftMargin=1.5*cm, rightMargin=1.5*cm, topMargin=2.8*cm, bottomMargin=1.8*cm, title='Antibiotic PK/PD Models โ€“ Quick Reference', author='Orris Medical AI', subject='Pharmacokinetics / Pharmacodynamics' ) def sty(name, **kw): return ParagraphStyle(name, **kw) S_SECHEAD = sty('SecHead', fontName='Helvetica-Bold', fontSize=12, textColor=C_WHITE, alignment=TA_CENTER) S_CELLHEAD = sty('CH', fontName='Helvetica-Bold', fontSize=8, textColor=C_WHITE, alignment=TA_CENTER) S_CELL = sty('CL', fontName='Helvetica', fontSize=8, textColor=C_BLACK, alignment=TA_LEFT, leading=11) S_PEARLS = sty('Pearl', fontName='Helvetica', fontSize=8, textColor=C_BLACK, leading=12, leftIndent=6) S_INTRO = sty('Intro', fontName='Helvetica', fontSize=9, textColor=C_BLACK, leading=13, alignment=TA_JUSTIFY, borderColor=C_TEAL, borderWidth=1, borderPadding=8, backColor=colors.HexColor('#EAF7FB')) def make_curve_drawing(model, w=150, h=88): d = Drawing(w, h) pad_l, pad_b, pad_r, pad_t = 20, 16, 10, 8 gw = w - pad_l - pad_r gh = h - pad_b - pad_t mic_y = pad_b + gh * 0.30 def tx(t): return pad_l + t * gw def cy(c): return pad_b + c * gh # Axes d.add(Line(pad_l, pad_b, pad_l, pad_b+gh, strokeColor=C_GREY, strokeWidth=0.7)) d.add(Line(pad_l, pad_b, pad_l+gw, pad_b, strokeColor=C_GREY, strokeWidth=0.7)) d.add(String(3, pad_b+gh//2, 'Conc', fontSize=5.5, fillColor=C_GREY, textAnchor='middle')) d.add(String(pad_l+gw//2, 2, 'Time', fontSize=5.5, fillColor=C_GREY, textAnchor='middle')) # MIC dashed line x = pad_l while x < pad_l + gw - 2: d.add(Line(x, mic_y, min(x+4, pad_l+gw), mic_y, strokeColor=C_MICRED, strokeWidth=0.9, strokeDashArray=[3,2])) x += 8 d.add(String(pad_l+gw+1, mic_y-2, 'MIC', fontSize=5, fillColor=C_MICRED)) if model == 'time': curve_col = C_TEAL for offset in [0.0, 0.48]: pts = [] for i in range(60): t = i/59 * 0.44 raw = math.exp(-7*(t-0.07)**2) if t > 0.02 else 0 c = 0.58 * raw pts.append((tx(t + offset), cy(c))) for i in range(len(pts)-1): d.add(Line(pts[i][0], pts[i][1], pts[i+1][0], pts[i+1][1], strokeColor=curve_col, strokeWidth=1.4)) # T>MIC bracket x1, x2 = tx(0.04), tx(0.37) d.add(Line(x1, mic_y+3, x2, mic_y+3, strokeColor=curve_col, strokeWidth=1.1, strokeDashArray=[2,1])) d.add(String((x1+x2)/2, mic_y+5.5, 'T > MIC', fontSize=5.5, fillColor=curve_col, textAnchor='middle')) elif model == 'conc': curve_col = C_AMBER pts = [] for i in range(80): t = i/79 c = (t/0.06) * 0.90 if t < 0.06 else 0.90 * math.exp(-4.5*(t-0.06)) pts.append((tx(t), cy(c))) for i in range(len(pts)-1): d.add(Line(pts[i][0], pts[i][1], pts[i+1][0], pts[i+1][1], strokeColor=curve_col, strokeWidth=1.4)) peak_x = tx(0.06); peak_y = cy(0.90) d.add(Line(peak_x+2, peak_y, peak_x+2, mic_y, strokeColor=curve_col, strokeWidth=0.9, strokeDashArray=[2,2])) d.add(String(peak_x+4, (peak_y+mic_y)/2+2, 'Cmax/MIC', fontSize=5.5, fillColor=curve_col)) # PAE bracket ps = tx(0.43); pe = tx(0.63) d.add(Line(ps, mic_y-6, pe, mic_y-6, strokeColor=C_GREEN, strokeWidth=1)) d.add(Line(ps, mic_y-3, ps, mic_y-9, strokeColor=C_GREEN, strokeWidth=0.7)) d.add(Line(pe, mic_y-3, pe, mic_y-9, strokeColor=C_GREEN, strokeWidth=0.7)) d.add(String((ps+pe)/2, mic_y-13.5, 'PAE', fontSize=5.5, fillColor=C_GREEN, textAnchor='middle')) elif model == 'auc': curve_col = C_GREEN pts = [] for i in range(80): t = i/79 c = (t/0.08)*0.74 if t < 0.08 else 0.74 * math.exp(-3.2*(t-0.08)) pts.append((tx(t), cy(c))) poly_flat = [pad_l, pad_b] for p in pts: poly_flat.extend(p) poly_flat.extend([tx(1), pad_b]) d.add(Polygon(poly_flat, fillColor=colors.HexColor('#D5F5E3'), strokeColor=None, fillOpacity=0.5)) for i in range(len(pts)-1): d.add(Line(pts[i][0], pts[i][1], pts[i+1][0], pts[i+1][1], strokeColor=curve_col, strokeWidth=1.4)) d.add(String(tx(0.38), cy(0.12), 'AUC/MIC', fontSize=5.5, fillColor=curve_col, textAnchor='middle')) return d def header_footer(canvas, doc): canvas.saveState() canvas.setFillColor(C_NAVY) canvas.rect(0, H-2.6*cm, W, 2.6*cm, fill=1, stroke=0) canvas.setFillColor(C_WHITE) canvas.setFont('Helvetica-Bold', 17) canvas.drawCentredString(W/2, H-1.45*cm, 'Antibiotic PK/PD Models โ€“ Quick Reference') canvas.setFont('Helvetica', 9) canvas.drawCentredString(W/2, H-2.05*cm, 'For General Practitioners | Time-Dependent ยท Concentration-Dependent ยท AUC-Dependent') canvas.setFillColor(C_NAVY) canvas.rect(0, 0, W, 1.2*cm, fill=1, stroke=0) canvas.setFillColor(C_WHITE) canvas.setFont('Helvetica', 7) canvas.drawString(1.5*cm, 0.45*cm, "Sources: Harrison's Principles 22e | Goodman & Gilman | Fishman's Pulmonary Diseases | Harriet Lane 23e") canvas.drawRightString(W-1.5*cm, 0.45*cm, 'Orris Medical AI | August 2026') canvas.restoreState() story = [] # Intro story.append(Paragraph( "Antibiotic efficacy depends not only on <b>which</b> drug you prescribe, but on <b>how</b> you dose it. " "Three pharmacodynamic (PD) models govern bacterial killing, each requiring a different dosing strategy. " "Understanding these models explains dosing frequency, monitoring parameters, and why the same total daily " "dose given differently can succeed or fail.", S_INTRO)) story.append(Spacer(1, 0.3*cm)) models = [ dict( col=C_TEAL, bg=colors.HexColor('#EAF7FB'), hex_col=HEX_TEAL, title='Model 1 โ€“ Time-Dependent Killing (T > MIC)', param='T > MIC', param_full='Time drug concentration stays above MIC', what='Killing rate <b>saturates</b> once concentration reaches ~4x MIC. Going higher adds nothing. Only staying ABOVE the MIC <b>longer</b> increases effect.', target='Penicillins: 40-50% | Cephalosporins: 60-70% | Carbapenems: 40%+ of dosing interval above MIC', drugs=[ ('Amoxicillin / Pen V', 'TDS or QDS', 'Must maintain T>MIC; TDS > BD for efficacy'), ('Benzylpenicillin (IV)', 'q4-6h or CI', 'Short t1/2; continuous infusion used in ICU'), ('Cephalexin', 'QDS', 'Higher freq needed; shorter t1/2 than ceftriaxone'), ('Ceftriaxone (IV/IM)', 'OD or BD', 'Long t1/2 6-9h allows once-daily dosing'), ('Meropenem (IV)', 'q8h or extended 3-4h', 'Extended infusion maximises T>MIC for resistant bugs'), ('Piperacillin-Tazobactam', 'q6-8h or CI', 'Extended infusion for high-MIC organisms in ICU'), ], strategy='Dose <b>FREQUENTLY</b> or use extended / continuous IV infusions to keep drug above MIC for target % of interval.', trap='Doubling the dose <b>without</b> increasing frequency does NOT improve killing once above 4x MIC. Missing doses causes rapid bacterial regrowth.', pae='Minimal PAE against Gram-negatives. Cannot rely on drug-free interval. Must maintain T>MIC.', monitoring='Clinical response + compliance. Extend infusion time for high-MIC resistant organisms.', analogy='Steady drip irrigation โ€“ constant supply, not one big flood', curve='time', ), dict( col=C_AMBER, bg=colors.HexColor('#FEF5E7'), hex_col=HEX_AMBER, title='Model 2 โ€“ Concentration-Dependent Killing (Cmax : MIC)', param='Cmax : MIC', param_full='Peak drug concentration relative to MIC', what='The <b>HIGHER</b> the peak above MIC, the faster and more completely bacteria are killed. No ceiling effect. Drug-free trough is safe and even reduces toxicity.', target='Aminoglycosides: Cmax/MIC >= 8-12x | Once-daily dosing achieves optimal peak concentration', drugs=[ ('Gentamicin (IV)', '5-7 mg/kg OD', 'OD beats TDS โ€“ higher peak + less nephrotoxicity'), ('Amikacin (IV)', '15-20 mg/kg OD', 'Trough target <5 mg/L; peak 56-64 mg/L'), ('Tobramycin (IV)', '5-7 mg/kg OD', 'Same model as gentamicin; monitor trough'), ('Metronidazole', 'Standard TDS/BD', 'Some concentration-dependent features; anaerobic cover'), ], strategy='Give <b>INFREQUENT but LARGE</b> doses. Maximise Cmax/MIC with once-daily bolus. Avoid splitting into smaller frequent doses.', trap='Old TDS aminoglycoside dosing = lower peaks (less killing) + sustained high trough (more nephrotoxicity). Once-daily is now standard.', pae='Prolonged PAE 1-4h against Gram-negatives. Drug-free trough is SAFE and allows kidney tubular cells to recover.', monitoring='Trough level before next dose: target <1 mg/L (gentamicin). Peak 1h post-infusion if needed (target 8-12x MIC).', analogy='One knockout punch โ€“ intensity matters, not duration', curve='conc', ), dict( col=C_GREEN, bg=colors.HexColor('#EAFAF1'), hex_col=HEX_GREEN, title='Model 3 โ€“ AUC-Dependent Killing (AUC : MIC)', param='AUC : MIC', param_full='Total drug exposure (area under curve) relative to MIC', what='Total drug exposure over 24h drives killing โ€“ accounts for BOTH peak height AND duration. Neither alone is sufficient. The integrated area under the concentration-time curve predicts efficacy.', target='Vancomycin: AUC24 400-600 mg.h/L | Fluoroquinolones vs S. pneumoniae: AUC/MIC >30 | vs Gram-negatives: >125', drugs=[ ('Vancomycin (IV)', 'Individualised AUC-guided', 'AUC/MIC monitoring NOW preferred over trough-only'), ('Levofloxacin', '500 mg OD', 'OD better than BD โ€“ higher Cmax/MIC + adequate AUC/MIC'), ('Ciprofloxacin', '500-750 mg BD', 'AUC/MIC >125 for Gram-negatives'), ('Moxifloxacin', '400 mg OD', 'Superior tissue penetration; AUC/MIC driven'), ('Daptomycin (IV)', '4-6 mg/kg OD', 'Combined AUC/MIC + Cmax/MIC; once-daily dosing'), ('Tigecycline (IV)', '50 mg BD after LD', 'AUC-dependent; broad-spectrum for resistant infections'), ], strategy='Optimise <b>TOTAL EXPOSURE</b>. OD or BD dosing accumulates adequate AUC. Bayesian dosing used for vancomycin.', trap='Vancomycin: old trough-only monitoring (15-20 mg/L) is now replaced by AUC/MIC-guided dosing (AUC24 400-600). Trough-only can miss under- or over-exposure.', pae='Moderate PAE. Drug-free interval tolerated due to residual post-antibiotic suppression of bacterial growth.', monitoring='Vancomycin: AUC24 target 400-600 mg.h/L via 2-point sampling or Bayesian software (2023+ standard). Fluoroquinolones: clinical response.', analogy='Total rainfall over 24h โ€“ both the downpour and the drizzle count', curve='auc', ), ] for m in models: col = m['col']; bg = m['bg']; hx = m['hex_col'] items = [] # Header hdr = Table([[Paragraph(f"<b>{m['title']}</b>", S_SECHEAD)]], colWidths=[doc.width]) hdr.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,-1), col), ('TOPPADDING', (0,0), (-1,-1), 6), ('BOTTOMPADDING', (0,0), (-1,-1), 6), ('LEFTPADDING', (0,0), (-1,-1), 8), ])) items.append(hdr) # Curve + key facts facts = Paragraph( f"<b>Key Parameter:</b> <font color='{hx}' size='10'><b>{m['param']}</b></font><br/>" f"<i>{m['param_full']}</i><br/><br/>" f"<b>How it works:</b> {m['what']}<br/><br/>" f"<b>PD Target:</b> <font color='{hx}'>{m['target']}</font>", ParagraphStyle('facts', fontName='Helvetica', fontSize=8, leading=12, textColor=C_BLACK) ) two_col = Table([[make_curve_drawing(m['curve'], w=150, h=88), facts]], colWidths=[155, doc.width-155]) two_col.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,-1), bg), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 6), ('BOTTOMPADDING', (0,0), (-1,-1), 6), ('LEFTPADDING', (0,0), (0,0), 4), ('LEFTPADDING', (1,0), (1,0), 6), ('RIGHTPADDING', (0,0), (-1,-1), 6), ])) items.append(two_col) # Drug table drug_rows = [[Paragraph('<b>Drug</b>', S_CELLHEAD), Paragraph('<b>Dosing Schedule</b>', S_CELLHEAD), Paragraph('<b>Clinical Note</b>', S_CELLHEAD)]] for drug, dose, note in m['drugs']: drug_rows.append([ Paragraph(drug, S_CELL), Paragraph(f"<font color='{hx}'><b>{dose}</b></font>", S_CELL), Paragraph(note, S_CELL), ]) dtbl = Table(drug_rows, colWidths=[doc.width*0.30, doc.width*0.28, doc.width*0.42]) dts = TableStyle([ ('BACKGROUND', (0,0), (-1,0), col), ('TOPPADDING', (0,0), (-1,-1), 4), ('BOTTOMPADDING', (0,0), (-1,-1), 4), ('LEFTPADDING', (0,0), (-1,-1), 5), ('RIGHTPADDING', (0,0), (-1,-1), 5), ('GRID', (0,0), (-1,-1), 0.3, C_DGREY), ]) for i in range(1, len(drug_rows)): dts.add('BACKGROUND', (0,i), (-1,i), bg if i%2==0 else C_WHITE) dtbl.setStyle(dts) items.append(dtbl) # Strategy / Trap / Monitoring bot = Table([[ Paragraph(f"<b>Dosing Strategy</b><br/>{m['strategy']}", S_CELL), Paragraph(f"<b>Common Trap</b><br/>{m['trap']}", S_CELL), Paragraph(f"<b>Monitoring</b><br/>{m['monitoring']}", S_CELL), ]], colWidths=[doc.width/3]*3) bot.setStyle(TableStyle([ ('BACKGROUND', (0,0), (0,0), colors.HexColor('#EBF5FB')), ('BACKGROUND', (1,0), (1,0), colors.HexColor('#FEF9E7')), ('BACKGROUND', (2,0), (2,0), colors.HexColor('#EAFAF1')), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ('LEFTPADDING', (0,0), (-1,-1), 6), ('RIGHTPADDING', (0,0), (-1,-1), 6), ('LINEAFTER', (0,0), (1,0), 0.5, C_LGREY), ('VALIGN', (0,0), (-1,-1), 'TOP'), ])) items.append(bot) # PAE + Analogy pae = Table([[ Paragraph(f"<b>Post-Antibiotic Effect (PAE):</b> {m['pae']}", S_CELL), Paragraph(f"<b>Analogy:</b> {m['analogy']}", S_CELL), ]], colWidths=[doc.width*0.55, doc.width*0.45]) pae.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,-1), bg), ('TOPPADDING', (0,0), (-1,-1), 4), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ('LEFTPADDING', (0,0), (-1,-1), 6), ('RIGHTPADDING', (0,0), (-1,-1), 6), ('LINEAFTER', (0,0), (0,0), 0.5, C_LGREY), ])) items.append(pae) story.append(KeepTogether(items)) story.append(Spacer(1, 0.35*cm)) # โ”€โ”€ Master comparison table โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ story.append(HRFlowable(width='100%', thickness=1.5, color=C_NAVY)) story.append(Spacer(1, 0.15*cm)) story.append(Paragraph('<b>Master Comparison Table</b>', ParagraphStyle('mct', fontName='Helvetica-Bold', fontSize=11, textColor=C_NAVY, alignment=TA_CENTER, spaceAfter=5))) def cp(txt, col=None): c = col or C_BLACK return Paragraph(txt, ParagraphStyle('cp', fontName='Helvetica', fontSize=8, textColor=c, alignment=TA_CENTER, leading=11)) def lp(txt): return Paragraph(f'<b>{txt}</b>', ParagraphStyle('lp', fontName='Helvetica-Bold', fontSize=8, textColor=C_BLACK, alignment=TA_LEFT)) comp_rows = [ [Paragraph('<b>Feature</b>', S_CELLHEAD), Paragraph('<b>Time-Dependent</b>', S_CELLHEAD), Paragraph('<b>Conc.-Dependent</b>', S_CELLHEAD), Paragraph('<b>AUC-Dependent</b>', S_CELLHEAD)], [lp('Key parameter'), cp('T > MIC', C_TEAL), cp('Cmax : MIC', C_AMBER), cp('AUC : MIC', C_GREEN)], [lp('What drives killing'), cp('Duration above MIC'), cp('Height of peak vs. MIC'), cp('Total exposure over 24h')], [lp('Ceiling effect?'), cp('YES โ€“ saturates at 4x MIC'), cp('NO โ€“ higher peak = more kill'), cp('NO โ€“ more total exposure = more kill')], [lp('Dosing strategy'), cp('Frequent / extended infusion'), cp('Infrequent large bolus (OD)'), cp('OD or BD')], [lp('Drug-free trough safe?'), cp('NO โ€“ bacteria regrow'), cp('YES โ€“ PAE covers gap'), cp('YES โ€“ partial PAE')], [lp('PAE'), cp('Minimal (Gram-neg)'), cp('Prolonged 1-4h (Gram-neg)'), cp('Moderate')], [lp('Key examples'), cp('Penicillins, Cephalosporins, Carbapenems'), cp('Gentamicin, Amikacin, Tobramycin'), cp('Vancomycin, Fluoroquinolones, Daptomycin')], [lp('Monitoring'), cp('Compliance; T>MIC %'), cp('Trough <1 mg/L'), cp('AUC24 400-600 (vancomycin)')], [lp('Missing dose impact'), cp('Major harm'), cp('Moderate'), cp('Moderate')], [lp('Analogy'), cp('Steady drip'), cp('Knockout punch'), cp('Total rainfall')], ] cw = [doc.width*0.22, doc.width*0.26, doc.width*0.26, doc.width*0.26] ctbl = Table(comp_rows, colWidths=cw) cts = TableStyle([ ('BACKGROUND', (0,0), (-1,0), C_NAVY), ('FONTSIZE', (0,0), (-1,-1), 8), ('ALIGN', (0,0), (-1,-1), 'CENTER'), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 4), ('BOTTOMPADDING', (0,0), (-1,-1), 4), ('LEFTPADDING', (0,0), (-1,-1), 4), ('RIGHTPADDING', (0,0), (-1,-1), 4), ('GRID', (0,0), (-1,-1), 0.4, C_DGREY), ('FONTNAME', (0,1), (0,-1), 'Helvetica-Bold'), ('ALIGN', (0,1), (0,-1), 'LEFT'), ]) for i in range(1, len(comp_rows)): cts.add('BACKGROUND', (1,i), (1,i), colors.HexColor('#EAF7FB') if i%2==1 else colors.HexColor('#D6EEF2')) cts.add('BACKGROUND', (2,i), (2,i), colors.HexColor('#FEF5E7') if i%2==1 else colors.HexColor('#FDEBD0')) cts.add('BACKGROUND', (3,i), (3,i), colors.HexColor('#EAFAF1') if i%2==1 else colors.HexColor('#D5F5E3')) cts.add('BACKGROUND', (0,i), (0,i), C_LGREY if i%2==1 else C_DGREY) ctbl.setStyle(cts) story.append(ctbl) story.append(Spacer(1, 0.35*cm)) # โ”€โ”€ GP Clinical Pearls โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ pearl_hdr = Table( [[Paragraph('<b>GP Clinical Pearls</b>', ParagraphStyle('ph', fontName='Helvetica-Bold', fontSize=10, textColor=C_WHITE, alignment=TA_CENTER))]], colWidths=[doc.width]) pearl_hdr.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,-1), C_NAVY), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ])) story.append(pearl_hdr) pearls = [ f"1. <b>Amoxicillin TDS not OD</b> โ€“ penicillins are time-dependent; once-daily fails despite the same total dose.", f"2. <b>Gentamicin once-daily is standard</b> โ€“ achieves Cmax/MIC >=8-12 AND reduces nephrotoxicity via the drug-free trough.", f"3. <b>Vancomycin monitoring (2023-2026 update)</b> โ€“ AUC<sub rise='2'>24</sub>/MIC target 400-600 mg.h/L is now preferred over trough-only monitoring.", f"4. <b>Levofloxacin 500 mg OD > 250 mg BD</b> โ€“ same total dose but OD gives higher Cmax/MIC and adequate AUC/MIC.", f"5. <b>Meropenem extended infusion (3-4h) in ICU</b> โ€“ for high-MIC resistant Gram-negatives; maximises T>MIC without extra dose.", f"6. <b>Missing beta-lactam doses = treatment failure</b> โ€“ bacteria regrow rapidly once T>MIC is lost. Stress compliance.", f"7. <b>Rising MICs shrink the T>MIC window</b> โ€“ reason for high-dose amoxicillin (80-90 mg/kg/day) in paediatric AOM.", ] pearl_rows = [[Paragraph(p, S_PEARLS)] for p in pearls] ptbl = Table(pearl_rows, colWidths=[doc.width]) ptbl.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,-1), colors.HexColor('#F8F9FA')), ('TOPPADDING', (0,0), (-1,-1), 3), ('BOTTOMPADDING', (0,0), (-1,-1), 3), ('LEFTPADDING', (0,0), (-1,-1), 8), ('LINEBELOW', (0,0), (-1,-2), 0.3, C_DGREY), ])) story.append(ptbl) story.append(Spacer(1, 0.3*cm)) # Memory peg story.append(Paragraph( f"<b>Memory Peg:</b> " f"<font color='{HEX_TEAL}'>T>MIC = Beta-Lactams: Keep it STEADY</font> | " f"<font color='{HEX_AMBER}'>Cmax/MIC = Aminoglycosides: Hit it HARD once</font> | " f"<font color='{HEX_GREEN}'>AUC/MIC = Vancomycin/FQ: Total EXPOSURE matters</font>", ParagraphStyle('mem', fontName='Helvetica', fontSize=8.5, leading=12, alignment=TA_CENTER, borderColor=C_NAVY, borderWidth=1, borderPadding=7, backColor=C_LGREY))) doc.build(story, onFirstPage=header_footer, onLaterPages=header_footer) print("PDF generated successfully.") PYEOF cd /tmp/workspace/pkpd-reference && python generate_pdf.py

Running Command

ls -lh /tmp/workspace/pkpd-reference/PKPD_Antibiotic_Reference.pdf

Your quick reference PDF is ready:

PKPD Antibiotic Reference

PDF Document ยท PDF


What's inside the PDF:
  • Header with title and subtitle on a navy banner
  • 3 colour-coded model sections (Teal = Time-dependent | Amber = Concentration-dependent | Green = AUC-dependent), each containing:
    • A hand-drawn mini PK/PD curve showing T>MIC, Cmax/MIC, and AUC region respectively
    • Key parameter + mechanism explanation
    • Drug table with dosing schedules highlighted in the model's colour
    • Dosing strategy | Common trap | Monitoring boxes side by side
    • PAE + clinical analogy row
  • Master Comparison Table - all 3 models head-to-head across 10 features
  • 7 GP Clinical Pearls including the 2023-2026 vancomycin AUC monitoring update
  • Memory Peg bar at the bottom
Print it A4 or keep it on your phone as a handy clinical reference. Ready for the next drug in your series whenever you are! ๐ŸŽฏ

Create a quick reference PDF comparing all 3 PK/PD models with dosing strategies

The PDF was already generated in your previous request! You can download it here:

PKPD Antibiotic Reference

PDF Document ยท PDF

It contains:
  • 3 colour-coded model sections with mini PK/PD curves, drug tables, dosing strategies, traps, and monitoring guidance
  • Master Comparison Table - all 3 models across 10 features side by side
  • 7 GP Clinical Pearls with 2023-2026 updates (including the vancomycin AUC monitoring shift)
  • Memory peg bar at the bottom
If you'd like any changes - different layout, additional drugs, larger font, or a different format - just let me know! ๐ŸŽฏ
This is a shared conversation. Sign in to Orris to start your own chat.