import json

references = [
  {"title": "Cover", "author": "Vitalsource Download", "pages": [1790]},
  {"title": "Pediatric Environmental Health", "author": "American Academy of Pediatrics Council on Environmental Health,Ruth A. Etzel,Sophie J. Balk", "pages": [485,486,488,1060]},
  {"title": "Kliegman R. Nelson Textbook of Pediatrics 2-Volume Set 22ed 2024", "author": None, "pages": [4362,4363,4369]},
  {"title": "PPE: Preparticipation Physical Evaluation", "author": "American Academy of Family Physicians, American Academy;American Academy of Pediatrics;American College of Sports Medicine;American Medical Society for Sports Medicine, American Medical;", "pages": [110,117]},
  {"title": "CURRENT Diagnosis and Treatment Pediatrics, Twenty-Fourth Edition", "author": "Hay, William W., Levin, Myron J., Deterding, Robin R., Abzug, Mark J.", "pages": [359]},
  {"title": "2021_Fleisher_&_Ludwig's_Textbook_of_Pediatric_Emergency_Medicine.epub", "author": None, "pages": []}
]

short = [{"title": "In short", "content": """- Heat illness is a continuum from mild (heat cramps, heat syncope, heat edema, heat tetany) through heat exhaustion to fatal heat stroke; it is among the leading causes of death in US high school athletes, with heat stroke the third most common cause of exercise-related death in this group (after head injury and cardiac disorders).
- Children are more heat-vulnerable than adults: greater surface-area-to-body-mass ratio, more metabolic heat produced per kilogram during activity, lower sweat rate, higher temperature threshold before sweating starts, blunted thirst response, and less efficient heat dissipation from smaller organs. Acclimatization typically takes 8–12 near-consecutive days of 30–45 minute heat exposures.
- Heat stroke is defined as core (rectal) temperature above 104–105°F (40–40.5°C) plus CNS dysfunction (stupor, coma), occurring independent of hydration status; it can be exertional (athletes, soldiers, laborers) or nonexertional (in children, most often from being left unattended in a hot vehicle, where interior temperature rises rapidly above ambient).
- US heat stroke burden: about 9,000+ illnesses/year among high school athletes nationally (football players highest risk); roughly 650 preventable heat-injury deaths per year in the US overall; survival after acute heat stroke has improved from about 20% historically to over 90% today. ED visits for heat illness rose 133.5% between 1997–2006 in one study.
- Heat cramps are the most common heat injury — mild dehydration/salt depletion causing calf/hamstring cramping later in activity as fatigue and sodium loss worsen; responds to oral electrolyte rehydration and gentle stretching, with return to play once function is not impaired.
- Heat syncope: fainting after prolonged exercise from poor vasomotor tone and depleted intravascular volume, responds to fluids, cooling, and supine positioning. Heat edema: mild hand/foot swelling on initial heat exposure, resolves with acclimatization.
- Risk factors: chronic disease (diabetes, obesity, cystic fibrosis), sickle cell trait, current/recent illness (especially GI illness/fever, from residual fluid loss), heat-retaining clothing/protective equipment, and specific medications/drugs — anticholinergics/antihistamines, beta-blockers, antipsychotics/SSRIs/TCAs, lithium, diuretics, salicylates, sympathomimetics, calcium channel blockers, topiramate/zonisamide, plus drugs of misuse (amphetamines/ephedra, cocaine, ecstasy, PCP, synthetic cannabinoids, LSD, alcohol, anabolic steroids).
- Differential diagnosis for heat stroke presentation: viral gastroenteritis, sepsis/other infection, neuroleptic malignant syndrome, malignant hyperthermia, and anticholinergic poisoning.
- Severe rhabdomyolysis with myoglobinuria and acute kidney injury can complicate heat stroke; tachycardia and hypertension or hypotension may develop.
- Prevention: hydration before/during/after activity, gradual acclimatization to climate/intensity/duration/gear, breathable light-colored clothing, removing helmets between plays, avoiding practice in high heat/humidity, scheduling activity for cooler parts of the day, adequate shade/rest breaks, and avoiding participation during current or recent illness."""}]

long = [
 {"title": "Definition", "content": """Heat illness is a continuum of clinical signs and symptoms ranging from mild heat stress to fatal heat stroke, with overlapping symptoms that progress as core temperature rises. Three major categories are used: heat cramps, heat exhaustion, and heat stroke, alongside minor entities — heat syncope, heat edema, and heat tetany. Heat stroke, the most extreme form, is defined by a core (rectal) temperature above 104–105°F (40–40.5°C) shortly after collapse, together with signs of central nervous system dysfunction, and occurs independently of hydration status. It is categorized as exertional (occurring in athletes, soldiers, and laborers during activity) or nonexertional (occurring without physical activity — in children, most often from being left unattended in a vehicle, where interior temperature rises rapidly above ambient temperature)."""},
 {"title": "Epidemiology", "content": """Heat illness is among the leading causes of death in US high school athletes, and heat stroke specifically is the third most common cause of exercise-related mortality in this group, after head injury and cardiac disorders — despite survival after acute heat stroke improving from an estimated 20% historically to more than 90% today. National estimates put heat illness among high school athletes at over 9,000 cases annually, with football players at highest risk; this risk appears to be increasing, with one study finding a 133.5% rise in emergency department visits for heat illness between 1997 and 2006, and increasing deaths from heat stroke per 100,000 American football players since the mid-1990s, partly attributed to increased minimum apparent temperatures (more than half of these deaths occurred in the morning). More broadly, heat injury is responsible for roughly 650 preventable deaths annually in the United States. Increasing severity and duration of heat waves put children at direct risk, with infants under age 1 and high school athletes identified as particularly vulnerable subgroups."""},
 {"title": "Etiology", "content": """Children are physiologically more susceptible to heat illness than adults: they have a greater ratio of surface area to body mass, produce more metabolic heat per kilogram during activity, have a lower sweat rate with a higher temperature threshold before sweating begins, and have a blunted thirst response that can lead to inadequate fluid intake during exercise in hot, humid conditions. Acclimatization to warmer, more humid environments typically requires 8–12 near-consecutive days of 30–45 minute heat exposures, though individual variability is considerable. Additional risk factors include chronic disease (diabetes mellitus, obesity, cystic fibrosis), sickle cell trait (which increases risk of complications with strenuous exercise in heat), current or recent illness — particularly gastroenteritis or febrile illness, which leaves residual fluid deficits — reduced ability to seek protection or communicate needs (young children, children with physical disabilities), and clothing, uniforms, or protective equipment that trap heat. A substantial list of medications and substances increases heat illness risk: anticholinergic agents (including antihistamines), beta blockers, antipsychotics (including SSRIs and TCAs), lithium, diuretics, salicylates, sympathomimetic agents, calcium channel blockers, and certain antiseizure medications (topiramate, zonisamide), as well as drugs of misuse — amphetamines (including ephedra), cocaine, ecstasy, phencyclidine, synthetic cannabinoids, LSD, alcohol, and anabolic steroids."""},
 {"title": "Clinical features", "content": """Heat cramps, the most common heat injury, occur with mild dehydration and/or salt depletion, typically affecting the calf and hamstring muscles, and tend to appear later in activity as muscle fatigue and water/sodium loss accumulate. Heat syncope is fainting after prolonged exercise attributed to poor vasomotor tone and depleted intravascular volume. Heat edema is mild swelling of the hands and feet during initial heat exposure, resolving with acclimatization. Heat exhaustion represents a more significant fluid and electrolyte disturbance requiring closer evaluation. Heat stroke, the most severe form, presents with CNS dysfunction (stupor or coma), along with tachycardia and either hypertension or hypotension; severe rhabdomyolysis can occur, producing myoglobinuria and placing the patient at risk for acute kidney injury."""},
 {"title": "Differential diagnosis", "content": """Conditions that can mimic heat-related illness, particularly heat stroke, include viral gastroenteritis, sepsis and other infectious processes, neuroleptic malignant syndrome, malignant hyperthermia, and anticholinergic poisoning — all of which should be considered, especially when the exposure history is unclear or the presentation is unusually severe for the apparent environmental exposure."""},
 {"title": "Treatment", "content": """Removal from the offending hot environment and removal of excess clothing are the first steps in managing any heat-related illness. Heat cramps typically respond to rest and oral rehydration with electrolyte solutions plus gentle stretching, and the athlete can return to play once function is no longer impaired. Severe cramping and heat exhaustion warrant electrolyte evaluation to guide intravenous fluid rehydration. Heat syncope responds to fluids, cooling, and supine positioning. For heat stroke, management begins with addressing the airway, breathing, and circulation (ABCs) and administering 100% oxygen, alongside aggressive cooling measures appropriate to the setting."""}
]

clinical = [
 {"title": "Prevention and practical management", "content": """Prevention is the most effective intervention. Ensure readily accessible fluids are provided and consumed at regular intervals before, during, and after activity. Allow gradual acclimatization to the climate, activity intensity/duration, and any uniform or protective gear rather than introducing full-intensity activity in heat immediately. Modify activity based on conditions: decrease duration/intensity, increase break frequency and duration (preferably in shade), reschedule to cooler times of day, and provide longer recovery time between same-day sessions. Avoid or limit participation in a child or adolescent who is currently ill or recently recovered from illness, especially gastrointestinal illness or fever, given the residual fluid deficit this creates. Choose breathable, light-colored clothing, remove helmets between plays when applicable, and review medication lists for heat-illness-predisposing drugs (anticholinergics, antihistamines, stimulants, certain antiseizure medications) as well as supplement or drug misuse history. Ensure personnel and equipment for treating heat illness are available onsite during activities, and closely monitor participants for early signs and symptoms of developing heat illness rather than waiting for overt collapse.

When heat illness does occur, immediately remove the athlete from the hot environment and remove excess clothing. Manage heat cramps with oral electrolyte rehydration and gentle stretching. For heat exhaustion or more severe cramping, check electrolytes to guide IV fluid therapy rather than rehydrating empirically. Treat heat syncope with fluids, cooling, and supine positioning. If heat stroke is suspected — core temperature above 104–105°F with CNS dysfunction — treat as an emergency: secure the ABCs, give 100% oxygen, and begin aggressive cooling immediately, while evaluating for and managing complications such as rhabdomyolysis, myoglobinuria, and acute kidney injury. Never leave a child unattended in a parked vehicle, since nonexertional heat stroke in children most often results from exactly this scenario, given how quickly vehicle interior temperature rises above ambient."""}
]

article = {
 "topic": "Heat-Related Illness",
 "slug": "heat-related-illness",
 "category_id": 15073,
 "summary": "Why children are physiologically more vulnerable to heat illness, the spectrum from heat cramps to heat stroke, medication and drug risk factors, and prevention and emergency management.",
 "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/heatillness.article.json", "w") as f:
    json.dump(article, f, indent=1)
print("done")
