Logo
Search
API Docs

Healthcare Appointment Booking: Structured Output Template

Structured Data & Outputs

Healthcare Appointment Booking: Structured Output Template

Overview

This is a production-ready structured-output schema for medical scheduling calls — patient identification, insurance details, and appointment preferences including type, department, timing, symptoms, and urgency. Attach it to an assistant the same way described in Structured Outputs (Post-Call Data Extraction). It's the full schema behind the one-line mention on Prebuilt Templates & Example Use Cases, joining Real Estate Lead Qualification: Structured Output Template and the E-commerce Order Processing template as the third schema in that set.


Full JSON Schema

{
  "name": "Healthcare Appointment",
  "type": "ai",
  "description": "Extract patient and appointment information for medical scheduling",
  "schema": {
    "type": "object",
    "properties": {
      "patient": {
        "type": "object",
        "properties": {
          "firstName": { "type": "string", "description": "Patient's first name" },
          "lastName": { "type": "string", "description": "Patient's last name" },
          "dateOfBirth": { "type": "string", "format": "date", "description": "Patient's date of birth (YYYY-MM-DD)" },
          "phoneNumber": { "type": "string", "pattern": "^\\+?[1-9]\\d{1,14}$", "description": "Patient's contact number" },
          "insuranceProvider": { "type": "string", "description": "Insurance provider name" },
          "memberID": { "type": "string", "description": "Insurance member ID" }
        },
        "required": ["firstName", "lastName", "phoneNumber"]
      },
      "appointment": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["new-patient", "follow-up", "annual-checkup", "urgent-care", "specialist"],
            "description": "Type of appointment"
          },
          "department": {
            "type": "string",
            "enum": ["general", "cardiology", "dermatology", "orthopedics", "pediatrics", "obgyn"],
            "description": "Medical department"
          },
          "preferredDates": {
            "type": "array",
            "items": { "type": "string", "format": "date" },
            "maxItems": 3,
            "description": "Up to 3 preferred appointment dates"
          },
          "preferredTimeSlot": {
            "type": "string",
            "enum": ["morning", "afternoon", "evening", "any"],
            "description": "Preferred time of day"
          },
          "symptoms": {
            "type": "array",
            "items": { "type": "string" },
            "description": "List of symptoms or reasons for visit"
          },
          "urgency": {
            "type": "string",
            "enum": ["routine", "soon", "urgent"],
            "description": "How urgent is the appointment"
          }
        },
        "required": ["type", "department", "urgency"]
      },
      "additionalNotes": {
        "type": "string",
        "description": "Any additional notes or special requirements"
      }
    },
    "required": ["patient", "appointment"]
  }
}

Worked Example Output

Here is what a populated output looks like after a call:

{
  "patient": {
    "firstName": "Sarah",
    "lastName": "Johnson",
    "dateOfBirth": "1985-03-15",
    "phoneNumber": "+14155551234",
    "insuranceProvider": "Blue Cross Blue Shield",
    "memberID": "BCB123456789"
  },
  "appointment": {
    "type": "follow-up",
    "department": "cardiology",
    "preferredDates": ["2026-08-15", "2026-08-16", "2026-08-17"],
    "preferredTimeSlot": "morning",
    "symptoms": ["chest pain", "shortness of breath"],
    "urgency": "urgent"
  },
  "additionalNotes": "Patient prefers female doctor if available"
}

Required Fields by Level

SectionRequired FieldsPurpose
Top levelpatient, appointmentEvery extraction must include both sections.
patientfirstName, lastName, phoneNumberMinimum viable patient identification and contact info.
appointmenttype, department, urgencyWhat kind of appointment, where, and how soon it needs to happen.
(top level) additionalNotes(none required)Free-text field for anything that doesn't fit a structured field.

Insurance fields (insuranceProvider, memberID), dateOfBirth, preferredDates, preferredTimeSlot, and symptoms are all optional — useful when available, but not required for a valid extraction.