"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parser = exports.PatientInfoSchema = void 0;
const output_parsers_1 = require("langchain/output_parsers");
const zod_1 = require("zod");
/**
 * Zod schema for the extracted patient information
 */
exports.PatientInfoSchema = zod_1.z.object({
    patient_first_name: zod_1.z
        .string()
        .nullable()
        .describe("Patient's first/given name"),
    patient_last_name: zod_1.z
        .string()
        .nullable()
        .describe("Patient's last/family name"),
    patient_full_name: zod_1.z
        .string()
        .nullable()
        .describe('Full name as written in document'),
    patient_dob: zod_1.z
        .string()
        .nullable()
        .describe('Date of birth in YYYY-MM-DD format'),
    patient_phone: zod_1.z
        .string()
        .nullable()
        .describe("Patient's phone number in E.164 format (e.g. +14155551234)"),
    patient_state: zod_1.z
        .string()
        .nullable()
        .describe("Patient's state of residence (2-letter US state code e.g. CA, NY, TX)"),
    insurance_name: zod_1.z
        .string()
        .nullable()
        .describe('Insurance company or plan name'),
    insurance_policy_number: zod_1.z
        .string()
        .nullable()
        .describe('Policy/Member ID number'),
    insurance_group_number: zod_1.z
        .string()
        .nullable()
        .describe('Group number if present'),
    insurance_policy_holder: zod_1.z.string().nullable().describe('Policy holder name'),
    referring_physician_name: zod_1.z
        .string()
        .nullable()
        .describe('Name of referring physician/provider'),
    confidence_level: zod_1.z
        .number()
        .min(0)
        .max(100)
        .describe('Confidence level of the extraction (0-100)'),
    extraction_notes: zod_1.z
        .string()
        .describe('Brief notes about the extraction process'),
});
/**
 * Structured Output Parser for patient information extraction
 */
exports.parser = output_parsers_1.StructuredOutputParser.fromZodSchema(exports.PatientInfoSchema);
//# sourceMappingURL=parser.js.map