Allergy History Management Skill
Record and manage allergy history, including drug allergies, food allergies, environmental allergies, etc., with quick query and update support.
Core Flow
User Input -> Parse Operation Type -> [add] Parse Allergy Info -> Medical Standardization -> Generate JSON -> Save
-> [list] Filter and Display
-> [update] Find and Update -> Save
-> [delete] Confirm Deletion
Step 1: Parse User Input
Operation Type Recognition
| Input Keywords |
Operation |
| add |
add |
| list |
list |
| update |
update |
| delete |
delete |
Step 2: Add Allergy Record (add)
Allergy Information Parsing
Extract from natural language:
Basic Information (Auto Extracted):
- Allergen Name: Specific substance name causing allergy
- Allergy Type: Drug, food, environmental, other
- Severity Level: Mild, moderate, severe, anaphylaxis
- Reaction Symptoms: Specific allergic reaction manifestations
Detailed Information (Extract or Ask):
- Discovery Time: When allergy was first discovered
- Discovery Circumstances: Situation and context at the time
- Confirmation Method: Doctor diagnosis, self-observation, test confirmed
- Current Status: Still allergic or resolved
Medical Standardization Conversion
| Colloquial Description |
Medical Term |
Type |
| Penicillin |
Penicillin |
Drug allergy |
| Peanut |
Peanut |
Food allergy |
| Pollen |
Pollen |
Environmental allergy |
| Iodine contrast |
Iodine contrast |
Drug allergy |
| Hymenoptera venom |
Hymenoptera venom |
Other allergy |
Allergy Type Classification
- Drug Allergies: Antibiotics (penicillin, cephalosporin, etc.), painkillers (aspirin, etc.), contrast agents, vaccines, TCM, etc.
- Food Allergies: Seafood (shrimp, crab, shellfish), nuts (peanut, walnut), eggs, dairy, gluten, fruits, etc.
- Environmental Allergies: Pollen, dust mites, animal dander, mold, latex, etc.
- Other Allergies: Insect bites, chemicals, metals, etc.
Automatic Severity Determination
Keyword Mapping:
- "Shock", "Anaphylaxis", "Unconscious", "Coma" → Level 4 (anaphylaxis)
- "Severe", "Systemic", "Unbearable", "BP drop" → Level 3 (severe)
- "Obvious", "Moderate", "Needs treatment", "Swelling" → Level 2 (moderate)
- "Mild", "Occasional", "Local" → Level 1 (mild) |
Reaction Symptom Recognition
Skin symptoms: Rash, hives, itching, redness, erythema
Respiratory symptoms: Dyspnea, wheezing, laryngeal edema, chest tightness
Digestive symptoms: Nausea, vomiting, diarrhea, abdominal pain
Systemic symptoms: Shock, blood pressure drop, syncope, loss of consciousness, systemic urticaria
Step 3: Generate JSON
{
"allergies": [
{
"id": "allergy_20251231123456789",
"allergen": {
"name": "Penicillin",
"type": "drug",
"type_category": "Drug allergy",
"synonyms": ["Penicillin", "盘尼西林"]
},
"severity": {
"level": "severe",
"level_code": 3,
"description": "Severe allergic reaction"
},
"reactions": [
{
"reaction": "Rash",
"onset_time": "Within 30 minutes of exposure",
"severity": "moderate"
}
],
"discovery": {
"date": "2010-05-15",
"age_at_discovery": "8 years old",
"circumstances": "Appeared after penicillin injection during pneumonia treatment"
},
"confirmation": {
"method": "doctor_confirmed",
"method_name": "Doctor diagnosis",
"confirmed_by": "XX Hospital Pediatrics"
},
"current_status": {
"status": "active",
"status_name": "Active"
},
"management": {
"avoidance_strategy": "Strictly avoid penicillin-class medications",
"emergency_plan": "Seek immediate medical attention if accidentally used, carry allergy information",
"medical_alert": true
},
"notes": "Must proactively inform medical staff during all medical visits"
}
]
}
Step 4: Save Data
File path: data/allergies.json
Step 5: View Allergy Records (list)
Filter Parameters:
- No parameters: Display all allergies
active: Display only active allergies
drug: Display only drug allergies
food: Display only food allergies
severe: Display only severe and above allergies
Step 6: Update/Delete Allergy Records
Supported Fields:
severity: Severity level (mild/moderate/severe/anaphylaxis)
status: Current status (active/resolved)
notes: Notes
Execution Instructions
1. Parse operation type (add/list/update/delete)
2. [add] Parse allergy info, medical standardization, generate JSON, save
3. [list] Read allergies.json, filter and display
4. [update] Find allergen, update fields, save
5. [delete] Confirm deletion, remove record
Example Interactions
Add Allergy Record
User: Penicillin severe allergy from childhood injection caused difficulty breathing
-> Save drug allergy record, severity level 3
View All Allergies
User: View all allergies
-> Display all allergy records grouped by type
View Severe Allergies
User: View severe allergies
-> Display only level 3 and above allergy records
Update Status
User: Peanut status changed to resolved
-> Update current status to resolved
Delete Record
User: Delete penicillin allergy
-> Confirm then delete record
1---2name: allergy3description: Manage allergy records including drug, food, and environmental allergies with severity tracking and medical alert integration.4---56# Allergy History Management Skill78Record and manage allergy history, including drug allergies, food allergies, environmental allergies, etc., with quick query and update support.910## Core Flow1112```13User Input -> Parse Operation Type -> [add] Parse Allergy Info -> Medical Standardization -> Generate JSON -> Save14 -> [list] Filter and Display15 -> [update] Find and Update -> Save16 -> [delete] Confirm Deletion17```1819## Step 1: Parse User Input2021### Operation Type Recognition2223| Input Keywords | Operation |24|----------------|-----------|25| add | add |26| list | list |27| update | update |28| delete | delete |2930## Step 2: Add Allergy Record (add)3132### Allergy Information Parsing3334Extract from natural language:3536**Basic Information (Auto Extracted):**37- **Allergen Name**: Specific substance name causing allergy38- **Allergy Type**: Drug, food, environmental, other39- **Severity Level**: Mild, moderate, severe, anaphylaxis40- **Reaction Symptoms**: Specific allergic reaction manifestations4142**Detailed Information (Extract or Ask):**43- **Discovery Time**: When allergy was first discovered44- **Discovery Circumstances**: Situation and context at the time45- **Confirmation Method**: Doctor diagnosis, self-observation, test confirmed46- **Current Status**: Still allergic or resolved4748### Medical Standardization Conversion4950| Colloquial Description | Medical Term | Type |51|------------------------|-------------|------|52| Penicillin | Penicillin | Drug allergy |53| Peanut | Peanut | Food allergy |54| Pollen | Pollen | Environmental allergy |55| Iodine contrast | Iodine contrast | Drug allergy |56| Hymenoptera venom | Hymenoptera venom | Other allergy |5758### Allergy Type Classification5960- **Drug Allergies**: Antibiotics (penicillin, cephalosporin, etc.), painkillers (aspirin, etc.), contrast agents, vaccines, TCM, etc.61- **Food Allergies**: Seafood (shrimp, crab, shellfish), nuts (peanut, walnut), eggs, dairy, gluten, fruits, etc.62- **Environmental Allergies**: Pollen, dust mites, animal dander, mold, latex, etc.63- **Other Allergies**: Insect bites, chemicals, metals, etc.6465### Automatic Severity Determination6667**Keyword Mapping:**68- "Shock", "Anaphylaxis", "Unconscious", "Coma" → Level 4 (anaphylaxis)69- "Severe", "Systemic", "Unbearable", "BP drop" → Level 3 (severe)70- "Obvious", "Moderate", "Needs treatment", "Swelling" → Level 2 (moderate)71- "Mild", "Occasional", "Local" → Level 1 (mild) |7273### Reaction Symptom Recognition7475**Skin symptoms:** Rash, hives, itching, redness, erythema76**Respiratory symptoms:** Dyspnea, wheezing, laryngeal edema, chest tightness77**Digestive symptoms:** Nausea, vomiting, diarrhea, abdominal pain78**Systemic symptoms:** Shock, blood pressure drop, syncope, loss of consciousness, systemic urticaria7980## Step 3: Generate JSON8182```json83{84 "allergies": [85 {86 "id": "allergy_20251231123456789",87 "allergen": {88 "name": "Penicillin",89 "type": "drug",90 "type_category": "Drug allergy",91 "synonyms": ["Penicillin", "盘尼西林"]92 },93 "severity": {94 "level": "severe",95 "level_code": 3,96 "description": "Severe allergic reaction"97 },98 "reactions": [99 {100 "reaction": "Rash",101 "onset_time": "Within 30 minutes of exposure",102 "severity": "moderate"103 }104 ],105 "discovery": {106 "date": "2010-05-15",107 "age_at_discovery": "8 years old",108 "circumstances": "Appeared after penicillin injection during pneumonia treatment"109 },110 "confirmation": {111 "method": "doctor_confirmed",112 "method_name": "Doctor diagnosis",113 "confirmed_by": "XX Hospital Pediatrics"114 },115 "current_status": {116 "status": "active",117 "status_name": "Active"118 },119 "management": {120 "avoidance_strategy": "Strictly avoid penicillin-class medications",121 "emergency_plan": "Seek immediate medical attention if accidentally used, carry allergy information",122 "medical_alert": true123 },124 "notes": "Must proactively inform medical staff during all medical visits"125 }126 ]127}128```129130## Step 4: Save Data131132File path: `data/allergies.json`133134## Step 5: View Allergy Records (list)135136**Filter Parameters:**137- No parameters: Display all allergies138- `active`: Display only active allergies139- `drug`: Display only drug allergies140- `food`: Display only food allergies141- `severe`: Display only severe and above allergies142143## Step 6: Update/Delete Allergy Records144145**Supported Fields:**146- `severity`: Severity level (mild/moderate/severe/anaphylaxis)147- `status`: Current status (active/resolved)148- `notes`: Notes149150## Execution Instructions151152```1531. Parse operation type (add/list/update/delete)1542. [add] Parse allergy info, medical standardization, generate JSON, save1553. [list] Read allergies.json, filter and display1564. [update] Find allergen, update fields, save1575. [delete] Confirm deletion, remove record158```159160## Example Interactions161162### Add Allergy Record163```164User: Penicillin severe allergy from childhood injection caused difficulty breathing165-> Save drug allergy record, severity level 3166```167168### View All Allergies169```170User: View all allergies171-> Display all allergy records grouped by type172```173174### View Severe Allergies175```176User: View severe allergies177-> Display only level 3 and above allergy records178```179180### Update Status181```182User: Peanut status changed to resolved183-> Update current status to resolved184```185186### Delete Record187```188User: Delete penicillin allergy189-> Confirm then delete record190```