- 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>
33 lines
1.8 KiB
TypeScript
33 lines
1.8 KiB
TypeScript
import * as z from 'zod';
|
|
import type { Prisma } from '../../../generated/prisma';
|
|
import { ClaimArgsObjectSchema as ClaimArgsObjectSchema } from './ClaimArgs.schema';
|
|
import { PaymentArgsObjectSchema as PaymentArgsObjectSchema } from './PaymentArgs.schema';
|
|
import { ServiceLineTransactionFindManySchema as ServiceLineTransactionFindManySchema } from '../findManyServiceLineTransaction.schema';
|
|
import { ServiceLineCountOutputTypeArgsObjectSchema as ServiceLineCountOutputTypeArgsObjectSchema } from './ServiceLineCountOutputTypeArgs.schema'
|
|
|
|
const makeSchema = () => 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.union([z.boolean(), z.lazy(() => ClaimArgsObjectSchema)]).optional(),
|
|
payment: z.union([z.boolean(), z.lazy(() => PaymentArgsObjectSchema)]).optional(),
|
|
serviceLineTransactions: z.union([z.boolean(), z.lazy(() => ServiceLineTransactionFindManySchema)]).optional(),
|
|
_count: z.union([z.boolean(), z.lazy(() => ServiceLineCountOutputTypeArgsObjectSchema)]).optional()
|
|
}).strict();
|
|
export const ServiceLineSelectObjectSchema: z.ZodType<Prisma.ServiceLineSelect> = makeSchema() as unknown as z.ZodType<Prisma.ServiceLineSelect>;
|
|
export const ServiceLineSelectObjectZodSchema = makeSchema();
|