"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.nonVisitNoteSchema = exports.bulletSchema = exports.bulletCategoryEnum = void 0;
const z = __importStar(require("zod"));
const extensions_core_1 = require("@awell-health/extensions-core");
const lodash_1 = require("lodash");
const nonVisitNoteTypeEnum = z.enum(['email', 'nonvisit', 'phone']);
// All values taken from Elation's API
exports.bulletCategoryEnum = z.enum([
    'Problem',
    'Past',
    'Family',
    'Social',
    'Instr',
    'PE',
    'ROS',
    'Med',
    'Data',
    'Assessment',
    'Test',
    'Tx',
    'Narrative',
    'Followup',
    'Reason',
    'Plan',
    'Objective',
    'Hpi',
    'Allergies',
    'Habits',
    'Assessplan',
    'Consultant',
    'Attending',
    'Dateprocedure',
    'Surgical',
    'Orders',
    'Referenced',
    'Procedure',
]);
exports.bulletSchema = z.object({
    id: extensions_core_1.NumericIdSchema.optional(),
    text: z.string().min(1),
    author: extensions_core_1.NumericIdSchema,
    /**
     * Hotfix, see https://awellhealth.slack.com/archives/C074XR57N0G/p1736802124866829
     * TODO: Remove this once we have a proper solution for the category field
     */
    // category: bulletCategoryEnum.default(bulletCategoryEnum.enum.Problem),
    category: z
        .string()
        .transform((v) => ((0, lodash_1.isNil)(v) || (0, lodash_1.isEmpty)(v) ? undefined : v))
        .optional(),
});
exports.nonVisitNoteSchema = z.object({
    type: nonVisitNoteTypeEnum.default(nonVisitNoteTypeEnum.enum.nonvisit),
    bullets: z.array(exports.bulletSchema),
    patient: extensions_core_1.NumericIdSchema,
    practice: extensions_core_1.NumericIdSchema.optional(),
    document_date: extensions_core_1.DateTimeSchema,
    chart_date: extensions_core_1.DateTimeSchema,
    tags: (0, extensions_core_1.validateCommaSeparatedList)((value) => extensions_core_1.NumericIdSchema.safeParse(value).success, true).optional(),
    signed_by: extensions_core_1.NumericIdSchema.optional(),
    sign_date: extensions_core_1.DateTimeSchema.optional(),
});
//# sourceMappingURL=nonVisitNote.zod.js.map