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).
allergy-adverse-reaction-summaryRetrieves, categorizes, and analyzes AllergyIntolerance resources with severity grading, cross-reactivity flags, and medication conflict detection. Use when user asks to "check allergies", "allergy summary", "drug allergies", "review adverse reactions", "allergy list", "is the patient allergic to", or "cross-reactivity check". Do NOT use for full clinical s…
Independent GitHub snapshot · Automated classification · Original documentation governs
Pull all AllergyIntolerance resources for a patient. Categorize by type (drug, food, environmental). Grade severity and criticality. Flag high-risk allergies that require special clinical attention (anaphylaxis history, contrast dye, latex, NSAID sensitivity). Cross-reference against current medications to detect active conflicts. Output a structured summary with actionable safety flags.
| Resource | Purpose | Search Parameters |
|---|---|---|
| AllergyIntolerance | Allergy and intolerance records | patient, clinical-status |
| MedicationRequest | Current medications for conflict detection | patient, status=active |
| Observation | IgE levels if available | patient, code (LOINC) |
Tool: fhir_search
resourceType: "AllergyIntolerance"
queryParams: "patient=[patient-id]"
Retrieve all records regardless of clinical status to capture full history. For each entry extract:
code.coding: Substance (RxNorm for drugs, SNOMED CT for non-drugs)clinicalStatus: active, inactive, resolvedverificationStatus: confirmed, unconfirmed, refuted, entered-in-errortype: allergy vs intolerancecategory: food, medication, environment, biologiccriticality: low, high, unable-to-assessreaction[]: Each reaction event
manifestation[].coding[].display: What happened (hives, anaphylaxis, rash, etc.)severity: mild, moderate, severeonset: When the reaction occurredsubstance: Specific substance if different from the top-level codeonsetDateTime: When allergy was first identifiedrecorder: Who documented itnote: Free-text notesGroup into four categories:
Drug Allergies (category = "medication"):
Food Allergies (category = "food"):
Environmental Allergies (category = "environment"):
Biologic/Other (category = "biologic" or uncategorized):
Scan the allergy list for the following high-risk patterns:
Anaphylaxis History:
reaction[].manifestation includes SNOMED 39579001 (Anaphylaxis) or display text contains "anaphylaxis" or "anaphylactic"Contrast Dye Allergy:
Latex Allergy:
NSAID Sensitivity:
Sulfonamide Allergy:
Opioid Allergy:
Apply known cross-reactivity rules:
Penicillin Cross-Reactivity:
Cephalosporin Cross-Reactivity:
ACE Inhibitor Angioedema:
Statin Myopathy:
Tool: fhir_search
resourceType: "MedicationRequest"
queryParams: "patient=[patient-id]&status=active"
For each active medication, check against the allergy list:
Flag any active conflict as:
ACTIVE CONFLICT: Patient is on [medication] but has documented allergy to [substance]
Reaction history: [manifestation] - Severity: [severity]
Action required: Verify with prescriber. This may be a monitored override or a documentation error.
Flag documentation issues:
reaction array empty)verificationStatus = "unconfirmed" for allergies older than 1 year (should be confirmed or refuted)type not specified (allergy vs intolerance distinction missing)ALLERGY & ADVERSE REACTION SUMMARY
====================================
Patient: [name] ([patient-id])
Reviewed: [timestamp]
Total Entries: [count]
Allergy Status: [Reviewed / Not Reviewed / NKDA]
HIGH-RISK ALERTS
================
[!] ANAPHYLAXIS RISK: [substance] - ensure epinephrine access
[!] CONTRAST ALLERGY: Premedication required
[!] LATEX ALLERGY: Non-latex equipment required
[!] ACTIVE CONFLICT: On [medication] with allergy to [substance]
DRUG ALLERGIES
==============
1. [Substance] (RxNorm: [code])
Type: Allergy | Status: Active | Criticality: High
Reaction: [manifestation] | Severity: Severe
Cross-reactivity note: [if applicable]
Documented: [date] by [recorder]
2. ...
FOOD ALLERGIES
==============
1. [Substance] - Reaction: [manifestation] - Severity: [severity]
2. ...
ENVIRONMENTAL ALLERGIES
=======================
1. [Substance] - Reaction: [manifestation] - Severity: [severity]
2. ...
INTOLERANCES (Non-Allergic)
============================
1. [Substance] - Type: Intolerance - Reaction: [manifestation]
2. ...
DOCUMENTATION QUALITY
=====================
- [N] allergies missing reaction details
- [N] allergies with unconfirmed verification status
- [Notes on documentation gaps]
CROSS-REACTIVITY NOTES
=======================
- [Relevant cross-reactivity information based on documented allergies]
User says: "Check allergies for patient 33221"
Actions:
fhir_search AllergyIntolerance?patient=33221 -- returns 5 entriesfhir_search MedicationRequest?patient=33221&status=active -- returns 8 medicationsResult:
ALLERGY & ADVERSE REACTION SUMMARY
====================================
Patient: David Park (33221)
Reviewed: 2026-02-07T10:00:00Z
Total Entries: 5
Allergy Status: Reviewed
HIGH-RISK ALERTS
================
[!] ANAPHYLAXIS RISK: Penicillin - ensure epinephrine access
[!] ACTIVE CONFLICT: On cephalexin (Keflex) with documented penicillin allergy
(anaphylaxis history) - IMMEDIATE REVIEW REQUIRED
DRUG ALLERGIES
==============
1. Penicillin (RxNorm: 7980)
Type: Allergy | Status: Active | Criticality: High
Reaction: Anaphylaxis | Severity: Severe
Cross-reactivity: 2% risk with cephalosporins. Given anaphylaxis history,
avoid all beta-lactams pending formal allergy testing.
Documented: 2019-05-12
2. Codeine (RxNorm: 2670)
Type: Intolerance | Status: Active | Criticality: Low
Reaction: Nausea, vomiting | Severity: Mild
Note: Likely opioid side effect, not true allergy. Other opioids
may be tolerated. Consider reclassifying as intolerance if not already.
Documented: 2020-08-03
FOOD ALLERGIES
==============
1. Shellfish (SNOMED: 278840001)
Reaction: Urticaria, throat tightness | Severity: Moderate
Note: Monitor for iodinated contrast cross-reactivity (historically
cited but evidence is weak; shellfish allergy is protein-based,
not iodine-based)
ENVIRONMENTAL ALLERGIES
=======================
1. Dust mites (SNOMED: 260147004)
Reaction: Rhinitis | Severity: Mild
INTOLERANCES
============
1. Lactose (SNOMED: 782415009)
Type: Intolerance | Reaction: Bloating, diarrhea | Severity: Mild
DOCUMENTATION QUALITY
=====================
- Codeine entry classified as "allergy" but reaction pattern suggests intolerance
- Dust mite allergy missing severity in FHIR record (inferred as mild from manifestation)
User says: "Does patient 99001 have any allergies?"
Actions:
fhir_search AllergyIntolerance?patient=99001 -- returns 0 entriesResult:
ALLERGY & ADVERSE REACTION SUMMARY
====================================
Patient: Lisa Chen (99001)
Reviewed: 2026-02-07T10:15:00Z
Total Entries: 0
Allergy Status: ** NOT REVIEWED **
HIGH-RISK ALERTS
================
[!] ALLERGY STATUS UNKNOWN: No allergy records found. This does NOT mean
"No Known Allergies" -- it means allergies have never been documented.
Allergy history MUST be collected before prescribing.
RECOMMENDATION
==============
Ask the patient about:
1. Drug allergies (especially antibiotics, NSAIDs, anesthetics)
2. Food allergies
3. Environmental allergies
4. Latex sensitivity
5. Contrast dye reactions
6. Previous adverse drug reactions
If patient reports no allergies, document a "No Known Allergies" entry:
Tool: fhir_create
resourceType: "AllergyIntolerance"
resource: {
"clinicalStatus": {"coding": [{"system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical", "code": "active"}]},
"verificationStatus": {"coding": [{"system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification", "code": "confirmed"}]},
"code": {"coding": [{"system": "http://snomed.info/sct", "code": "716186003", "display": "No known allergy"}]},
"patient": {"reference": "Patient/99001"}
}
code.text but not code.coding. Use the display text for matching.note or extension fields that indicate a deliberate override.patient-demographics-summary -- for complete patient overview including insurance and contactsproblem-list-review -- for cross-referencing allergies with conditionsclinical-summary-generator -- for allergies in the context of a full CCD summary