Ye 3-step chain hai — kram zaroori hai:
- BILL: galat patient ke chart me Visits → us din ke "● Bills" table me "🗑 Delete" → "Move to Recycle Bin" (Action Guard on ho to PIN), 30 din tak recoverable; permanent delete sirf owner. Bill par payment juda ho to app rok deta hai — owner / admin pehle wo payment void kare (ya refund).
- TREATMENT: owner / admin done / planned row ka 🗑 dabaye. Bill pehle delete na kiya ho to server rokta hai: "TT chain: this treatment's bill … still exists. Delete the bill to the Recycle Bin first, then this treatment can be deleted." Doosre role ko "Forbidden: DELETE restricted to owner/admin/super_admin".
- SAHI PATIENT: sahi patient kholo, "+ Treatment" se wahi treatment sahi tooth par jodo aur Done karo — bill / Rx / consent dobara ban jaate hain.
CHECK
galat patient me bana Rx bhi hatao (Visits → Prescription ka 🗑, owner / admin); lab order bana ho to Treatment → Lab me cancel karo; consent record Forms me rehta hai.
EDGE CASE
payment void ki thi to sahi patient ke naye bill par payment fresh record karo.
AAGE SE
chart ke upar patient ka naam + UHID dekh kar hi Done karo; duplicate files ka shak ho to Patient Care → Patients → Find Duplicates.