import json

references = [
  {"title": "Pediatric ICD-10-CM 2023", "author": "American Academy of Pediatrics Committee on Coding and Nomenclature;", "pages": [198]},
  {"title": "Kliegman R. Nelson Textbook of Pediatrics 2-Volume Set 22ed 2024", "author": None, "pages": [1211,1215]},
  {"title": "MedStudy Pediatrics Core 11th Edition 2024-2025", "author": None, "pages": [236]},
  {"title": "Pediatric Clinical Practice Guidelines & Policies, 18th Edition", "author": "American Academy of Pediatrics", "pages": [49,624]},
  {"title": "Update in Pediatrics", "author": None, "pages": [37,40]},
  {"title": "Pediatric Clinical Practice Guidelines and Policies", "author": "American Academy of Pediatrics (AAP);", "pages": [103]},
  {"title": "Cover", "author": "Vitalsource Download", "pages": [1132]},
  {"title": "Pediatric Board Study Guide", "author": None, "pages": [1029]}
]

short = [{"title": "In short", "content": """- Cannabis is the most commonly used illicit drug among US adolescents — about 50% have used it by 12th grade. Earlier onset of use is associated with greater risk of later substance use with other drugs; cannabis often co-occurs with alcohol/opioid use disorders and psychiatric conditions (mood, anxiety, ADHD).
- DSM-5 no longer separates "abuse" and "dependence" — substance use disorder is diagnosed on a spectrum using 11 criteria across 4 categories: impaired control, social impairment, risky use, and pharmacologic criteria (tolerance, withdrawal).
- Physical signs of acute use: tachypnea, tachycardia, elevated blood pressure, conjunctival injection, increased appetite, chronic cough, ataxia, and nystagmus, plus euphoria, decreased alertness/anxiety, and impaired cognition/judgment/coordination.
- Cannabis impairs all 4 major cognitive domains: working memory, perceptual reasoning, delayed recall, and inhibitory control; heavy daily use for 10+ years is associated with subtle cognitive impairment (sequencing, processing speed, inhibition, sustained attention), and regular adolescent use is associated with impaired educational attainment.
- Urine drug screen detects cannabis for 2–8 days in infrequent users but up to 4–6 weeks after long-term heavy use.
- Cannabis withdrawal syndrome (added in DSM-5): ≥3 of irritability/anger/aggression, nervousness/anxiety, sleep difficulty, decreased appetite/weight loss, restlessness, depressed mood, plus at least one physical symptom (abdominal pain, tremor, sweating, fever, chills, headache) — occurring after about 1 week following cessation of heavy, near-daily use of a few months' duration.
- Cannabinoid hyperemesis syndrome (CHS): recurrent cyclic vomiting with abdominal pain and nausea in a patient with chronic (typically >1–2 years), frequent (multiple times/week) cannabis use; classically relieved by hot showers/baths. Treatment is cannabis cessation (the single most effective treatment) plus antiemetics (ondansetron) and topical capsaicin; other causes of vomiting must be excluded first.
- Cannabis dependence occurs in about 1 in 10 users overall; other chronic adverse effects include chronic bronchitis/impaired respiratory function in regular smokers, and psychotic symptoms/disorders in heavy users, especially those with a personal or family history of psychosis.
- Synthetic cannabinoids (e.g., "Spice," "K2"), popular among teens since emerging in 2008, cause a similar-but-more-severe toxidrome: tachycardia, tachypnea, hypertension, conjunctival injection, nystagmus, and anxiety, and can cause new-onset aggression, palpitations, confusion, and disorientation.
- Screening and treatment: a positive CRAFFT screen for marijuana warrants brief counseling; more intensive treatment (motivational interviewing, cognitive behavioral therapy) is indicated based on duration/frequency of use; buspirone and gabapentin have been used adjunctively for cannabis withdrawal alongside behavioral therapy."""}]

long = [
 {"title": "Definition", "content": """DSM-5 no longer distinguishes substance "abuse" from "dependence" as separate categories; instead, substance use disorder (including cannabis use disorder) is defined by a cluster of cognitive, behavioral, and physiologic symptoms indicating continued use despite evidence of harm, diagnosed along a severity spectrum using 11 criteria grouped into four categories: impaired control (e.g., using more than intended, unsuccessful attempts to cut down, spending significant time obtaining/using/recovering, craving), social impairment (failure to fulfill major role obligations, continued use despite social/interpersonal problems, giving up important activities), risky use (recurrent use in physically hazardous situations, continued use despite known physical/psychological harm), and pharmacologic criteria (tolerance, withdrawal). Even after detoxification, substance use disorder can leave persistent changes in brain circuits with lasting behavioral effects."""},
 {"title": "Epidemiology", "content": """Cannabis is the most commonly used illicit drug in the United States; approximately 50% of students report having used it by the time they reach 12th grade. Earlier initiation of cannabis use is associated with greater risk of later use of other substances; although cannabis is no longer considered a classic "gateway drug," an association with subsequent use of other substances persists. Cannabis use frequently coexists with alcohol and opioid use disorders and with psychiatric conditions, including mood and anxiety disorders and ADHD. Cannabis dependence develops in roughly 1 in 10 users overall."""},
 {"title": "Clinical features", "content": """Acute cannabis intoxication produces tachypnea, tachycardia, elevated blood pressure, conjunctival injection, increased appetite, chronic cough (in regular smokers), ataxia, and nystagmus, along with euphoria, decreased alertness and anxiety, and impairment of cognition, judgment, and coordination. Acute adverse effects include anxiety and panic (especially in cannabis-naive users), psychotic symptoms at high doses, motor vehicle crashes if driving while intoxicated, and cannabis hyperemesis syndrome. Chronic adverse effects include cannabis dependence syndrome (about 1 in 10 users), chronic bronchitis and impaired respiratory function in regular smokers, psychotic symptoms and disorders in heavy users (particularly those with a personal history of psychotic symptoms or a family history of psychotic disorders), impaired educational attainment in adolescents who use regularly, and — in daily users of 10 or more years — subtle cognitive impairment affecting sequencing ability, cognitive processing speed, inhibition, and sustained attention. Cannabis impairs all four major cognitive domains: working memory, perceptual reasoning, delayed recall, and inhibitory control. Cannabis withdrawal syndrome, recognized in DSM-5, requires at least 3 of the following after about 1 week of discontinuation following heavy, near-daily use for a period of months: irritability/anger/aggression, nervousness/anxiety, sleep difficulty/insomnia, decreased appetite/weight loss, restlessness, depressed mood, and at least one physical symptom (abdominal pain, shakiness/tremor, sweating, fever, chills, or headache)."""},
 {"title": "Differential diagnosis", "content": """Cannabinoid hyperemesis syndrome (CHS) presents with recurrent cyclic vomiting, epigastric abdominal pain, and nausea, classically relieved by hot showers or baths, in a patient with chronic (typically over 1–2 years) and frequent (multiple times per week) cannabis use; it shares considerable clinical overlap with cyclic vomiting syndrome, and other causes of recurrent vomiting must be excluded before attributing symptoms to CHS. Chest pain in a cannabis user requires its own differential — acute coronary syndrome, asthma exacerbation, and pneumothorax/pneumomediastinum should all be considered and the actual etiology determined rather than assumed. Synthetic cannabinoids (sold as "Spice," "K2," and similar names, popular among teenagers since emerging around 2008) produce a related but often more severe and unpredictable toxidrome — tachycardia, tachypnea, hypertension, conjunctival injection, nystagmus, anxiety, and can present with new-onset aggression, palpitations, confusion, and disorientation that should not be mistaken for straightforward cannabis intoxication."""},
 {"title": "Diagnostics", "content": """Urine drug screening confirms recent cannabis use; the detection window is roughly 2–8 days for infrequent users but can extend to 4–6 weeks after long-term, heavy use, which matters when interpreting a positive screen in the context of a reported quit date. Diagnosis of cannabis use disorder itself is clinical, based on meeting DSM-5 criteria across the four symptom domains rather than on a laboratory test. The CRAFFT screening tool is used to identify adolescents at risk for substance use disorders, including marijuana use, and a positive screen should prompt further clinical assessment."""}
]

clinical = [
 {"title": "Management", "content": """For acute symptoms of cannabis intoxication or panic reaction, manage with a calm environment, decreased stimulation, and reassurance; benzodiazepines are sometimes indicated for severe anxiety or agitation. Evaluate chest pain in a cannabis user on its own merits — rule out acute coronary syndrome, asthma exacerbation, and pneumothorax/pneumomediastinum — rather than attributing it reflexively to the cannabis itself.

For suspected cannabinoid hyperemesis syndrome, first exclude other causes of recurrent vomiting, then treat with cessation of cannabis use (the single most effective intervention), antiemetics (ondansetron), and topical capsaicin; counsel the patient explicitly that abstinence, not just symptomatic treatment, is required to resolve the syndrome.

For an adolescent with a positive CRAFFT screen for marijuana, provide a brief counseling session; escalate to more intensive treatment — motivational interviewing and cognitive behavioral therapy have shown effectiveness in this age group — based on the duration and frequency of use. For cannabis withdrawal syndrome (irritability, anger, sleep disturbance, decreased appetite, restlessness, depressed mood, plus a physical symptom, emerging about a week after stopping heavy near-daily use), behavioral therapy is the mainstay, with buspirone and gabapentin used adjunctively in some cases. Given how common cannabis use is among adolescents, take the opportunity at routine visits to provide direct education on the short- and long-term health hazards of use, including the cognitive, respiratory, psychiatric, and educational-attainment risks described above."""}
]

article = {
 "topic": "Cannabis Use Disorder",
 "slug": "cannabis-use-disorder",
 "category_id": 15652,
 "summary": "DSM-5 criteria for cannabis use disorder, its acute and chronic adverse effects in adolescents, and recognizing and treating cannabis withdrawal and cannabinoid hyperemesis syndrome.",
 "written_by": "claude-sonnet",
 "references": references,
 "short": short,
 "long": long,
 "clinical": clinical
}
with open("/tmp/claude-0/-home-danvics-docker-quiz/c1e0577a-e42c-4a3d-b1ea-3edd61103a4e/scratchpad/articles/cannabis.article.json", "w") as f:
    json.dump(article, f, indent=1)
print("done")
