import json, pathlib

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

article = {
    "topic": "Lateral Ligament Injury",
    "slug": "lateral-ligament-injury",
    "category_id": 15661,
    "summary": "The lateral ankle sprain in children — the most common acute ankle injury, how its age-dependent injury pattern differs from adult ligament sprains, and when a clinical rule can safely avoid an x-ray.",
    "written_by": "claude-sonnet",
    "references": sources["references"],
    "short": [{
        "title": "In short",
        "content": """- The most common acute ankle injury in pediatric athletes is the lateral ankle sprain, typically from an inversion and plantarflexion mechanism, presenting with swelling and pain over the affected ligament and bruising over the ankle.
- Injury pattern in the lower leg, ankle, and foot depends on age: young children tend to sustain diaphyseal (shaft) injuries, older children in rapid growth tend to sustain epiphyseal and apophyseal injuries, and only skeletally mature adolescents are prone to adult-pattern ligamentous injury.
- Ligament injuries are commonly graded 1-3: grade 1 is a stretching injury, grade 2 is partial ligament disruption, and grade 3 is complete disruption; radiographs help exclude bone injury (especially in the skeletally immature athlete), and MRI is reserved for suspected grade 3 injury or concomitant intra-articular derangement.
- Treatment of ligament sprains is almost always conservative: ice and elevation initially, with a protective brace worn during recovery.
- A validated clinical decision tool, the Low-Risk Ankle Rule (LRAR), identifies children safe to manage without radiography: tenderness and swelling isolated to the distal fibula and/or adjacent lateral ligaments, distal to the tibial anterior joint line, define a low-risk injury (lateral ankle sprain, nondisplaced Salter-Harris I/II fracture of the distal fibula, or avulsion fracture of the distal fibula/lateral talus); one study found the LRAR 100% sensitive in children ages 3-16 and reduced ankle radiography by 20%.
- Because young children have limited ability to describe mechanism or localize pain, ankle/foot injuries in toddlers and preschoolers are a diagnostic challenge; the toddler's fracture (a nondisplaced spiral fracture of the tibial shaft from torsion of the foot relative to the tibia) is a classic occult injury in this age group, often unwitnessed.
- Occult fractures of the foot bones also occur in young children; initial radiographs can be subtle or entirely normal, becoming apparent only 1-2 weeks later.
- A Salter-Harris type I fracture (tenderness over a physis after joint-area trauma, without radiographic evidence) and stress fractures can similarly lack initial radiographic confirmation despite a true injury being present.
- A limp or refusal to bear weight after a fall in a toddler should raise suspicion for an occult fracture even with normal initial imaging, and warrants immobilization with follow-up rather than dismissal based on a negative x-ray alone."""
    }],
    "long": [
        {"title": "Definition",
         "content": "A lateral ligament injury of the ankle (lateral ankle sprain) is damage to the lateral ligament complex of the ankle, typically from an inversion and plantarflexion mechanism. It is the most common acute ankle injury seen in pediatric athletes."},
        {"title": "Epidemiology",
         "content": "Injuries in the lower leg, ankle, and foot are common in pediatric athletes, with the pattern of injury depending heavily on age: young children tend toward diaphyseal (bone shaft) injuries, older children in a rapid growth phase tend toward epiphyseal and apophyseal injuries, and it is only the skeletally mature adolescent who becomes prone to the adult pattern of pure ligamentous injury. Despite fractures being possible with both inversion and eversion mechanisms, the lateral ankle sprain remains the single most common acute ankle injury across pediatric athletes."},
        {"title": "Etiology",
         "content": "The typical mechanism is inversion combined with plantarflexion of the ankle, stressing the lateral ligament complex. In younger, less skeletally mature children, an analogous force more often produces a physeal (growth plate) or bony injury rather than a pure ligament sprain, because the growing skeleton's physis is often more vulnerable than the ligament itself at this age."},
        {"title": "Clinical features",
         "content": "A lateral ankle sprain presents with swelling and pain localized over the injured ligament, along with bruising over the ankle. Because young children have limited verbal ability and cooperation, they often cannot describe the mechanism of injury or localize pain precisely, making ankle and foot injuries in toddlers and preschoolers a particular diagnostic challenge; a limp or refusal to walk may be the only presenting sign."},
        {"title": "Diagnostics",
         "content": "Radiographs (standard views) are useful, especially in the skeletally immature athlete, to look for bony injury at the distal femur, proximal tibia, or distal fibula/tibia; MRI is reserved for suspected grade 3 ligament injury or when a concomitant intra-articular injury is suspected. A validated clinical decision tool, the Low-Risk Ankle Rule (LRAR), can identify children who do not need radiography at all: when tenderness and swelling are isolated to the distal fibula and/or the adjacent lateral ligaments, distal to the tibial anterior joint line, the injury is classified as low-risk, encompassing lateral ankle sprains, nondisplaced Salter-Harris type I or II fractures of the distal fibula, and avulsion fractures of the distal fibula or lateral talus. One study found the LRAR to be 100% sensitive in children ages 3-16 and reduced ankle radiography use by 20%. Initial radiographs can be misleadingly normal even with a true bony injury: a Salter-Harris type I fracture may show only tenderness over the physis without radiographic change, and stress fractures can similarly lack overt radiographic findings until they become apparent 1-2 weeks later."},
        {"title": "Differential diagnosis",
         "content": "In a young, ambulatory child (roughly ages 1-4) presenting with limp or refusal to bear weight after an unwitnessed fall, the toddler's fracture — a nondisplaced oblique or spiral fracture of the middle or distal tibia from a twisting fall or jump — should be considered, since toddlers are prone to this injury because of their unsteady gait; standard AP and lateral radiographs may initially appear normal. Occult fractures of the foot bones also occur in this age group. A Salter-Harris type I physeal injury should be considered in any child with point tenderness over a growth plate after trauma, even with a normal initial x-ray."},
        {"title": "Treatment",
         "content": "Treatment of ligament sprains, graded on the standard 1-3 scale (grade 1: stretching injury; grade 2: partial ligament disruption; grade 3: complete disruption), is almost always conservative. Initial management is ice and elevation, followed by a protective brace during the recovery period. When an occult fracture (toddler's fracture, Salter-Harris I, stress fracture) is suspected despite normal initial imaging, immobilization is appropriate, with the diagnosis often confirmed only on follow-up imaging 1-2 weeks later once healing changes become visible."},
        {"title": "Complications",
         "content": "A missed or inadequately immobilized physeal (Salter-Harris) injury carries a risk of permanent growth disturbance if not properly rested, since ongoing stress can complete an incompletely diagnosed fracture or disrupt normal ossification at the physis. Insufficiency-type stress injuries in children with underlying focal or systemic bone-weakening processes require cessation of the causative stress with adequate time for bone repair and recovery of normal ossification."},
    ],
    "clinical": [
        {"title": "Bedside evaluation of the injured ankle",
         "content": "In a child presenting with ankle pain, swelling, and bruising after an inversion/plantarflexion injury, examine carefully to localize tenderness: if it is confined to the distal fibula and/or adjacent lateral ligaments, distal to the tibial anterior joint line, apply the Low-Risk Ankle Rule — this pattern is 100% sensitive for excluding a clinically important fracture in children ages 3-16 and can safely avoid radiography, covering lateral ankle sprains, nondisplaced Salter-Harris I/II fractures of the distal fibula, and avulsion fractures. If tenderness extends beyond this distribution, or the child is too young to reliably localize pain, obtain radiographs, keeping in mind that a real physeal or occult fracture can still be present despite an initially normal film. In a toddler with an unwitnessed fall and new limp or refusal to walk, keep toddler's fracture and occult foot fractures on the differential even when x-rays look clean."},
        {"title": "Treatment and follow-up",
         "content": "For a confirmed lateral ligament sprain, manage conservatively with ice, elevation, and a protective brace; grade the injury (1: stretch, 2: partial tear, 3: complete tear) to guide expectations, reserving MRI for suspected grade 3 injury or concern for concomitant intra-articular derangement. When a young child has a normal initial x-ray but a clinical picture concerning for toddler's fracture, Salter-Harris I injury, or stress fracture, immobilize empirically and plan follow-up imaging in 1-2 weeks, since radiographic confirmation is often delayed even when a true fracture is present — this avoids both unnecessary anxiety over a falsely reassuring film and the risk of growth disturbance from an unrecognized, unprotected physeal injury."},
    ],
}

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/lateral-ligament-injury.article.json")
out.write_text(json.dumps(article, indent=1))
print(out)
