- Add Upload Payment Documents section with Extract & Download (Excel) and Extract & Import (database) buttons - PDF extractor (pdfplumber) parses MassHealth RA PDFs: two-pass strategy joins summary-page ICN/patient map with detail-page procedure data (CDT code, paid code, tooth, date, allowed amount) - RA cover-page summary (Payee ID, RA #, Payment Amount, etc.) included as separate Excel sheet; numeric values written as numbers - Backend PDF import route groups rows by Member #, finds/creates patient, creates Payment + ServiceLines with ICN per procedure - Add icn, paidCode, allowedAmount fields to ServiceLine schema - Payments table: status simplified to Paid in Full / Balance; adjustment auto-computed on mhPaidAmount/copayment change; Paid in Full and Revert buttons with confirmation dialogs - Edit Payment modal: shows ICN, Paid Code, Allowed Amount per line - PDF Import badge distinguishes from OCR imports in payments table Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
62 lines
3.9 KiB
TypeScript
62 lines
3.9 KiB
TypeScript
import type { Prisma } from '../../generated/prisma';
|
|
import * as z from 'zod';
|
|
import { ServiceLineIncludeObjectSchema as ServiceLineIncludeObjectSchema } from './objects/ServiceLineInclude.schema';
|
|
import { ServiceLineOrderByWithRelationInputObjectSchema as ServiceLineOrderByWithRelationInputObjectSchema } from './objects/ServiceLineOrderByWithRelationInput.schema';
|
|
import { ServiceLineWhereInputObjectSchema as ServiceLineWhereInputObjectSchema } from './objects/ServiceLineWhereInput.schema';
|
|
import { ServiceLineWhereUniqueInputObjectSchema as ServiceLineWhereUniqueInputObjectSchema } from './objects/ServiceLineWhereUniqueInput.schema';
|
|
import { ServiceLineScalarFieldEnumSchema } from './enums/ServiceLineScalarFieldEnum.schema';
|
|
|
|
// Select schema needs to be in file to prevent circular imports
|
|
//------------------------------------------------------
|
|
|
|
export const ServiceLineFindManySelectSchema: z.ZodType<Prisma.ServiceLineSelect> = z.object({
|
|
id: z.boolean().optional(),
|
|
claimId: z.boolean().optional(),
|
|
paymentId: z.boolean().optional(),
|
|
procedureCode: z.boolean().optional(),
|
|
procedureDate: z.boolean().optional(),
|
|
quad: z.boolean().optional(),
|
|
arch: z.boolean().optional(),
|
|
toothNumber: z.boolean().optional(),
|
|
toothSurface: z.boolean().optional(),
|
|
icn: z.boolean().optional(),
|
|
paidCode: z.boolean().optional(),
|
|
allowedAmount: z.boolean().optional(),
|
|
totalBilled: z.boolean().optional(),
|
|
totalPaid: z.boolean().optional(),
|
|
totalAdjusted: z.boolean().optional(),
|
|
totalDue: z.boolean().optional(),
|
|
status: z.boolean().optional(),
|
|
claim: z.boolean().optional(),
|
|
payment: z.boolean().optional(),
|
|
serviceLineTransactions: z.boolean().optional(),
|
|
_count: z.boolean().optional()
|
|
}).strict() as unknown as z.ZodType<Prisma.ServiceLineSelect>;
|
|
|
|
export const ServiceLineFindManySelectZodSchema = z.object({
|
|
id: z.boolean().optional(),
|
|
claimId: z.boolean().optional(),
|
|
paymentId: z.boolean().optional(),
|
|
procedureCode: z.boolean().optional(),
|
|
procedureDate: z.boolean().optional(),
|
|
quad: z.boolean().optional(),
|
|
arch: z.boolean().optional(),
|
|
toothNumber: z.boolean().optional(),
|
|
toothSurface: z.boolean().optional(),
|
|
icn: z.boolean().optional(),
|
|
paidCode: z.boolean().optional(),
|
|
allowedAmount: z.boolean().optional(),
|
|
totalBilled: z.boolean().optional(),
|
|
totalPaid: z.boolean().optional(),
|
|
totalAdjusted: z.boolean().optional(),
|
|
totalDue: z.boolean().optional(),
|
|
status: z.boolean().optional(),
|
|
claim: z.boolean().optional(),
|
|
payment: z.boolean().optional(),
|
|
serviceLineTransactions: z.boolean().optional(),
|
|
_count: z.boolean().optional()
|
|
}).strict();
|
|
|
|
export const ServiceLineFindManySchema: z.ZodType<Prisma.ServiceLineFindManyArgs> = z.object({ select: ServiceLineFindManySelectSchema.optional(), include: z.lazy(() => ServiceLineIncludeObjectSchema.optional()), orderBy: z.union([ServiceLineOrderByWithRelationInputObjectSchema, ServiceLineOrderByWithRelationInputObjectSchema.array()]).optional(), where: ServiceLineWhereInputObjectSchema.optional(), cursor: ServiceLineWhereUniqueInputObjectSchema.optional(), take: z.number().optional(), skip: z.number().optional(), distinct: z.union([ServiceLineScalarFieldEnumSchema, ServiceLineScalarFieldEnumSchema.array()]).optional() }).strict() as unknown as z.ZodType<Prisma.ServiceLineFindManyArgs>;
|
|
|
|
export const ServiceLineFindManyZodSchema = z.object({ select: ServiceLineFindManySelectSchema.optional(), include: z.lazy(() => ServiceLineIncludeObjectSchema.optional()), orderBy: z.union([ServiceLineOrderByWithRelationInputObjectSchema, ServiceLineOrderByWithRelationInputObjectSchema.array()]).optional(), where: ServiceLineWhereInputObjectSchema.optional(), cursor: ServiceLineWhereUniqueInputObjectSchema.optional(), take: z.number().optional(), skip: z.number().optional(), distinct: z.union([ServiceLineScalarFieldEnumSchema, ServiceLineScalarFieldEnumSchema.array()]).optional() }).strict(); |