patient creation done

This commit is contained in:
2025-07-14 00:07:53 +05:30
parent e542e6c701
commit 30eb473409
4 changed files with 136 additions and 28 deletions

View File

@@ -165,6 +165,7 @@ export interface IStorage {
// Patient methods
getPatient(id: number): Promise<Patient | undefined>;
getPatientByInsuranceId(insuranceId: string): Promise<Patient | null>;
getPatientsByUserId(userId: number): Promise<Patient[]>;
getRecentPatients(limit: number, offset: number): Promise<Patient[]>;
getTotalPatientCount(): Promise<number>;
@@ -315,6 +316,12 @@ export const storage: IStorage = {
return await db.patient.findMany({ where: { userId } });
},
async getPatientByInsuranceId(insuranceId: string): Promise<Patient | null> {
return db.patient.findFirst({
where: { insuranceId },
});
},
async getRecentPatients(limit: number, offset: number): Promise<Patient[]> {
return db.patient.findMany({
skip: offset,