import sys, os
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from lib import build_and_save

references = [
 {"title": "Illustrated Textbook of Paediatrics (Tom Lissauer, Will Carroll)", "author": "Lissauer, Tom,Carroll, Will", "pages": [126]},
 {"title": "CURRENT Diagnosis and Treatment Pediatrics, Twenty-Fourth Edition", "author": "Hay, William W., Levin, Myron J., Deterding, Robin R., Abzug, Mark J.", "pages": [246, 248]},
 {"title": "Cover", "author": "Vitalsource Download", "pages": [570]},
 {"title": "Kliegman R. Nelson Textbook of Pediatrics 2-Volume Set 22ed 2024", "author": None, "pages": [158]},
 {"title": "Pediatric Clinical Practice Guidelines and Policies", "author": "American Academy of Pediatrics (AAP);", "pages": [133, 1284]},
 {"title": "Caring for the Hospitalized Child", "author": "Section on Hospital Medicine, American Academy of Pediatrics;Jeffrey C. Gershel;Daniel A. Rauch;", "pages": [558]},
 {"title": "Pediatric Board Study Guide", "author": None, "pages": [887, 1116]},
 {"title": "Ghai Essential Pediatrics, 9e (Vinod K Paul, Arvind Bagga)", "author": "CamScanner", "pages": [795]},
]

short_md = """## In short

- Child abuse (maltreatment) includes physical abuse, sexual abuse, emotional abuse/neglect, physical neglect, medical care neglect, and medical child abuse (Munchausen syndrome by proxy).
- The US CAPTA (1988) definition: any recent act or failure to act by a parent/caretaker that results in death, serious physical or emotional harm, sexual abuse or exploitation, or an act/failure to act presenting imminent risk of serious harm.
- The caregiver is the abuser in about 90% of child abuse cases; siblings of an abused child are at increased risk themselves.
- Neglect is the most common form of child maltreatment overall, though it is seen least often among hospitalized children; failure to thrive is its most common presentation.
- Fractures are present in only a minority of physically abused children, but physical abuse is the most common cause of serious intracranial injury in the first year of life, and child abuse overall is the most common cause of head injury in infants under 1 year.
- About one-third of severely shaken infants die; most survivors suffer long-term consequences such as intellectual disability, cerebral palsy, or blindness.
- Concerning historical features: an implausible or discrepant/evolving history, delay in seeking care, a history of abuse in the caregiver's own childhood, escalating severity or frequency of injuries, and social/physical isolation of the child or caregiver.
- Children with disabilities or chronic medical conditions are at higher risk of abuse, and identification of abuse can be more difficult in this group.
- The most common presentation of an abused child can be asymptomatic - absence of physical signs does not exclude abuse.
"""

long_md = """## Definition

Child abuse (maltreatment) encompasses physical abuse, sexual abuse, emotional abuse, physical neglect, medical care neglect, and medical child abuse (Munchausen syndrome by proxy). Abuse is defined as an act of commission; neglect as an act of omission. The minimal US federal definition (Child Abuse Prevention and Treatment Act, CAPTA, 1988) describes child abuse as "any recent act or failure to act on the part of a parent or caretaker which results in death, serious physical or emotional harm, sexual abuse or exploitation, or an act or failure to act which presents an imminent risk of serious harm"; individual states may extend this to other household members and broader circumstances, and many also incorporate the concept of potential harm, weighing both its likelihood and severity. The World Health Organization similarly defines physical abuse as the intentional use of physical force against a child that results in, or has a high likelihood of resulting in, harm to the child's health, survival, development, or dignity. Physical abuse itself is an act of commission by a caregiver causing or potentially causing actual physical harm - ranging from bruising to fractures to death - even when no serious injury results.

## Epidemiology

Child abuse is not confined to any one societal group and occurs across all cultural and socioeconomic strata. The caregiver is the perpetrator in approximately 90% of cases. Neglect is the most prevalent form of maltreatment overall, though because of its nature it is the presentation seen least often among hospitalized children. Siblings of an abused child are themselves at increased risk of abuse.

## Etiology and Risk Factors

Recognized psychosocial risk factors include family isolation, employment instability, neighborhood violence, social unrest, domestic/intimate-partner violence, adolescent parenthood, substance use, single parenthood, maternal depression, and multiple or closely spaced births. Individual risk factors include prematurity, low birth weight, and childhood disability or chronic medical conditions - which both raise the risk of abuse and can make its identification more difficult. A history of abuse in the caregiver's own childhood is a recognized risk factor, as is an inappropriate caregiver affect, unrealistic expectations of the child, and a stressful family crisis. Poverty and poor housing are also associated environmental factors, though neglect is distinguished from poverty in that neglect occurs only when reasonable resources are actually available to the caregiver.

## Clinical Features

Physical abuse most often presents with bruises, burns, fractures, head trauma, or abdominal injuries. Fractures are present in only a minority of physically abused children, yet physical abuse is the most common cause of serious intracranial injury in the first year of life, and child abuse overall is the most common cause of head injury in children under 1 year of age. Abusive head trauma (shaken baby syndrome) can present with lethargy, poor feeding, retinal hemorrhages, or coma without any external signs of cutaneous trauma, often accompanied by an implausible mechanism such as a minor fall. About one-third of severely shaken infants die, and most survivors have long-term sequelae such as intellectual disability, cerebral palsy, or blindness. Neglect most commonly presents as failure to thrive, but may also present as lack of supervision (for example, ingestion of an unsecured toxic substance) or as medical/dental neglect, such as not filling prescriptions or missing needed appointments. Death in abused children is most often the result of head injury or injury to internal organs, and skeletal findings such as multiple fractures at different stages of healing are characteristic patterns of inflicted injury.

## Diagnostics

Diagnosis rests on a detailed history and thorough physical examination. Concerning historical features include an implausible or discrepant, evolving, or absent explanation for the injury; a delay in seeking care; a specific triggering event or behavior by the child that led to caregiver loss of control; a history of abuse in the caregiver's own childhood; an inappropriate caregiver affect; a pattern of increasing severity or frequency of injury without intervention; social or physical isolation; family stress or crisis; and unexplained changes in the child's behavior. In suspected abusive head trauma specifically, concerning features include a developmentally inconsistent history, a previous apparent life-threatening event, a recent emergency call, vomiting, irritability, or bleeding from the nose or mouth. Given the frequently subtle presentation of abuse, seeking advice from experienced colleagues, pediatric radiologists, and pediatric or orthopedic surgeons is recommended whenever abuse is being considered, since a missed diagnosis carries risk of significant morbidity and mortality.

## Treatment/Management

The pediatrician's role includes identifying children with suspicious injuries, reporting suspected abuse to child protective services for investigation, supporting affected families, coordinating with other professionals and community agencies for immediate and long-term treatment of victimized children, providing court testimony when necessary, and delivering preventive care and anticipatory guidance in routine visits. Early identification and reporting are emphasized whenever abuse is suspected, along with engagement of emergency social work or child protective services.

## Complications

Beyond acute injury, maltreated children face long-term physiologic and anatomic brain changes and increased risk of physical and behavioral problems. Child abuse is a recognized risk factor for later attention-deficit/hyperactivity disorder, particularly when maltreatment occurs early in life or recurs; a traumatic history can also produce ADHD-like symptoms that are actually a manifestation of trauma. Clinical presentations following maltreatment can include intense emotional and physiologic distress, disturbed sleep, difficulty concentrating, anger and irritability, withdrawal, and intrusive thoughts, with extreme distress on exposure to trauma reminders.
"""

clinical_md = """## Recognizing and Working Up Suspected Abuse

Take a detailed history from the caregiver and examine the child thoroughly; the most common presentation of an abused child is actually asymptomatic, so absence of visible injury never excludes abuse. Weigh historical red flags together rather than in isolation: an implausible, discrepant, evolving, or absent mechanism for the injury; delay in seeking care; a history of abuse in the caregiver's own childhood; escalating injury severity or frequency; and social or physical isolation of the child or family. In an infant under 1 year presenting with head injury, treat child abuse as the leading cause until proven otherwise, and specifically consider abusive head trauma (shaken baby syndrome) when an infant presents with lethargy, poor feeding/sucking, or retinal hemorrhage with a trivial reported mechanism such as rolling off a bed - remember that shaking can cause coma with no external signs of cutaneous trauma. Because fractures are present in only a minority of physically abused children, their absence does not rule out abuse, while multiple fractures at different stages of healing are a characteristic pattern when present. Consult experienced colleagues, pediatric radiology, and pediatric or orthopedic surgery early when abuse is suspected, since presentations are frequently subtle.

## Reporting and Coordinating Care

Once abuse is suspected, report to the child protection agency for investigation - do not delay reporting while awaiting diagnostic certainty. Engage emergency social work/child protective services, coordinate with other professionals and community agencies for both immediate and long-term treatment, and support the family through the process. Remember that neglect most commonly presents as failure to thrive, and can also present as lack of supervision (such as an unintentional toxic ingestion) or as medical/dental neglect from missed treatments or appointments - each of these presentations should also prompt consideration of a protective referral.
"""

build_and_save(
    topic="Child Abuse",
    slug="child-abuse",
    category_id=15640,
    summary="Definitions and forms of child maltreatment, red-flag historical and physical findings, abusive head trauma, and the pediatrician's role in identification and reporting.",
    references=references,
    short_md=short_md,
    long_md=long_md,
    clinical_md=clinical_md,
)
