import json

data = {
 "topic": "Pancreatic Insufficiency",
 "slug": "pancreatic-insufficiency",
 "category_id": 15031,
 "summary": "Exocrine pancreatic insufficiency, most commonly caused by cystic fibrosis in children, produces malabsorption of fat and protein leading to steatorrhea and failure to thrive, diagnosed with fecal elastase and treated with enteric-coated pancreatic enzyme replacement therapy.",
 "written_by": "claude-sonnet",
 "references": [
  {"title": "Kliegman R. Nelson Textbook of Pediatrics 2-Volume Set 22ed 2024", "author": None, "pages": [2438, 2439, 2440, 2697]},
  {"title": "Cover", "author": "Vitalsource Download", "pages": [5862, 5867, 7761]},
  {"title": "Ghai Essential Pediatrics, 9e (Vinod K Paul, Arvind Bagga)", "author": "CamScanner", "pages": [293]},
  {"title": "Textbook of Pediatric Gastroenterology, Hepatology and Nutrition (Stefano Guandalini, Anil Dhawan)", "author": None, "pages": [460, 510, 520]},
  {"title": "Illustrated Textbook of Paediatrics (Tom Lissauer, Will Carroll)", "author": "Lissauer, Tom,Carroll, Will", "pages": [329]},
  {"title": "CURRENT Diagnosis and Treatment Pediatrics, Twenty-Fourth Edition", "author": "Hay, William W., Levin, Myron J., Deterding, Robin R., Abzug, Mark J.", "pages": [746]}
 ],
 "short": [
  {"title": "In short", "content": (
   "- Exocrine pancreatic insufficiency (EPI) is present in about 85% of patients with cystic fibrosis (CF), the dominant pediatric cause; only 1-2% of residual pancreatic enzyme reserve is needed to remain pancreas-sufficient, so insufficiency reflects substantial gland loss\n"
   "- Non-CF causes are rare in children and include Shwachman-Diamond syndrome, Johanson-Blizzard syndrome, Ivemark syndrome, Pearson syndrome, isolated enzyme deficiencies, enterokinase deficiency, chronic pancreatitis, protein-calorie malnutrition, pancreatic agenesis/hypoplasia, congenital rubella, celiac disease, inflammatory bowel disease, duodenal atresia/stenosis, and infantile-onset multisystem neurologic, endocrine, and pancreatic disease (IMNEPD, from PTRH2 gene variants, dominated by neurologic features)\n"
   "- More than 95% of the pancreas must be surgically excised before pancreatic insufficiency occurs - relevant in infants who undergo near-total pancreatectomy for hyperinsulinemic hypoglycemia\n"
   "- Pancreatic-sufficient CF patients can progress to insufficiency later in life - consider this in any pancreatic-sufficient CF patient who develops new abdominal pain, altered stool pattern, or failure to thrive\n"
   "- Core symptoms: delayed growth, failure to thrive, diarrhea/steatorrhea, abdominal pain, fat-soluble vitamin (A, D, E, K) deficiencies, and skin or bone manifestations from those deficiencies\n"
   "- Fecal elastase-1 (FE-1) is the standard screening test; a negative result (>100 mcg/g stool) has 99% predictive value for ruling out pancreatic insufficiency, but results can be falsely low if stool is diluted by severe diarrhea\n"
   "- Additional workup for chronic pancreatitis-related insufficiency includes abdominal X-ray (pancreatic calcification), ultrasound/CT (ductal dilation, strictures, calcification, altered gland size/texture), and ERCP/MRCP (ductal anatomy, strictures, intraductal calculi) to plan endoscopic or surgical therapy; fasting/postprandial glucose evaluates for coexisting endocrine (diabetes) insufficiency, which develops in up to 35% by adolescence/adulthood in some series\n"
   "- Local complications of chronic pancreatitis include pseudocyst, pancreatic ascites, pancreatic duct stricture, biliary stricture, and portal hypertension from splenic vein thrombosis; hereditary pancreatitis carries increased pancreatic cancer risk\n"
   "- Treatment is pancreatic enzyme replacement therapy (PERT) using enterically coated enzyme capsules (protecting them from gastric acid degradation and small intestinal autodigestion) taken with all meals and snacks, dosed by clinical response; switching brands typically uses a 1:1 lipase ratio, then titrating for efficacy\n"
   "- A high-calorie diet (about 150% of normal intake) is essential, sometimes requiring overnight gastrostomy feeding to achieve; most patients also require fat-soluble vitamin supplementation; recurrent pancreatitis in a pancreas-sufficient patient can itself progress to insufficiency over time and is managed with enzyme therapy plus a low-fat diet in well-nourished patients to rest the pancreas"
  )}
 ],
 "long": [
  {"title": "Definition", "content": (
   "Exocrine pancreatic insufficiency (EPI, or pancreatic insufficiency, PI) is the inadequate secretion or activity of pancreatic digestive enzymes needed for normal digestion and absorption of dietary fat and protein. It is distinct from endocrine pancreatic insufficiency (diabetes), though both can coexist, particularly in cystic fibrosis and chronic pancreatitis, where advanced glandular damage affects both compartments."
  )},
  {"title": "Epidemiology", "content": (
   "Cystic fibrosis (CF) is by far the dominant cause of pediatric exocrine pancreatic insufficiency, present in approximately 85% of CF patients. Only 1-2% of normal pancreatic enzyme reserve is required to maintain pancreatic sufficiency, meaning insufficiency reflects the loss of the vast majority of functional exocrine tissue. Pancreatic-sufficient CF patients can progress to insufficiency later in life, so this diagnosis should be reconsidered in any pancreatic-sufficient CF patient who develops new abdominal pain, a change in stool frequency or consistency, or failure to thrive. Beyond CF, other causes of pediatric pancreatic insufficiency are rare."
  )},
  {"title": "Etiology", "content": (
   "Non-CF causes of pancreatic insufficiency in children include genetic/syndromic conditions - Shwachman-Diamond syndrome, Johanson-Blizzard syndrome, Ivemark syndrome, Pearson syndrome, isolated pancreatic enzyme deficiencies, enterokinase deficiency, pancreatic agenesis, congenital pancreatic hypoplasia, and infantile-onset multisystem neurologic, endocrine, and pancreatic disease (IMNEPD, caused by PTRH2 gene variants, in which neurologic features - microcephaly, intellectual disability, cerebellar atrophy, deafness, neuropathy - dominate but pancreatic insufficiency is seen in most affected patients). Acquired causes include chronic pancreatitis (progressive parenchymal fibrosis from accumulated damage), protein-calorie malnutrition, celiac disease, postinfectious enteropathy (via loss of endocrine stimulation of the exocrine pancreas), congenital rubella, duodenal atresia/stenosis, and surgical pancreatic excision (more than 95% of the gland must be removed before insufficiency develops, relevant after near-total pancreatectomy performed for hyperinsulinemic hypoglycemia of infancy, pancreatic tumors, or severe chronic pancreatitis/trauma). Pancreatic insufficiency associated with celiac disease and undernutrition typically recovers with nutritional rehabilitation rather than requiring lifelong enzyme replacement."
  )},
  {"title": "Clinical features", "content": (
   "Children with exocrine pancreatic insufficiency typically present with delayed growth, failure to thrive, diarrhea, and malabsorption with steatorrhea (from fat malabsorption). Additional manifestations include abdominal pain, fat-soluble vitamin (A, D, E, K) deficiencies, and associated skin or bone manifestations of those deficiencies. In cases arising from chronic pancreatitis, associated endocrine (diabetes) insufficiency can develop later, and local structural complications include pseudocyst formation, pancreatic ascites, pancreatic duct stricture, biliary stricture, and portal hypertension from splenic vein thrombosis; patients with hereditary pancreatitis carry an increased risk of pancreatic carcinoma."
  )},
  {"title": "Diagnostics", "content": (
   "Fecal elastase-1 (FE-1) is the standard screening test for pancreatic insufficiency; a negative result (greater than 100 mcg/g stool) has 99% predictive value for ruling out the diagnosis, though results can be falsely low due to stool dilution in the setting of severe diarrhea, requiring cautious interpretation in that context. Direct pancreatic function testing is used in selected patients. A 72-hour fecal fat evaluation can also be used to quantify malabsorption. For suspected chronic pancreatitis as the underlying cause, additional imaging includes abdominal X-ray (which may show pancreatic calcification), ultrasound or CT (showing ductal dilation, strictures, calcification, and altered pancreatic size or echotexture), and ERCP or MRCP (to define ductal anatomy, including strictures or intraductal calculi, for procedural planning). Fasting and postprandial blood glucose testing (or formal glucose tolerance testing) should be used to evaluate for coexisting endocrine insufficiency, which can develop with increasing age - reported in up to 35% of some cohorts by adolescence/adulthood. Etiologic workup should also screen for hypercalcemia and other contributors depending on the clinical context."
  )},
  {"title": "Treatment", "content": (
   "The cornerstone of treatment is pancreatic enzyme replacement therapy (PERT), using modern capsules with enterically coated enzymes that protect the enzymes from degradation by gastric acid and from autodigestion within the small intestine. Enzyme products are taken with all meals and snacks, and dosage is titrated according to clinical response; when switching between products, a 1:1 lipase ratio is commonly used as a starting point before further titration for maximum efficacy. A high-calorie diet is essential, with dietary intake recommendations around 150% of normal caloric needs; overnight gastrostomy feeding is increasingly used to help achieve this target when oral intake alone is insufficient. Most patients also require fat-soluble vitamin supplementation given the malabsorption of vitamins A, D, E, and K. In patients with recurrent pancreatitis who remain pancreas-sufficient (a state that can itself progress to insufficiency over time), treatment includes pancreatic enzyme therapy and a low-fat diet in well-nourished patients, aimed at resting the pancreas."
  )}
 ],
 "clinical": [
  {"title": "Approach at the bedside", "content": (
   "In any child with cystic fibrosis, or with unexplained failure to thrive, chronic diarrhea, steatorrhea, or fat-soluble vitamin deficiency, check a fecal elastase-1 level as the standard first-line screening test - remembering that a level above 100 mcg/g essentially rules out pancreatic insufficiency (99% predictive value), but that severe diarrhea can dilute stool and produce a falsely low result requiring cautious interpretation. In a pancreas-sufficient CF patient who develops new abdominal pain, altered stool pattern, or growth faltering, re-test for progression to pancreatic insufficiency rather than assuming their prior sufficiency status still holds.\n\nOnce pancreatic insufficiency is confirmed, start pancreatic enzyme replacement therapy with an enteric-coated product, dosed with every meal and snack and titrated to clinical response (using a 1:1 lipase ratio as a starting point if switching products). Ensure the diet targets roughly 150% of normal caloric intake, considering overnight gastrostomy feeding if oral intake cannot meet this target, and start fat-soluble vitamin (A, D, E, K) supplementation given the near-universal need in this population. If the suspected etiology is chronic pancreatitis rather than CF, pursue imaging (ultrasound/CT, then ERCP/MRCP as needed) to characterize ductal anatomy and structural complications, and screen for coexisting endocrine insufficiency with fasting/postprandial glucose given the risk of diabetes developing over time. In a child with celiac disease or malnutrition-related pancreatic insufficiency, anticipate that enzyme dependence may resolve with adequate nutritional rehabilitation rather than being lifelong, and reassess periodically rather than assuming permanent PERT dependence in that specific context."
  )}
 ]
}

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