brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
chronic-pain-management-reviewPerforms comprehensive chronic pain management assessment with opioid safety review, MME calculation, and multimodal treatment evaluation. Use when user asks to "review pain management", "check MME", "opioid review", "pain assessment", "pain medication review", "morphine equivalent", mentions "chronic pain", "pain score trends", "urine drug screen", or need…
Independent GitHub snapshot · Automated classification · Original documentation governs
Pull and analyze all pain-related clinical data for a comprehensive chronic pain management review. Retrieve pain-related Conditions, current analgesic MedicationRequests (opioid and non-opioid), pain score Observations over time, functional status assessments, and urine drug screen results. Calculate current daily morphine milligram equivalents (MME). Evaluate adherence to CDC 2022 opioid prescribing guidelines. Flag high-risk patterns: elevated MME, concurrent benzodiazepines, lack of multimodal approach, missing urine drug screens, absent naloxone prescription. Present structured review with risk mitigation recommendations.
| Resource | Purpose | Key Fields |
|---|---|---|
| Patient | Demographics, age | birthDate, gender |
| Condition | Pain diagnoses, comorbidities | code, clinicalStatus, onsetDateTime, bodySite |
| MedicationRequest | Analgesics, adjuvants, naloxone | medicationCodeableConcept, status, dosageInstruction, authoredOn |
| Observation | Pain scores, UDS, functional status | code, valueQuantity, effectiveDateTime, interpretation |
| Procedure | Pain interventions (injections, nerve blocks) | code, performedDateTime, status |
Tool: fhir_read
resourceType: "Patient"
id: "[patient-id]"
Extract age, gender. Age is relevant for Beers criteria (>=65 years: avoid opioids as first-line per AGS).
Tool: fhir_search
resourceType: "Condition"
queryParams: "patient=[patient-id]&code:below=22253000&clinical-status=active"
SNOMED 22253000 = Pain (finding). This captures chronic pain subtypes.
Also search for specific chronic pain conditions:
Tool: fhir_search
resourceType: "Condition"
queryParams: "patient=[patient-id]&code=82423001,279039007,203082005,431855005,73211009,724637000&clinical-status=active"
SNOMED codes:
For each Condition:
code (pain type), bodySite, onsetDateTime (duration of chronic pain)Tool: fhir_search
resourceType: "MedicationRequest"
queryParams: "patient=[patient-id]&status=active&_count=100"
Categorize medications into:
Opioids (calculate MME for each):
Non-Opioid Analgesics:
Adjuvant Analgesics:
High-Risk Combinations to Flag:
For each opioid MedicationRequest:
dosageInstruction[0].doseAndRate[0].doseQuantitydosageInstruction[0].timing.repeat (period, periodUnit, frequency)CDC 2022 thresholds:
=90 MME/day: high risk, avoid or justify with documented rationale
See references/opioid-safety.md for complete MME conversion table and methadone variable conversion.
Tool: fhir_search
resourceType: "Observation"
queryParams: "patient=[patient-id]&code=72514-3,38208-5,77565-0&_sort=-date&_count=50"
LOINC codes:
Build pain score time series. Calculate:
Tool: fhir_search
resourceType: "Observation"
queryParams: "patient=[patient-id]&code=77565-0,89555-7&_sort=-date&_count=10"
Functional improvement is a key metric -- pain reduction without functional improvement suggests suboptimal management.
Tool: fhir_search
resourceType: "Observation"
queryParams: "patient=[patient-id]&code=3426-4,19659-2,12300-3&_sort=-date&_count=10"
LOINC codes (common UDS panel):
Expected UDS findings for chronic opioid therapy:
Flag:
Tool: fhir_search
resourceType: "Procedure"
queryParams: "patient=[patient-id]&code=231253001,399097000,18946005&_sort=-date"
SNOMED codes:
Also search for physical therapy, chiropractic, acupuncture:
Tool: fhir_search
resourceType: "Procedure"
queryParams: "patient=[patient-id]&code=91251008,44868003,231785002&_sort=-date"
SNOMED: 91251008 = Physical therapy, 44868003 = Chiropractic, 231785002 = Acupuncture.
Tool: fhir_search
resourceType: "MedicationRequest"
queryParams: "patient=[patient-id]&code=7242&status=active"
RxNorm 7242 = naloxone. CDC recommends naloxone co-prescription if MME >=50, history of overdose, concurrent benzodiazepines, or substance use disorder history.
Search for controlled substance agreement and PDMP check documentation:
Tool: fhir_search
resourceType: "Observation"
queryParams: "patient=[patient-id]&code=PDMP&_sort=-date&_count=5"
Note: PDMP data may not be available via FHIR. Flag if no documentation of PDMP check exists.
CHRONIC PAIN MANAGEMENT REVIEW -- [Patient Name] -- [Date]
=============================================================
PAIN DIAGNOSES
1. [Condition] -- onset [date] -- duration [years/months]
Pain type: [nociceptive / neuropathic / mixed / nociplastic]
Body site: [location]
CURRENT PAIN REGIMEN
Opioids:
[Drug] [dose] [frequency] = [daily dose] = [MME] MME/day
...
Total Daily MME: [sum] MME/day [<50 / 50-89 / >=90 risk level]
Non-Opioid Analgesics:
[Drug] [dose] [frequency]
...
Adjuvant Medications:
[Drug] [dose] [frequency]
...
MULTIMODAL ASSESSMENT
[x] Opioid therapy
[x/o] Non-opioid pharmacotherapy
[x/o] Adjuvant analgesics (neuropathic agents)
[x/o] Interventional procedures
[x/o] Physical therapy / rehabilitation
[x/o] Behavioral/psychological therapy
[x/o] Complementary approaches (acupuncture, massage)
PAIN SCORE TREND
[Date]: [score] -> [Date]: [score] -> [Date]: [score]
Average (3 months): [value]/10
Trend: [improving / stable / worsening]
FUNCTIONAL STATUS
PEG Score: [value]/30 (Pain [x], Enjoyment [x], General activity [x])
Trend: [improving / stable / declining]
RISK MITIGATION STATUS
[x/o] Controlled substance agreement on file
[x/o] PDMP checked within last [X] months
[x/o] Urine drug screen: [date] -- [results summary]
[x/o] Naloxone prescribed [required if MME >=50 or concurrent BZD]
SAFETY FLAGS
[!] [Description of any safety concern]
...
RECOMMENDATIONS
[Specific actions based on review findings]
User says: "Review pain management for patient PAIN-2201"
Actions:
fhir_read Patient/PAIN-2201 -- 54-year-old malefhir_search Condition?patient=PAIN-2201&code:below=22253000&clinical-status=active -- chronic low back pain (2019), lumbar degenerative disc diseasefhir_search MedicationRequest?patient=PAIN-2201&status=active -- oxycodone 10mg q8h, gabapentin 600mg TID, meloxicam 15mg daily, naloxone nasal sprayfhir_search Observation?patient=PAIN-2201&code=72514-3&_sort=-date&_count=50 -- pain scores: 7, 6, 5, 5, 5 over 6 monthsfhir_search Observation?patient=PAIN-2201&code=3426-4,19659-2&_sort=-date&_count=10 -- UDS 2 months ago: positive opiates (expected), negative benzodiazepines, negative cocaine, negative amphetaminesfhir_search Procedure?patient=PAIN-2201&_sort=-date -- lumbar epidural 3 months ago, PT completed 6 months agoResult:
CHRONIC PAIN MANAGEMENT REVIEW -- David Thompson -- 2026-02-07
================================================================
PAIN DIAGNOSES
1. Chronic low back pain -- onset 2019 -- 7 years
2. Lumbar degenerative disc disease -- L4-L5, L5-S1
Pain type: Mixed (nociceptive + neuropathic component)
CURRENT PAIN REGIMEN
Opioids:
Oxycodone 10mg q8h (30mg/day) = 45 MME/day
Total Daily MME: 45 MME/day [BELOW 50 threshold -- standard risk]
Non-Opioid: Meloxicam 15mg daily
Adjuvant: Gabapentin 600mg TID (neuropathic component)
MULTIMODAL ASSESSMENT
[x] Opioid therapy
[x] Non-opioid pharmacotherapy (NSAID)
[x] Adjuvant analgesic (gabapentin)
[x] Interventional (epidural steroid injection, 3 months ago)
[x] Physical therapy (completed 6-month course)
[o] Behavioral/psychological therapy -- NOT DOCUMENTED
[o] Complementary approaches -- NOT DOCUMENTED
PAIN SCORE TREND
2025-08: 7 -> 2025-10: 6 -> 2025-12: 5 -> 2026-01: 5 -> 2026-02: 5
Average (3 months): 5.0/10
Trend: IMPROVED then STABLE
RISK MITIGATION STATUS
[x] UDS: 2025-12-10 -- expected opioid positive, all others negative [CONCORDANT]
[x] Naloxone prescribed (nasal spray on file)
[?] Controlled substance agreement -- not found in FHIR records
[?] PDMP check -- not documented in FHIR records
ASSESSMENT: Well-managed chronic pain regimen with appropriate multimodal approach.
MME below 50 threshold. UDS concordant. Pain improving/stable.
RECOMMENDATIONS
- Continue current regimen
- Consider CBT referral for chronic pain (behavioral therapy gap)
- Document PDMP check and controlled substance agreement
- Next UDS due by 2026-06 (annual minimum)
- Re-assess epidural benefit at next visit
User says: "Pain management review for patient PAIN-5590, high MME concern"
Actions:
fhir_read Patient/PAIN-5590 -- 42-year-old femalefhir_search Condition?patient=PAIN-5590&code:below=22253000&clinical-status=active -- chronic pain syndrome, fibromyalgia, anxiety disorderfhir_search MedicationRequest?patient=PAIN-5590&status=active -- oxycodone ER 40mg q12h, oxycodone IR 10mg q4h PRN, alprazolam 1mg TID, acetaminophen 500mg PRNfhir_search Observation?patient=PAIN-5590&code=72514-3&_sort=-date&_count=50 -- pain scores stable at 7-8/10 despite high MMEfhir_search Observation?patient=PAIN-5590&code=3426-4,19659-2&_sort=-date -- last UDS was 14 months agofhir_search MedicationRequest?patient=PAIN-5590&code=7242 -- NO naloxone on fileResult:
CHRONIC PAIN MANAGEMENT REVIEW -- Jennifer Adams -- 2026-02-07
================================================================
[!] MULTIPLE SAFETY FLAGS IDENTIFIED
PAIN DIAGNOSES
1. Chronic pain syndrome -- onset 2020 -- 6 years
2. Fibromyalgia (SNOMED 203082005)
3. Generalized anxiety disorder (comorbid)
Pain type: Nociplastic (fibromyalgia) + nociceptive
CURRENT PAIN REGIMEN
Opioids:
Oxycodone ER 40mg q12h (80mg/day) = 120 MME/day
Oxycodone IR 10mg q4h PRN (up to 60mg/day) = up to 90 MME/day
Total Daily MME: 120-210 MME/day [EXCEEDS 90 MME THRESHOLD -- HIGH RISK]
Concurrent sedative: Alprazolam 1mg TID [CONCURRENT BENZODIAZEPINE]
Non-Opioid: Acetaminophen 500mg PRN (inadequate as sole non-opioid)
SAFETY FLAGS
[!] MME >= 90: Total 120-210 MME/day -- significantly exceeds CDC threshold
[!] CONCURRENT BENZODIAZEPINE: Alprazolam 1mg TID with high-dose opioids -- CDC strongly advises against
[!] NO NALOXONE PRESCRIBED: Required at >=50 MME and concurrent benzodiazepine
[!] UDS OVERDUE: Last UDS 14 months ago (should be at minimum annual, more frequent with risk factors)
[!] PAIN NOT CONTROLLED: Scores 7-8/10 despite 120+ MME -- suggests opioid-induced hyperalgesia or inadequate approach
[!] NO ADJUVANT THERAPY: Fibromyalgia responds poorly to opioids; duloxetine/pregabalin not prescribed
[!] NO INTERVENTIONAL OR NON-PHARMACOLOGIC THERAPY documented
RECOMMENDATIONS
1. IMMEDIATE: Prescribe naloxone nasal spray and provide overdose education
2. IMMEDIATE: Obtain UDS and PDMP check
3. URGENT: Develop benzodiazepine taper plan -- concurrent use with high-dose opioids is highest-risk combination
4. Add fibromyalgia-specific therapy: duloxetine or pregabalin (first-line for fibromyalgia per ACR)
5. Develop opioid taper plan targeting <90 MME initially, with goal of further reduction
6. Refer to pain management specialist for multimodal approach
7. Refer to behavioral health for anxiety management (alternative to benzodiazepine) and chronic pain CBT
8. Consider physical therapy and exercise program referral
dosageInstruction.maxDosePerDay if populated for prescriber-defined daily limits.asNeeded without timing, estimate conservatively at 4 doses/day and note the assumption.fhir_search Observation?patient=[id]&category=laboratory&code:text=drug+screen&_sort=-date.category=vital-signs&code=72514-3.opioid-risk-assessment -- for detailed opioid risk stratification (ORT, SOAPP-R)medication-reconciliation -- for complete medication reviewlab-result-interpreter -- for UDS result interpretation and hepatic/renal function monitoringmental-health-screening -- for depression/anxiety screening in chronic pain patients