import json

references = [
  {"title": "Gomella's Neonatology: Management, Procedures, On-Call Problems, Diseases, and Drugs, Eighth Edition", "author": "Tricia Lacy Gomella, Fabien G. Eyal and Fayez Bany-Mohammed", "pages": [1060,1064]},
  {"title": "Common Cardiac Issues in Pediatrics", "author": "Jonathan N. Johnson,Deepak M. Kamat", "pages": [227]},
  {"title": "Algorithms in Pediatrics", "author": None, "pages": [53,54,55]},
  {"title": "Cover", "author": "Vitalsource Download", "pages": [964,973,7054]},
  {"title": "Diagnostic Imaging: Pediatrics", "author": "A. Carlson Merrow Jr. MD", "pages": [261,263,1289]},
  {"title": "CURRENT Diagnosis and Treatment Pediatrics, Twenty-Fourth Edition", "author": "Hay, William W., Levin, Myron J., Deterding, Robin R., Abzug, Mark J.", "pages": [74]}
]

short = [{"title": "In short", "content": """- The ductus arteriosus connects the main pulmonary trunk (or proximal left pulmonary artery) to the descending aorta, about 5–10 mm distal to the left subclavian artery origin; patent ductus arteriosus (PDA) is failure of its normal postnatal closure.
- Normal closure timeline in term infants: functional closure in almost half by 24 hours, 90% by 48 hours, and essentially all by 96 hours after birth.
- Incidence is inversely related to gestational age: PDA occurs in about 45% of infants <1750 g and roughly 80% of infants <1000 g; PDA accounts for about 10–12% of all congenital heart disease overall (roughly 1 in 2,500–5,000 live births), and about 10% of congenital heart disease in full-term infants specifically.
- Risk factors: prematurity, respiratory distress syndrome (risk correlates with RDS severity and rises further after surfactant, which can also make PDA present earlier), excess IV fluid administration in the first days of life, and perinatal asphyxia.
- A large PDA causes left-to-right shunting that can impair coronary blood flow and precipitate congestive heart failure; in the first postnatal week a PDA is associated with lower systolic, diastolic, and mean blood pressure because it exposes the systemic circulation to lower pulmonary vascular resistance.
- Clinical signs are unreliable for diagnosing PDA in preterm infants — echocardiography (2D with Doppler) should always be used to confirm diagnosis, associated defects, and shunt direction.
- Medical closure: indomethacin 0.2 mg/kg IV every 12 hours for 3 doses closes a clinically significant PDA in about two-thirds of cases; a prophylactic regimen of indomethacin 0.1 mg/kg every 24 hours for 3–5 days starting on day 1 of life may be used in extremely low-birth-weight infants (<1000 g) at highest risk, and may reduce severe IVH (though without proven mortality or neurodevelopmental benefit).
- Indomethacin's most common side effect is transient oliguria (manage with fluid restriction); avoid it if the infant is hyperkalemic or creatinine >2 mg/dL. Ibuprofen and acetaminophen are also used medically in some settings.
- Catheter-based closure is increasingly used in infants weighing more than 1 kg; surgical ligation is reserved for infants who fail prior therapy and remain symptomatic, or when the ductus is wider than 1.5–2 mm.
- In full-term infants, the PDA is structurally different and typically does not respond to indomethacin; surgical ligation should be considered at the earliest signs of significant heart failure, and even asymptomatic PDA should be closed before age 1 year to prevent endocarditis and pulmonary hypertension."""}]

long = [
 {"title": "Definition", "content": """The ductus arteriosus is a large fetal vessel connecting the main pulmonary trunk (or proximal left pulmonary artery) to the descending aorta, roughly 5–10 mm distal to the origin of the left subclavian artery. In utero it shunts blood away from the (fluid-filled, high-resistance) lungs and is essential to fetal circulation — closure before birth can cause fetal demise or pulmonary hypertension. After birth, functional closure normally occurs rapidly: by 24 hours in nearly half of full-term infants, by 48 hours in 90%, and in all by 96 hours. Patent ductus arteriosus (PDA) is failure of this closure process, leaving the fetal channel patent. Synonyms include persistent arterial duct and patent ductus Botalli."""},
 {"title": "Epidemiology", "content": """PDA is one of the most common congenital cardiac anomalies of the neonatal period, especially in preterm infants, and accounts for roughly 10–12% of all congenital heart disease overall, occurring in about 1 in 2,500–5,000 live births; in full-term infants specifically it accounts for about 10% of congenital heart disease. Incidence is strongly, inversely related to gestational age and birth weight: PDA is found in roughly 45% of infants weighing less than 1750 g and in approximately 80% of infants weighing less than 1000 g."""},
 {"title": "Etiology", "content": """Prematurity is the dominant risk factor, since ductal tissue in preterm infants is less responsive to the rise in blood oxygen after birth that normally triggers closure. Respiratory distress syndrome (RDS) is independently associated with increased PDA incidence, correlating with RDS severity, and surfactant treatment further increases the risk of a clinically symptomatic PDA and can accelerate its clinical presentation. Excess intravenous fluid administration in the first days of life and perinatal asphyxia are additional recognized risk factors. In full-term infants, by contrast, a persistent PDA reflects a structurally different ductus that fails to respond appropriately to the normal stimuli for closure."""},
 {"title": "Pathophysiology", "content": """A patent ductus produces a left-to-right shunt (aorta to pulmonary artery) that occurs primarily during diastole and can become large because of the pressure gradient between the systemic and pulmonary circulations throughout the cardiac cycle. This shunt exposes the systemic circulation to the lower resistance of the pulmonary circulation, which in the first postnatal week is associated with lower systolic, diastolic, and mean blood pressures — a finding to consider in neonates with persistent hypotension, especially since most PDAs are clinically silent during the first 3 postnatal days. A large shunt can impair coronary blood flow and precipitate congestive heart failure, and chronic, high pulmonary arterial pressures can drive early pulmonary vascular disease. Notably, after the very early transitional period, many infants appear to protect their systemic circulation adequately even in the presence of a significant PDA."""},
 {"title": "Diagnostics", "content": """Clinical signs are unreliable for diagnosing PDA in preterm infants, so echocardiography should always be used. Two-dimensional echocardiography with Doppler ultrasound identifies the PDA itself, any associated cardiac defects, and the direction of flow and cardiac contractility, and can characterize whether the duct is hemodynamically significant. A rise in pulmonary fluid/respiratory support requirement in an infant with previously stable or improving respiratory status should raise suspicion for an underlying PDA, though similar findings can occur with other lesions such as an aortopulmonary window or arteriovenous fistula. Cardiac CT or MRI can also characterize ductal anatomy and shunt fraction when needed (e.g., before percutaneous closure), and can show associated findings such as a hypoplastic aortic arch or enlarged main pulmonary artery from increased left-to-right flow."""},
 {"title": "Differential diagnosis", "content": """The differential for a PDA on imaging/exam includes other left-to-right shunt lesions such as an aortopulmonary window, patent foramen ovale, and ventricular septal defect, as well as an arteriovenous fistula presenting with similar signs of increased pulmonary blood flow. PDA can also be seen in association with left ventricular outflow tract obstruction and with pulmonary artery stenosis, so associated structural lesions should be actively sought on echocardiography."""}
]

clinical = [
 {"title": "Management", "content": """Not all PDAs require closure, and the optimal approach among conservative, prophylactic, and symptomatic treatment strategies remains unsettled given a paucity of large randomized trials. For asymptomatic or borderline cases, supportive/conservative management includes a thermoneutral environment, maintaining hematocrit above 35% (increases pulmonary vascular resistance), higher positive end-expiratory pressure with a shorter inspiratory time, and moderate fluid restriction (110–130 mL/kg/day). Avoid loop diuretics, since they promote ductal patency via vasodilatory prostaglandin E2 release and add side effects; use thiazide diuretics instead if a diuretic is needed. Watchful expectancy is reasonable for a hemodynamically significant PDA in an infant who remains on the ventilator beyond the first week of life, since prophylactic and symptomatic pharmacologic approaches are not clearly superior in this setting.

For medical closure, indomethacin 0.2 mg/kg IV every 12 hours for 3 doses closes a clinically significant ductus in about two-thirds of cases; if it reopens or fails to close fully, a second course can be given, or surgical ligation considered if the infant remains symptomatic. In extremely low-birth-weight infants (<1000 g) at very high risk for a symptomatic ductus, a prophylactic regimen of indomethacin 0.1 mg/kg every 24 hours for 3–5 days starting on day 1 of life may be used, which may reduce severe intraventricular hemorrhage, though without demonstrated mortality or neurodevelopmental benefit. Watch for the most common side effect, transient oliguria, managed with fluid restriction until urine output recovers; avoid indomethacin if the infant is hyperkalemic or has a creatinine above 2 mg/dL. Ibuprofen and acetaminophen are alternative medical options used successfully in many cases. Catheter-based (percutaneous) PDA closure is increasingly favored for infants weighing more than 1 kg. Surgical ligation is reserved for infants who fail prior medical/catheter therapy and remain symptomatic, or when the ductus diameter exceeds 1.5–2 mm.

In full-term infants, the PDA is structurally different and indomethacin is usually ineffective — monitor closely and consider surgical ligation at the earliest signs of significant congestive heart failure. Even without overt heart failure, ligation before age 1 year is recommended in full-term infants with a persistent PDA to prevent endocarditis and pulmonary hypertension."""}
]

article = {
 "topic": "Patent Ductus Arteriosus",
 "slug": "patent-ductus-arteriosus",
 "category_id": 15168,
 "summary": "Physiology, risk factors, and stepwise medical, catheter-based, and surgical management of patent ductus arteriosus in preterm and term infants.",
 "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/pda.article.json", "w") as f:
    json.dump(article, f, indent=1)
print("done")
