feature: phase0 - Global patients + mobile normalization
This commit is contained in:
@@ -60,7 +60,7 @@ model Organization {
|
||||
sharedWithMe OrganizationLink[] @relation("OrganizationB")
|
||||
sharedWithOthers OrganizationLink[] @relation("OrganizationA")
|
||||
sentOrganizationInvitations OrganizationInvitation[] @relation("OrganizationInvitationInviter")
|
||||
patients Patient[]
|
||||
createdPatients Patient[] @relation("PatientCreatedBy")
|
||||
appointments Appointment[]
|
||||
treatments Treatment[]
|
||||
caseSends TreatmentCaseSend[]
|
||||
@@ -72,24 +72,23 @@ model Organization {
|
||||
}
|
||||
|
||||
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
|
||||
id String @id @default(uuid())
|
||||
firstName String
|
||||
lastName String
|
||||
mobile String @unique
|
||||
email String?
|
||||
dateOfBirth DateTime?
|
||||
notes String?
|
||||
isActive Boolean @default(true)
|
||||
createdByOrganizationId String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
organization Organization @relation(fields: [organizationId], references: [id])
|
||||
treatments Treatment[]
|
||||
appointments Appointment[]
|
||||
createdByOrganization Organization? @relation("PatientCreatedBy", fields: [createdByOrganizationId], references: [id], onDelete: SetNull)
|
||||
treatments Treatment[]
|
||||
appointments Appointment[]
|
||||
|
||||
@@index([organizationId, createdAt])
|
||||
@@index([organizationId, lastName, firstName])
|
||||
@@index([lastName, firstName])
|
||||
@@map("patients")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user