improvement: treatment plan turned into a wizard. shift+click control added to FDI tooth chart for cunnected prosthesises.
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "treatment_details" ADD COLUMN "toothSelectionGroups" JSONB;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "lab_case_tooth_prosthesis" ADD COLUMN "selectionGroupId" TEXT NOT NULL DEFAULT '';
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "lab_case_tasks" ADD COLUMN "selectionGroupId" TEXT NOT NULL DEFAULT '';
|
||||
|
||||
-- DropIndex
|
||||
DROP INDEX IF EXISTS "lab_case_tasks_labCaseId_treatmentDetailId_prosthesisTypeCode_stepOrder_key";
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "lab_case_tasks_labCaseId_treatmentDetailId_selectionGroupId_prosthesisTypeCode_stepOrder_key" ON "lab_case_tasks"("labCaseId", "treatmentDetailId", "selectionGroupId", "prosthesisTypeCode", "stepOrder");
|
||||
@@ -176,6 +176,8 @@ model TreatmentDetail {
|
||||
sortOrder Int
|
||||
treatmentType String
|
||||
teeth Json
|
||||
/** Selection groups: connected spans + singles. Shape: { groupId, kind, teeth[] }[] */
|
||||
toothSelectionGroups Json?
|
||||
comment String?
|
||||
|
||||
treatment Treatment @relation(fields: [treatmentId], references: [id], onDelete: Cascade)
|
||||
@@ -340,6 +342,8 @@ model LabCaseToothProsthesis {
|
||||
treatmentDetailId String
|
||||
tooth String
|
||||
prosthesisTypeCode String
|
||||
/** Links to TreatmentDetail.toothSelectionGroups[].groupId for task grouping. */
|
||||
selectionGroupId String @default("")
|
||||
|
||||
labCase LabCase @relation(fields: [labCaseId], references: [id], onDelete: Cascade)
|
||||
detail TreatmentDetail @relation(fields: [treatmentDetailId], references: [id], onDelete: Cascade)
|
||||
@@ -355,6 +359,8 @@ model LabCaseTask {
|
||||
teeth Json
|
||||
treatmentType String
|
||||
prosthesisTypeCode String
|
||||
/** Empty string for legacy tasks; otherwise matches selection group id. */
|
||||
selectionGroupId String @default("")
|
||||
workflowStepCode String
|
||||
stepOrder Int
|
||||
stepLabel String
|
||||
@@ -373,7 +379,7 @@ model LabCaseTask {
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@unique([labCaseId, treatmentDetailId, prosthesisTypeCode, stepOrder])
|
||||
@@unique([labCaseId, treatmentDetailId, selectionGroupId, prosthesisTypeCode, stepOrder])
|
||||
@@index([labCaseId, status])
|
||||
@@index([assigneeUserId])
|
||||
@@map("lab_case_tasks")
|
||||
|
||||
Reference in New Issue
Block a user