jevrecipes

Recipe catalog / appointment-request-kind

Classify a patient's appointment request

appointment-request-kind is a Jev recipe from the jev-recipes TypeScript package. What does the patient primarily want from message: to schedule, reschedule, or cancel an appointment, get results, get a refill, or ask a question? Use it when you need to route incoming patient portal messages or voicemail transcripts to the scheduling, results, or pharmacy queue by the main thing the patient asks for.

Last updated .

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

How do I use appointment-request-kind 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 { appointmentRequestKind } from 'jev-recipes/appointment-request-kind';

const result = await appointmentRequestKind({
  "message": "Hi, I am scheduled with Dr. Nguyen on Thursday at 2pm but my work shift changed. Is there anything available Friday morning instead?",
  "minConfidence": 0.8
});
console.log(result);

What input does appointment-request-kind 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"
        ]
      },
      "verdict": {
        "type": "string",
        "enum": [
          "schedule",
          "reschedule",
          "cancel",
          "results",
          "refill",
          "question",
          "unclear"
        ]
      },
      "confidence": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      },
      "probabilities": {
        "type": "object",
        "propertyNames": {
          "type": "string",
          "enum": [
            "schedule",
            "reschedule",
            "cancel",
            "results",
            "refill",
            "question",
            "unclear"
          ]
        },
        "additionalProperties": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "required": [
          "schedule",
          "reschedule",
          "cancel",
          "results",
          "refill",
          "question",
          "unclear"
        ]
      }
    },
    "required": [
      "model",
      "usage",
      "status",
      "verdict",
      "confidence",
      "probabilities"
    ],
    "additionalProperties": false
  }
}

What does a appointment-request-kind 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 appointment-request-kind.

{
  "model": "demo-fixture",
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0
  },
  "status": "ready",
  "verdict": "reschedule",
  "confidence": 0.9,
  "probabilities": {
    "schedule": 0.05,
    "reschedule": 0.9,
    "cancel": 0.02,
    "results": 0.01,
    "refill": 0,
    "question": 0.01,
    "unclear": 0.01
  }
}

Input

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

Result

verdict is one of schedule, reschedule, cancel, results, refill, question, unclear. unclear means the supplied facts do not establish a decision and always requires review.

A result is ready when confidence meets minConfidence and the verdict is not unclear. Inspect the verdict as well as the status: a ready result can name an outcome your application treats as negative. probabilities covers every verdict.

Reuse and calls

Uses the shared choice helper for the Jev call and response parsing. This folder owns its question, verdict criteria, and review policy. A live invocation makes one logical Jev request.

Limits

The verdict is the patient's primary stated request, so a message that asks for two things of equal weight returns unclear rather than both. It does not confirm that the appointment, prescription, or test the patient refers to exists, is theirs, or is eligible for the action; look those up in your scheduling and pharmacy records. Reschedule versus cancel depends on wording, and the recipe follows the words: a patient who cancels and separately asks to book later is judged on which request dominates.

Example input

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

How accurate is appointment-request-kind?

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 appointment-request-kind?