Recipe catalog / symptom-facets
Label the symptom facets a patient message states
symptom-facets is a Jev recipe from the jev-recipes TypeScript package. Which of these does message state about a symptom: when it began, how bad it is, how long it has lasted, what makes it better or worse, what the patient has already tried? Use it when you need to know which standard intake details a patient message already supplies so you can pre-fill a form or ask only for what is missing.
Last updated .
Explore this recipe interactively · Source and implementation guide · Markdown version
How do I use symptom-facets in TypeScript?
Install with npm install jev-recipes. Requires Node.js 22.9 or newer and ES modules. Set TYPESAFE_API_KEY in your server environment for live calls, which send input to TypeSafe and use API quota. See the installation guide.
import { symptomFacets } from 'jev-recipes/symptom-facets';
const result = await symptomFacets({
"message": "My lower back started hurting on Saturday after I moved some boxes, so it has been about five days now. Sitting sets it off and walking around settles it down. I have been taking ibuprofen twice a day and using a heating pad at night. Should I come in?",
"minConfidence": 0.8
});
console.log(result);
What input does symptom-facets take?
| Field | Type | Needed |
|---|---|---|
| message | string | Required |
| minConfidence | number | Optional |
Full input and result schemas
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"message": {
"type": "string"
},
"minConfidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"message"
]
},
"result": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"model": {
"type": "string"
},
"usage": {
"type": "object",
"properties": {
"input_tokens": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"output_tokens": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"input_tokens",
"output_tokens"
],
"additionalProperties": false
},
"status": {
"type": "string",
"enum": [
"ready",
"review"
]
},
"detected": {
"type": "array",
"items": {
"type": "string",
"enum": [
"statesOnset",
"statesSeverity",
"statesDuration",
"statesModifiers",
"statesPriorTreatment"
]
}
},
"labels": {
"type": "object",
"properties": {
"statesOnset": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"ready",
"review"
]
},
"verdict": {
"type": "string",
"enum": [
"present",
"absent"
]
},
"probability": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"status",
"verdict",
"probability",
"confidence"
],
"additionalProperties": false
},
"statesSeverity": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"ready",
"review"
]
},
"verdict": {
"type": "string",
"enum": [
"present",
"absent"
]
},
"probability": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"status",
"verdict",
"probability",
"confidence"
],
"additionalProperties": false
},
"statesDuration": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"ready",
"review"
]
},
"verdict": {
"type": "string",
"enum": [
"present",
"absent"
]
},
"probability": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"status",
"verdict",
"probability",
"confidence"
],
"additionalProperties": false
},
"statesModifiers": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"ready",
"review"
]
},
"verdict": {
"type": "string",
"enum": [
"present",
"absent"
]
},
"probability": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"status",
"verdict",
"probability",
"confidence"
],
"additionalProperties": false
},
"statesPriorTreatment": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"ready",
"review"
]
},
"verdict": {
"type": "string",
"enum": [
"present",
"absent"
]
},
"probability": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"status",
"verdict",
"probability",
"confidence"
],
"additionalProperties": false
}
},
"required": [
"statesOnset",
"statesSeverity",
"statesDuration",
"statesModifiers",
"statesPriorTreatment"
],
"additionalProperties": false
}
},
"required": [
"model",
"usage",
"status",
"detected",
"labels"
],
"additionalProperties": false
}
}What does a symptom-facets result look like?
This hand-authored response demonstrates the contract. It is not a model accuracy measurement. Run it without an API key: npx jev-recipes demo symptom-facets.
{
"model": "demo-fixture",
"usage": {
"input_tokens": 0,
"output_tokens": 0
},
"status": "ready",
"detected": [
"statesOnset",
"statesDuration",
"statesModifiers",
"statesPriorTreatment"
],
"labels": {
"statesOnset": {
"status": "ready",
"verdict": "present",
"probability": 0.95,
"confidence": 0.95
},
"statesSeverity": {
"status": "ready",
"verdict": "absent",
"probability": 0.12,
"confidence": 0.88
},
"statesDuration": {
"status": "ready",
"verdict": "present",
"probability": 0.93,
"confidence": 0.93
},
"statesModifiers": {
"status": "ready",
"verdict": "present",
"probability": 0.94,
"confidence": 0.94
},
"statesPriorTreatment": {
"status": "ready",
"verdict": "present",
"probability": 0.96,
"confidence": 0.96
}
}
}
Input
See shared options and behavior for client configuration, validation, and errors. Types are inferred from this folder's Zod 4 schemas.
Result
labels holds one check per label: statesOnset, statesSeverity, statesDuration, statesModifiers, statesPriorTreatment. Each check has a verdict of present or absent, the yes probability, confidence for the chosen side, and its own status. detected lists the present labels in declaration order.
The overall status is review when any single label falls below minConfidence. Labels that are individually ready remain usable in that case.
Reuse and calls
Uses the shared labels helper, which places one yes/no question per label in a single Jev request. This folder owns the questions and their outcome descriptions. A live invocation makes one logical Jev request.
Limits
Each facet reports only that the patient's wording states it; a message that says "since Tuesday" counts as stating onset whether or not that date is plausible. The recipe makes no clinical judgment: it does not assess what the symptoms suggest, whether the stated severity is concerning, or whether the prior treatment was appropriate. Parse the actual dates, durations, and doses in application code, and route any clinical decision through your clinical protocol. To decide whether to ask the patient about a missing facet, use clarify.
Example input
demo.json contains editable input and a hand-authored response. After installing jev-recipes, npx jev-recipes demo symptom-facets shows an offline illustration, not an accuracy measurement. Use npx jev-recipes describe symptom-facets to inspect the input and result schemas.
How accurate is symptom-facets?
No verified live accuracy measurement is available. Evaluate representative cases before using this decision in your workflow.
Use the evaluation guide to measure this decision on your own labeled cases.
What are the limits of symptom-facets?
- Reports intake completeness only: whether the wording states each facet, not whether the details are accurate or clinically meaningful. It makes no diagnosis or triage judgment.
- Labels are independent, so a message can state several facets or none. Parse actual dates, durations, and doses in code.
Which recipes are related to symptom-facets?
- message-facets: Use message-facets for the general communicative facets of a message, such as questions, deadlines, and requests.
- clarify: Use clarify to decide whether to ask the patient a follow-up question about the facets this recipe finds missing.