Files
DentalManagement09/packages/db/usedSchemas/browser.js
T
GiteadandClaude Opus 5.5 44a1a41efa feat: Preauth column for AI claims; searchable policy holder + ADA box 18; 2PA fix
- Schedule: last column is the Preauth column; "Claim for Column with AI" is now
  "Claim/Preauth for Column with AI" — that column's appointments go to PreAuth
  (MH, CCA, Tufts SCO, United/DentalHub; other insurances are skipped), the rest
  to Claim. Preauthorized appointments (hasPreauth) aren't resubmitted
- PreAuth payloads carry appointmentId; appointment X-rays/attachments are sent
  with MH/CCA/UnitedDH/Tufts preauths (shared appendAppointmentFiles helper)
- Patient form: policy holder is searchable from patients in the DB, plus
  "Relationship to Policy Holder/Subscriber" (Self, Spouse, Dependent Child,
  Other). New Patient columns policyHolderPatientId, policyHolderRelationship;
  browser-side schema updated so the fields aren't stripped on save
- ADA form: box 12-14 filled from the linked policy holder's record; box 18
  ticks the relationship (Self when the patient is the holder)
- AI notes: a bare "2PA" is an image count, not tooth #2 — restored before CDT
  lookup so it maps to D0220 #8 / D0230 #24

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 21:09:51 -04:00

274 lines
11 KiB
JavaScript

"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.ShoppingVendorUncheckedCreateInputObjectSchema = exports.CommunicationUncheckedCreateInputObjectSchema = exports.CloudFileUncheckedCreateInputObjectSchema = exports.CloudFolderUncheckedCreateInputObjectSchema = exports.BackupDestinationUncheckedCreateInputObjectSchema = exports.DatabaseBackupUncheckedCreateInputObjectSchema = exports.NotificationUncheckedCreateInputObjectSchema = exports.ServiceLineTransactionCreateInputObjectSchema = exports.PaymentUncheckedCreateInputObjectSchema = exports.PdfGroupUncheckedCreateInputObjectSchema = exports.PdfFileUncheckedCreateInputObjectSchema = exports.InsuranceCredentialUncheckedCreateInputObjectSchema = exports.ClaimUncheckedCreateInputObjectSchema = exports.NpiProviderUncheckedCreateInputObjectSchema = exports.AppointmentProcedureUncheckedCreateInputObjectSchema = exports.AppointmentUncheckedCreateInputObjectSchema = exports.StaffUncheckedCreateInputObjectSchema = exports.PatientUncheckedCreateInputObjectSchema = exports.UserUncheckedCreateInputObjectSchema = exports.CommunicationStatusSchema = exports.CommunicationDirectionSchema = exports.CommunicationChannelSchema = exports.PdfTitleKeySchema = exports.ProcedureSourceSchema = exports.NotificationTypesSchema = exports.PaymentStatusSchema = exports.PaymentMethodSchema = exports.ClaimStatusSchema = exports.PatientStatusSchema = void 0;
const z = __importStar(require("zod"));
// ─── Enums ────────────────────────────────────────────────────────────────────
exports.PatientStatusSchema = z.enum(["ACTIVE", "INACTIVE", "UNKNOWN", "PLAN_NOT_ACCEPTED"]);
exports.ClaimStatusSchema = z.enum([
"PENDING",
"APPROVED",
"CANCELLED",
"REVIEW",
"VOID",
]);
exports.PaymentMethodSchema = z.enum([
"EFT",
"CHECK",
"CASH",
"CARD",
"OTHER",
]);
exports.PaymentStatusSchema = z.enum([
"PENDING",
"PARTIALLY_PAID",
"PAID",
"OVERPAID",
"DENIED",
"VOID",
]);
exports.NotificationTypesSchema = z.enum([
"BACKUP",
"CLAIM",
"PAYMENT",
"ETC",
]);
exports.ProcedureSourceSchema = z.enum(["COMBO", "MANUAL"]);
exports.PdfTitleKeySchema = z.enum([
"INSURANCE_CLAIM",
"INSURANCE_CLAIM_PREAUTH",
"ELIGIBILITY_STATUS",
"CLAIM_STATUS",
"OTHER",
]);
exports.CommunicationChannelSchema = z.enum(["sms", "voice"]);
exports.CommunicationDirectionSchema = z.enum(["outbound", "inbound"]);
exports.CommunicationStatusSchema = z.enum([
"queued",
"sent",
"delivered",
"failed",
"completed",
"busy",
"no_answer",
]);
// ─── Object Schemas ───────────────────────────────────────────────────────────
exports.UserUncheckedCreateInputObjectSchema = z.object({
id: z.number().int().optional(),
username: z.string(),
password: z.string(),
});
exports.PatientUncheckedCreateInputObjectSchema = z.object({
id: z.number().int().optional(),
firstName: z.string(),
lastName: z.string(),
dateOfBirth: z.string(),
gender: z.string().optional().nullable(),
phone: z.string().optional().nullable(),
email: z.string().optional().nullable(),
address: z.string().optional().nullable(),
city: z.string().optional().nullable(),
state: z.string().optional().nullable(),
zipCode: z.string().optional().nullable(),
insuranceProvider: z.string().optional().nullable(),
insuranceId: z.string().optional().nullable(),
groupNumber: z.string().optional().nullable(),
policyHolder: z.string().optional().nullable(),
policyHolderPatientId: z.number().int().optional().nullable(),
policyHolderRelationship: z.string().optional().nullable(),
allergies: z.string().optional().nullable(),
medicalConditions: z.string().optional().nullable(),
preferredLanguage: z.string().optional().nullable(),
status: exports.PatientStatusSchema.optional(),
userId: z.number().int().optional(),
createdAt: z.coerce.date().optional(),
});
exports.StaffUncheckedCreateInputObjectSchema = z.object({
id: z.number().int().optional(),
firstName: z.string(),
lastName: z.string(),
role: z.string(),
phone: z.string().optional(),
email: z.string().optional(),
userId: z.number().int().optional(),
});
exports.AppointmentUncheckedCreateInputObjectSchema = z.object({
id: z.number().int().optional(),
patientId: z.number().int(),
userId: z.number().int().optional(),
staffId: z.number().int().optional(),
npiProviderId: z.number().int().optional().nullable(),
title: z.string().optional(),
date: z.coerce.date(),
startTime: z.string(),
endTime: z.string(),
type: z.string(),
status: z
.enum(["scheduled", "confirmed", "completed", "cancelled", "no-show"])
.optional(),
notes: z.string().optional(),
});
exports.AppointmentProcedureUncheckedCreateInputObjectSchema = z.object({
id: z.number().int().optional(),
appointmentId: z.number().int(),
patientId: z.number().int(),
procedureCode: z.string(),
procedureLabel: z.string().optional().nullable(),
fee: z.number().optional().nullable(),
category: z.string().optional().nullable(),
toothNumber: z.string().optional().nullable(),
toothSurface: z.string().optional().nullable(),
oralCavityArea: z.string().optional().nullable(),
source: exports.ProcedureSourceSchema.optional(),
comboKey: z.string().optional().nullable(),
createdAt: z.coerce.date().optional(),
});
exports.NpiProviderUncheckedCreateInputObjectSchema = z.object({
id: z.number().int().optional(),
userId: z.number().int(),
npiNumber: z.string(),
providerName: z.string(),
createdAt: z.coerce.date().optional(),
});
exports.ClaimUncheckedCreateInputObjectSchema = z.object({
id: z.number().int().optional(),
patientId: z.number().int(),
appointmentId: z.number().int().optional(),
status: exports.ClaimStatusSchema.optional(),
submittedAt: z.string().optional(),
paidAt: z.string().optional(),
amount: z.number().optional(),
insuranceId: z.string().optional(),
});
exports.InsuranceCredentialUncheckedCreateInputObjectSchema = z.object({
id: z.number().int().optional(),
userId: z.number().int(),
siteKey: z.string(),
username: z.string(),
password: z.string(),
});
exports.PdfFileUncheckedCreateInputObjectSchema = z.object({
id: z.number().int().optional(),
filename: z.string(),
pdfData: z.instanceof(Uint8Array),
uploadedAt: z.coerce.date().optional(),
groupId: z.number().int(),
});
exports.PdfGroupUncheckedCreateInputObjectSchema = z.object({
id: z.number().int().optional(),
title: z.string(),
titleKey: exports.PdfTitleKeySchema.optional(),
createdAt: z.coerce.date().optional(),
patientId: z.number().int(),
});
exports.PaymentUncheckedCreateInputObjectSchema = z.object({
id: z.number().int().optional(),
patientId: z.number().int(),
appointmentId: z.number().int().optional(),
amount: z.number(),
method: exports.PaymentMethodSchema.optional(),
status: exports.PaymentStatusSchema.optional(),
paymentDate: z.string().optional(),
updatedById: z.number().int().optional(),
});
exports.ServiceLineTransactionCreateInputObjectSchema = z.object({
transactionId: z.string().optional().nullable(),
paidAmount: z.number(),
adjustedAmount: z.number().optional(),
method: exports.PaymentMethodSchema,
receivedDate: z.coerce.date(),
payerName: z.string().optional().nullable(),
notes: z.string().optional().nullable(),
createdAt: z.coerce.date().optional(),
});
exports.NotificationUncheckedCreateInputObjectSchema = z.object({
id: z.number().int().optional(),
userId: z.number().int(),
type: exports.NotificationTypesSchema,
message: z.string(),
createdAt: z.coerce.date().optional(),
read: z.boolean().optional(),
});
exports.DatabaseBackupUncheckedCreateInputObjectSchema = z.object({
id: z.number().int().optional(),
userId: z.number().int(),
createdAt: z.coerce.date().optional(),
});
exports.BackupDestinationUncheckedCreateInputObjectSchema = z.object({
id: z.number().int().optional(),
userId: z.number().int(),
path: z.string(),
isActive: z.boolean().optional(),
createdAt: z.coerce.date().optional(),
});
exports.CloudFolderUncheckedCreateInputObjectSchema = z.object({
id: z.number().int().optional(),
userId: z.number().int(),
name: z.string(),
parentId: z.number().int().optional().nullable(),
createdAt: z.coerce.date().optional(),
});
exports.CloudFileUncheckedCreateInputObjectSchema = z.object({
id: z.number().int().optional(),
userId: z.number().int(),
name: z.string(),
mimeType: z.string().optional().nullable(),
fileSize: z.bigint(),
folderId: z.number().int().optional().nullable(),
isComplete: z.boolean().optional(),
totalChunks: z.number().int().optional().nullable(),
createdAt: z.coerce.date().optional(),
});
exports.CommunicationUncheckedCreateInputObjectSchema = z.object({
id: z.number().int().optional(),
patientId: z.number().int(),
userId: z.number().int().optional().nullable(),
channel: exports.CommunicationChannelSchema,
direction: exports.CommunicationDirectionSchema,
status: exports.CommunicationStatusSchema,
body: z.string().optional().nullable(),
callDuration: z.number().int().optional().nullable(),
twilioSid: z.string().optional().nullable(),
createdAt: z.coerce.date().optional(),
});
exports.ShoppingVendorUncheckedCreateInputObjectSchema = z.object({
id: z.number().int().optional(),
userId: z.number().int(),
vendorName: z.string(),
websiteUrl: z.string(),
loginUsername: z.string(),
loginPassword: z.string(),
});