pdf files db, backend route done
This commit is contained in:
@@ -52,7 +52,10 @@ model Patient {
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
appointments Appointment[]
|
||||
claims Claim[]
|
||||
pdfs ClaimPdf[]
|
||||
groups PdfGroup[]
|
||||
|
||||
@@index([insuranceId])
|
||||
@@index([createdAt])
|
||||
}
|
||||
|
||||
model Appointment {
|
||||
@@ -73,6 +76,9 @@ model Appointment {
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
staff Staff? @relation(fields: [staffId], references: [id])
|
||||
claims Claim[]
|
||||
|
||||
@@index([patientId])
|
||||
@@index([date])
|
||||
}
|
||||
|
||||
model Staff {
|
||||
@@ -108,7 +114,6 @@ model Claim {
|
||||
staff Staff? @relation("ClaimStaff", fields: [staffId], references: [id])
|
||||
|
||||
serviceLines ServiceLine[]
|
||||
pdf ClaimPdf[]
|
||||
}
|
||||
|
||||
model ServiceLine {
|
||||
@@ -136,17 +141,33 @@ model InsuranceCredential {
|
||||
@@index([userId])
|
||||
}
|
||||
|
||||
model ClaimPdf {
|
||||
model PdfGroup {
|
||||
id Int @id @default(autoincrement())
|
||||
title String // e.g., "June Claim Docs", "Eligibility Set A"
|
||||
category PdfCategory
|
||||
createdAt DateTime @default(now())
|
||||
patientId Int
|
||||
patient Patient @relation(fields: [patientId], references: [id], onDelete: Cascade)
|
||||
pdfs PdfFile[]
|
||||
|
||||
@@index([patientId])
|
||||
@@index([category])
|
||||
}
|
||||
|
||||
model PdfFile {
|
||||
id Int @id @default(autoincrement())
|
||||
patientId Int
|
||||
claimId Int?
|
||||
filename String
|
||||
pdfData Bytes
|
||||
uploadedAt DateTime @default(now())
|
||||
groupId Int
|
||||
group PdfGroup @relation(fields: [groupId], references: [id], onDelete: Cascade)
|
||||
|
||||
patient Patient @relation(fields: [patientId], references: [id], onDelete: Cascade)
|
||||
claim Claim? @relation(fields: [claimId], references: [id], onDelete: Cascade)
|
||||
@@index([groupId])
|
||||
|
||||
@@index([patientId])
|
||||
@@index([claimId])
|
||||
}
|
||||
|
||||
enum PdfCategory {
|
||||
CLAIM
|
||||
ELIGIBILITY
|
||||
OTHER
|
||||
}
|
||||
|
||||
@@ -5,4 +5,6 @@ export * from '../shared/schemas/objects/UserUncheckedCreateInput.schema';
|
||||
export * from '../shared/schemas/objects/StaffUncheckedCreateInput.schema'
|
||||
export * from '../shared/schemas/objects/ClaimUncheckedCreateInput.schema'
|
||||
export * from '../shared/schemas/objects/InsuranceCredentialUncheckedCreateInput.schema'
|
||||
export * from '../shared/schemas/objects/ClaimPdfUncheckedCreateInput.schema'
|
||||
export * from '../shared/schemas/objects/PdfFileUncheckedCreateInput.schema'
|
||||
export * from '../shared/schemas/objects/PdfGroupUncheckedCreateInput.schema'
|
||||
export * from '../shared/schemas/enums/PdfCategory.schema'
|
||||
Reference in New Issue
Block a user