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

references = [
 {"title": "Kliegman R. Nelson Textbook of Pediatrics 2-Volume Set 22ed 2024", "author": None, "pages": [624, 1666]},
 {"title": "Signs and Symptoms in Pediatrics", "author": "Henry M. Adam,Jane Meschan Foy", "pages": [895]},
 {"title": "Red_Book_2021_2024_Report_of_the_Comm_z_library_sk,_1lib_sk,", "author": None, "pages": [134]},
 {"title": "CURRENT Diagnosis and Treatment Pediatrics, Twenty-Fourth Edition", "author": "Hay, William W., Levin, Myron J., Deterding, Robin R., Abzug, Mark J.", "pages": [976]},
 {"title": "Diagnostic Imaging: Pediatrics", "author": "A. Carlson Merrow Jr. MD", "pages": [356, 501, 537]},
 {"title": "Red Book 2018", "author": "Kimberlin, David W.; Long, Sarah S.; Brady, Michael T.", "pages": [139]},
 {"title": "Cover", "author": "Vitalsource Download", "pages": [3164, 3249]},
 {"title": "Pediatric Dentistry: Infancy through Adolescence - Arthur J. Nowak, John R. Christensen, Tad R. Mabry, Janice A. Townsend, Martha H. Wells - 6th Edition (2018) 656 pp., ISBN: 978-0-323-60826-8", "author": "Arthur J. Nowak, John R. Christensen, Tad R. Mabry, Janice A. Townsend, Martha H. Wells", "pages": [90]},
]

short_md = """## In short

- Blunt trauma is the dominant mechanism of pediatric splenic injury: motor vehicle collision is most common (about 40%), followed by bicycle-related injury (17%), falls (19%), and sports (13%); iatrogenic injury is rare.
- Nonaccidental trauma accounts for only about 1% of splenic injuries overall, but splenic injury is seen in up to 26% of nonaccidental trauma patients.
- Preexisting splenic enlargement (e.g., from EBV or a hematologic disorder) predisposes the spleen to injury.
- By AAST grading, Grade I injury is a subcapsular hematoma involving under 10% of surface area or a capsular tear with laceration depth under 1 cm; Grade II is a subcapsular hematoma of 10-50% surface area or an intraparenchymal hematoma under 5 cm.
- More than 95% of pediatric splenic injuries are now managed nonoperatively, with observation and rarely interventional radiology - a major shift driven by recognition of postsplenectomy sepsis.
- CT findings help determine when a child can safely return to usual activity; follow-up imaging is rarely necessary.
- When laparotomy is required, splenic repair is preferred over splenectomy.
- Asplenia - whether surgical (after trauma), functional (e.g., sickle cell disease, thalassemia), or congenital - carries a markedly increased risk of fulminant septicemia from encapsulated bacteria such as Streptococcus pneumoniae, Haemophilus influenzae type b, and Salmonella; the risk of septicemia after trauma splenectomy or in sickle cell disease can be up to 350-fold higher than in an immunocompetent child, and risk is greatest in younger children.
- Asplenic children should receive prophylactic penicillin or amoxicillin, particularly under age 5, along with pneumococcal conjugate, Hib, and meningococcal vaccination.
"""

long_md = """## Definition

Splenic injury refers to traumatic disruption of the spleen, ranging from a small subcapsular hematoma or superficial capsular laceration to more extensive parenchymal or vascular injury, most often resulting from blunt abdominal trauma.

## Epidemiology

Blunt trauma is by far the most common cause, with motor vehicle collisions responsible for roughly 40% of cases, followed by bicycle-related injuries (about 17%), falls (about 19%), and sports-related injuries (about 13%); iatrogenic injury (for example from thoracentesis, biopsy, or intraoperative manipulation) is rare. Nonaccidental trauma is an uncommon overall cause of splenic injury (about 1%), but splenic injury is found in up to 26% of children evaluated for nonaccidental trauma, making it an important consideration when abuse is suspected. A spleen that is already enlarged - for example from Epstein-Barr virus infection or an underlying hematologic disorder - is predisposed to injury from relatively minor trauma.

## Clinical Features

Splenic injury from blunt abdominal trauma commonly produces diffuse abdominal tenderness as a result of hemoperitoneum. Mechanisms of injury overlap substantially with those causing blunt liver trauma, which is the most common fatal abdominal injury in children and shares the same high-force mechanisms.

## Diagnostics

CT imaging is central to evaluating splenic injury and is staged using the American Association for the Surgery of Trauma (AAST) grading system. Grade I injury consists of a subcapsular hematoma involving less than 10% of surface area, or a capsular laceration with parenchymal depth under 1 cm. Grade II injury consists of a subcapsular hematoma involving 10-50% of surface area, or an intraparenchymal hematoma under 5 cm in diameter; higher grades reflect progressively deeper parenchymal disruption or vascular injury. CT findings are used to guide the timing of return to usual activities, and routine follow-up imaging is rarely necessary once a child is clinically stable.

## Treatment

Nonoperative treatment - observation, with interventional radiology used only rarely - has become the standard of care for hemodynamically stable children with blunt splenic, hepatic, or renal injury, and more than 95% of pediatric splenic injuries are now managed this way. This approach avoids perioperative complications, decreases the need for blood transfusion, and shortens hospital stay compared with surgery. When laparotomy is required, splenic repair is preferred over splenectomy whenever the spleen can be salvaged, precisely because of the long-term infectious risk that follows splenectomy.

## Complications

The central long-term complication of splenectomy (or any cause of asplenia) is loss of splenic filtering and opsonization function, leaving the child vulnerable to fulminant, often fatal septicemia from encapsulated bacteria - principally Streptococcus pneumoniae, Haemophilus influenzae type b, and Salmonella - as well as blood-borne protozoa. Compared with an immunocompetent child, the incidence and mortality of septicemia are increased by as much as 350-fold in children who undergo splenectomy after trauma or who have sickle cell disease, and the risk may be even higher after splenectomy for thalassemia. Younger children carry a higher risk of invasive bacterial infection than older children.

## Prevention

Because postsplenectomy sepsis can be rapidly fatal, asplenic children (surgical, functional, or congenital) should receive prophylactic antibiotics - penicillin or amoxicillin - particularly under 5 years of age, together with pneumococcal conjugate, Hib, and meningococcal vaccination.
"""

clinical_md = """## Initial Management of Blunt Splenic Injury

In a hemodynamically stable child with blunt splenic injury on CT, manage nonoperatively with observation; interventional radiology is only rarely needed, and this approach now succeeds in more than 95% of pediatric cases while avoiding the complications, transfusion needs, and longer hospital stay associated with surgery. Use CT findings to guide the timing of safe return to usual activity, and do not routinely order follow-up imaging once the child is stable. Reserve laparotomy for the rare child who is not hemodynamically stable, and prefer splenic repair over splenectomy whenever the spleen can be preserved, given the long-term infectious risk of asplenia.

## Preventing Postsplenectomy Sepsis

Any child left asplenic - after trauma splenectomy or from functional asplenia such as sickle cell disease - needs lifelong precautions against overwhelming infection with encapsulated organisms (Streptococcus pneumoniae, Haemophilus influenzae type b, Salmonella). Start prophylactic penicillin or amoxicillin, especially in children under 5 years of age, and ensure pneumococcal conjugate, Hib, and meningococcal vaccines are up to date. Counsel families that risk of fulminant septicemia is highest in young children and can be increased up to 350-fold compared with an immunocompetent child, so any fever in an asplenic child warrants urgent medical evaluation.
"""

build_and_save(
    topic="Splenic Injury",
    slug="splenic-injury",
    category_id=15375,
    summary="Pediatric blunt splenic injury: mechanisms, AAST grading, the shift to nonoperative management, and the lifelong infection risk of resulting asplenia.",
    references=references,
    short_md=short_md,
    long_md=long_md,
    clinical_md=clinical_md,
)
