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": [1930, 3355, 3359, 3361]},
 {"title": "Zitelli and Davis' Atlas of Pediatric Physical Diagnosis: Expert Consult - Online", "author": None, "pages": [732, 734, 739, 740]},
 {"title": "Berkowitz's Pediatrics", "author": "Berkowitz, Carol D.;", "pages": [424]},
 {"title": "2021_Fleisher_&_Ludwig's_Textbook_of_Pediatric_Emergency_Medicine.epub", "author": None, "pages": []},
 {"title": "Signs and Symptoms in Pediatrics", "author": "Henry M. Adam,Jane Meschan Foy", "pages": [277]},
]

short_md = """## In short

- Vulvitis is external genital pruritus, burning, redness, or rash; vaginitis is vaginal inflammation with discharge and/or bleeding; when both occur together, the term vulvovaginitis is used.
- About 75% of prepubertal vulvovaginitis is nonspecific, driven by the unestrogenized, thin, alkaline vaginal mucosa, absent labial protection of the introitus, and proximity of the anus to the vagina, compounded by poor hygiene, chemical irritants (bubble bath, soaps, detergents, pools/hot tubs), tight clothing, obesity, and poor aeration.
- Among prepubertal girls with visible discharge on exam (not just irritation/erythema), up to 50% have a specific infectious cause warranting antimicrobial treatment; vaginal cultures show normal flora in 33-85% of nonspecific cases.
- Group A beta-hemolytic streptococcus is found in about 10-20% of cases and can present with serosanguineous (blood-tinged) discharge; other respiratory pathogens (including Streptococcus pneumoniae) can cause vulvovaginitis via orodigital transmission, sometimes concurrent with or following a respiratory infection.
- Shigella can also cause vulvovaginitis, sometimes with blood-tinged discharge, and should be considered especially with a history of diarrhea.
- Candida vulvovaginitis is common after puberty (over 80% caused by C. albicans) but rare in healthy prepubertal children unless there is a predisposing factor (diabetes mellitus, systemic antibiotics, steroids); presents with vulvar erythema, thick cheesy/creamy discharge, satellite lesions, and sometimes perianal dermatitis - confirmed by KOH/wet prep.
- Sexually transmitted pathogens (including Trichomonas vaginalis, more relevant after puberty or via maternal passage in infants) causing vulvovaginitis in a prepubertal child should raise concern for sexual abuse; pelvic inflammatory disease in a prepubertal girl similarly warrants sexual abuse evaluation.
- Evaluation includes a history of hygiene practices (front-to-back wiping), chemical exposures, recent diarrhea, perianal or nighttime itching, and possible vaginal foreign body; culture with sensitivities can be obtained via a moistened cotton or urethral (Calgiswab) swab.
- Prevention/first-line management for nonspecific vulvovaginitis centers on hygiene measures: front-to-back wiping, wet wipes after bowel movements, proper genital cleansing during baths, avoiding perfumed/deodorant soaps and other topical irritants, and routine handwashing.
"""

long_md = """## Definition

Vulvitis refers to external genital pruritus, burning, redness, or rash. Vaginitis denotes inflammation of the vagina, manifesting as discharge (with or without odor) and/or bleeding. When both occur together, the term vulvovaginitis is used, though in practice this term is often applied loosely to patients with dysuria, vulvar pain or itching, or vaginal discharge even when they lack overt signs of inflammation or have only vulvar or only vaginal involvement.

## Epidemiology

Vulvovaginitis is a common gynecologic complaint in prepubescent girls. Approximately 75% of cases in this age group are nonspecific, with vaginal cultures showing normal or nonspecific flora in 33-85% of such cases. More specific bacterial causes, such as group A beta-hemolytic streptococcus, account for roughly 10-20% of cases and appear to have seasonal variation. Importantly, among symptomatic premenarchal girls who have visible vaginal discharge on examination (as opposed to irritation and erythema alone), up to 50% have a specific vaginal infection warranting antimicrobial treatment - a distinction that matters for triaging further work-up.

## Etiology

Prepubertal girls are predisposed to vulvovaginitis by several age-appropriate anatomic and physiologic factors: the labia do not fully cover or protect the vaginal vestibule from friction and external irritants, particularly when sitting or squatting; the unestrogenized (hypoestrogenized) vaginal epithelium is thin, friable, and easily traumatized; and the vaginal environment is alkaline rather than the protective acidic pH that develops with pubertal lactobacilli colonization. Noninfectious causes include chemical irritants (bath soaps, bubble bath, bath bombs, laundry detergents, swimming pools, hot tubs), poor or inconsistent hygiene, frictional irritation, poor aeration (exacerbated by obesity), tight clothing, and underlying dermatologic disorders. Infectious causes are subclassified into nonsexually transmitted and sexually transmitted pathogens. Nonsexually transmitted bacterial pathogens and herpes simplex virus are often transferred to the vulvovaginal area from another body site (nose, mouth, throat, skin, or GI tract) via the child's own hands (orodigital or autoinoculation transmission). Group A beta-hemolytic streptococcus is a well-recognized cause, sometimes producing serosanguineous discharge; other respiratory flora, including Streptococcus pneumoniae, can also cause purulent discharge with vulvitis and vaginitis, concurrent with or following an upper respiratory infection. Shigella species are another recognized nonsexually transmitted cause, particularly relevant with a history of diarrhea, and can also produce blood-tinged discharge. Candida is a common cause of diaper dermatitis but rarely causes true vulvovaginitis in a prepubertal child who is no longer in diapers, unless a predisposing factor is present, such as diabetes mellitus or systemic antibiotic or steroid use; Candida vulvovaginitis is, by contrast, common after puberty, with more than 80% of cases caused by Candida albicans, and predisposing factors in this age group include pregnancy, oral contraceptive use, and oral antibiotics. Sexually transmitted pathogens causing vulvovaginitis in a prepubertal child are almost always associated with sexual abuse and should prompt that evaluation; Trichomonas vaginalis is more relevant after puberty begins, or in infants via maternal passage during birth.

## Clinical Features

Symptoms across most causes of vulvovaginitis are similar: perineal itching or pain, external or contact dysuria, and occasionally vaginal discharge, which can range from clear to white to green or yellow, and may be odorless or foul-smelling. In noninfectious vulvovaginitis, physical findings are often unimpressive despite significant patient and parental concern, and vaginal discharge is unusual. Candida vulvovaginitis typically shows diffuse vulvar erythema, sometimes with white or pink cobblestoned plaques on an erythematous base in chronic cases, excoriations from scratching, satellite lesions on the perineum, perianal dermatitis, and a thick creamy or cheesy discharge; in adolescents, whitish plaques may adhere to the vagina or cervix. After puberty, a normal, asymptomatic increase in vaginal discharge occurs, which may be clear, opaque, white, or yellow, becoming more mucoid mid-cycle after ovulation, and may have an odor but typically no accompanying discomfort - this must be distinguished from pathologic vaginitis. Vulvovaginitis is a relatively uncommon cause of pediatric vaginal bleeding but should be considered, particularly with causes like Streptococcus or Shigella that can produce serosanguineous discharge. Pelvic inflammatory disease primarily affects sexually active adolescents but should raise suspicion of sexual abuse when seen in a prepubertal girl, presenting with abdominal pain.

## Diagnostics

A thorough history should cover hygiene practices (front-to-back wiping), possible exposure to chemical irritants, recent diarrhea, perianal or nighttime itching, and the possibility of a vaginal foreign body (though a young child is unlikely to recall or report this). Children with vulvovaginitis symptoms often have had prior evaluations and treatment failures, making a systematic approach important. Cultures with sensitivities for specific pathogens can be obtained using a cotton swab or a urethral (Calgiswab) swab moistened with nonbacteriostatic saline; swabbing can cause discomfort or, rarely, minimal bleeding. Candida infection is confirmed by KOH preparation or wet mount, which shows yeast and often increased inflammatory cells. The diagnosis of nonspecific vaginitis should be made only after other identifiable causes have been excluded through examination and, where indicated, testing.

## Differential Diagnosis

Causes are best classified into noninfectious and infectious categories, with infectious further divided into nonsexually and sexually transmitted pathogens. A finding of visible discharge on exam (versus irritation/erythema alone) should raise the pretest probability of a specific infectious cause requiring different management than nonspecific vulvovaginitis. Sexually transmitted infection or pelvic inflammatory disease in a prepubertal child should always prompt evaluation for sexual abuse.

## Treatment

Nonspecific vulvovaginitis is managed with hygiene measures: front-to-back wiping, use of wet wipes after bowel movements, proper genital cleansing during baths, routine handwashing, and avoidance of topical irritants, chemicals, and perfumed or deodorant soaps. Candida vulvovaginitis is treated effectively with vaginal creams or troches of nystatin, clotrimazole, or miconazole, or with a single oral dose of fluconazole. Bacterial causes identified by culture (such as group A streptococcus) are treated with targeted antimicrobial therapy.
"""

clinical_md = """## Evaluating a Prepubertal Girl with Vulvovaginal Symptoms

Take a detailed history covering hygiene technique (front-to-back wiping), exposure to chemical irritants (bubble baths, soaps, detergents, pools/hot tubs), tight clothing, recent diarrhea, and perianal or nighttime itching, and gently ask about the possibility of a foreign body, recognizing a young child may not recall or disclose this. On exam, distinguish visible discharge from irritation/erythema alone - visible discharge raises the likelihood of a specific infectious cause to about 50%, whereas irritation without discharge more often reflects nonspecific vulvovaginitis from the combination of unestrogenized mucosa, absent labial protection, and alkaline pH that predisposes all prepubertal girls. Obtain a culture with sensitivities using a moistened cotton or urethral (Calgiswab) swab when a specific infectious cause is suspected, particularly with blood-tinged/serosanguineous discharge (raising concern for group A streptococcus or Shigella) or a history of recent respiratory illness or diarrhea. Reserve a diagnosis of nonspecific vaginitis for after other identifiable causes have been reasonably excluded, since many of these children have already had prior evaluations and treatment failures.

## Recognizing Red Flags and Treating by Cause

Treat any prepubertal child with a sexually transmitted pathogen identified on vulvovaginal culture, or with pelvic inflammatory disease, as a sexual abuse concern requiring a full evaluation - this association is close to universal at this age. Consider Candida vulvovaginitis only when a predisposing factor is present (diabetes, recent systemic antibiotics or steroids) in a prepubertal, diaper-free child, since Candida is otherwise an uncommon cause at this age despite being a frequent culprit in diaper dermatitis and in postpubertal vulvovaginitis; confirm with KOH prep/wet mount and treat with topical azole antifungals or, in adolescents, a single dose of oral fluconazole. For nonspecific vulvovaginitis, the majority of cases, focus first-line management entirely on hygiene counseling (front-to-back wiping, wet wipes, gentle genital cleansing, avoiding perfumed soaps and other irritants) before escalating to antimicrobial therapy, since most children improve with these measures alone.
"""

build_and_save(
    topic="Vulvovaginitis",
    slug="vulvovaginitis",
    category_id=15000,
    summary="Prepubertal vulvovaginitis: why unestrogenized anatomy predisposes to nonspecific disease, the discharge-versus-irritation distinction that flags a specific infectious cause, and when a finding should trigger a sexual abuse evaluation.",
    references=references,
    short_md=short_md,
    long_md=long_md,
    clinical_md=clinical_md,
)
