- 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>
37 lines
2.9 KiB
TypeScript
37 lines
2.9 KiB
TypeScript
import * as z from 'zod';
|
|
import type { Prisma } from '../../../generated/prisma';
|
|
import { SortOrderSchema } from '../enums/SortOrder.schema';
|
|
import { SortOrderInputObjectSchema as SortOrderInputObjectSchema } from './SortOrderInput.schema';
|
|
import { ServiceLineCountOrderByAggregateInputObjectSchema as ServiceLineCountOrderByAggregateInputObjectSchema } from './ServiceLineCountOrderByAggregateInput.schema';
|
|
import { ServiceLineAvgOrderByAggregateInputObjectSchema as ServiceLineAvgOrderByAggregateInputObjectSchema } from './ServiceLineAvgOrderByAggregateInput.schema';
|
|
import { ServiceLineMaxOrderByAggregateInputObjectSchema as ServiceLineMaxOrderByAggregateInputObjectSchema } from './ServiceLineMaxOrderByAggregateInput.schema';
|
|
import { ServiceLineMinOrderByAggregateInputObjectSchema as ServiceLineMinOrderByAggregateInputObjectSchema } from './ServiceLineMinOrderByAggregateInput.schema';
|
|
import { ServiceLineSumOrderByAggregateInputObjectSchema as ServiceLineSumOrderByAggregateInputObjectSchema } from './ServiceLineSumOrderByAggregateInput.schema'
|
|
|
|
const makeSchema = () => z.object({
|
|
id: SortOrderSchema.optional(),
|
|
claimId: z.union([SortOrderSchema, z.lazy(() => SortOrderInputObjectSchema)]).optional(),
|
|
paymentId: z.union([SortOrderSchema, z.lazy(() => SortOrderInputObjectSchema)]).optional(),
|
|
procedureCode: SortOrderSchema.optional(),
|
|
procedureDate: SortOrderSchema.optional(),
|
|
quad: z.union([SortOrderSchema, z.lazy(() => SortOrderInputObjectSchema)]).optional(),
|
|
arch: z.union([SortOrderSchema, z.lazy(() => SortOrderInputObjectSchema)]).optional(),
|
|
toothNumber: z.union([SortOrderSchema, z.lazy(() => SortOrderInputObjectSchema)]).optional(),
|
|
toothSurface: z.union([SortOrderSchema, z.lazy(() => SortOrderInputObjectSchema)]).optional(),
|
|
icn: z.union([SortOrderSchema, z.lazy(() => SortOrderInputObjectSchema)]).optional(),
|
|
paidCode: z.union([SortOrderSchema, z.lazy(() => SortOrderInputObjectSchema)]).optional(),
|
|
allowedAmount: z.union([SortOrderSchema, z.lazy(() => SortOrderInputObjectSchema)]).optional(),
|
|
totalBilled: SortOrderSchema.optional(),
|
|
totalPaid: SortOrderSchema.optional(),
|
|
totalAdjusted: SortOrderSchema.optional(),
|
|
totalDue: SortOrderSchema.optional(),
|
|
status: SortOrderSchema.optional(),
|
|
_count: z.lazy(() => ServiceLineCountOrderByAggregateInputObjectSchema).optional(),
|
|
_avg: z.lazy(() => ServiceLineAvgOrderByAggregateInputObjectSchema).optional(),
|
|
_max: z.lazy(() => ServiceLineMaxOrderByAggregateInputObjectSchema).optional(),
|
|
_min: z.lazy(() => ServiceLineMinOrderByAggregateInputObjectSchema).optional(),
|
|
_sum: z.lazy(() => ServiceLineSumOrderByAggregateInputObjectSchema).optional()
|
|
}).strict();
|
|
export const ServiceLineOrderByWithAggregationInputObjectSchema: z.ZodType<Prisma.ServiceLineOrderByWithAggregationInput> = makeSchema() as unknown as z.ZodType<Prisma.ServiceLineOrderByWithAggregationInput>;
|
|
export const ServiceLineOrderByWithAggregationInputObjectZodSchema = makeSchema();
|