"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.referralOrderSchema = exports.icdCodesSchema = exports.resolutionSchema = exports.ResolutionStateSchema = exports.AuthorizationForShortSchema = exports.AuthorizationForSchema = void 0;
const extensions_core_1 = require("@awell-health/extensions-core");
const zod_1 = require("zod");
const specialty_zod_1 = require("./specialty.zod");
exports.AuthorizationForSchema = zod_1.z.enum([
    'Referral For Treatment, includes Consult Visit',
    'Procedure / Testing Only',
    'Consult (One Visit Only)',
]);
exports.AuthorizationForShortSchema = zod_1.z.enum([
    'ForTreat',
    'ProcOnly',
    'ConsOnly',
]);
exports.ResolutionStateSchema = zod_1.z.enum([
    'outstanding',
    'fulfilled',
    'cancelled',
]);
exports.resolutionSchema = zod_1.z.object({
    id: zod_1.z.number(),
    document: zod_1.z.number(),
    resolving_document: zod_1.z.number().nullable(),
    state: exports.ResolutionStateSchema,
    note: zod_1.z.string().nullable(),
    created_date: zod_1.z.string().datetime(), // Validates ISO datetime strings
    deleted_date: zod_1.z.string().datetime().nullable(),
});
exports.icdCodesSchema = zod_1.z.array(zod_1.z.object({
    code: zod_1.z.string(),
    description: zod_1.z.string(),
}));
// Note: id is not included in the schema as it's generated by the server
// It's only included in the response type (PostReferralOrderResponse)
exports.referralOrderSchema = zod_1.z.object({
    authorization_for: exports.AuthorizationForSchema,
    auth_number: zod_1.z.string().nullable(),
    consultant_name: zod_1.z.string(),
    short_consultant_name: zod_1.z.string().optional(),
    date_for_reEval: zod_1.z.string().datetime().nullable(),
    authorization_for_short: exports.AuthorizationForShortSchema.nullable().optional(),
    practice: extensions_core_1.NumericIdSchema,
    patient: extensions_core_1.NumericIdSchema,
    letter: extensions_core_1.NumericIdSchema,
    resolution: exports.resolutionSchema.nullable(),
    icd10_codes: exports.icdCodesSchema.optional(),
    specialty: specialty_zod_1.specialtySchema.nullable(),
});
//# sourceMappingURL=referralOrder.zod.js.map