Co-authors: Amie Goodin, University of Florida
Background: Identifying whether a patient uses cannabis is now tractable at scale. Our foundational work developed an LLM-based pipeline to determine cannabis use status across UF Health’s longitudinal clinical notes, finding more than three times as many users as diagnosis codes. Use status, however, is a low-information exposure variable. Cannabis now reaches patients through multiple channels, including state-authorized medical programs, retail hemp products, and illicit supply, so patients pooled as current users differ in product, potency, and regulatory context. Toxicology cannot resolve these differences, detecting analytes rather than exposure characteristics. These distinctions surface only in free text, which has not been examined beyond use status.
Objective: To characterize documentation of cannabis use setting and source in clinical notes, and to determine whether these distinctions can be extracted at scale using locally deployable LLMs.
Methods: From the same UF Health cohort (1,000 randomly sampled patients; 132,500 notes, 2017-2025), our foundational pipeline yielded 1,887 snippets with manually confirmed cannabis use. Two rounds of expert annotation (94.5% agreement) and an internal-consistency audit assigned each snippet to one of four mutually exclusive categories based on explicit wording about how or where cannabis was obtained or used: authorized (medical card, state program, clinician certification, or dispensary); illicit (outside legal channels, “off the street”); recreational (social use, “socially with friends”); and unknown. Snippets were classified by Gemma-4-31B-it, an open-weight LLM run in UF HiPerGator (HIPAA-compliant), using expert-defined few-shot prompting.
Results: Setting or source was documented in 269 of 1,887 snippets (14.3%): 179 authorized (9.5%), 45 illicit (2.4%), and 45 recreational (2.4%). The remaining 1,618 (85.7%) recorded use with no setting or source. Average F1 across the three documented categories ranged from 0.748 to 0.904 over three prompting strategies. The best strategy reached F1=0.951 for authorized (precision=0.982, recall=0.922), 0.898 for illicit (0.830, 0.978), and 0.864 for recreational (0.972, 0.778), with four-category accuracy 0.980. Errors were almost entirely missed mentions rather than misclassifications: when the model detected relevant wording, it assigned the correct category in 268 of 269 cases (99.6%).
Conclusions: Cannabis use setting and source are extractable from clinical notes with high accuracy using locally deployable, open-weight LLMs without model training. The binding constraint is documentation rather than technology: 86% of snippets do not document setting or source. More consistent documentation at the point of care would substantially expand what these methods can deliver for cannabis outcomes research.