import json, pathlib

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

article = {
    "topic": "Language Delay",
    "slug": "language-delay",
    "category_id": 15101,
    "summary": "Slower-than-typical but normally sequenced language development in children, its causes and red-flag mimics, when it resolves versus becomes a persistent disorder, and the evaluation this warrants.",
    "written_by": "claude-sonnet",
    "references": sources["references"],
    "short": [{
        "title": "In short",
        "content": """- Language delay is language development following the normal sequence but at a slower rate than typical; it may affect only expressive language or both receptive and expressive language (mixed). This differs from a language disorder, where the sequence itself is atypical or deviant.
- Speech and language delay is arguably the most common developmental concern parents raise, with estimated prevalence ranging from 2-19% (specific language impairment in school-age children without hearing loss or an obvious genetic/neurologic cause is about 7%); it affects boys 3-4 times more often than girls.
- Risk factors: family history of language delay/disorder or reading disability, prematurity, lack of appropriate developmental stimulation, lower socioeconomic status, and chronic middle ear effusion — but NOT birth order (siblings "speaking for" the child), laziness, or bilingual home exposure, none of which have been proven to cause delay.
- About 60% of children with early language delay catch up by age 4, especially with early intervention; but many continue to have persistent delay, and those with dissociated delays (differing rates across language domains) meet DSM-5 criteria for language disorder — persistent delay at school entry carries significant risk for language-based learning disabilities.
- The most common single cause of language delay is intellectual disability (accounting for about half of cases), where both expressive and receptive language are affected and speech is typically more delayed than other developmental domains; hearing loss is another major cause and can be conductive (middle ear effusion, malformation) or sensorineural (intracranial infection, ototoxic drugs, kernicterus, congenital anomalies, syndromes).
- Other causes: autism spectrum disorder, apraxia (impaired ability to program speech musculature), structural anomalies (cleft palate is the most commonly associated), CNS processing disorders, degenerative neurologic disease, closed head injury, and child abuse/neglect; up to 50% of children with delayed language have delays in other developmental areas too.
- Developmental language disorder causes speech/language delay in the absence of hearing loss, vocal tract anomaly, intellectual disability, or global developmental delay; "late talkers" (normal comprehension, simply late to speak) have a milder form, while completely nonverbal children have more severe involvement.
- A language delay becomes a language disorder when it persists to school age, is functionally impactful for communication/social skills/learning, or is qualitatively different from normal developmental patterns; a specific language impairment involves discrepant delays across phonology, morphology, syntax, semantics, and/or pragmatics without global delay, and typical nonverbal abilities, adaptive functioning, and social skills.
- Minimum diagnostic evaluation for a child with language delay/disorder includes psychologic/neurodevelopmental evaluation (including social skills), a speech-language evaluation, formal audiologic assessment (by an audiologist, not screened in the pediatrician's office), and a pediatric examination; therapy can improve impairment and prognosis, but many children do not fully "outgrow" a true language disorder, and early identification and intervention provide the greatest long-term functional benefit."""
    }],
    "long": [
        {"title": "Definition",
         "content": "Language delay is the development of language skills in the normal sequence but at a slower pace than typical; it may involve only expressive language or both receptive and expressive language (mixed receptive-expressive delay). A language disorder, by contrast, is an atypical (deviant) sequence of language skill acquisition, with persistent and significant limitation in the ability to receive or express language. A speech-language or communication disorder is broadly defined as impairment in the ability to receive, send, process, and/or comprehend verbal, nonverbal, or graphic symbol systems. Language dissociation describes differing developmental rates within the language domain (e.g., expressive versus receptive) or between domains (e.g., language versus motor skills); language deviation describes acquiring advanced concepts before mastering earlier milestones."},
        {"title": "Epidemiology",
         "content": "Speech and language delay is arguably the most common developmental concern parents have about young children, with estimated prevalence of 2-19% depending on the study; speech delay overall is reported to affect 3-10% of children. Specific language impairment in school-age children without hearing loss or an obvious genetic or neurologic condition affects about 7%. Language delays and disorders are 3-4 times more common in boys than girls, and more common in children with a family history of language, speech, or reading disorders."},
        {"title": "Etiology",
         "content": "Risk factors for language delay include male sex, a family history of language delay, speech/language disorder, or language-based learning disability, prematurity, lack of appropriate developmental stimulation, and lower socioeconomic status. Birth order (older siblings \"speaking for\" the child), perceived laziness, and bilingual home exposure have never been proven to contribute to delay and should not be accepted as explanations. Intellectual disability is the most common single cause of language delay, accounting for about half of cases; both expressive and receptive components are affected, with speech typically more delayed than other developmental domains, reflecting a global developmental delay. Hearing loss is another major cause and can be conductive (middle ear effusion or malformation) or sensorineural (intracranial infection, ototoxic drugs, kernicterus, congenital anomalies, certain syndromes); early hearing loss produces profound speech delay. Other causes include autism spectrum disorder, apraxia (impaired ability to program speech musculature to organize and initiate speech), structural anomalies of the lip, palate, or oropharynx (cleft palate is the most commonly associated anatomic cause), disorders of central nervous system processing, degenerative neurologic disorders, closed head injury, and child abuse or neglect. Chronic middle ear effusion is commonly associated with delayed language development. Up to 50% of children with delayed language development have delays in other developmental areas as well, and language disorders tend to cluster in families, suggesting a genetic contribution."},
        {"title": "Clinical features",
         "content": "\"Late talkers\" — children with normal comprehension who simply begin speaking later than typical — represent a milder form of developmental language problem, while completely nonverbal children have more severe involvement. Deviant language patterns include echolalia (meaningless repetition of phrases), pronoun reversal, and a sing-song or monotonous voice quality. A child with a language disorder may present initially with a chief complaint of \"delayed speech,\" but once words emerge, may continue to struggle with following directions, forming sentences, using correct verb tense, or holding a conversation. Language disorders (specific language impairment) can show discrepant delays in any or all components of language — phonology, morphology, syntax, semantics, and pragmatics — and by definition occur in children who are not globally delayed and typically have normal nonverbal abilities, adaptive functioning, and social skills."},
        {"title": "Diagnostics",
         "content": "A language delay becomes a language disorder when it persists to school age, is functionally impactful for communication, social skills, or learning and cognition, or is qualitatively different from normal developmental sequences; language and communication skills must always be interpreted in the context of the child's overall cognitive, social, and physical abilities. Preschool-aged children with dissociated delays across language domains currently meet DSM-5 criteria for a diagnosis of language disorder. A multidisciplinary evaluation is often warranted, including at minimum: a psychologic or neurodevelopmental evaluation (including assessment of social skills), a speech-language evaluation, a formal audiologic assessment performed by an audiologist under proper testing conditions (not screened in the pediatrician's office), and a pediatric examination. The American Academy of Pediatrics recommends that pediatricians perform ongoing developmental surveillance and screening to identify at-risk children, refer for appropriate evaluation, and implement intervention as early as possible."},
        {"title": "Differential diagnosis",
         "content": "The differential for delayed language development includes hearing loss, disorders of central nervous system processing (global developmental delay, intellectual disability, autism spectrum disorder), anatomic abnormalities (cleft palate, oromotor incoordination as in cerebral palsy), and environmental deprivation or lack of social interaction opportunity. A normal variant or familial pattern is also possible. Developmental language disorder is diagnosed only in the absence of hearing loss, anatomic vocal tract abnormality, intellectual disability, or global developmental delay — when any of these is present, the language delay is attributed to that underlying condition rather than a primary language disorder."},
        {"title": "Treatment",
         "content": "Early developmental promotion of language, together with early identification and intervention for speech and language disorders, is vital to achieving the greatest long-term functional benefit. Therapy can improve the degree of impairment and prognosis, though many children do not fully \"outgrow\" a true speech or language disorder, even as it manifests differently over time."},
        {"title": "Complications",
         "content": "About 60% of children with early language delays catch up by age 4 with no persistent problems, particularly with appropriate early intervention and early childhood special education services. However, many children continue to exhibit persistent language delays, and those who do so as they enter school are at significant risk for developing language-based learning disabilities, along with later difficulty in reading, written expression, learning a foreign language, and appropriate social interaction. Good evidence links early language impairment with later difficulty learning to read."},
    ],
    "clinical": [
        {"title": "Initial evaluation in the clinic",
         "content": "When a parent raises concern about delayed speech, first characterize whether development follows the normal sequence at a slower pace (delay) or shows an atypical/deviant pattern (possible disorder), and note whether expressive language alone or both receptive and expressive language are affected. Do not accept birth order, bilingual home exposure, or \"laziness\" as an explanation — these have never been shown to cause delay, and accepting them risks missing a true underlying cause. Screen specifically for the most common causes: assess overall developmental level (intellectual disability accounts for about half of cases, with speech often disproportionately delayed relative to other domains), refer for formal audiologic testing by an audiologist (not an in-office screen) given how commonly hearing loss underlies delay, and examine for structural anomalies (cleft palate) or signs of autism spectrum disorder. Ask about chronic ear infections/effusion, prematurity, and family history of language or reading difficulty, all of which raise risk."},
        {"title": "Referral, monitoring, and counseling",
         "content": "Arrange a multidisciplinary evaluation for any child with a persistent or concerning language delay: psychologic/neurodevelopmental evaluation with social-skills assessment, formal speech-language evaluation, audiologic assessment, and a full pediatric exam. Do not delay referral while \"waiting to see\" for an extended period — early intervention improves outcomes, and about 60% of children with early delay catch up by age 4, especially with timely support, while persistent delay at school age carries real risk for language-based learning disability. If the delay is dissociated across language domains (e.g., markedly different expressive versus receptive skills) rather than a uniform slower pace, consider that this preschool pattern meets DSM-5 criteria for language disorder rather than simple delay, which should prompt more structured, ongoing therapy rather than a wait-and-see approach. Set expectations that therapy improves outcomes but a true language disorder often does not fully resolve, so ongoing monitoring into the school years is appropriate even after initial improvement."},
    ],
}

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