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.4argument-hint: <operation_type(add/list/update/delete) allergy_information_natural_language_description>5allowed-tools: Read, Write6schema: allergy/schema.json7---89# Allergy History Management Skill1011Record and manage allergy history, including drug allergies, food allergies, environmental allergies, etc., with quick query and update support.1213## Core Flow1415```16User Input -> Parse Operation Type -> [add] Parse Allergy Info -> Medical Standardization -> Generate JSON -> Save17 -> [list] Filter and Display18 -> [update] Find and Update -> Save19 -> [delete] Confirm Deletion20```2122## Step 1: Parse User Input2324### Operation Type Recognition2526| Input Keywords | Operation |27|----------------|-----------|28| add | add |29| list | list |30| update | update |31| delete | delete |3233## Step 2: Add Allergy Record (add)3435### Allergy Information Parsing3637Extract from natural language:3839**Basic Information (Auto Extracted):**40- **Allergen Name**: Specific substance name causing allergy41- **Allergy Type**: Drug, food, environmental, other42- **Severity Level**: Mild, moderate, severe, anaphylaxis43- **Reaction Symptoms**: Specific allergic reaction manifestations4445**Detailed Information (Extract or Ask):**46- **Discovery Time**: When allergy was first discovered47- **Discovery Circumstances**: Situation and context at the time48- **Confirmation Method**: Doctor diagnosis, self-observation, test confirmed49- **Current Status**: Still allergic or resolved5051### Medical Standardization Conversion5253| Colloquial Description | Medical Term | Type |54|------------------------|-------------|------|55| Penicillin | Penicillin | Drug allergy |56| Peanut | Peanut | Food allergy |57| Pollen | Pollen | Environmental allergy |58| Iodine contrast | Iodine contrast | Drug allergy |59| Hymenoptera venom | Hymenoptera venom | Other allergy |6061### Allergy Type Classification6263- **Drug Allergies**: Antibiotics (penicillin, cephalosporin, etc.), painkillers (aspirin, etc.), contrast agents, vaccines, TCM, etc.64- **Food Allergies**: Seafood (shrimp, crab, shellfish), nuts (peanut, walnut), eggs, dairy, gluten, fruits, etc.65- **Environmental Allergies**: Pollen, dust mites, animal dander, mold, latex, etc.66- **Other Allergies**: Insect bites, chemicals, metals, etc.6768### Automatic Severity Determination6970**Keyword Mapping:**71- "Shock", "Anaphylaxis", "Unconscious", "Coma" → Level 4 (anaphylaxis)72- "Severe", "Systemic", "Unbearable", "BP drop" → Level 3 (severe)73- "Obvious", "Moderate", "Needs treatment", "Swelling" → Level 2 (moderate)74- "Mild", "Occasional", "Local" → Level 1 (mild) |7576### Reaction Symptom Recognition7778**Skin symptoms:** Rash, hives, itching, redness, erythema79**Respiratory symptoms:** Dyspnea, wheezing, laryngeal edema, chest tightness80**Digestive symptoms:** Nausea, vomiting, diarrhea, abdominal pain81**Systemic symptoms:** Shock, blood pressure drop, syncope, loss of consciousness, systemic urticaria8283## Step 3: Generate JSON8485```json86{87 "allergies": [88 {89 "id": "allergy_20251231123456789",90 "allergen": {91 "name": "Penicillin",92 "type": "drug",93 "type_category": "Drug allergy",94 "synonyms": ["Penicillin", "盘尼西林"]95 },96 "severity": {97 "level": "severe",98 "level_code": 3,99 "description": "Severe allergic reaction"100 },101 "reactions": [102 {103 "reaction": "Rash",104 "onset_time": "Within 30 minutes of exposure",105 "severity": "moderate"106 }107 ],108 "discovery": {109 "date": "2010-05-15",110 "age_at_discovery": "8 years old",111 "circumstances": "Appeared after penicillin injection during pneumonia treatment"112 },113 "confirmation": {114 "method": "doctor_confirmed",115 "method_name": "Doctor diagnosis",116 "confirmed_by": "XX Hospital Pediatrics"117 },118 "current_status": {119 "status": "active",120 "status_name": "Active"121 },122 "management": {123 "avoidance_strategy": "Strictly avoid penicillin-class medications",124 "emergency_plan": "Seek immediate medical attention if accidentally used, carry allergy information",125 "medical_alert": true126 },127 "notes": "Must proactively inform medical staff during all medical visits"128 }129 ]130}131```132133## Step 4: Save Data134135File path: `data/allergies.json`136137## Step 5: View Allergy Records (list)138139**Filter Parameters:**140- No parameters: Display all allergies141- `active`: Display only active allergies142- `drug`: Display only drug allergies143- `food`: Display only food allergies144- `severe`: Display only severe and above allergies145146## Step 6: Update/Delete Allergy Records147148**Supported Fields:**149- `severity`: Severity level (mild/moderate/severe/anaphylaxis)150- `status`: Current status (active/resolved)151- `notes`: Notes152153## Execution Instructions154155```1561. Parse operation type (add/list/update/delete)1572. [add] Parse allergy info, medical standardization, generate JSON, save1583. [list] Read allergies.json, filter and display1594. [update] Find allergen, update fields, save1605. [delete] Confirm deletion, remove record161```162163## Example Interactions164165### Add Allergy Record166```167User: Penicillin severe allergy from childhood injection caused difficulty breathing168-> Save drug allergy record, severity level 3169```170171### View All Allergies172```173User: View all allergies174-> Display all allergy records grouped by type175```176177### View Severe Allergies178```179User: View severe allergies180-> Display only level 3 and above allergy records181```182183### Update Status184```185User: Peanut status changed to resolved186-> Update current status to resolved187```188189### Delete Record190```191User: Delete penicillin allergy192-> Confirm then delete record193```