import json

references = [
  {"title": "Textbook of Pediatric Gastroenterology, Hepatology and Nutrition (Stefano Guandalini, Anil Dhawan)", "author": None, "pages": [257]},
  {"title": "Kliegman R. Nelson Textbook of Pediatrics 2-Volume Set 22ed 2024", "author": None, "pages": [1646,1647,4193]},
  {"title": "Cover", "author": "Vitalsource Download", "pages": [4395,8914]},
  {"title": "CURRENT Diagnosis and Treatment Pediatrics, Twenty-Fourth Edition", "author": "Hay, William W., Levin, Myron J., Deterding, Robin R., Abzug, Mark J.", "pages": [18]},
  {"title": "2021_Fleisher_&_Ludwig's_Textbook_of_Pediatric_Emergency_Medicine.epub", "author": None, "pages": []},
  {"title": "The febrile infant (29 to 90 days of age): Outpatient evaluation - UpToDate", "author": None, "pages": [15]},
  {"title": "Red Book 2018", "author": "Kimberlin, David W.; Long, Sarah S.; Brady, Michael T.", "pages": [1165]},
  {"title": "Red Book Atlas 4th Ed.indb", "author": "American Academy of Pediatrics;Carol J. Baker, MD, FAAP;", "pages": [799,807]}
]

short = [{"title": "In short", "content": """- Serious bacterial infection (SBI) occurs in 7–13% of febrile neonates and young infants; within this group, UTI accounts for 5–13%, bacteremia 1–2%, and meningitis 0.2–0.5%.
- "Invasive bacterial infection" (IBI) specifically means bacteremia and meningitis, distinguished from UTI because UTI is often managed differently (e.g., with oral antibiotics) rather than requiring the more aggressive workup and treatment used for bacteremia/meningitis.
- E. coli is the single most common cause of SBI in young infants overall, and also the most common cause of both UTI and neonatal bacteremia/meningitis; group B Streptococcus (GBS) is the second most common cause of bacteremia and meningitis, though GBS infection rates have fallen with intrapartum prophylaxis.
- Organism frequency differs by infection type: for UTI, common organisms are E. coli, with Klebsiella and Enterococcus less common; for bacteremia/meningitis, common organisms are E. coli and GBS, with Listeria monocytogenes, Streptococcus pneumoniae, Staphylococcus aureus, and Klebsiella less common, and Neisseria meningitidis, Salmonella, Enterobacter, Cronobacter sakazakii, Haemophilus influenzae, Citrobacter, and Proteus mirabilis rare.
- Risk of SBI is higher in infants who appear clinically ill (versus well-appearing) and in those with specific risk factors, and risk is inversely related to postnatal age — younger infants are at higher risk.
- "Recurrent bacterial infections" in the context of pediatric HIV/AIDS is formally defined as 2 or more episodes of sepsis, meningitis, pneumonia, internal abscess, or bone/joint infection; before aggressive antiretroviral therapy, PCP prophylaxis with TMP-SMX, and pneumococcal conjugate vaccination, this occurred in roughly 15% of children with pediatric AIDS, and rates have fallen substantially with these interventions.
- In HIV-infected children, Streptococcus pneumoniae is the most frequent bloodstream isolate, though gram-negative enteric organisms (including Salmonella), staphylococci, and even Pseudomonas bacteremia occur more often than in HIV-uninfected children; less invasive infections (chronic/recurrent sinusitis, otitis media, pyoderma) are also more common.
- Bacterial diarrhea incidence in HIV-infected, treatment-naive adults is at least 100-fold higher than in the general population, and tends to be more protracted and severe.
- For simple cutaneous bacterial infections, a 3-day course of trimethoprim-sulfamethoxazole has shown comparable efficacy to a 5-day once-daily course; intramuscular benzathine benzylpenicillin is an option when compliance with multi-dose oral regimens is a concern."""}]

long = [
 {"title": "Definition", "content": """Serious bacterial infection (SBI) is a category used specifically in the evaluation of febrile neonates and young infants, encompassing urinary tract infection, bacteremia, and meningitis. A narrower term, invasive bacterial infection (IBI), refers specifically to bacteremia and meningitis, deliberately excluding UTI — this distinction exists because infants found to have a UTI are often managed differently (for example, with oral antibiotics) than those with bacteremia or meningitis, which require more aggressive evaluation and parenteral treatment."""},
 {"title": "Epidemiology", "content": """SBI occurs in 7–13% of febrile neonates and young infants. Within this group, UTI is the most common SBI (5–13% of febrile infants), followed by bacteremia (1–2%) and meningitis (0.2–0.5%). The risk of SBI is highest in infants who appear clinically ill rather than well, in those with specific risk factors, and is inversely related to postnatal age, meaning younger infants carry the highest risk. Separately, in the context of pediatric HIV/AIDS, recurrent bacterial infections — defined as 2 or more episodes of sepsis, meningitis, pneumonia, internal abscess, or bone/joint infection — were seen in approximately 15% of children prior to the availability of aggressive antiretroviral therapy, PCP prophylaxis with TMP-SMX, and pneumococcal conjugate vaccination; the frequency of such infections has fallen substantially with these protective measures now in routine use."""},
 {"title": "Etiology", "content": """Escherichia coli is the most common organism causing SBI in young infants overall, and specifically the most common cause of both UTI and neonatal bacteremia/meningitis. Group B Streptococcus (GBS) is the second most common cause of bacteremia and meningitis, although the frequency of GBS infection has decreased with intrapartum antibiotic prophylaxis. Organism frequency differs somewhat by site of infection: for UTI, E. coli predominates, with Klebsiella species and Enterococcus species less common. For bacteremia and meningitis, E. coli and GBS are the common organisms; Listeria monocytogenes, Streptococcus pneumoniae, Staphylococcus aureus, and Klebsiella species are less common; and Neisseria meningitidis, Salmonella species, Enterobacter species, Cronobacter sakazakii, Haemophilus influenzae, Citrobacter species, and Proteus mirabilis are rare causes. In HIV-infected children, the organism pattern shifts: Streptococcus pneumoniae is the most frequent bloodstream isolate, but gram-negative enteric organisms (including Salmonella), staphylococci, and even Pseudomonas bacteremia occur more often than in immunocompetent children, and chronic/recurrent sinusitis, otitis media, and pyoderma are also more common."""},
 {"title": "Clinical features", "content": """In the febrile young infant, clinical appearance is a key discriminator of SBI risk: ill-appearing infants carry substantially higher risk than well-appearing infants, though clinical appearance alone is an imperfect screen, particularly in the youngest infants, which is why structured risk-stratification protocols incorporating age, laboratory markers, and specific risk factors are used rather than gestalt assessment alone. In immunocompromised children (e.g., HIV/AIDS), recurrent bacterial infection is itself a defining clinical pattern — repeated episodes of sepsis, meningitis, pneumonia, internal abscess, or bone/joint infection — that should prompt evaluation of the underlying immune status if not already known. In HIV-infected children specifically, bacterial diarrhea tends to be more protracted and severe than in immunocompetent children, alongside a markedly higher overall incidence."""},
 {"title": "Treatment", "content": """Management of suspected SBI in a febrile young infant is stratified by risk (age, appearance, laboratory findings) and by the specific infection identified: UTI is often managed with oral antibiotics, whereas invasive bacterial infection (bacteremia or meningitis) requires more aggressive parenteral antibiotic therapy and closer monitoring, reflecting the IBI/UTI distinction built into the classification itself. For uncomplicated cutaneous bacterial infections, a 3-day course of trimethoprim-sulfamethoxazole has shown comparable efficacy to a once-daily 5-day course, and intramuscular benzathine benzylpenicillin is a reasonable alternative when adherence to a multi-dose, multi-day oral regimen is a concern. In immunocompromised children with recurrent bacterial infections, prevention is as important as acute treatment: PCP prophylaxis with TMP-SMX, pneumococcal conjugate vaccination, and effective antiretroviral therapy (in HIV-infected children) have substantially reduced the frequency of recurrent invasive bacterial infection compared with the pre-ART era."""}
]

clinical = [
 {"title": "Approach to the febrile infant", "content": """When evaluating a febrile neonate or young infant, keep the SBI risk figures in mind to calibrate the workup: overall SBI risk is 7–13%, driven mostly by UTI (5–13%), with bacteremia (1–2%) and meningitis (0.2–0.5%) less common but higher stakes. Because E. coli is the leading cause of SBI at every site (UTI, bacteremia, and meningitis) and GBS is the second most common cause of bacteremia/meningitis, empiric antibiotic choices in this age group should reliably cover both organisms until culture results return. Use clinical appearance and age as primary risk stratifiers — ill-appearing infants and younger infants carry substantially higher SBI risk — and remember that the IBI/UTI distinction matters practically: a well-characterized UTI can often be managed with oral antibiotics, while bacteremia or meningitis requires parenteral therapy and closer inpatient monitoring.

In a child with recurrent bacterial infections — 2 or more episodes of sepsis, meningitis, pneumonia, internal abscess, or bone/joint infection — evaluate for an underlying immunodeficiency, including HIV, if not already known, since this pattern is a defining feature of significant immune compromise. If HIV infection is confirmed, ensure PCP prophylaxis (TMP-SMX), pneumococcal conjugate vaccination, and effective antiretroviral therapy are in place, since these measures have substantially reduced recurrent bacterial infection frequency compared with historical rates of around 15%. For simple, uncomplicated cutaneous bacterial infections where adherence to a multi-day oral regimen is a concern, consider a shorter 3-day TMP-SMX course or a single intramuscular dose of benzathine benzylpenicillin as practical alternatives."""}
]

article = {
 "topic": "Bacterial Infection",
 "slug": "bacterial-infection",
 "category_id": 15303,
 "summary": "Rates and causative organisms of serious bacterial infection in febrile young infants, the invasive-versus-UTI distinction that shapes treatment, and recurrent bacterial infection in immunocompromised children.",
 "written_by": "claude-sonnet",
 "references": references,
 "short": short,
 "long": long,
 "clinical": clinical
}
with open("/tmp/claude-0/-home-danvics-docker-quiz/c1e0577a-e42c-4a3d-b1ea-3edd61103a4e/scratchpad/articles/bacterial.article.json", "w") as f:
    json.dump(article, f, indent=1)
print("done")
