feature: a very minimal patients feature implemented. it needs lots of improvments though
This commit is contained in:
@@ -55,6 +55,7 @@ model Organization {
|
||||
|
||||
sharedWithMe OrganizationLink[] @relation("OrganizationB")
|
||||
sharedWithOthers OrganizationLink[] @relation("OrganizationA")
|
||||
patients Patient[]
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
@@ -62,6 +63,45 @@ model Organization {
|
||||
@@map("organizations")
|
||||
}
|
||||
|
||||
model Patient {
|
||||
id String @id @default(uuid())
|
||||
organizationId String
|
||||
firstName String
|
||||
lastName String
|
||||
phone String?
|
||||
email String?
|
||||
dateOfBirth DateTime?
|
||||
notes String?
|
||||
isActive Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
organization Organization @relation(fields: [organizationId], references: [id])
|
||||
treatments PatientTreatmentHistory[]
|
||||
|
||||
@@index([organizationId, createdAt])
|
||||
@@index([organizationId, lastName, firstName])
|
||||
@@map("patients")
|
||||
}
|
||||
|
||||
model PatientTreatmentHistory {
|
||||
id String @id @default(uuid())
|
||||
patientId String
|
||||
title String
|
||||
status String
|
||||
treatmentAt DateTime
|
||||
tooth String?
|
||||
notes String?
|
||||
totalCost Float?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
patient Patient @relation(fields: [patientId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([patientId, treatmentAt])
|
||||
@@map("patient_treatment_histories")
|
||||
}
|
||||
|
||||
model Plan {
|
||||
id String @id @default(uuid())
|
||||
name String @unique // "Solo", "Small", "Medium", "Large", "Enterprise"
|
||||
|
||||
Reference in New Issue
Block a user