first one is that no stones are left,secondly papillary stenosis or stricture(Distal obstruction).Also make sure that there are no intra hepatic stones.
The question is: when do we have to use a T-tube? In case of residual stones not able to be removed, when there is a distal stricture or we have mistreated the papilla during the manouvers to remove the stones (oedema) and in case of severe cholangitis
Primary closure of common bile duct following choledochotomy and common bile duct exploration is a well known surgical procedure. Postoperative cholangiography for detection of retained calculi is not possible after primary closure and this is considered as a disadvantage. Compared to choledochorrhaphy using T-tube drainage of bile duct or to choledochoduodenostomy, primary closure represents a safe, less expensive alternative with fewer postoperative complications and shorter hospital stay. To accomplish a safe primary choledochorrhaphy, four strict criteria, stressed by Mayo in 1923, Mirizzi in 1942 and Edwards in 1952, must be met. These four requirements for a safe and successful primary closure of common bile duct are a 1) patent Vater’s ampulla, 2) complete removal of all intraductal calculi, 3) absence of pancreatic pathology and 4) meticulous suture of the duct. In order to complete these criteria, most authors routinely use intraoperative cholangiography and choledochoscopy . Nevertheless, retained calculi after common bile duct exploration are referred in the literature to range from 0 to 7.5%.
T tube must be routinely used in all cases underwent exploration of CBD esp after failure of ERCP as ERCP limits the role of choledochotomy to minority of cases with difficult anatomy or advanced pathology and in both cases primary closure even over a stent my carry the risk of leakage