feat(patient-status schema updated)- applied changes
This commit is contained in:
@@ -52,7 +52,7 @@ model Patient {
|
||||
policyHolder String?
|
||||
allergies String?
|
||||
medicalConditions String?
|
||||
status String @default("active")
|
||||
status PatientStatus @default(UNKNOWN)
|
||||
userId Int
|
||||
createdAt DateTime @default(now())
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
@@ -65,6 +65,12 @@ model Patient {
|
||||
@@index([createdAt])
|
||||
}
|
||||
|
||||
enum PatientStatus {
|
||||
ACTIVE
|
||||
INACTIVE
|
||||
UNKNOWN
|
||||
}
|
||||
|
||||
model Appointment {
|
||||
id Int @id @default(autoincrement())
|
||||
patientId Int
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import { PatientUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
|
||||
import {
|
||||
PatientStatusSchema,
|
||||
PatientUncheckedCreateInputObjectSchema,
|
||||
} from "@repo/db/usedSchemas";
|
||||
import { z } from "zod";
|
||||
import { makeEnumOptions } from "../utils";
|
||||
|
||||
export type Patient = z.infer<typeof PatientUncheckedCreateInputObjectSchema>;
|
||||
|
||||
@@ -28,6 +32,17 @@ export const insuranceIdSchema = z.preprocess(
|
||||
.nullable()
|
||||
);
|
||||
|
||||
//patient status
|
||||
export type PatientStatus = z.infer<typeof PatientStatusSchema>;
|
||||
|
||||
// enum → select options
|
||||
export const patientStatusOptions =
|
||||
makeEnumOptions<
|
||||
typeof PatientStatusSchema extends z.ZodTypeAny
|
||||
? z.infer<typeof PatientStatusSchema>
|
||||
: string
|
||||
>(PatientStatusSchema);
|
||||
|
||||
export const insertPatientSchema = (
|
||||
PatientUncheckedCreateInputObjectSchema as unknown as z.ZodObject<any>
|
||||
)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// using this, as the browser load only the required files , not whole db/shared/schemas/ files.
|
||||
export * from '../shared/schemas/objects/AppointmentUncheckedCreateInput.schema';
|
||||
export * from '../shared/schemas/objects/PatientUncheckedCreateInput.schema';
|
||||
export * from '../shared/schemas/enums/PatientStatus.schema';
|
||||
export * from '../shared/schemas/objects/UserUncheckedCreateInput.schema';
|
||||
export * from '../shared/schemas/objects/StaffUncheckedCreateInput.schema'
|
||||
export * from '../shared/schemas/objects/ClaimUncheckedCreateInput.schema'
|
||||
|
||||
Reference in New Issue
Block a user