The overarching goal of the study is to understand how medical cannabis use affects opioid analgesic use over time, with particular attention to THC/CBD content, HIV outcomes, and adverse events. The study will include a cohort of 250 HIV+ and HIV- adults with (a) severe or chronic pain, (b) opioid analgesic use, and (c) new certification for medical cannabis. Over 18 months, participants will have 7 in-person visits every 3 months and 39 web-based questionnaires every 2 weeks. Data sources will include questionnaires; medical, pharmacy, and Prescription Monitoring Program records; and urine and blood samples. Over each 2-week time period (unit of analysis), the primary exposure measure will be number of days of medical cannabis use, and the primary outcome measure will be cumulative opioid analgesic dose. Qualitative interviews will also be conducted with a subgroup of 30 participants to explore perceptions of how medical cannabis use affects opioid analgesic use. Qualitative findings will help understand the reasons underlying the findings of the cohort study.