import json

data = {
 "topic": "Pyloric Stenosis",
 "slug": "pyloric-stenosis",
 "category_id": 15364,
 "summary": "Hypertrophic pyloric stenosis is an acquired gastric outlet obstruction of early infancy from pyloric muscle hypertrophy, causing progressive nonbilious projectile vomiting and a hypochloremic, hypokalemic metabolic alkalosis, diagnosed by ultrasound and cured by pyloromyotomy after correcting fluids and electrolytes.",
 "written_by": "claude-sonnet",
 "references": [
  {"title": "Zitelli and Davis' Atlas of Pediatric Physical Diagnosis: Expert Consult - Online", "author": None, "pages": [435, 686]},
  {"title": "MedStudy Pediatrics Core 11th Edition 2024-2025", "author": None, "pages": [342]},
  {"title": "2021_Fleisher_&_Ludwig's_Textbook_of_Pediatric_Emergency_Medicine.epub", "author": None, "pages": []},
  {"title": "Berkowitz's Pediatrics", "author": "Berkowitz, Carol D.;", "pages": [926]},
  {"title": "Kliegman R. Nelson Textbook of Pediatrics 2-Volume Set 22ed 2024", "author": None, "pages": [2290, 2291]},
  {"title": "Caring for the Hospitalized Child", "author": "Section on Hospital Medicine, American Academy of Pediatrics;Jeffrey C. Gershel;Daniel A. Rauch;", "pages": [852, 853]},
  {"title": "Illustrated Textbook of Paediatrics (Tom Lissauer, Will Carroll)", "author": "Lissauer, Tom,Carroll, Will", "pages": [250]}
 ],
 "short": [
  {"title": "In short", "content": (
   "- Hypertrophic pyloric stenosis is caused by hypertrophy of the pyloric muscle narrowing the gastric outlet; it is the most common surgical cause of vomiting in infancy\n"
   "- Incidence is about 2-5 per 1,000 live births in the US (cited variably as 1 in 250 to 1 in 300 births), more common in White infants of northern European ancestry, less common in Black and Asian populations\n"
   "- Males are affected about 4-6 times more often than females; firstborn males account for roughly 30% of cases\n"
   "- Familial risk is significant: about 20% of sons and 7-10% of daughters of a mother who had pyloric stenosis will develop it themselves\n"
   "- Typical age of onset is 2-8 weeks (most sources cite 2-6 weeks), though presentation can range from 1 week to 4 months of age; early exposure to erythromycin/macrolides is an associated risk factor\n"
   "- Presentation: progressive, nonbilious, projectile vomiting after feeds, often with curdled milk, in a hungry infant eager to re-feed; weight loss and dehydration develop if diagnosis is delayed\n"
   "- Classic exam findings: a palpable olive-shaped mass in the epigastrium/right upper quadrant (present in under half of cases) and visible gastric peristaltic waves\n"
   "- Labs classically show a hypochloremic, hypokalemic metabolic alkalosis; severe alkalosis can rarely cause apnea\n"
   "- Diagnosis is confirmed by ultrasound; per 2015 ACR criteria (reaffirmed 2023), pyloric channel length >18 mm and wall thickness >4 mm are diagnostic (3-4 mm can be significant in premature/younger neonates); ultrasound sensitivity is about 95%\n"
   "- Treatment: correct dehydration and electrolyte abnormalities (especially hypokalemia and alkalosis) FIRST, then perform pyloromyotomy (open or laparoscopic) - curative, with operative mortality under 0.5% and recurrence under 1%"
  )}
 ],
 "long": [
  {"title": "Definition", "content": (
   "Hypertrophic pyloric stenosis is an acquired condition of early infancy in which hypertrophy of the pyloric muscle narrows the pyloric channel, producing progressive gastric outlet obstruction. It is the most common surgical condition associated with vomiting in infancy and the most common cause of upper gastrointestinal obstruction in this age group."
  )},
  {"title": "Epidemiology", "content": (
   "Reported incidence figures vary somewhat by source but are broadly consistent: approximately 2-5 per 1,000 live births in the United States, with other estimates citing 1 in 250 to 1 in 300 live births, or 2-4 per 1,000. The condition is more common in White infants, particularly those of northern European ancestry, and less frequent in Black and Asian populations. Males are affected roughly 4-6 times more often than females, and firstborn males are at particularly elevated risk, accounting for about 30% of affected infants in one series. A clear familial pattern exists: approximately 20% of male and 7-10% of female offspring of a mother who herself had pyloric stenosis will develop the condition, and having any affected relative raises risk (about 20% of affected males and 7% of affected females have an affected relative in one cited series)."
  )},
  {"title": "Etiology", "content": (
   "The cause of the pyloric muscle hypertrophy is not definitively known and is likely multifactorial, combining genetic predisposition with environmental contributors. Early postnatal exposure to erythromycin (and macrolides more broadly) has been associated with increased risk of developing hypertrophic pyloric stenosis. Pyloric stenosis has also been associated with other congenital anomalies, including tracheoesophageal fistula and hypoplasia or agenesis of the inferior labial frenulum."
  )},
  {"title": "Clinical features", "content": (
   "Onset is classically between 2 and 8 weeks of age (most commonly 2-6 weeks), though presentation can range from as early as 1-2 weeks to as late as 4 months. The hallmark symptom is vomiting that starts as intermittent regurgitation and becomes progressively more frequent, forceful, and eventually projectile; the emesis is nonbilious (since the obstruction is proximal to the ampulla of Vater) and may contain curdled milk, reflecting delayed gastric emptying. Despite the vomiting, affected infants typically remain hungry and eager to feed immediately afterward. If the diagnosis is delayed, progressive dehydration and weight loss develop; some infants develop starvation-pattern constipation, while others pass small, frequent, mucus-laden \"starvation diarrhea\" stools that represent intestinal secretions rather than true feeding-related stool. On examination, visible gastric peristaltic waves may be seen crossing the epigastrium, and a firm, mobile, olive-shaped mass may be palpable in the epigastrium or right upper quadrant - classically during or after a test feed - though this is found in fewer than half of cases in current practice. Rarely, pyloric stenosis presents with hematemesis, and severe metabolic alkalosis can, uncommonly, precipitate apnea."
  )},
  {"title": "Diagnostics", "content": (
   "Basic metabolic labs classically show a hypochloremic, hypokalemic metabolic alkalosis from repeated loss of hydrochloric acid and potassium in vomitus, with elevated urinary sodium reflecting renal compensation. Abdominal ultrasound has replaced contrast studies as the imaging modality of choice, with a sensitivity of approximately 95%. Per 2015 American College of Radiology criteria (reaffirmed in 2023), pyloric stenosis is defined sonographically by a pyloric channel length greater than 18 mm and a pyloric wall (muscle) thickness greater than 4 mm; a wall thickness of 3-4 mm can also be concerning, particularly in premature or younger neonates. Other cited sonographic thresholds include a muscle wall width greater than 3 mm (with 2-3 mm equivocal and less than 2 mm negative) and pyloric length greater than 14-15 mm, or, in another series, a length of 15-19 mm with a pyloric diameter of 10-14 mm - reflecting some variation in cited cutoffs across sources, though all converge on a thickened, elongated pyloric channel as diagnostic. Because pyloric stenosis is a progressive process, an early ultrasound can be falsely negative or equivocal; if clinical suspicion persists, the study should be repeated (commonly after about 1 week). When ultrasound is unavailable, an upper GI contrast series can show a \"string sign\" (a thin stream of barium through the narrowed channel), a \"shoulder sign\" (bulge of the hypertrophied pyloric muscle into the antrum), or a \"double tract sign\" (parallel streaks of barium in the narrowed channel)."
  )},
  {"title": "Differential diagnosis", "content": (
   "Pyloric stenosis must be distinguished from other causes of infant vomiting, irritability, and dehydration. Gastroesophageal reflux is the most common mimic but is typically self-limited, presents with frequent effortless regurgitation rather than forceful projectile vomiting, and does not cause the characteristic electrolyte abnormalities. Adrenogenital syndrome (adrenal insufficiency) can mimic pyloric stenosis but is distinguished by metabolic acidosis (rather than alkalosis) and elevated serum potassium and urinary sodium. Inborn errors of metabolism can cause recurrent vomiting with either alkalosis (urea cycle disorders) or acidosis (organic acidemias), often accompanied by lethargy, coma, or seizures, and may be flagged on newborn screening. Infections such as urinary tract infection or gastroenteritis can cause vomiting but are usually accompanied by fever or diarrhea. Rare structural mimics include a pyloric membrane or pyloric duplication (which can also present with a palpable mass) and duodenal stenosis proximal to the ampulla of Vater, which is differentiated by the absence of a pyloric mass on exam or ultrasound."
  )},
  {"title": "Treatment", "content": (
   "Pyloric stenosis is not a surgical emergency: the priority before any operative intervention is full correction of dehydration and electrolyte abnormalities, particularly hypokalemia and metabolic alkalosis. Definitive treatment is surgical pyloromyotomy, performed either open (traditionally via the Ramstedt technique, through a small right-upper-quadrant transverse incision with a longitudinal division of the hypertrophied muscle down to the submucosa) or laparoscopically; laparoscopic pyloromyotomy has become the preferred approach given improved instrumentation and potentially shorter recovery. The procedure is curative, safe, and cost-effective, with an operative mortality of 0-0.5% and a recurrence rate of less than 1%. Full oral feeds can typically resume quickly after surgery."
  )}
 ],
 "clinical": [
  {"title": "Management at the bedside", "content": (
   "In a 2-8-week-old infant with progressive, nonbilious, projectile vomiting who remains hungry after vomiting, examine for an epigastric \"olive\" mass and visible peristaltic waves, and send basic metabolic panel looking for hypochloremic, hypokalemic metabolic alkalosis. Confirm the diagnosis with abdominal ultrasound (pyloric channel length >18 mm, wall thickness >4 mm per ACR criteria); if the study is negative or equivocal but suspicion remains high, repeat it in about a week rather than ruling out the diagnosis on one negative scan.\n\nOnce confirmed, this is not a surgical emergency - stabilize first. Correct dehydration with isotonic fluids and specifically correct hypokalemia and metabolic alkalosis before proceeding to the operating room, since anesthesia in an alkalotic, hypokalemic infant carries risk (including apnea). Once fluids and electrolytes are normalized, arrange pyloromyotomy (open or laparoscopic) - it is curative with mortality under 0.5%. Advance to full oral feeds relatively quickly postoperatively per surgical team protocol. Keep the differential in mind if the clinical or lab picture doesn't fit cleanly: acidosis rather than alkalosis should prompt evaluation for adrenal insufficiency or an inborn error of metabolism rather than assuming pyloric stenosis."
  )}
 ]
}

with open("/tmp/pyloric-stenosis.article.json", "w") as f:
    json.dump(data, f, indent=1)
print("written")
