import json, pathlib

sources = json.loads(pathlib.Path("/tmp/claude-0/-home-danvics-docker-quiz/c1e0577a-e42c-4a3d-b1ea-3edd61103a4e/scratchpad/articles/post-concussion-syndrome.sources.json").read_text())

article = {
    "topic": "Post-Concussion Syndrome",
    "slug": "post-concussion-syndrome",
    "category_id": 15726,
    "summary": "The minority of concussed children whose somatic, cognitive, and emotional symptoms persist beyond the usual 7-10 day recovery window, the risk factors that predict this, and graduated return-to-activity management.",
    "written_by": "claude-sonnet",
    "references": sources["references"],
    "short": [{
        "title": "In short",
        "content": """- Concussion is a form of traumatic brain injury from sudden acceleration, deceleration, or rotational force to the brain, from a blow to the head, neck, face, or body; it occurs without evidence of structural brain injury on standard neuroimaging, and most sport-related concussions self-resolve within 7-10 days.
- Persistent postconcussion symptoms (PPCS)/post-concussion syndrome affect a minority of children, extending beyond 28 days, and can limit functional ability, cause social isolation, reduce school attendance and performance, and lead to anxiety, mood alteration, and lower quality of life.
- Symptoms span five categories: somatic (headache — the most common acute symptom — dizziness, nausea, vomiting, sensitivity to light/noise, slurred speech, fatigue), vestibular, cognitive (amnesia — retrograde or anterograde — confusion, difficulty concentrating, disorientation), emotional (irritability, anxiety, mood lability), and sleep-related; sleep disturbance, anxiety, and mood symptoms are more likely to appear weeks after injury rather than acutely.
- Loss of consciousness occurs in fewer than 5% of sport-related concussions and is NOT associated with injury severity or recovery time; older grading systems based on initial signs/symptoms are no longer used, since they do not predict outcome.
- The strongest predictor of prolonged recovery is initial symptom burden — greater symptom load and severity raises PPCS risk; other non-injury risk factors include female sex, history of migraine, prior concussion, poorer pre-injury adjustment, family dysfunction, a neurodevelopmental disorder (learning disability, ADHD), and psychiatric illness (anxiety, depression).
- Second impact syndrome is a distinct, catastrophic risk: an athlete who sustains a second head injury before symptoms of the first have fully cleared risks permanent disability or death — underscoring why return-to-play must wait for full symptom resolution.
- Diagnosis is clinical; laboratory workup (CBC, electrolytes, bedside glucose, toxicology, coagulation studies if intracranial hemorrhage is suspected) is reserved for significant head trauma or an altered level of consciousness, not for routine concussion evaluation.
- Cognitive and physical rest is the mainstay of initial management, with reduction — not necessarily complete elimination — of activity now favored; return to school and sport uses a gradual, stepwise program with activity increased progressively while monitoring for symptom recurrence, and neuropsychological testing can help guide management.
- The number of concussions an individual can sustain and still safely play contact sports is not defined; providers should adopt a more conservative return-to-play approach when repeated concussions occur with lesser force, are more severe, take longer to resolve, or show a change from baseline brain function."""
    }],
    "long": [
        {"title": "Definition",
         "content": "Concussion is a form of traumatic brain injury (TBI) caused by sudden acceleration, deceleration, or rotational forces to the brain, occurring from a blow to the head, neck, face, or body, without evidence of structural brain injury on standard neuroimaging. The American Academy of Neurology defines it as a trauma-induced alteration in mental status that may or may not involve loss of consciousness. Post-concussion syndrome (or persistent postconcussion symptoms, PPCS) refers to the constellation of symptoms — somatic, emotional, and cognitive — that persists beyond the typical recovery window, generally defined as extending beyond 28 days after injury."},
        {"title": "Epidemiology",
         "content": "Concussion is a major cause of pediatric emergency care visits across all age groups. Most sport-related concussions (SRCs) self-resolve within 7-10 days, but a minority of children experience persistent postconcussion symptoms beyond 28 days. Concussion risk is multifactorial with no single absolutely predictive element; boys are reportedly more affected than girls, likely reflecting more injury exposure and sports participation, while girls are more likely to report concussion symptoms when they occur. A history of ADHD or learning problems raises lifetime concussion risk, and a history of prior concussion raises the risk of a future one."},
        {"title": "Etiology",
         "content": "Concussion results from direct or transmitted biomechanical force to the head, face, or neck, producing brain injury through an interplay of pathophysiologic processes without visible structural damage on standard imaging. Risk factors for prolonged symptoms (PPCS) include a prior history of concussion-like symptoms, known intracranial abnormalities, psychiatric disorders, headache disorders, and family/social stressors — again, multifactorial with no single predictive element. Additional documented risk factors for prolonged recovery include female sex, history of migraine, history of prior concussion, poorer preinjury child adjustment, family dysfunction, neurodevelopmental disorders (learning disability, ADHD), and psychiatric illness (anxiety, depression)."},
        {"title": "Clinical features",
         "content": "Signs and symptoms fall into five categories: somatic, vestibular, cognitive, emotional, and sleep-related. Acutely, headache is the most commonly reported symptom, followed by dizziness, difficulty concentrating, and confusion; additional somatic and behavioral findings include nausea, vomiting, refusal to feed (in young children), gait abnormalities, sensitivity to light or noise, slurred speech, fatigue, and increased sleep. Cognitive symptoms include amnesia (retrograde or anterograde), confusion, difficulty concentrating, and disorientation. Sleep disturbance, anxiety, and mood-related symptoms are more likely to appear several weeks after injury rather than acutely. Brief loss of consciousness occurs in fewer than 5% of sport-related concussions and is not associated with injury severity or time to recovery. The most reliable predictor of recovery time is initial symptom burden: children with greater symptom load and severity are at increased risk of developing PPCS."},
        {"title": "Diagnostics",
         "content": "Diagnosis of concussion is typically clinical, based on history and symptom assessment; older grading systems based on initial signs and symptoms are no longer used by most experts, since they do not predict subsequent outcome. Measures of recovery, not just initial injury severity, must guide decisions about readiness to resume school, work, and sport. Laboratory testing (complete blood count, serum electrolytes) should be performed for significant head trauma; bedside glucose monitoring is warranted for any child with head injury and altered consciousness, toxicology testing when intoxication is suspected in an adolescent with altered consciousness, and coagulation studies (PT, aPTT) plus type and screen for a child with suspected intracranial hemorrhage. Neuropsychological testing is a helpful tool in managing concussion, particularly when recovery is prolonged."},
        {"title": "Differential diagnosis",
         "content": "A thorough understanding of concussion's definition, signs, and symptoms is necessary to recognize it and rule out more severe intracranial injury, which may require more urgent evaluation and different management."},
        {"title": "Treatment",
         "content": "Cognitive and physical rest is the mainstay of initial management, though current guidance favors reduction — not necessarily complete elimination — of activity. Return to school and sport should follow a stepwise, progressive program with gradually increasing physical and cognitive activity, monitoring for any return of symptoms at each stage before advancing. Because every concussion has its own unique symptom spectrum and severity, individualized management is appropriate rather than a one-size-fits-all protocol. Second impact syndrome — sustaining a second head injury before symptoms from the first have fully resolved — carries risk of catastrophic outcomes including permanent disability or death, making strict adherence to full symptom resolution before return to play essential."},
        {"title": "Complications",
         "content": "A minority of children develop persistent postconcussion symptoms extending beyond 28 days, which can limit functional ability, cause social isolation, reduce school attendance and performance, and contribute to anxiety, mood alteration, and reduced quality of life. Postconcussion syndrome symptoms — dizziness, headache, irritability, memory deficits, impaired behavior, and impaired cognitive development — can persist for months and are occasionally permanent; affected children may warrant formal neurobehavioral testing. Overall prognosis for mild TBI/concussion is good, though children may take longer than adults to reach complete recovery. Sustained attention and cognitive deficits following a concussion can persist long enough to limit medical eligibility for continued sports participation in some athletes. The absolute number of concussions an individual can sustain while continuing to safely participate in contact sports has not been defined; a more conservative return-to-play approach is warranted when repeated concussions occur with lesser force, are more severe, take longer to resolve, or show a change from the athlete's baseline brain function."},
    ],
    "clinical": [
        {"title": "Initial assessment after a head injury",
         "content": "Evaluate any child with a blow to the head, face, neck, or body for the five symptom categories of concussion: somatic (headache, dizziness, nausea, light/noise sensitivity, fatigue), vestibular, cognitive (amnesia, confusion, difficulty concentrating), emotional (irritability, anxiety), and sleep-related. Remember that loss of consciousness occurs in fewer than 5% of concussions and does not predict severity or recovery time, so its absence should not be reassuring nor its presence alarming on its own. Reserve laboratory workup (CBC, electrolytes, glucose, toxicology, coagulation studies) for significant head trauma or altered consciousness, rather than routine concussion presentations. Ask specifically about risk factors for prolonged recovery — female sex, migraine history, prior concussion, family/social stressors, a neurodevelopmental disorder, or psychiatric illness — since initial symptom burden combined with these factors helps anticipate which children are more likely to develop persistent postconcussion symptoms."},
        {"title": "Managing recovery and return to activity",
         "content": "Start with cognitive and physical rest, favoring a reduction rather than complete elimination of activity, and individualize the plan to the child's specific symptom spectrum. Use a stepwise, progressive return-to-activity program for both school and sport, advancing physical and cognitive demands gradually while monitoring for symptom recurrence at each stage — do not advance if symptoms return. Emphasize to athletes and families that a second head injury before full recovery from the first risks second impact syndrome, a catastrophic and sometimes fatal complication, so strict avoidance of return to play until complete symptom resolution is essential. Refer for formal neuropsychological or neurobehavioral testing when recovery extends beyond the usual 7-10 day window or symptoms are substantially interfering with school or daily function. For athletes with a history of multiple concussions, especially those from progressively lesser force, taking longer to resolve, or showing a change from baseline, favor a more conservative eligibility decision for continued contact or collision sport participation."},
    ],
}

for v in ("short", "long", "clinical"):
    for s in article[v]:
        assert s["title"].strip() and s["content"].strip()

out = pathlib.Path("/tmp/claude-0/-home-danvics-docker-quiz/c1e0577a-e42c-4a3d-b1ea-3edd61103a4e/scratchpad/articles/post-concussion-syndrome.article.json")
out.write_text(json.dumps(article, indent=1))
print(out)
