Files
DentalManagementMH05/packages/db/shared/schemas/objects/ClaimCreateWithoutAppointmentInput.schema.ts
Gitead 3e899376c3 feat: Select Procedures flow, batch-column NPI provider fix, auto PDF save
- Add 'Select Procedures' right-click option on appointment page (separate from Claims/PreAuth)
- Select Procedures form saves CDT codes + NPI provider to AppointmentProcedure storage
- Remove Save button from insurance claim form; Claims/PreAuth opens for insurance submission only
- Claims/PreAuth auto-prefills from saved procedures including NPI provider
- Batch-column: procedures npiProviderId takes priority over stale claim npiProviderId
- Batch-column: auto-save PDF to patient Documents after successful submission (no socket needed)
- Add npiProviderId column to AppointmentProcedure table (prisma db push)
- Fix 'invalid db creation invocation': guard staffId, npiProviderId, procedureDate as Date object, totalBilled NaN guard
- Add full error logging to batch-column catch block

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-27 00:25:24 -04:00

39 lines
3.0 KiB
TypeScript

import * as z from 'zod';
import type { Prisma } from '../../../generated/prisma';
import { MissingTeethStatusSchema } from '../enums/MissingTeethStatus.schema';
import { NullableJsonNullValueInputSchema } from '../enums/NullableJsonNullValueInput.schema';
import { ClaimStatusSchema } from '../enums/ClaimStatus.schema';
import { PatientCreateNestedOneWithoutClaimsInputObjectSchema as PatientCreateNestedOneWithoutClaimsInputObjectSchema } from './PatientCreateNestedOneWithoutClaimsInput.schema';
import { UserCreateNestedOneWithoutClaimsInputObjectSchema as UserCreateNestedOneWithoutClaimsInputObjectSchema } from './UserCreateNestedOneWithoutClaimsInput.schema';
import { StaffCreateNestedOneWithoutClaimsInputObjectSchema as StaffCreateNestedOneWithoutClaimsInputObjectSchema } from './StaffCreateNestedOneWithoutClaimsInput.schema';
import { NpiProviderCreateNestedOneWithoutClaimsInputObjectSchema as NpiProviderCreateNestedOneWithoutClaimsInputObjectSchema } from './NpiProviderCreateNestedOneWithoutClaimsInput.schema';
import { ServiceLineCreateNestedManyWithoutClaimInputObjectSchema as ServiceLineCreateNestedManyWithoutClaimInputObjectSchema } from './ServiceLineCreateNestedManyWithoutClaimInput.schema';
import { ClaimFileCreateNestedManyWithoutClaimInputObjectSchema as ClaimFileCreateNestedManyWithoutClaimInputObjectSchema } from './ClaimFileCreateNestedManyWithoutClaimInput.schema';
import { PaymentCreateNestedOneWithoutClaimInputObjectSchema as PaymentCreateNestedOneWithoutClaimInputObjectSchema } from './PaymentCreateNestedOneWithoutClaimInput.schema'
import { JsonValueSchema as jsonSchema } from '../../helpers/json-helpers';
const makeSchema = () => z.object({
patientName: z.string(),
memberId: z.string(),
dateOfBirth: z.coerce.date(),
remarks: z.string(),
missingTeethStatus: MissingTeethStatusSchema.optional(),
missingTeeth: z.union([NullableJsonNullValueInputSchema, jsonSchema]).optional(),
serviceDate: z.coerce.date(),
insuranceProvider: z.string(),
createdAt: z.coerce.date().optional(),
updatedAt: z.coerce.date().optional(),
status: ClaimStatusSchema.optional(),
claimNumber: z.string().optional().nullable(),
patient: z.lazy(() => PatientCreateNestedOneWithoutClaimsInputObjectSchema),
user: z.lazy(() => UserCreateNestedOneWithoutClaimsInputObjectSchema).optional(),
staff: z.lazy(() => StaffCreateNestedOneWithoutClaimsInputObjectSchema).optional(),
npiProvider: z.lazy(() => NpiProviderCreateNestedOneWithoutClaimsInputObjectSchema).optional(),
serviceLines: z.lazy(() => ServiceLineCreateNestedManyWithoutClaimInputObjectSchema).optional(),
claimFiles: z.lazy(() => ClaimFileCreateNestedManyWithoutClaimInputObjectSchema).optional(),
payment: z.lazy(() => PaymentCreateNestedOneWithoutClaimInputObjectSchema).optional()
}).strict();
export const ClaimCreateWithoutAppointmentInputObjectSchema: z.ZodType<Prisma.ClaimCreateWithoutAppointmentInput> = makeSchema() as unknown as z.ZodType<Prisma.ClaimCreateWithoutAppointmentInput>;
export const ClaimCreateWithoutAppointmentInputObjectZodSchema = makeSchema();