Surgeons can make artificial stoma or opening to drain off the waste products. In the case of the bowels a colostomy or illiostomy can be surgically placed. And in the case of the bladder a urostomy can be surgically created.
In a situation where a person cannot digest food at all, he or she would have to remain hospitalized. In some cases, surgeons can perform related surgical procedures like illiostomy to assist the body in the digestion process.