70 lines
2.5 KiB
Markdown
70 lines
2.5 KiB
Markdown
# Medication Prompt
|
|
|
|
Extract medication tracking details.
|
|
|
|
User said: "{{INPUT}}"
|
|
Language: {{LANGUAGE}}
|
|
|
|
**If the user mentions multiple medications, create one entry for each in an `entries` array. The `input_config` for the follow-up prompt should also contain a separate checkbox field for each medication identified.**
|
|
|
|
IMPORTANT: Respond with ONLY the JSON object. No explanations, no markdown fences, no text before or after.
|
|
|
|
```json
|
|
{
|
|
"question": "tracking question in {{LANGUAGE}}",
|
|
"type": "medication_name_snake_case",
|
|
"input_type": "form",
|
|
"schedule": [{"days": [...], "time": "HH:MM"}],
|
|
"input_config": {"fields": [{"key": "med_name", "type": "checkbox", "label": "Med Name"}]},
|
|
"entries": [{"value": "...", "data": {...}}]
|
|
}
|
|
```
|
|
|
|
## Schedule format
|
|
- `days`: array of "mon", "tue", "wed", "thu", "fri", "sat", "sun"
|
|
- `time`: 24h format "08:00", "12:00", "18:00" etc.
|
|
- Daily = all 7 days
|
|
- "once" or one-time event = null (no schedule, no recurring prompt)
|
|
|
|
## Rules
|
|
- `entry.data` must be a JSON OBJECT, not a string.
|
|
- If multiple medications are mentioned, create a separate entry for each in the `entries` array.
|
|
- The `input_config.fields` should contain a checkbox for each medication found. The `key` should be the snake_case name of the medication, and the `label` should be the proper name.
|
|
- If only one medication is mentioned, use the `entries` array with a single element and a single checkbox in `input_config`.
|
|
|
|
## Examples
|
|
|
|
Input: "took ibuprofen 400mg"
|
|
```json
|
|
{
|
|
"question": "Did you take your ibuprofen?",
|
|
"type": "ibuprofen",
|
|
"input_type": "form",
|
|
"schedule": [{"days": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], "time": "08:00"}],
|
|
"input_config": {"fields": [
|
|
{"key": "ibuprofen", "type": "checkbox", "label": "Ibuprofen"}
|
|
]},
|
|
"entries": [{"value": "Ibuprofen 400mg", "data": {"medication": "ibuprofen", "dose": 400, "unit": "mg"}}]
|
|
}
|
|
```
|
|
|
|
Input: "I took my morning pills: 10mg of Lisinopril and a multivitamin."
|
|
```json
|
|
{
|
|
"question": "Did you take your morning pills?",
|
|
"type": "morning_pills",
|
|
"input_type": "form",
|
|
"schedule": [{"days": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], "time": "08:00"}],
|
|
"input_config": {
|
|
"fields": [
|
|
{"key": "lisinopril", "type": "checkbox", "label": "Lisinopril"},
|
|
{"key": "multivitamin", "type": "checkbox", "label": "Multivitamin"}
|
|
]
|
|
},
|
|
"entries": [
|
|
{"value": "10mg Lisinopril", "data": {"medication": "lisinopril", "dose": 10, "unit": "mg"}},
|
|
{"value": "Multivitamin", "data": {"medication": "multivitamin"}}
|
|
]
|
|
}
|
|
```
|