95 lines
2.5 KiB
Markdown
95 lines
2.5 KiB
Markdown
# History Prompt
|
|
|
|
Extract details from a past medical event (user's own history, not documented).
|
|
|
|
User said: "{{INPUT}}"
|
|
Language: {{LANGUAGE}}
|
|
|
|
IMPORTANT: Respond with ONLY the JSON object. No explanations, no markdown fences, no text before or after.
|
|
|
|
```json
|
|
{
|
|
"question": "friendly confirmation question in {{LANGUAGE}}",
|
|
"type": "snake_case_identifier",
|
|
"input_type": "form",
|
|
"schedule": null,
|
|
"input_config": {"fields": [...]},
|
|
"entry": {"value": "human readable", "data": {...}}
|
|
}
|
|
```
|
|
|
|
## Schedule
|
|
|
|
Always `null` for history — these are one-time records, not recurring prompts.
|
|
|
|
## Type mapping
|
|
|
|
| Input pattern | type |
|
|
|---------------|------|
|
|
| appendix, appendectomy | appendectomy |
|
|
| tonsils, tonsillectomy | tonsillectomy |
|
|
| broke, fracture, broken | fracture |
|
|
| chickenpox, measles, mumps | childhood_illness |
|
|
| surgery (general) | past_surgery |
|
|
| allergy | allergy |
|
|
| injury | past_injury |
|
|
|
|
## Entry data structure
|
|
|
|
```json
|
|
{
|
|
"condition": "appendectomy",
|
|
"age": 12,
|
|
"year": 2005,
|
|
"body_part": "left arm",
|
|
"severity": "normal",
|
|
"complications": "none",
|
|
"notes": "..."
|
|
}
|
|
```
|
|
|
|
Include only fields that can be inferred from input.
|
|
|
|
## Rules
|
|
|
|
- entry.data must be a JSON OBJECT, not a string
|
|
- schedule is always null (no recurring prompt)
|
|
|
|
## Examples
|
|
|
|
Input: "I had my appendix removed when I was 12"
|
|
```json
|
|
{
|
|
"question": "Appendectomy recorded. Any complications?",
|
|
"type": "appendectomy",
|
|
"input_type": "form",
|
|
"schedule": null,
|
|
"input_config": {"fields": [{"key": "complications", "type": "text", "label": "Complications"}]},
|
|
"entry": {"value": "Appendectomy at age 12", "data": {"condition": "appendectomy", "age": 12}}
|
|
}
|
|
```
|
|
|
|
Input: "Broke my left arm in 2015"
|
|
```json
|
|
{
|
|
"question": "Left arm fracture recorded. How did it heal?",
|
|
"type": "fracture",
|
|
"input_type": "form",
|
|
"schedule": null,
|
|
"input_config": {"fields": [{"key": "healing", "type": "select", "label": "Healing outcome", "options": ["Full recovery", "Some limitations", "Ongoing issues"]}]},
|
|
"entry": {"value": "Left arm fracture, 2015", "data": {"condition": "fracture", "body_part": "left arm", "year": 2015}}
|
|
}
|
|
```
|
|
|
|
Input: "had chickenpox as a child"
|
|
```json
|
|
{
|
|
"question": "Chickenpox recorded. Any complications?",
|
|
"type": "childhood_illness",
|
|
"input_type": "form",
|
|
"schedule": null,
|
|
"input_config": {"fields": [{"key": "complications", "type": "text", "label": "Complications (if any)"}]},
|
|
"entry": {"value": "Chickenpox in childhood", "data": {"condition": "chickenpox", "age_period": "childhood"}}
|
|
}
|
|
```
|