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

references = [
 {"title": "Pediatric Board Study Guide", "author": None, "pages": [215]},
 {"title": "2021_Fleisher_&_Ludwig's_Textbook_of_Pediatric_Emergency_Medicine.epub", "author": None, "pages": []},
 {"title": "Cover", "author": "Vitalsource Download", "pages": [5195, 5197]},
 {"title": "Pediatric ICD-10-CM 2023", "author": "American Academy of Pediatrics Committee on Coding and Nomenclature;", "pages": [103]},
 {"title": "Update in Pediatrics", "author": None, "pages": [124]},
 {"title": "Kliegman R. Nelson Textbook of Pediatrics 2-Volume Set 22ed 2024", "author": None, "pages": [4100]},
 {"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": [45, 202]},
 {"title": "CURRENT Diagnosis and Treatment Pediatrics, Twenty-Fourth Edition", "author": "Hay, William W., Levin, Myron J., Deterding, Robin R., Abzug, Mark J.", "pages": [248]},
]

short_md = """## In short

- A laceration is a traumatic disruption of the dermis; in children the face accounts for about 60% and the upper extremities about 25% of lacerations, and most are non-life-threatening but require appropriate management.
- Hemostasis first: apply direct pressure (or a tourniquet if necessary), and consider injury to deeper structures - especially in the neck, where carotid arteries, jugular veins, trachea, and esophagus are at risk.
- Repair in children is often complicated by fear, anxiety, and lack of cooperation; topical anesthetic LET (4% lidocaine, 1:2000 epinephrine, 0.5% tetracaine) is effective 20-30 minutes after application, with blanching of the site indicating effective anesthesia.
- Cervicofacial lacerations are most often caused by animal (particularly dog) bites, with peak incidence under age 10 (young children may provoke an attack by invading the animal's space); most are closed with special suturing techniques under conscious sedation, though general anesthesia may be needed for extensive defects.
- A child's face has more fatty tissue and skeletal flexibility, so facial/neck trauma mainly produces soft-tissue injury; extensive laceration with facial/neck skeletal fracture is uncommon and, when present, usually results from motor vehicle accidents, animal-related trauma, or iatrogenic injury rather than typical childhood play.
- Palatal lacerations often occur from running or playing with an object in the mouth (pencil, toothbrush, stick); most palate, tongue, and buccal mucosa lacerations heal spontaneously, but larger ones may need suturing.
- Palatal/oropharyngeal lacerations extending laterally pose a risk of injury to the great vessels - these need hospitalization for observation, with MR angiography if worrisome neurologic signs or symptoms develop.
- Physical findings from abuse can include lacerations alongside abrasions, bites, bruises, burns, dental trauma, fractures, and ligature marks, often in multiple stages of healing; patterned injuries (loop marks, cord marks) and injuries on soft-tissue areas (ear, neck, abdomen, buttock, genitals) raise concern, versus accidental injuries typically over bony prominences in ambulatory children.
- "Children who don't cruise rarely bruise" - any bruise (or unexplained laceration/injury) in a non-mobile infant under about 6 months warrants heightened suspicion for abuse.
"""

long_md = """## Definition

A laceration is a traumatic disruption of the dermis layer of the skin. In children, common locations are the face (about 60% of cases) and the upper extremities (about 25%).

## Epidemiology

Most pediatric lacerations are non-life-threatening but still require appropriate management; severe or life-threatening lacerations must be evaluated and treated promptly. Facial and neck trauma occurs frequently in childhood, but because a child's face has relatively more fatty tissue and greater skeletal flexibility than an adult's, these injuries mainly result in soft-tissue laceration rather than skeletal fracture; extensive facial/neck skeletal injury is comparatively uncommon in children and, when it occurs, usually results from motor vehicle accidents, animal-related trauma, or iatrogenic injury rather than routine childhood play. Cervicofacial lacerations specifically are most often caused by animal bites, particularly from dogs, with peak incidence in children younger than 10 years, who may not anticipate an aggressive response and can precipitate an attack by irritating the animal or invading its personal space.

## Clinical Features

Initial assessment must address hemostasis (direct pressure, or a tourniquet if necessary) and evaluate for injury to deeper structures, particularly in high-risk locations such as the neck, where the carotid arteries, jugular veins, trachea, and esophagus can be involved. Palatal injuries occur frequently in children, often from running or playing with an object in the mouth such as a pencil, toothbrush, or stick; lacerations of the hard and soft palate, tongue, and buccal mucosa usually heal spontaneously, though larger lacerations may require suturing. Palatal and oropharyngeal lacerations that extend laterally carry potential risk of injury to the great vessels.

## Diagnostics

Evaluation of a laceration should include assessment of depth, involvement of underlying structures (vessels, nerves, tendons, deeper compartments), and, for palatal/oropharyngeal lacerations extending laterally, consideration of hospitalization for observation with MR angiographic evaluation if worrisome neurologic signs or symptoms develop. Because injury patterns can sometimes reflect non-accidental trauma, examination should also note whether the pattern, location, and explanation are consistent with the reported mechanism: physical findings of abuse can include lacerations alongside abrasions, bites, bruises, burns, dental trauma, fractures, and ligature marks, often present in multiple stages of healing, and abusive injuries are more often patterned (belt marks, looped cord marks, grab or pinch marks) and located over soft-tissue areas of the body, in contrast to accidental injuries in ambulatory children, which typically occur over bony prominences such as shins and elbows. Any bruise, laceration, or other unexplained injury in a young infant who is not yet cruising or walking is unusual and warrants careful evaluation, since injury from accidental causes is rare in this age group.

## Treatment

Repair of pediatric lacerations can be more difficult than in adults because of fear, anxiety, and lack of cooperation, so anesthetic and anxiolytic strategies are important. Topical anesthetic LET (4% lidocaine, 1:2000 epinephrine, 0.5% tetracaine) is a useful option, becoming effective 20-30 minutes after application; blanching of the treated site most often indicates that effective anesthesia has been achieved. Cervicofacial lacerations, most often from dog bites, are typically closed using special suturing techniques under conscious sedation, though general anesthesia may be necessary when the tissue defect is extensive. Most oral cavity lacerations (palate, tongue, buccal mucosa) heal spontaneously without intervention, with suturing reserved for larger defects.

## Complications

Deep neck lacerations risk injury to the carotid arteries, jugular veins, trachea, or esophagus, and require prompt recognition. Laterally extending palatal or oropharyngeal lacerations carry a specific risk of great vessel injury, which may not be apparent immediately and can present later with neurologic signs or symptoms, justifying a period of inpatient observation in concerning cases.
"""

clinical_md = """## Initial Management of a Pediatric Laceration

Address hemostasis first with direct pressure (tourniquet only if necessary), then assess the wound for depth and involvement of deeper structures - be especially vigilant with any neck laceration, given the proximity of the carotid arteries, jugular veins, trachea, and esophagus. For facial or intraoral lacerations, ask about the mechanism (a fall while running with an object in the mouth is classic for palatal injury), and treat any palatal or oropharyngeal laceration extending laterally as a potential great-vessel injury - admit for observation and pursue MR angiography if worrisome neurologic signs or symptoms develop. For a cervicofacial laceration from a dog bite, anticipate the need for special suturing technique, generally under conscious sedation, with general anesthesia reserved for extensive tissue defects.

## Anesthesia, Repair, and Recognizing Non-Accidental Injury

Use topical LET (4% lidocaine, 1:2000 epinephrine, 0.5% tetracaine) for straightforward lacerations amenable to topical anesthesia, allowing 20-30 minutes for effect and watching for blanching at the site as a sign of adequate anesthesia before proceeding, since fear and lack of cooperation can otherwise make repair difficult in children. While evaluating any laceration, note whether the location and pattern fit the stated mechanism: be more concerned about abuse when injuries are patterned (loop, cord, or belt marks) or located on soft-tissue areas (ears, neck, abdomen, buttocks, genitals) rather than bony prominences, when injuries are in multiple stages of healing, or when the laceration or bruise occurs in an infant who is not yet cruising or walking - "children who don't cruise rarely bruise" is a useful reminder that unexplained injury in this age group deserves careful scrutiny rather than routine reassurance.
"""

build_and_save(
    topic="Laceration",
    slug="laceration",
    category_id=15368,
    summary="Pediatric laceration management: hemostasis and deep-structure risk (especially neck and lateral palatal injuries), LET topical anesthesia, dog-bite cervicofacial repair, and abuse-pattern red flags.",
    references=references,
    short_md=short_md,
    long_md=long_md,
    clinical_md=clinical_md,
)
