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 { PatientCountOrderByAggregateInputObjectSchema as PatientCountOrderByAggregateInputObjectSchema } from './PatientCountOrderByAggregateInput.schema';
import { PatientAvgOrderByAggregateInputObjectSchema as PatientAvgOrderByAggregateInputObjectSchema } from './PatientAvgOrderByAggregateInput.schema';
import { PatientMaxOrderByAggregateInputObjectSchema as PatientMaxOrderByAggregateInputObjectSchema } from './PatientMaxOrderByAggregateInput.schema';
import { PatientMinOrderByAggregateInputObjectSchema as PatientMinOrderByAggregateInputObjectSchema } from './PatientMinOrderByAggregateInput.schema';
import { PatientSumOrderByAggregateInputObjectSchema as PatientSumOrderByAggregateInputObjectSchema } from './PatientSumOrderByAggregateInput.schema'

const makeSchema = () => z.object({
  id: SortOrderSchema.optional(),
  firstName: SortOrderSchema.optional(),
  lastName: SortOrderSchema.optional(),
  dateOfBirth: z.union([SortOrderSchema, z.lazy(() => SortOrderInputObjectSchema)]).optional(),
  gender: SortOrderSchema.optional(),
  phone: SortOrderSchema.optional(),
  email: z.union([SortOrderSchema, z.lazy(() => SortOrderInputObjectSchema)]).optional(),
  address: z.union([SortOrderSchema, z.lazy(() => SortOrderInputObjectSchema)]).optional(),
  city: z.union([SortOrderSchema, z.lazy(() => SortOrderInputObjectSchema)]).optional(),
  zipCode: z.union([SortOrderSchema, z.lazy(() => SortOrderInputObjectSchema)]).optional(),
  insuranceProvider: z.union([SortOrderSchema, z.lazy(() => SortOrderInputObjectSchema)]).optional(),
  insuranceId: z.union([SortOrderSchema, z.lazy(() => SortOrderInputObjectSchema)]).optional(),
  groupNumber: z.union([SortOrderSchema, z.lazy(() => SortOrderInputObjectSchema)]).optional(),
  policyHolder: z.union([SortOrderSchema, z.lazy(() => SortOrderInputObjectSchema)]).optional(),
  allergies: z.union([SortOrderSchema, z.lazy(() => SortOrderInputObjectSchema)]).optional(),
  medicalConditions: z.union([SortOrderSchema, z.lazy(() => SortOrderInputObjectSchema)]).optional(),
  preferredLanguage: z.union([SortOrderSchema, z.lazy(() => SortOrderInputObjectSchema)]).optional(),
  status: SortOrderSchema.optional(),
  userId: SortOrderSchema.optional(),
  createdAt: SortOrderSchema.optional(),
  updatedAt: SortOrderSchema.optional(),
  _count: z.lazy(() => PatientCountOrderByAggregateInputObjectSchema).optional(),
  _avg: z.lazy(() => PatientAvgOrderByAggregateInputObjectSchema).optional(),
  _max: z.lazy(() => PatientMaxOrderByAggregateInputObjectSchema).optional(),
  _min: z.lazy(() => PatientMinOrderByAggregateInputObjectSchema).optional(),
  _sum: z.lazy(() => PatientSumOrderByAggregateInputObjectSchema).optional()
}).strict();
export const PatientOrderByWithAggregationInputObjectSchema: z.ZodType<Prisma.PatientOrderByWithAggregationInput> = makeSchema() as unknown as z.ZodType<Prisma.PatientOrderByWithAggregationInput>;
export const PatientOrderByWithAggregationInputObjectZodSchema = makeSchema();
