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

references = [
 {"title": "Zitelli and Davis' Atlas of Pediatric Physical Diagnosis: Expert Consult - Online", "author": None, "pages": [931]},
 {"title": "Pediatric Plastic and Reconstructive Surgery for Primary Care", "author": "Taub, Peter J.;King, Timothy W.;American Academy of Pediatrics (AAP);", "pages": [112, 119]},
 {"title": "2021_Fleisher_&_Ludwig's_Textbook_of_Pediatric_Emergency_Medicine.epub", "author": None, "pages": []},
 {"title": "Cover", "author": "Vitalsource Download", "pages": [5129, 5196]},
 {"title": "Pediatric Otolaryngology (American Academy of Pediatrics) ( etc.)", "author": None, "pages": [185, 186, 188]},
]

short_md = """## In short

- Nasal fractures are the most common facial bone injury in children (some sources rank them second most common overall, behind mandible), typically from sports, falls, or abuse.
- Presentation: epistaxis, edema, ecchymosis, and sometimes clear rhinorrhea (raise concern for CSF leak).
- Abundant pediatric nasal cartilage can mask fractures on exam and makes them easy to miss; plain radiographs are also difficult to interpret and are rarely needed for emergency management.
- Every exam must include an intranasal speculum exam to look for a septal hematoma - this is a true emergency.
- Septal hematoma requires urgent incision and drainage; left untreated it causes pressure necrosis of the septal cartilage and a saddle-nose deformity.
- If swelling obscures the exam, re-examine in 2-7 days once it resolves, then decide on reduction based on residual cosmetic deformity or functional (airway) compromise - not on the radiographic fracture itself.
- Nasal fracture with visible deformity should be reduced, usually a closed reduction under general anesthesia, with treatment goals of recognizing/draining septal hematoma immediately and reducing a deformed fracture within 7 days (some sources note 4-5 days as the point urgent subspecialist referral is needed).
- Associated injuries are common: 30% of children with facial fractures have neurologic or orthopedic injuries, so a full trauma assessment is warranted, and CSF rhinorrhea should not be missed.
- Growth disturbance is a long-term risk - nasal fractures can cause septal/nasal deviation and midface hypoplasia even with adequate early treatment, sometimes needing septorhinoplasty deferred until near skeletal maturity.
"""

long_md = """## Definition

A nasal fracture is a break involving the nasal bones, the upper lateral cartilages, and/or the nasal septum. In children the loose attachment of the upper lateral cartilages to the nasal bones also predisposes to hematoma formation in this area, separate from a septal hematoma.

## Epidemiology

Nasal fractures are the most common pediatric facial fracture (cited as either the most common or second most common, depending on the series), occurring far more often than mandibular, orbital, zygomaticomalar, or Le Fort-type midface fractures. Midfacial fractures overall are rare in children and usually follow high-impact mechanisms such as motor vehicle crashes; zygomaticomalar complex fractures account for only 10-15% and Le Fort maxillary fractures for 5-10% of pediatric facial fractures. Mandibular fractures, by contrast, make up 20-50% of pediatric facial fractures (excluding nasal fractures) and are the most common facial fracture requiring hospitalization.

## Etiology

Nasal trauma in children commonly results from sports injuries, falls, and minor everyday trauma, and in young children abuse must be considered as a cause of nasal trauma, septal hematoma, or septal abscess.

## Clinical Features

Children typically present with epistaxis, edema, and ecchymosis over the nose; clear rhinorrhea after trauma is a rarer presenting complaint and should raise concern for a CSF leak from a fracture extending to the anterior skull base/cribriform plate. Because the pediatric nose contains an abundance of soft cartilage that dissipates impact force, fractures are frequently missed on examination, and significant soft-tissue swelling further obscures clinical assessment. Associated injuries are common: about 30% of children with any facial fracture have a concurrent neurologic or orthopedic injury, and associated injuries to the globe, orbit, or paranasal sinuses can occur alongside nasal trauma; sinus involvement may be suggested by crepitus or tenderness over the sinus.

## Diagnostics

Diagnosis rests on the history of nasal trauma with self-resolving epistaxis and physical examination. Every patient needs an intranasal examination with a speculum to exclude a septal hematoma. Plain radiographs are frequently difficult to interpret and imaging is rarely needed in the emergency evaluation, since it seldom changes management when the fracture appears clinically isolated; a fine-cut facial CT is reserved for concern about other injuries rather than to confirm the nasal fracture itself. Because swelling can mask both deformity and fracture on the initial visit, re-examination 2-7 days later, once edema has resolved, is often needed to properly assess nasal appearance and airway function and to decide on the need for intervention.

## Differential Diagnosis

Clinicians must distinguish an isolated nasal fracture from a septal hematoma (or a cartilaginous hematoma from separation of the upper lateral cartilages), a naso-orbito-ethmoid fracture (suggested by a free-floating nasal base, a rare injury), and associated orbital or sinus fractures, as well as CSF rhinorrhea from a skull base injury.

## Treatment

The indication for surgical treatment is clinical, not purely based on the radiographic fracture pattern: it is the appearance of the nose and septum, and the presence of functional obstruction, that determine the need for reduction. A septal hematoma must be drained urgently to prevent pressure necrosis of the septal cartilage and resulting saddle-nose deformity. A fracture causing visible deformity or nasal obstruction should be reduced, usually by closed reduction under general anesthesia, sometimes with an internal or external splint; the treatment goal is reduction of a deformed fracture within about 7 days of injury (patients with persistent deformity at 4-5 days need urgent subspecialist referral). Closed reduction carries a fairly high subsequent revision rate; if a revision septorhinoplasty is later required, it is typically delayed until closer to skeletal maturity.

## Complications

Even with early, adequate reduction, cosmetic and functional deformities can still occur, including septal or nasal deviation, dorsal humps, saddle-nose deformity, and airway obstruction. Nasal fractures can also disturb facial growth, with septal or nasal deviation and midface hypoplasia attributed in part to premature ossification of the septovomerine suture. Families should be counseled about the possibility of these long-term deformities and the potential need for further corrective surgery as the child grows.
"""

clinical_md = """## Emergency Evaluation and Management

Address active epistaxis with direct pressure. Take a mechanism history to screen for associated closed head injury, then examine for septal hematoma, obvious fracture or deviation, and signs of ophthalmologic or severe head injury; any clear fluid drainage from the nose should raise concern for a CSF leak. Crepitus or tenderness over a sinus suggests an associated sinus fracture. Imaging is rarely needed emergently, since plain films are hard to interpret and rarely change management of an isolated nasal injury; reserve fine-cut facial CT for suspected associated injuries. Nasal trauma as part of major trauma, or with associated neurologic changes, warrants emergent evaluation.

## Septal Hematoma and Timing of Reduction

Perform an intranasal speculum exam on every child with nasal trauma specifically to look for a septal hematoma - this requires urgent incision and drainage, since an untreated hematoma causes pressure necrosis of the avascular septal cartilage and a saddle-nose deformity. If swelling limits assessment of deformity, plan re-examination in 2-7 days once it resolves. A fracture with visible deformity or functional (airway) compromise should be reduced, typically by closed reduction under general anesthesia, with the goal of reduction within about 7 days of injury; a child with persistent nasal deformity at 4-5 days post-injury needs urgent referral to a subspecialist to restore anatomic alignment.
"""

build_and_save(
    topic="Nasal Fracture",
    slug="nasal-fracture",
    category_id=15753,
    summary="Pediatric nasal fractures: recognizing septal hematoma as an emergency, why imaging is rarely needed, and timing of closed reduction.",
    references=references,
    short_md=short_md,
    long_md=long_md,
    clinical_md=clinical_md,
)
