jevrecipes

Recipe catalog / care-urgency-wording

Grade the urgency a patient's wording asks for

care-urgency-wording is a Jev recipe from the jev-recipes TypeScript package. How urgent is the care that message asks for, from routine to emergency, judged on what the patient's wording says rather than on medical assessment? Use it when you need to sort patient messages into scheduling or response-time queues by the timeline the patient asks for, before or alongside clinical triage handled by protocol.

Last updated .

Explore this recipe interactively · Source and implementation guide · Markdown version

How do I use care-urgency-wording 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 { careUrgencyWording } from 'jev-recipes/care-urgency-wording';

const result = await careUrgencyWording({
  "message": "My daughter has had a fever of 101 since last night and now she says her ear really hurts. She is drinking fine and otherwise seems okay. Can someone see her today or tomorrow? I do not think it is an emergency, but I would rather not wait until next week.",
  "minConfidence": 0.8
});
console.log(result);

What input does care-urgency-wording take?

FieldTypeNeeded
messagestringRequired
minConfidencenumberOptional
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"
        ]
      },
      "score": {
        "type": "number",
        "minimum": 0
      },
      "level": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991
      },
      "confidence": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      },
      "probabilities": {
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        }
      },
      "urgency": {
        "type": "string",
        "enum": [
          "routine",
          "soon",
          "prompt",
          "urgent",
          "emergency"
        ]
      }
    },
    "required": [
      "model",
      "usage",
      "status",
      "score",
      "level",
      "confidence",
      "probabilities",
      "urgency"
    ],
    "additionalProperties": false
  }
}

What does a care-urgency-wording 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 care-urgency-wording.

{
  "model": "demo-fixture",
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0
  },
  "status": "ready",
  "score": 2.02,
  "level": 2,
  "confidence": 0.82,
  "probabilities": {
    "0": 0.02,
    "1": 0.06,
    "2": 0.82,
    "3": 0.08,
    "4": 0.02
  },
  "urgency": "prompt"
}

Input

See shared options and behavior for client configuration, validation, and errors. Types are inferred from this folder's Zod 4 schemas.

Result

urgency is one of routine, soon, prompt, urgent, emergency, taken from the most likely rubric level. level is that level's index from 0 to 4. score is Jev's expected value across the rubric and can fall between levels; use it for ranking or thresholds where a single label loses information.

A result is ready when confidence meets minConfidence. Otherwise it is review and still carries the graded values for inspection. probabilities is keyed by level index.

Reuse and calls

Uses the shared score helper. This folder owns the question, the rubric wording, and the review policy. A live invocation makes one logical Jev request.

Limits

This is a reading of wording, not triage. A patient who describes chest pain in calm language and asks for "an appointment sometime" grades as routine, and a patient asking to be seen today for a mild rash grades as urgent. Do not use the level to decide medical priority; enforce emergency routing in code by protocol, such as keyword rules or a nurse review queue, before or regardless of this score. Use the level for scheduling queues, response-time expectations, and drafting replies that match the timeline the patient asked for.

Example input

demo.json contains editable input and a hand-authored response. After installing jev-recipes, npx jev-recipes demo care-urgency-wording shows an offline illustration, not an accuracy measurement. Use npx jev-recipes describe care-urgency-wording to inspect the input and result schemas.

How accurate is care-urgency-wording?

Fixture only

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 care-urgency-wording?